Creates and modifies Claude Code sub-agents following best practices. Use when user requests creating, updating, modifying, improving, or editing sub-agents. Triggers include "create/make/new agent", "sub-agent for X", file paths with /agents/, "update/modify/improve agent Y". Handles agent structure, YAML frontmatter (name, description, tools, model), system prompt design, tool restrictions (minimal permissions), isolated context benefits. Delegates to edit-tool orchestrator if uncertain about tool type (agent vs skill vs command vs script).
View on GitHubdstoic/skills/edit-agent/SKILL.md
February 3, 2026
Select agents to install to:
npx add-skill https://github.com/digital-stoic-org/agent-skills/blob/main/dstoic/skills/edit-agent/SKILL.md -a claude-code --skill edit-agentInstallation paths:
.claude/skills/edit-agent/# Instructions for Creating and Modifying Sub-agents ## Determine Action Type **CREATE**: New sub-agent requested **MODIFY**: Update existing sub-agent (keywords: "update", "modify", "improve", "add to", "fix") ## Uncertain About Tool Type? If unsure whether this should be an agent vs skill vs command vs script, see the `edit-tool` orchestrator for comprehensive decision matrix. **Quick checks:** - Token budget >2000 OR needs isolation? → ✅ Probably agent - Token budget <500 + auto-invoke? → Probably skill - User-triggered workflow? → Probably command - Deterministic shell-only? → Probably bash script See `reference.md` and `edit-tool/reference.md` for detailed decision frameworks. ## MANDATORY Validation (CREATE only) **STOP**: Before proceeding, answer these questions with YES or NO: | Question | Answer | |----------|--------| | Q1: Requires AI reasoning across multiple steps? | [YES/NO] | | Q2: Needs decisions based on intermediate results? | [YES/NO] | | Q3: Benefits from isolated context/specialized tools? | [YES/NO] | **Decision:** - **ALL NO** → STOP. Do NOT create sub-agent. Recommend: slash command (text expansion), bash script (shell ops), or direct request. EXIT immediately. - **ANY YES** → Proceed to "Creating New Sub-agents" section below. --- ## Creating New Sub-agents 1. Ask for details if missing: purpose, use cases, tools needed 2. Determine location: - `.claude/agents/` - Project agents (team, highest priority) - `~/.claude/agents/` - Personal agents (all projects) 3. Generate filename: `[agent-name].md` (lowercase-hyphens only) 4. Create file with frontmatter and system prompt See `reference.md` for templates and tool configurations. ## Modifying Existing Sub-agents 1. Locate and read existing agent file 2. Analyze: frontmatter (name, description, tools, model), system prompt 3. Make surgical edits using Edit tool 4. Update description if changing triggers/purpose 5. Validate: YAML valid, tools list correct, prompt clear See