/rcc:writing-subagentsfrom rcc
Creates specialized Claude Code subagents in .claude/agents/ with minimal tools, clear triggers, and isolated context. Activates on 'create agent', 'add reviewer', 'specialized agent', or 'isolated context task'.
Ships in rcc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Writing subagents IS creating specialized workers with isolated contexts.
Subagents run via the Agent 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.
Follow task initialization protocol.
Tasks: 0. Fetch latest official subagent spec
Announce: "Created 8 tasks (0–7). Starting execution..."
| Phase | Focus | What You Do |
|---|---|---|
| Requirements | Understanding | Identify what specialized task needs isolation |
| Analysis | Problem definition | Document why main agent isn't sufficient |
| Design | Configuration | Plan agent tools, model, and system prompt |
| Implementation | Creation | Write agent file with proper configuration |
| Optimization | Refinement | Fine-tune tools and prompts for efficiency |
Goal: Pull the current Anthropic subagent spec before designing — never trust cached memory.
Action:
Skill tool: fetching-claude-docs
component: subagent
question: "frontmatter fields, tool inheritance, model selection,
description trigger format (PROACTIVELY, examples), context isolation"
Verification: Received YAML with source: https://code.claude.com/docs/en/sub-agents.md and non-empty spec_excerpt. Use this as the authoritative reference for Tasks 1–7; if any rule in this SKILL conflicts with the fetched spec, the fetched spec wins (and flag the conflict for refactoring).
Goal: Understand what specialized task needs isolation.
Questions to answer:
When to use subagents:
See references/examples.md for subagent templates and trigger examples.
Built-in subagent types (consider BEFORE creating custom agents):
| Type | Model | Tools | Use Case |
|---|---|---|---|
Explore | Haiku | Read-only (no Write/Edit) | Fast codebase search, analysis |
Plan | Inherit | Read-only | Research and planning |
general-purpose | Inherit | All | Complex multi-step tasks |
Decision: Can a built-in type handle this? If yes, use it directly via the Agent tool — no agent file needed.
Verification: Can describe the agent's single responsibility in one sentence.
Goal: Clearly understand why the main agent is insufficient for this task.
Analysis points:
Verification: Documented specific problems that justify creating a specialized subagent.
Goal: Plan the agent configuration to address the documented problems.
Before drafting the system prompt, walk through prompt-design-principles.md:
.claude/agents/ # Project-level
~/.claude/agents/ # User-level (global)
---
name: agent-name
description: What this agent does. Use proactively when [triggers].
tools: Read, Grep, Glob, Bash
model: sonnet
---
System prompt for the agent.
## Role
[Clear description of the agent's responsibility]
## Process
[Steps the agent should follow]
## Output Format
[Expected output structure]
See references/agent-spec.md for full configuration fields, model selection, context:fork guidelines, and tool permissions.
Key rules:
name: lowercase with hyphens, matches filenamedescription: include 2-4 concrete examples in <example> blocks showing triggering conditionsmodel: specified explicitly; inherit is an anti-pattern in plugin agents (only project/user-level agents in .claude/agents/ may omit)color: unique color per agent (blue, green, red, purple, yellow)tools: minimal set (principle of least privilege). Subagents cannot request permissions at runtime.hooks, mcpServers, or permissionMode| Agent Type | Recommended Tools |
|---|---|
| Code reviewer | Read, Grep, Glob |
| Test runner | Read, Bash, Grep |
| Explorer | Read, Glob, Grep, Bash |
| Writer | Read, Edit, Write |
See references/agent-spec.md for the three-layer model selection guide, isolation guide, effort guide, and Opus/Haiku constraints.
Verification:
model explicitly specified (inherit = anti-pattern in plugin agents)Goal: Verify agent file structure is correct.
Checklist:
.claude/agents/ directoryname and descriptionVerification: All checklist items pass.
Goal: Verify agent can be invoked via Agent tool.
Test:
Agent tool:
- subagent_type: "[plugin:]agent-name"
- prompt: "Test invocation"
Check:
Verification: Agent invocation succeeds without errors.
Goal: Run agent on real task and verify quality.
Process:
Verification:
Goal: Have subagent reviewed by subagent-reviewer.
Agent tool:
- subagent_type: "rcc:subagent-reviewer"
- prompt: "Review subagent at [path/to/agent.md]"
Interpret YAML output:
pass: true → Subagent completepass: false → Fix all issues listed, re-run reviewer, repeat until pass: trueThis is the REFACTOR phase: Close loopholes identified by reviewer.
Verification: subagent-reviewer returns YAML with pass: true.
A single agent file may be invoked once, fanned-out, or voted on. Design choices change depending on which.
| Pattern | Invocation | Design implication |
|---|---|---|
| Single | One Agent call | Default. No special design needed. |
| P-Thread (fanout) | N Agent calls in one message, different inputs | Output must be self-contained — no shared state, no "see other agent's result". |
| F-Thread (Best-of-N) | N Agent calls in one message, same input | Output must be deterministic-shape (YAML / structured) so caller can diff or vote. Reviewer agents are prime F-Thread candidates. |
| B-Thread (orchestrator) | This agent dispatches sub-agents itself | Grant the Agent tool. Document which sub-agents it may call. |
Rules when designing for fanout:
Read, Grep, Glob is safe for N-parallel; Write, Edit, Bash is not.For dispatch mechanics (how the caller fans out and merges results), see the dispatching-parallel-agents skill.
These thoughts mean you're rationalizing. STOP and reconsider:
All of these mean: You're about to create a weak agent. Follow the process.
| Excuse | Reality |
|---|---|
| "Needs all tools" | More tools = more ways to go wrong. Minimize. |
| "Multi-purpose agent" | Jack of all trades = master of none. One job. |
| "Main context works" | Context pollution is invisible until it's a problem. |
| "Simple prompt" | Simple ≠ correct. Test the behavior. |
| "Use opus for everything / use haiku for everything" | Each layer has a role. Start with Sonnet as implementer. Add Haiku orchestration only when dispatch complexity justifies it. Add Opus quality gate only with a revision loop. |
advising-architecture skill for component classification guidanceWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wayne930242/reflexive-claude-code --plugin rcc23 skills in this plugin
/advising-architectureValidates component-type choices for agent system work, classifying knowledge as CLAUDE.md vs rule vs skill vs agent vs hook and checking for conflicts. Use when starting any skill/agent/rule workflow to validate approach. Use when classifying knowledge type. Use when checking for component conflicts./analyzing-agent-systemsScans project structure and agent system components, runs 11-category weakness analysis, and produces actionable restructuring recommendations. Use when analyzing an existing agent system for weaknesses. Use when user says "analyze agent system", "check agent setup", "audit agent config". Use when called by migrating-agent-systems or refactoring-skills./applying-agent-systemsBuilds agent system components from a confirmed component plan. Use when executing a component plan to build agent system elements. Use when called by planning-agent-systems after plan is confirmed. Use when user says "apply agent plan", "build agent system"./brainstorming-workflowsExplores user workflows through targeted questions about pipeline modes, pain points, routine tasks, and human intervention points to inform agent system design. Use when exploring workflows after analysis. Use when user says "explore workflows", "brainstorm workflows", "what should I automate". Use when called by analyzing-agent-systems./creating-pluginsScaffolds a new Claude Code plugin package with manifest, skills, agents, and marketplace entry. Use when creating a new Claude Code plugin package. Use when user says "create plugin", "new plugin", "scaffold plugin", "plugin template"./dispatching-parallel-agentsFans out work across multiple agents — same prompt to many for Best-of-N, different prompts for parallel exploration, or a scout before committing. Use when user says "parallel agents", "fan out", "best of N", "scout", "race", "vote", "spawn workers".Other plugins' skills for the same job