Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Claude Code agentic coding tool — terminal-based assistant for coding, git workflows, and codebase understanding.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
examples/agent-creation-prompt.md
1# AI-Assisted Agent Generation Template23Use this template to generate agents using Claude with the agent creation system prompt.45## Usage Pattern67### Step 1: Describe Your Agent Need89Think about:10- What task should the agent handle?11- When should it be triggered?12- Should it be proactive or reactive?13- What are the key responsibilities?1415### Step 2: Use the Generation Prompt1617Send this to Claude (with the agent-creation-system-prompt loaded):1819```20Create an agent configuration based on this request: "[YOUR DESCRIPTION]"2122Return ONLY the JSON object, no other text.23```2425**Replace [YOUR DESCRIPTION] with your agent requirements.**2627### Step 3: Claude Returns JSON2829Claude will return:3031```json32{33"identifier": "agent-name",34"whenToUse": "Use this agent when... Examples: <example>...</example>",35"systemPrompt": "You are... **Your Core Responsibilities:**..."36}37```3839### Step 4: Convert to Agent File4041Create `agents/[identifier].md`:4243```markdown44---45name: [identifier from JSON]46description: [whenToUse from JSON]47model: inherit48color: [choose: blue/cyan/green/yellow/magenta/red]49tools: ["Read", "Write", "Grep"] # Optional: restrict tools50---5152[systemPrompt from JSON]53```5455## Example 1: Code Review Agent5657**Your request:**58```59I need an agent that reviews code changes for quality issues, security vulnerabilities, and adherence to best practices. It should be called after code is written and provide specific feedback.60```6162**Claude generates:**63```json64{65"identifier": "code-quality-reviewer",66"whenToUse": "Use this agent when the user has written code and needs quality review, or explicitly asks to review code changes. Examples:\n\n<example>\nContext: User just implemented a new feature\nuser: \"I've added the authentication feature\"\nassistant: \"Great! Let me review the code quality.\"\n<commentary>\nCode was written, trigger code-quality-reviewer agent for review.\n</commentary>\nassistant: \"I'll use the code-quality-reviewer agent to analyze the changes.\"\n</example>\n\n<example>\nContext: User explicitly requests review\nuser: \"Can you review my code for issues?\"\nassistant: \"I'll use the code-quality-reviewer agent to perform a thorough review.\"\n<commentary>\nExplicit review request triggers the agent.\n</commentary>\n</example>",67"systemPrompt": "You are an expert code quality reviewer specializing in identifying issues in software implementations.\n\n**Your Core Responsibilities:**\n1. Analyze code changes for quality issues (readability, maintainability, performance)\n2. Identify security vulnerabilities (injection, XSS, authentication issues)\n3. Check adherence to project best practices and coding standards\n4. Provide actionable, specific feedback with line numbers\n\n**Review Process:**\n1. Read the code changes using available tools\n2. Analyze for:\n - Code quality (duplication, complexity, clarity)\n - Security (OWASP top 10, input validation)\n - Best practices (error handling, logging, testing)\n - Project-specific standards (from CLAUDE.md)\n3. Identify issues with severity (critical/major/minor)\n4. Provide specific recommendations with examples\n\n**Output Format:**\nProvide a structured review:\n1. Summary (2-3 sentences)\n2. Critical Issues (must fix)\n3. Major Issues (should fix)\n4. Minor Issues (nice to fix)\n5. Positive observations\n6. Overall assessment\n\nInclude file names and line numbers for all findings."68}69```7071**You create:**7273File: `agents/code-quality-reviewer.md`7475```markdown76---77name: code-quality-reviewer78description: Use this agent when the user has written code and needs quality review, or explicitly asks to review code changes. Examples:7980<example>81Context: User just implemented a new feature82user: "I've added the authentication feature"83assistant: "Great! Let me review the code quality."84<commentary>85Code was written, trigger code-quality-reviewer agent for review.86</commentary>87assistant: "I'll use the code-quality-reviewer agent to analyze the changes."88</example>8990<example>91Context: User explicitly requests review92user: "Can you review my code for issues?"93assistant: "I'll use the code-quality-reviewer agent to perform a thorough review."94<commentary>95Explicit review request triggers the agent.96</commentary>97</example>9899model: inherit100color: blue101tools: ["Read", "Grep", "Glob"]102---103104You are an expert code quality reviewer specializing in identifying issues in software implementations.105106**Your Core Responsibilities:**1071. Analyze code changes for quality issues (readability, maintainability, performance)1082. Identify security vulnerabilities (injection, XSS, authentication issues)1093. Check adherence to project best practices and coding standards1104. Provide actionable, specific feedback with line numbers111112**Review Process:**1131. Read the code changes using available tools1142. Analyze for:115- Code quality (duplication, complexity, clarity)116- Security (OWASP top 10, input validation)117- Best practices (error handling, logging, testing)118- Project-specific standards (from CLAUDE.md)1193. Identify issues with severity (critical/major/minor)1204. Provide specific recommendations with examples121122**Output Format:**123Provide a structured review:1241. Summary (2-3 sentences)1252. Critical Issues (must fix)1263. Major Issues (should fix)1274. Minor Issues (nice to fix)1285. Positive observations1296. Overall assessment130131Include file names and line numbers for all findings.132```133134## Example 2: Test Generation Agent135136**Your request:**137```138Create an agent that generates unit tests for code. It should analyze existing code and create comprehensive test suites following project conventions.139```140141**Claude generates:**142```json143{144"identifier": "test-generator",145"whenToUse": "Use this agent when the user asks to generate tests, needs test coverage, or has written code that needs testing. Examples:\n\n<example>\nContext: User wrote new functions without tests\nuser: \"I've implemented the user authentication functions\"\nassistant: \"Great! Let me generate tests for these functions.\"\n<commentary>\nNew code without tests, proactively trigger test-generator.\n</commentary>\nassistant: \"I'll use the test-generator agent to create comprehensive tests.\"\n</example>",146"systemPrompt": "You are an expert test engineer specializing in creating comprehensive unit tests...\n\n**Your Core Responsibilities:**\n1. Analyze code to understand behavior\n2. Generate test cases covering happy paths and edge cases\n3. Follow project testing conventions\n4. Ensure high code coverage\n\n**Test Generation Process:**\n1. Read target code\n2. Identify testable units (functions, classes, methods)\n3. Design test cases (inputs, expected outputs, edge cases)\n4. Generate tests following project patterns\n5. Add assertions and error cases\n\n**Output Format:**\nGenerate complete test files with:\n- Test suite structure\n- Setup/teardown if needed\n- Descriptive test names\n- Comprehensive assertions"147}148```149150**You create:** `agents/test-generator.md` with the structure above.151152## Example 3: Documentation Agent153154**Your request:**155```156Build an agent that writes and updates API documentation. It should analyze code and generate clear, comprehensive docs.157```158159**Result:** Agent file with identifier `api-docs-writer`, appropriate examples, and system prompt for documentation generation.160161## Tips for Effective Agent Generation162163### Be Specific in Your Request164165**Vague:**166```167"I need an agent that helps with code"168```169170**Specific:**171```172"I need an agent that reviews pull requests for type safety issues in TypeScript, checking for proper type annotations, avoiding 'any', and ensuring correct generic usage"173```174175### Include Triggering Preferences176177Tell Claude when the agent should activate:178179```180"Create an agent that generates tests. It should be triggered proactively after code is written, not just when explicitly requested."181```182183### Mention Project Context184185```186"Create a code review agent. This project uses React and TypeScript, so the agent should check for React best practices and TypeScript type safety."187```188189### Define Output Expectations190191```192"Create an agent that analyzes performance. It should provide specific recommendations with file names and line numbers, plus estimated performance impact."193```194195## Validation After Generation196197Always validate generated agents:198199```bash200# Validate structure201./scripts/validate-agent.sh agents/your-agent.md202203# Check triggering works204# Test with scenarios from examples205```206207## Iterating on Generated Agents208209If generated agent needs improvement:2102111. Identify what's missing or wrong2122. Manually edit the agent file2133. Focus on:214- Better examples in description215- More specific system prompt216- Clearer process steps217- Better output format definition2184. Re-validate2195. Test again220221## Advantages of AI-Assisted Generation222223- **Comprehensive**: Claude includes edge cases and quality checks224- **Consistent**: Follows proven patterns225- **Fast**: Seconds vs manual writing226- **Examples**: Auto-generates triggering examples227- **Complete**: Provides full system prompt structure228229## When to Edit Manually230231Edit generated agents when:232- Need very specific project patterns233- Require custom tool combinations234- Want unique persona or style235- Integrating with existing agents236- Need precise triggering conditions237238Start with generation, then refine manually for best results.239