write-subagent

Create Claude Code subagent configurations with YAML metadata in .claude/agents/.

16|5|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/wayne930242/Reflexive-Claude-Code --skill write-subagent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-subagent
Source: https://github.com/wayne930242/Reflexive-Claude-Code/tree/main/skills/write-subagent
Command: npx skills add https://github.com/wayne930242/Reflexive-Claude-Code --skill write-subagent

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps create Claude Code subagent configurations for isolated contexts, enabling specialized agents for code review, testing, or domain-specific tasks with minimal tool access and clear triggers.

Core Features & Use Cases

  • Isolated Contexts: Each subagent runs in its own context window.
  • Specialized Roles: One clear responsibility per subagent.
  • Minimal Tools: Grant only necessary tool access.

Quick Start

Define a subagent under .claude/agents/ (e.g., code-reviewer.md) with a YAML block describing tools, model, and triggers. Then invoke via Task tool to load the subagent when needed.

Frequently Asked Questions about write-subagent

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

FAQPage Schema
How do I create isolated subagents for specialized tasks in Claude Code?

Create subagent configurations in the .claude/agents/ directory as YAML/Markdown files. Each subagent defines a single responsibility, isolated context window, minimal tool access, and trigger-based prompts. Define metadata including name, description, tools, model, skills, permissionMode, and invoke via the Task tool when needed.

What's the best way to delegate code review and testing to separate agents?

Subagents enable delegation by isolating each task into dedicated agent configurations with specialized tools and clear triggers. A code-reviewer subagent and a testing subagent each operate in separate context windows, preventing context pollution and ensuring focused execution on their single responsibility.

Can I run multiple agents concurrently with isolated contexts?

Yes. Subagent configurations enforce isolated context windows for each agent. Multiple subagents can run independently without sharing context, enabling parallel execution of code review, testing, and domain-specific tasks without interference.

How do I control what tools each subagent can access?

Each subagent configuration explicitly declares its tool access in the YAML metadata. Grant only necessary tools per subagent responsibility—a code reviewer may access file-reading tools; a tester may access build and test runners—minimizing scope and security surface.

What metadata do I need to define for a subagent?

Subagent metadata includes name, description, tools list, model selection, skills, permissionMode, and trigger-based prompts. This structured YAML/Markdown block in .claude/agents/ defines the subagent's identity, capabilities, and activation conditions.

Do subagents work for domain-specific tasks beyond code review and testing?

Yes. Subagents support any domain-specific task with a clear, isolated responsibility. Define custom subagent configurations for API documentation generation, security audits, performance analysis, or other specialized workflows by declaring appropriate tools and triggers.