/context-engineering:agent-devfrom context-engineering
Creates and refines Claude Code sub-agent definitions following Anthropic best practices. Guides YAML frontmatter, system prompts, tool access, and discovery-optimized descriptions.
Ships in context-engineering. 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.
None: SKILL.md is the whole skill.
This skill helps create production-ready Claude Code sub-agent definitions following Anthropic's official specifications and best practices.
Each agent should have ONE clear purpose. Avoid creating multipurpose agents that try to do everything.
Good: postgres-expert - PostgreSQL database management and optimization
Bad: database-expert - All databases (too broad)
The description field is critical for Claude to discover when to use your agent. Include:
Grant only necessary tools following principle of least privilege:
tools field: Inherits all tools from main conversation (use for general-purpose agents)Choose the right model for the task:
sonnet: Default choice for most agents (balanced performance/cost)opus: Complex reasoning, architecture decisions, critical taskshaiku: Simple, repetitive tasks with clear patternsinherit: Match parent conversation's model---
name: agent-identifier
description: >
Primary description with capabilities and use cases.
Examples:
<example>
Context: Situation description
user: "User request example"
assistant: "I'll use the agent-name to handle this task."
<commentary>
Explanation of why this agent is appropriate.
</commentary>
</example>
<example>
Context: Another scenario
user: "Different request pattern"
assistant: "Let me use the agent-name for this."
<commentary>
Another use case explanation.
</commentary>
</example>
tools: Tool1, Tool2, Tool3 # Optional - omit to inherit all tools
model: sonnet # Optional - sonnet, opus, haiku, or inherit
color: "#hexcolor" # Optional - UI color coding
---
System prompt content starts here.
You are a [role description] specializing in [domain].
## Core Responsibilities
- List key responsibilities
- Be specific and actionable
- Include success criteria
## Approach
- Describe methodology
- Include examples
- Reference best practices
## Constraints
- Limitations and boundaries
- Security considerations
- Performance requirements
Project-level (shared with team):
.claude/agents/agent-name.md.claude/agents/postgres-expert.mdUser-level (personal, cross-project):
~/.claude/agents/agent-name.md~/.claude/agents/custom-reviewer.mdNaming conventions:
Unique identifier using lowercase alphanumeric characters and hyphens.
name: fastapi-expert # Good
name: FastAPI Expert # Bad - no spaces or capitals
name: expert # Bad - too generic
Natural language explanation with examples. This is THE MOST IMPORTANT FIELD.
Structure:
Example:
description: >
Expert in PostgreSQL database management, optimization, and architecture. Specializes in
query performance tuning, schema design, replication, and PostgreSQL 16+ advanced features.
Use PROACTIVELY for database optimization, slow queries, or schema design tasks.
Examples:
<example>
Context: User needs query optimization
user: "My PostgreSQL queries are slow"
assistant: "I'll use the postgres-expert agent to analyze and optimize your queries."
<commentary>
Query performance is a core competency, so this agent is appropriate.
</commentary>
</example>
Comma-separated list of allowed tools. Omit to inherit all tools from main conversation.
When to restrict:
Common tool sets:
# Read-only analysis
tools: Read, Grep, Glob, Bash(git :*)
# Code modification
tools: Read, Write, Edit, Grep, Glob
# Research and planning
tools: Read, Grep, Glob, WebFetch, WebSearch
# Full-stack development
tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch
Specify model for this agent. Options: sonnet, opus, haiku, inherit
model: sonnet # Default - balanced performance
model: opus # Complex reasoning, architecture
model: haiku # Simple, fast tasks
model: inherit # Match parent conversation
Hex color for UI identification (optional, cosmetic).
color: "#d79921" # Yellow
color: "#458588" # Blue
color: "#cc241d" # Red
Start with a clear role statement:
You are an expert PostgreSQL database administrator and architect specializing in
performance optimization, schema design, and high-availability configurations.
List concrete, actionable responsibilities:
## Core Responsibilities
### Query Optimization
- Analyze EXPLAIN plans and execution statistics
- Recommend index strategies for slow queries
- Identify and fix N+1 query problems
- Optimize JOIN operations and subqueries
### Schema Design
- Design normalized schemas following 3NF principles
- Implement efficient indexing strategies
- Set up row-level security (RLS) for multi-tenancy
- Create database migrations with zero downtime
Describe methodology with examples:
## Approach
When optimizing queries:
1. Request the slow query and current execution plan
2. Analyze EXPLAIN ANALYZE output for bottlenecks
3. Recommend specific index additions or query rewrites
4. Provide before/after performance metrics
5. Explain the reasoning behind each optimization
Include working examples:
## Example: Index Optimization
For a slow query like:
\`\`\`sql
SELECT users.*, orders.total
FROM users
JOIN orders ON users.id = orders.user_id
WHERE orders.created_at > NOW() - INTERVAL '30 days';
\`\`\`
Recommend:
\`\`\`sql
CREATE INDEX idx_orders_created_user
ON orders(created_at, user_id)
INCLUDE (total);
\`\`\`
Define what the agent should NOT do:
## Constraints
- Never recommend dropping production indexes without analyzing dependencies
- Always suggest testing schema changes in staging first
- Do not execute destructive operations without explicit confirmation
- Require EXPLAIN ANALYZE output before optimization recommendations
Characteristics:
Example: Code reviewer, security auditor, documentation analyzer
Characteristics:
Example: Python expert, React specialist, FastAPI architect
Characteristics:
Example: Docker engineer, Terraform specialist, K8s expert
Characteristics:
Example: Project planner, workflow coordinator
After creating an agent definition:
Test discovery: Ask natural language questions that should trigger the agent
User: "Help me optimize my PostgreSQL query"
Expected: Claude invokes postgres-expert agent
Verify tool access: Ensure the agent can access specified tools
Check boundaries: Confirm the agent stays within its defined scope
Review examples: Ensure example scenarios accurately represent usage
❌ Too broad scope
name: backend-expert
description: Expert in all backend technologies
✅ Focused scope
name: fastapi-expert
description: Expert in FastAPI async Python API development
❌ Generic description
description: Helps with database tasks
✅ Specific description with examples
description: >
PostgreSQL expert for query optimization, schema design, and replication.
Use for slow queries, database architecture, or production scaling.
Examples: [concrete user/assistant dialogues]
❌ No tool restrictions when needed
# Security audit agent with full write access - dangerous!
tools: # Inherits all tools including Edit, Write, Bash
✅ Appropriate tool restrictions
# Security audit agent - read-only access
tools: Read, Grep, Glob, Bash(git :*)
❌ Missing examples in description
description: Expert in React development
✅ Examples included
description: >
Expert in React development...
Examples:
<example>
Context: User needs component optimization
user: "My dashboard re-renders too often"
assistant: "I'll use the react-expert to profile and optimize rendering."
<commentary>Performance optimization is a core competency.</commentary>
</example>
Each agent execution gets a unique agentId. You can resume previous agent conversations:
User: "Resume agent execution abc123 and continue the analysis"
Transcripts are stored separately and can be continued with full context.
Include phrases in description to encourage automatic invocation:
Dynamic agent creation without files:
claude --agents '{"name": "temp-agent", "description": "...", "tools": "Read,Grep"}'
Reference the examples directory for:
Next Steps: After creating an agent definition, test it with natural language queries to verify Claude discovers and invokes it appropriately. Refine the description based on actual usage patterns.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub andisab/swe-marketplace --plugin context-engineering7 skills in this plugin
/command-devUse this skill when creating or refining custom Claude Code slash commands. Slash commands are user-invoked reusable prompts that can accept arguments, reference files, and execute bash operations. Helps design command syntax, argument handling, file references, bash execution, and frontmatter configuration. Automatically invoked when user requests "create a command", "make a slash command", "add a /command", or mentions custom command development.
/hook-devUse this skill when creating or refining Claude Code hooks. Hooks are shell commands that execute at specific lifecycle events (tool use, prompt submit, notifications, session events). Helps design event handlers for notifications, formatting, logging, feedback, and permission control. Automatically invoked when user requests "create a hook", "add automation", "event handler", "workflow automation", or mentions hook development.
/mcp-server-devCreate MCP servers — multi-tool services exposed via Model Context Protocol. Use this skill whenever users mention MCP servers, building servers, server scaffolding, tool registration, or want to package tools for distribution via uvx or npx. Also use when the conversation involves stdio transport, server lifecycle, or grouping multiple related tools into a service. Covers Python (FastMCP) and TypeScript (@modelcontextprotocol/sdk) patterns, packaging, and testing.
Activate for: - "Create an MCP server" - "Build a server with multiple tools" - "Package tools for uvx/npx" - "Set up stdio transport" - "Register tools on a server"
Do NOT use for: - Creating a single standalone tool function (use mcp-tool-dev) - General REST API development - Claude Code agents, skills, or commands
Other plugins' skills for the same job