Spec-Driven Design with Subagents¶
Full Approach¶
You can go through the full structured approach in the folders below or just skip to areas where you want to drill down into the details.
Subagents¶
In the sections of Structured Development Process below, there are prompts for each stage. Now, with Claude Code, you can even create subagents based on these prompts to help implement the process automatically.
For example, you can create a backend python coding subagent to implement a feature, and a testing subagent to test the feature.
It's useful to have a verification system in place because the model often marks tasks as complete prematurely. Create a separate test subagent that is responsible for checking the work done by the code agent to ensure that the results are reliable. When the coding subagent says it is done, the test subagent will run the tests and let you know if they passed or failed. If they failed, the coding subagent will be asked to fix the code and run the tests again. This can be repeated until the tests pass.
You can also use subagents to parallelize tasks that are independent of each other. This can speed up the process.
Subagents are pre-configured AI personalities that Claude Code can delegate tasks to. Each subagent:
- Has a specific purpose and expertise area
- Uses its own context window separate from the main conversation
- Can be configured with specific tools it's allowed to use
- Includes a custom system prompt that guides its behavior
When Claude Code encounters a task that matches a subagentβs expertise, it can delegate that task to the specialized subagent, which works independently and returns results.
Excerpt copied from Anthropic documentation.
The Anthropic help doc has instructions for creating subagents. You can customize prompts like in the structured development processes below, and create your own agents.
Basic Example implementation from Ian Nuttall
To customize agents for your existing code, you can use a prompt like this
There is a feature in Claude Code called subagents, the documentation is at https://docs.anthropic.com/en/docs/claude-code/sub-agents. Please go through it and determine the best sub agents you can create for my app to improve my app and speed up coding time, then implement the subagents.
If you are using subagents, also add a rule to CLAUDE.md to use subagents for tasks that match their expertise, and parallelize tasks but do not overwrite each others updates.
You can even build a council of subagents to review each other and give perspectives. This Youtube video explains the idea.
Since the subagents feature was shipped, Anthropic has added new features including Skills and Plugins.
Claude Skills¶
Claude Skills are domain-specific βpacksβ of knowledge, instructions, and optionally scripts that Claude can load only when needed, keeping the context window lean.
Claude Plugins¶
Plugins are distribution containers that can include skills, slash commands, subagents, tools (via MCP), and hooks, usually installed into Claude Code with a single action.
They are focused on extending the Claude Code environment itselfβdefining how and when capabilities show up in your IDE/terminal workflow, and are often shared via marketplaces or repos.
You can find more about Claude Skills and Plugins on the Claude Code page of this website.