Agent Building Blocks: Skills, Subagents, MCP and Hooks
A free, hands-on course on the four pieces behind Cursor and Claude Code agents: skills, subagents, MCP servers and hooks. Build each one, then combine them.
9 chapters · about 30 min · free
Who it is for: Developers who already use Cursor or Claude Code for day-to-day coding and want the agent to follow their workflows, call the right tools and stay inside guardrails.
What you will learn
- Explain what skills, subagents, MCP servers and hooks each do, and pick the right one for a job
- Write a valid SKILL.md, install it in Cursor and Claude Code, and validate it before you share it
- Define a subagent with its own tools and model, and check which model it actually ran on
- Connect an MCP server to Cursor and Claude Code and test it with the MCP Inspector
- Add a hook that blocks a dangerous command or formats files after every edit
- Combine all four into one small, reviewable workflow
Before you start
- Cursor (desktop) or Claude Code installed and signed in
- Node.js 18+ for npx (Node 22.13+ if you also want the Caveman CLI)
- Comfort with a terminal and editing JSON / Markdown files
- A throwaway Git repo to practise in
Chapters
- 01The four building blocks, and when to reach for each4 min
- 02Skills: the anatomy of a SKILL.md3 min
- 03Install, validate and share skills4 min
- 04Subagents: when to split the work4 min
- 05Subagent models and cost: make the model in the file the model that runs3 min
- 06MCP: what a server exposes and how a host uses it4 min
- 07Connect MCP servers to Cursor and Claude Code3 min
- 08Hooks: deterministic guardrails3 min
- 09Putting it together: a release-notes workflow2 min
Frequently asked questions
What is the difference between a skill and an MCP server?
A skill is knowledge: a SKILL.md that tells the agent how to do something and when. An MCP server is a capability: a program that exposes tools the agent can call, such as converting Markdown to Slack format or reading a ticket. Many good setups pair them, with the server providing the ability and a skill saying when to use it.
Do skills work in both Cursor and Claude Code?
Yes. Skills follow the open Agent Skills format (agentskills.io), so the same folder with a SKILL.md works in Cursor, Claude Code, Codex and other hosts that support the format. The install folder differs by host; the skills CLI (npx skills add) and plugin installs put files in the right place for you.
When should I use a subagent instead of just asking the main agent?
When the task reads far more than it returns (searching a large repo, summarising logs or PRs), when it should have fewer permissions (a read-only reviewer), or when it suits a cheaper model. For small tasks that need the conversation history, keep the work in the main chat.
Why does my Cursor subagent ignore the model in its file?
Cursor's Task tool runs subagents on the parent chat's model when you use a personal Anthropic API key (BYOK) or when the model named in the agent file is not enabled in your settings. Enable the model, or route subagents through Claude Code with the Claude Code Subagents for Cursor skill, which adds a 'ran on ' receipt to every run.
What is an MCP server, in one sentence?
A program that speaks the Model Context Protocol so any compatible AI host can list and call its tools, read its resources and use its prompt templates.
Are MCP servers safe to install?
They run code on your machine (stdio) or receive your data (HTTP), so treat them like any dependency: read what they do, prefer read-only servers for remote use, keep secrets out of config files you commit, and treat tool output as untrusted text that cannot change the agent's task.
What can hooks do that prompts cannot?
Guarantee behaviour. A hook runs your command at a fixed point (before a tool call, after an edit, when the agent stops) and can block the action. A prompt or skill can only ask the model to comply.
How do I block a dangerous command in Claude Code?
Add a PreToolUse hook with a matcher for Bash in .claude/settings.json. The hook reads the command from the JSON on stdin and exits with code 2 to block it; whatever it prints to stderr is sent back to the model as the reason.
How long does this course take?
Under an hour of reading. Each chapter has a short hands-on exercise; doing all of them in a scratch repo takes longer, depending on your setup.
Is the course free?
Yes. All the tools it uses are free or open source: ai-agent-skills, the AI Agent Skill Validator, Claude Code Subagents for Cursor and Markdown Convert MCP. Your Cursor or Claude Code plan applies as usual.






