Chapter 56 · Reviewing Claude Config
Subchapter 56.5
checklists/agents.mdMarkdown13 KBView on GitHub
Review checklist for changes to Claude Code agent files (.claude/agents/*.md and plugins/*/agents/*.md).
Focus Areas:
name and descriptiontools, modelRequired YAML Frontmatter:
---
name: agent-name-in-lowercase-with-hyphens
description: Specific description with activation triggers
---Optional YAML Fields:
---
name: agent-name
description: Clear description
tools: Read, Grep, Glob # Comma-separated tool names (omit to inherit all)
model: sonnet # Options: sonnet, opus, haiku, inherit
---Critical Issues to Flag Immediately:
name fielddescription fieldmodel value (must be: sonnet, opus, haiku, inherit)tools fieldPrinciple of Least Privilege: Agents should have ONLY the tools necessary for their specific function.
Tool Access Patterns:
✅ GOOD - Read-only analysis agent:
---
name: code-analyzer
description: Analyzes code quality and patterns
tools: Read, Grep, Glob
---✅ GOOD - Scoped editing agent:
---
name: test-generator
description: Generates unit tests for existing code
tools: Read, Grep, Write
---❌ BAD - Overly broad access:
---
name: helper-agent
description: Helps with various tasks
# No tools field = inherits ALL tools
---❌ BAD - Unnecessary destructive access:
---
name: documentation-writer
description: Writes documentation
tools: Read, Write, Edit, Bash # Why does documentation need Bash?
---Security Checks:
Common Secure Patterns:
Red Flags:
Reference: reference/claude-code-requirements.md - Tool Access Security (lines 109-133)
Effective Descriptions: Descriptions must be specific about BOTH functionality AND activation triggers.
✅ GOOD - Specific with activation triggers:
description: Reviews Kotlin code for MVVM violations, state management issues, and Compose best practices. Use when analyzing Android ViewModels, state flows, or Compose UI code.✅ GOOD - Clear automatic delegation:
description: Debugs runtime errors by analyzing stack traces and logs. PROACTIVELY invoke when error messages or exceptions are present.✅ GOOD - Narrow scope with examples:
description: Generates unit tests for Python functions using pytest. Use when working with .py files that lack test coverage.❌ BAD - Too vague:
description: Helps with code stuff.❌ BAD - No activation triggers:
description: Analyzes code quality and suggests improvements.
# When should this be used? What languages? What types of improvements?❌ BAD - Too broad (violates single responsibility):
description: Handles all aspects of development including coding, testing, deployment, documentation, and architecture design.Check For:
Activation Language Patterns:
System Prompt Requirements:
Clarity and Specificity:
Prompt Engineering Best Practices:
✅ GOOD - Structured with examples:
# Code Reviewer Agent
## Role
You are a specialized code reviewer focusing on security vulnerabilities, performance issues, and adherence to SOLID principles.
## Capabilities
- Identify SQL injection, XSS, and CSRF vulnerabilities
- Detect performance anti-patterns (N+1 queries, memory leaks)
- Verify SOLID principle adherence
## Process
1. Read the file and understand context
2. Analyze against security checklist
3. Check performance patterns
4. Verify architectural principles
5. Provide inline comments with file:line references
## Output Format
**file.py:42** - CRITICAL: SQL injection vulnerability
[Specific fix with code example]
[Rationale explaining security impact]
## Examples
[Include 2-3 examples of good review comments]✅ GOOD - Includes structured thinking:
Before analyzing each file, use structured thinking:
<thinking>
1. What is the file's purpose?
2. What are the main security risks for this type of code?
3. What performance patterns should I check?
4. Are there obvious SOLID violations?
</thinking>
Then provide your analysis...❌ BAD - Too vague:
Review code and find problems.❌ BAD - No structure or examples:
You're a code reviewer. Look at code and tell the user what's wrong with it. Check for bugs and bad practices.Structured Thinking Guidance:
<thinking> blocks guide reasoning processToken Efficiency:
Reference: Anthropic Chain of Thought documentation (40% error reduction with structured thinking)
Model Selection Guidance:
model: haiku # Fast, cost-effective for simple tasks
model: sonnet # Balanced for most tasks (default)
model: opus # Most capable, use sparingly for complex reasoning
model: inherit # Inherits from parent conversationWhen to Use Each Model:
Haiku - Simple, straightforward tasks:
Sonnet - Most agent tasks (default):
Opus - Complex reasoning only:
Inherit - Context-dependent:
Best Practice Checks:
Anti-Patterns:
For Marketplace-Bound Agents:
Elevated Standards:
Documentation Requirements:
Production Readiness:
Internal vs Marketplace:
Classify findings using reference/priority-framework.md:
Over-Privileged Agent:
Vague Purpose:
Missing Structured Thinking:
<thinking> blocks with key questionsWrong Model Selection:
Scope Creep:
Security Oversights:
Before completing review, verify: