Understand the key building blocks before writing a single prompt. Know where Skills, Agents, Hooks, and MCP fit in your delivery workflow.
What problem does each abstraction solve?
When to compose vs. when to keep it simple
Mapping concepts to real engineering tasks
The Four Building Blocks
Each solves a different problem in the AI-assisted workflow
Skill
Reusable domain knowledge and instructions. Extend what the agent knows — like plugins for context.
Agent
Autonomous task executor. Spawns sub-agents for parallel work. Reads, writes, and runs tools.
Hook
Event-driven guardrails. Trigger scripts before or after tool calls to validate, lint, or transform.
MCP
Model Context Protocol servers. Connect external tools and data sources as first-class capabilities.
Workflow
Copilot CLI components plug into each phase.
Idea
→
Plan
→
Change
→
Validate
→
Commit
Idea → Skills provide domain context
Plan → /plan breaks work into tasks
Change → Agents edit code & files
Validate → Hooks run lint & tests
Commit → w/ MCP or manually
Implement
Guardrails, automation, and integration patterns
2. Implement
Guardrail-First Development
Build safety nets before you automate. Hooks give you pre-tool and post-edit control points. Skills encode team standards. MCP connects your toolchain.
Three concrete automation patterns
Pre-tool-call hooks for safety
Post-edit hooks for quality gates
MCP for external tool integration
Example 1: Schema → Migration
postToolUse hook generates migration SQL
▸ Trigger
Agent modifies a database model file
When the agent edits a model file, a postToolUse hook fires — the script checks the file path against **/models/*.ts and generates migration SQL.
▸ Action
Hook generates migration SQL
The hook runs a diff against the current schema and produces an ALTER TABLE migration file — no manual SQL writing needed.