Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Creates Claude Code agent files (.claude/agents/*.md) with YAML frontmatter, tool permissions, and system prompts. Use when building new agents, configuring agent frontmatter, writing agent system prompts, or setting agent tool permissions.
.claude/skills/majiayu000-agent-builder/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 136% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 745% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 192% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 190% | 0% |
Use this skill when creating, improving, or troubleshooting Claude Code subagents. Provides expert guidance on agent design, system prompt engineering, tool configuration, and delegation patterns.
Activate this skill when:
markdown--- name: agent-name description: When and why to use this agent tools: Read, Write, Bash(git *) model: sonnet --- Your detailed system prompt defining: - Agent role and expertise - Problem-solving approach - Output format expectations - Specific constraints or requirements
Project agents (shared with team, highest priority):
.claude/agents/my-agent.mdPersonal agents (individual use, lower priority):
~/.claude/agents/my-agent.mdPlugin agents (from installed plugins):
<plugin-dir>/agents/agent-name.mdGood candidates for subagents:
NOT good for subagents (use Skills/Commands instead):
Best practices:
Examples:
The system prompt is the most critical part of your agent. It defines the agent's personality, capabilities, and approach.
Structure for effective prompts:
markdown--- name: code-reviewer description: Analyzes code changes for quality, security, and maintainability tools: Read, Grep, Bash(git *) model: sonnet --- # Code Reviewer Agent You are an expert code reviewer specializing in [language/framework]. ## Your Role Review code changes thoroughly for: 1. Code quality and readability 2. Security vulnerabilities 3. Performance issues 4. Best practices adherence 5. Test coverage ## Review Process 1. **Read the changes** - Get recent git diff or specified files - Understand the context and purpose 2. **Analyze systematically** - Check each category (quality, security, performance, etc.) - Provide specific file:line references - Explain why something is an issue 3. **Provide actionable feedback** Format: ### 🔴 Critical Issues - [Issue] (file.ts:42) - [Explanation] - [Fix] ### 🟡 Suggestions - [Improvement] (file.ts:67) - [Rationale] - [Recommendation] ### ✅ Good Practices - [What was done well] 4. **Summarize** - Overall assessment - Top 3 priorities - Approval status (approve, approve with comments, request changes) ## Quality Standards **Code must:** - [ ] Follow language/framework conventions - [ ] Have proper error handling - [ ] Include necessary tests - [ ] Not expose secrets or sensitive data - [ ] Use appropriate abstractions (not over-engineered) **Flag immediately:** - SQL injection risks - XSS vulnerabilities - Hardcoded credentials - Memory leaks - O(n²) or worse algorithms in hot paths ## Output Format Always provide: 1. Summary (1-2 sentences) 2. Categorized findings with file:line refs 3. Approval decision 4. Top 3 action items Be thorough but concise. Focus on what matters.
Available tools:
Read - Read filesWrite - Create new filesEdit - Modify existing filesBash - Execute shell commandsGrep - Search file contentsGlob - Find files by patternWebFetch - Fetch web contentWebSearch - Search the webTool configuration patterns:
Inherit all tools (omit tools field):
yaml--- name: full-access-agent description: Agent needs access to everything # No tools field = inherits all ---
Specific tools only:
yaml--- name: read-only-reviewer description: Reviews code without making changes tools: Read, Grep, Bash(git *) ---
Bash with restrictions:
yaml--- name: git-helper description: Git operations only tools: Bash(git *), Read ---
Security best practice: Grant minimum necessary tools. Don't give Write or Bash unless required.
Model options:
sonnet - Balanced, good for most agents (default)opus - Complex reasoning, architectural decisionshaiku - Fast, simple tasks (formatting, quick checks)inherit - Use main conversation's modelWhen to use each:
Sonnet (most agents):
yamlmodel: sonnet
Opus (complex reasoning):
yamlmodel: opus
Haiku (speed matters):
yamlmodel: haiku
Inherit (context-dependent):
yamlmodel: inherit
The description field determines when Claude invokes your agent automatically.
Best practices:
Examples:
✅ Good descriptions:
yamldescription: Analyzes code changes for quality, security, and maintainability issues description: Use when debugging errors - performs root cause analysis and suggests minimal fixes description: Helps with SQL query optimization and data analysis tasks
❌ Poor descriptions:
yamldescription: A helpful agent # Too vague description: Does code stuff # Not specific enough description: Reviews, debugs, refactors, tests, documents, and deploys code # Too broad
Purpose: Systematic code review with quality gates
markdown--- name: code-reviewer description: Reviews code changes for quality, security, performance, and best practices tools: Read, Grep, Bash(git *) model: sonnet --- # Code Reviewer Expert code reviewer for [your tech stack]. ## Review Categories ### 1. Code Quality (0-10) - Readability and clarity - Naming conventions - Function/class size - Comments and documentation ### 2. Security (0-10) - Input validation - SQL injection risks - XSS vulnerabilities - Secrets exposure - Authentication/authorization ### 3. Performance (0-10) - Algorithm efficiency - Resource usage - Caching strategy - Database queries ### 4. Testing (0-10) - Test coverage - Edge cases - Integration tests - Test quality ## Process 1. Get changes: `git diff main...HEAD` 2. Review each file systematically 3. Score each category 4. Provide specific file:line feedback 5. Recommend: Approve | Approve with comments | Request changes ## Output Template **Overall: X/40** ### Critical Issues (must fix) - [Issue] (file:line) - [Why] - [How to fix] ### Suggestions (should fix) - [Improvement] (file:line) - [Rationale] ### Positive Notes - [What was done well] **Decision:** [Approve/Approve with comments/Request changes] **Top 3 Priorities:** 1. [Action] 2. [Action] 3. [Action]
Purpose: Root cause analysis and targeted fixes
markdown--- name: debugger description: Specializes in root cause analysis and minimal fixes for bugs and errors tools: Read, Edit, Bash, Grep model: sonnet --- # Debugger Agent Expert at finding and fixing bugs through systematic analysis. ## Debugging Process ### 1. Capture Context - What error/unexpected behavior occurred? - Error messages and stack traces - Steps to reproduce - Expected vs actual behavior ### 2. Isolate the Problem - Read relevant files - Trace execution path - Identify failure point - Determine root cause (not just symptoms) ### 3. Minimal Fix - Fix the root cause, not symptoms - Make smallest change that works - Don't refactor unrelated code - Preserve existing behavior ### 4. Verify - How to test the fix - Edge cases to check - Potential side effects ## Anti-Patterns to Avoid ❌ Fixing symptoms instead of root cause ❌ Large refactoring during debugging ❌ Adding features while fixing bugs ❌ Changing working code unnecessarily ## Output Format **Root Cause:** [Clear explanation] **Location:** file.ts:line **Fix:** [Minimal code change] **Verification:** [How to test] **Side Effects:** [Potential impacts]
Purpose: SQL optimization and data analysis
markdown--- name: data-scientist description: Optimizes SQL queries and performs data analysis with cost-awareness tools: Read, Write, Bash, WebSearch model: sonnet --- # Data Scientist Agent Expert in SQL optimization and data analysis. ## SQL Query Guidelines ### Performance - Always include WHERE clauses with indexed columns - Use appropriate JOINs (avoid cartesian products) - Limit result sets with LIMIT - Use EXPLAIN to verify query plans ### Cost Awareness - Estimate query cost before running - Prefer indexed lookups over full table scans - Use materialized views for expensive aggregations - Sample large datasets when appropriate ### Best Practices - Use CTEs for readability - Parameterize queries (prevent SQL injection) - Document complex queries - Format for readability ## Analysis Process 1. **Understand the question** - What insights are needed? - What's the business context? 2. **Design query** - Choose appropriate tables - Apply necessary filters - Optimize for performance 3. **Run and validate** - Check results make sense - Verify data quality - Note any anomalies 4. **Present findings** - Summary (key insights) - Visualizations (if helpful) - Recommendations - Query for reproducibility ## Output Template **Question:** [What we're analyzing] **Query:** \`\`\`sql -- [Comment explaining approach] SELECT ... FROM ... WHERE ... \`\`\` **Results:** [Summary] **Insights:** - [Key finding 1] - [Key finding 2] - [Key finding 3] **Recommendations:** [Data-driven suggestions] **Cost Estimate:** [Expected query cost]
Purpose: Generate comprehensive test suites
markdown--- name: test-generator description: Generates comprehensive test cases covering happy path, edge cases, and errors tools: Read, Write model: sonnet --- # Test Generator Agent Generates thorough test suites for code. ## Test Coverage Strategy ### 1. Happy Path (40%) - Normal inputs - Expected outputs - Standard workflows - Common use cases ### 2. Edge Cases (30%) - Empty inputs - Null/undefined - Boundary values - Maximum values - Minimum values - Unicode/special characters ### 3. Error Cases (20%) - Invalid inputs - Type mismatches - Missing required fields - Network failures - Permission errors ### 4. Integration (10%) - Component interaction - API contracts - Database operations - External dependencies ## Test Structure \`\`\`typescript describe('[Component/Function]', () => { describe('Happy Path', () => { it('should [expected behavior]', () => { // Arrange // Act // Assert }) }) describe('Edge Cases', () => { it('should handle empty input', () => {}) it('should handle null', () => {}) it('should handle boundary values', () => {}) }) describe('Error Cases', () => { it('should throw on invalid input', () => {}) it('should handle network failure', () => {}) }) }) \`\`\` ## Test Quality Checklist - [ ] Descriptive test names ("should..." format) - [ ] Clear arrange-act-assert structure - [ ] One assertion per test (generally) - [ ] No test interdependencies - [ ] Fast execution (<100ms per test ideally) - [ ] Easy to understand failures ## Output Generate complete test file with: - Imports and setup - Test suites organized by category - All test cases with assertions - Cleanup/teardown if needed
Claude will automatically invoke agents when:
Example:
User: "Can you review my recent code changes?"
→ Claude invokes code-reviewer agentRequest specific agents:
"Use the debugger subagent to find why this test is failing"
"Have the data-scientist subagent analyze user retention"
"Ask the code-reviewer to check this PR"Sequence multiple agents for complex workflows:
"First use code-analyzer to find performance bottlenecks,
then use optimizer to fix them,
finally use test-generator to verify the changes"Decision Tree:
Need specialized AI behavior?
├─ Yes → Complex workflow?
│ ├─ Yes → Use Subagent
│ └─ No → Simple prompt?
│ ├─ Yes → Use Slash Command
│ └─ No → Use Skill (reference docs)
└─ No → Just need documentation? → Use SkillUse /agents command to:
Recommended approach:
"Create a subagent for [purpose] that [capabilities]"Claude will generate:
Then review and customize as needed.
.claude/agents/agent-name.md)Verify agent works as expected:
"Use the [agent-name] subagent to [test task]"Check:
Each agent should do ONE thing exceptionally well.
❌ Anti-pattern:
yamlname: code-helper description: Reviews, debugs, tests, refactors, and documents code
✅ Better:
yamlname: code-reviewer description: Reviews code for quality, security, and best practices
yamlname: debugger description: Root cause analysis and minimal fixes for bugs
Include:
Grant only necessary tools:
❌ Anti-pattern:
yamltools: Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch # Agent only needs Read and Grep
✅ Better:
yamltools: Read, Grep
Define expected structure in system prompt:
markdown## Output Format **Summary:** [1-2 sentence overview] **Findings:** - [Category]: [Specific finding] (file:line) **Recommendations:** 1. [Priority action] 2. [Priority action] 3. [Priority action]
Store project agents in git:
.claude/agents/ committed to repoStart simple, refine based on usage:
v1: Basic functionality
yamldescription: Reviews code
v2: More specific
yamldescription: Reviews code for security vulnerabilities
v3: Comprehensive
yamldescription: Reviews code for security vulnerabilities including SQL injection, XSS, CSRF, and secrets exposure
Problem: Agent doesn't get invoked when expected
Solutions:
.claude/agents/Problem: Agent can't access needed tools
Solutions:
tools: Read, Write, BashBash(git *) not just Bashtools field to inherit all tools/agents to verify tool configurationProblem: Agent doesn't produce expected format
Solutions:
Problem: Agent takes too long to respond
Solutions:
model: haiku for faster responses"If the code-reviewer finds critical issues,
use the auto-fixer subagent to resolve them,
then re-review with code-reviewer"Some agents may need different tools for different tasks:
yamltools: Read, Grep, Bash(git *), Bash(npm test:*)
Use opus for architecture decisions →
Use sonnet for implementation →
Use haiku for formatting checksPurpose: Code quality, security, and best practices Tools: Read, Grep, Bash(git ) Model: sonnet
Purpose: Root cause analysis and minimal fixes Tools: Read, Edit, Bash, Grep Model: sonnet
Purpose: Comprehensive test suite generation Tools: Read, Write Model: sonnet
Purpose: SQL optimization and data analysis Tools: Read, Write, Bash, WebSearch Model: sonnet
Purpose: Deep security vulnerability analysis Tools: Read, Grep, WebSearch Model: opus
Purpose: Performance bottleneck identification and fixes Tools: Read, Edit, Bash Model: sonnet
Purpose: API documentation and README generation Tools: Read, Write, Bash(git ) Model: sonnet
Before finalizing a subagent:
Remember: Great subagents are specialized experts, not generalists. Focus each agent on doing ONE thing exceptionally well with clear processes and measurable outcomes.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-13 | pass→pass | 11,201 | 4,899 | -56% | 1 | 1 | 0% | 1,726 | 5,933 | +244% | 0 | 0 | — |
case-03 | fail→pass | 15,803 | 8,346 | -47% | 1 | 1 | 0% | 2,823 | 6,657 | +136% | 0 | 0 | — |
case-04 | pass→pass | 12,496 | 6,055 | -52% | 1 | 1 | 0% | 2,273 | 6,061 | +167% | 0 | 0 | — |
case-01 | pass→pass | 16,113 | 10,431 | -35% | 1 | 1 | 0% | 2,819 | 6,946 | +146% | 0 | 0 | — |
case-02 | fail→pass | 22,250 | 10,213 | -54% | 1 | 1 | 0% | 3,723 | 6,778 | +82% | 0 | 0 | — |
case-05 | pass→pass | 8,447 | 6,860 | -19% | 1 | 1 | 0% | 1,441 | 6,243 | +333% | 0 | 0 | — |
case-06 | fail→pass | 4,226 | 4,357 | +3% | 1 | 1 | 0% | 676 | 5,714 | +745% | 0 | 0 | — |
case-07 | fail→pass | 9,009 | 2,853 | -68% | 1 | 1 | 0% | 1,915 | 5,588 | +192% | 0 | 0 | — |
case-08 | pass→pass | 7,371 | 2,632 | -64% | 1 | 1 | 0% | 1,227 | 5,464 | +345% | 0 | 0 | — |
case-09 | fail→pass | 12,514 | 6,052 | -52% | 1 | 1 | 0% | 2,083 | 6,043 | +190% | 0 | 0 | — |
case-10 | fail→pass | 7,782 | 3,060 | -61% | 1 | 1 | 0% | 1,439 | 5,502 | +282% | 0 | 0 | — |
case-11 | fail→pass | 3,488 | 4,597 | +32% | 1 | 1 | 0% | 605 | 5,413 | +795% | 0 | 0 | — |
case-12 | pass→pass | 9,283 | 2,476 | -73% | 1 | 1 | 0% | 1,439 | 5,406 | +276% | 0 | 0 | — |
case-14 | pass→pass | 11,146 | 8,093 | -27% | 1 | 1 | 0% | 1,977 | 6,411 | +224% | 0 | 0 | — |
case-15 | fail→pass | 14,016 | 9,202 | -34% | 1 | 1 | 0% | 2,200 | 6,612 | +201% | 0 | 0 | — |
case-16 | pass→pass | 9,753 | 5,420 | -44% | 1 | 1 | 0% | 1,889 | 5,830 | +209% | 0 | 0 | — |
case-17 | fail→pass | 17,089 | 9,699 | -43% | 1 | 1 | 0% | 3,160 | 6,752 | +114% | 0 | 0 | — |
case-18 | pass→pass | 13,579 | 8,201 | -40% | 1 | 1 | 0% | 2,191 | 6,432 | +194% | 0 | 0 | — |
case-19 | fail→pass | 15,774 | 18,256 | +16% | 1 | 1 | 0% | 1,979 | 6,976 | +253% | 0 | 0 | — |
case-20 | pass→pass | 9,657 | 1,944 | -80% | 1 | 1 | 0% | 1,804 | 5,266 | +192% | 0 | 0 | — |
case-21 | pass→pass | 8,581 | 3,381 | -61% | 1 | 1 | 0% | 1,410 | 5,573 | +295% | 0 | 0 | — |
case-22 | pass→pass | 16,324 | 10,009 | -39% | 1 | 1 | 0% | 2,661 | 6,711 | +152% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +45 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.