Use when creating specialized Claude Code subagents in .claude/agents/. Use when user says "create agent", "add reviewer", "specialized agent", "isolated context task".
View on GitHubplugins/rcc/skills/writing-subagents/SKILL.md
February 5, 2026
Select agents to install to:
npx add-skill https://github.com/wayne930242/Reflexive-Claude-Code/blob/main/plugins/rcc/skills/writing-subagents/SKILL.md -a claude-code --skill writing-subagentsInstallation paths:
.claude/skills/writing-subagents/# Writing Subagents ## Overview **Writing subagents IS creating specialized workers with isolated contexts.** Subagents run via the Task tool with their own context window, tools, and system prompt. Use for tasks that benefit from focused expertise. **Core principle:** One agent, one responsibility. Bloated agents become unfocused. **Violating the letter of the rules is violating the spirit of the rules.** ## Task Initialization (MANDATORY) Before ANY action, create task list using TaskCreate: ``` TaskCreate for EACH task below: - Subject: "[writing-subagents] Task N: <action>" - ActiveForm: "<doing action>" ``` **Tasks:** 1. Analyze requirements 2. RED - Test without subagent 3. GREEN - Write agent file 4. Validate structure 5. Test invocation 6. Verify behavior Announce: "Created 6 tasks. Starting execution..." **Execution rules:** 1. `TaskUpdate status="in_progress"` BEFORE starting each task 2. `TaskUpdate status="completed"` ONLY after verification passes 3. If task fails → stay in_progress, diagnose, retry 4. NEVER skip to next task until current is completed 5. At end, `TaskList` to confirm all completed ## TDD Mapping for Subagents | TDD Phase | Subagent Creation | What You Do | |-----------|-------------------|-------------| | **RED** | Test without agent | Perform task in main context, note issues | | **Verify RED** | Document problems | Note context pollution, scope creep | | **GREEN** | Write agent | Create focused agent addressing problems | | **Verify GREEN** | Test invocation | Verify agent runs with correct tools/prompt | | **REFACTOR** | Optimize | Reduce tools, sharpen system prompt | ## Task 1: Analyze Requirements **Goal:** Understand what specialized task needs isolation. **Questions to answer:** - What specific task needs a subagent? - Why can't the main agent do this? - What tools does this agent need? - Should it be proactive or manual? **When to use subagents:** - Task needs isolated context (code review, deep analysis) - Ta