creating-subagents

Create Claude Code subagents with YAML frontmatter and system prompts.

2|1|Updated Oct 30, 2025
One-click install
npx skills add https://github.com/mikkelkrogsholm/dst-skills --skill creating-subagents
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-subagents
Source: https://github.com/mikkelkrogsholm/dst-skills/tree/main/.claude/skills/creating-subagents
Command: npx skills add https://github.com/mikkelkrogsholm/dst-skills --skill creating-subagents

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill teaches you to create specialized AI assistants that Claude can delegate tasks to, transforming complex projects into manageable workflows and freeing you from micro-management.

Core Features & Use Cases

  • Subagent Design: Define subagents with specific roles, tailored system prompts, and precise tool permissions, ensuring each AI expert focuses on its core competency.
  • Automatic Invocation: Craft descriptions that enable Claude to autonomously delegate tasks to the most suitable subagent, ensuring the right AI is always on the job.
  • Model Selection: Choose the optimal AI model (Haiku, Sonnet, Opus) for each subagent's specific task, balancing speed, cost, and reasoning power to optimize performance and efficiency.

Quick Start

I want to create a new subagent. What are the key elements I need to include in its system prompt?

Frequently Asked Questions about creating-subagents

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a subagent for Claude Code to delegate tasks to?

Create a subagent by defining a .claude/agents/{name}.md file with YAML frontmatter (name, description, tools, model) and a tailored system prompt. Claude uses the description to autonomously invoke the right subagent for specific tasks, ensuring specialized handling without manual routing.

What system prompt sections should I include when setting up a specialized agent?

Structure your system prompt with standardized sections that define the agent's role, core responsibilities, tool permissions, and decision logic. The Skill enforces consistent formatting across agents to enable reliable task delegation and ensure each AI expert focuses on its specific competency.

How do I choose the right model for each subagent?

Select Haiku for speed and cost efficiency, Sonnet for balanced performance, or Opus for complex reasoning. Match the model to the subagent's task complexity—faster models reduce latency for straightforward work, while Opus handles intricate analysis and orchestration.

Can I use subagents to automate code review and documentation workflows?

Yes, subagents excel at specialized tasks like code review, documentation generation, and testing. Define each agent with precise tool permissions and role-specific prompts, then Claude delegates work automatically based on task fit, transforming complex projects into manageable workflows.

What fields are required in the YAML frontmatter for a subagent?

Required fields are name, description, tools, and model. The description must be crafted to enable Claude to recognize when the subagent should handle a task. Optional fields provide additional configuration; all frontmatter must comply with YAML structure standards.

Why should I create separate subagents instead of one generalist agent?

Specialized agents reduce micro-management, improve task accuracy, and optimize resource use by matching model size and tools to specific jobs. Each subagent focuses on its core competency, enabling faster execution and cost efficiency across diverse workflow stages.