|
1 | | -# Agents & Subagents |
| 1 | +# Agents & Specialized Agents |
2 | 2 |
|
3 | 3 | Harness the power of specialized AI agents to delegate tasks, maintain context, and create sophisticated collaborative workflows that scale with your development needs. |
4 | 4 |
|
5 | | -## Overview |
| 5 | +## Core Philosophy |
6 | 6 |
|
7 | | -Claude Code agents are specialized AI assistants that excel at specific domains, tasks, or workflows. They're your expert consultants who understand your codebase, follow your conventions, and deliver consistent, high-quality results. |
| 7 | +Claude Code agents are **context firewalls** - specialized processing units that consume large amounts of information and return focused, actionable insights. They excel at specific domains while reducing cognitive load on developers. |
| 8 | + |
| 9 | +**The Agent Principle**: Agents should process 100% of relevant context but return only 10-20% as concentrated, actionable information. |
8 | 10 |
|
9 | 11 | **Why Use Agents?** |
| 12 | +- **Context Reduction**: Process extensive codebases and return focused insights |
10 | 13 | - **Specialization**: Each agent masters specific domains rather than being generalist |
11 | 14 | - **Consistency**: Agents apply the same expertise and patterns every time |
12 | | -- **Scalability**: Delegate complex work while maintaining quality standards |
13 | | -- **Context Preservation**: Agents remember project patterns and preferences |
| 15 | +- **Scalability**: Delegate complex analysis while maintaining quality standards |
| 16 | +- **Cognitive Load Management**: Handle information processing so you can focus on decision-making |
14 | 17 | - **Team Alignment**: Shared agents ensure consistent practices across team members |
15 | 18 |
|
16 | 19 | ## Agent Architecture |
@@ -51,7 +54,7 @@ Refactoring, optimization, migration, and technical debt management. |
51 | 54 | #### 📚 **Documentation Agents** |
52 | 55 | Creating, maintaining, and improving project documentation. |
53 | 56 |
|
54 | | -## Subagent Use Cases & Patterns |
| 57 | +## Agent Use Cases & Patterns |
55 | 58 |
|
56 | 59 | ### The Multi-Agent Feature Development Pattern |
57 | 60 |
|
@@ -325,32 +328,94 @@ name: "android-specialist" |
325 | 328 | description: "Android native development and Play Store optimization expert" |
326 | 329 | ``` |
327 | 330 |
|
| 331 | +## Agent Creation Template |
| 332 | +
|
| 333 | +Use this template when creating new agents: |
| 334 | +
|
| 335 | +```yaml |
| 336 | +name: "agent-name" |
| 337 | +description: "Single-sentence purpose focused on output, not process" |
| 338 | +instructions: | |
| 339 | + You are [role] specializing in [domain]. |
| 340 | + |
| 341 | + CORE PRINCIPLE: Process extensive information, return focused insights. |
| 342 | + |
| 343 | + INPUT: [What you expect to receive] |
| 344 | + PROCESS: [How you analyze the input] |
| 345 | + OUTPUT: [Specific format of concise results - aim for 10-20% of input size] |
| 346 | + |
| 347 | + FOCUS AREAS: |
| 348 | + - [Specific concern 1] |
| 349 | + - [Specific concern 2] |
| 350 | + - [Specific concern 3] |
| 351 | + |
| 352 | + COMMUNICATION STYLE: |
| 353 | + - Lead with actionable findings |
| 354 | + - Prioritize critical issues |
| 355 | + - Provide specific file/line references |
| 356 | + - Suggest concrete next steps |
| 357 | + |
| 358 | +tools: |
| 359 | + - name: "Read" |
| 360 | + - name: "Grep" |
| 361 | +context_files: |
| 362 | + - "relevant-project-files.md" |
| 363 | +``` |
| 364 | +
|
| 365 | +## Agent Anti-Patterns |
| 366 | +
|
| 367 | +**❌ Avoid These Common Mistakes:** |
| 368 | +
|
| 369 | +### The Verbose Responder |
| 370 | +- **Problem**: Agents that return as much information as they process |
| 371 | +- **Solution**: Always summarize and prioritize findings |
| 372 | +
|
| 373 | +### The Generalist Agent |
| 374 | +- **Problem**: Agents that try to handle multiple unrelated domains |
| 375 | +- **Solution**: Create focused, single-purpose agents |
| 376 | +
|
| 377 | +### The Anthropomorphized Assistant |
| 378 | +- **Problem**: Agents with personality or conversational behavior |
| 379 | +- **Solution**: Focus on processing patterns and consistent output formats |
| 380 | +
|
| 381 | +### The Inconsistent Agent Communication |
| 382 | +- **Problem**: Mixing "agent" and "subagent" terminology without clear distinction |
| 383 | +- **Solution**: Use "agent" consistently, specify "specialized agent" when needed for clarity |
| 384 | +
|
| 385 | +### The Simple Task Handler |
| 386 | +- **Problem**: Using agents for tasks that don't need context reduction |
| 387 | +- **Solution**: Use agents only when processing complexity exceeds output complexity |
| 388 | +
|
| 389 | +### The Inter-Agent Communicator |
| 390 | +- **Problem**: Agents designed to work with other agents |
| 391 | +- **Solution**: Design independent agents with clear handoff points |
| 392 | +
|
328 | 393 | ## Agent Management Best Practices |
329 | 394 |
|
330 | | -### 1. **Scope Limitation** 🎯 |
331 | | -- Give agents specific, well-defined responsibilities |
332 | | -- Limit tool access to what each agent actually needs |
333 | | -- Avoid creating "do everything" agents |
| 395 | +### 1. **Single Purpose Design** 🎯 |
| 396 | +- Give agents one clear, specific responsibility |
| 397 | +- Limit tool access to exactly what each agent needs |
| 398 | +- Ensure agents can operate independently |
334 | 399 |
|
335 | | -### 2. **Context Optimization** 📋 |
| 400 | +### 2. **Context Reduction Focus** 📋 |
| 401 | +- Train agents to process large inputs and return focused outputs |
336 | 402 | - Include relevant documentation in context_files |
337 | | -- Keep agent instructions focused and actionable |
338 | | -- Update context as project evolves |
| 403 | +- Measure success by output conciseness and actionability |
339 | 404 |
|
340 | | -### 3. **Quality Validation** ✅ |
| 405 | +### 3. **Output Standardization** ✅ |
| 406 | +- Define clear output formats for consistent results |
341 | 407 | - Test agents with real scenarios before team adoption |
342 | | -- Validate outputs match expected quality standards |
343 | | -- Iterate on instructions based on actual usage |
| 408 | +- Validate that outputs are actionable, not just informative |
344 | 409 |
|
345 | 410 | ### 4. **Team Coordination** 🤝 |
346 | 411 | - Share successful agent configurations with team |
347 | 412 | - Establish naming conventions for agent organization |
348 | | -- Document agent capabilities and use cases |
| 413 | +- Document specific use cases and expected outcomes |
349 | 414 |
|
350 | 415 | ### 5. **Evolution Management** 🔄 |
351 | 416 | - Version control agent configurations |
352 | 417 | - Update agents as project patterns change |
353 | | -- Retire or merge agents that become redundant |
| 418 | +- Retire agents that don't provide sufficient value over simple tasks |
354 | 419 |
|
355 | 420 | ## Integration with Command System |
356 | 421 |
|
@@ -385,4 +450,11 @@ Agents work seamlessly with command workflows: |
385 | 450 | - `database-perf`: Query optimization and indexing specialist |
386 | 451 | - `infrastructure-perf`: Scaling and resource optimization expert |
387 | 452 |
|
388 | | -This agent ecosystem transforms development from individual effort into orchestrated specialist collaboration, delivering higher quality results while maintaining development velocity. |
| 453 | +This agent ecosystem transforms development from individual effort into orchestrated specialist collaboration, delivering higher quality results while maintaining development velocity. |
| 454 | + |
| 455 | +## Quick Setup Resources |
| 456 | + |
| 457 | +Accelerate your agent development: |
| 458 | + |
| 459 | +- **[Claude Code Templates](https://github.com/davila7/claude-code-templates)** - Pre-configured agents for frontend, backend, testing, and specialized domains |
| 460 | +- **[CCPM](/resources/tools#ccpm---claude-code-project-management)** - Parallel agent execution system for complex multi-agent workflows |
0 commit comments