|
| 1 | +# Claude Code Agents |
| 2 | + |
| 3 | +This directory contains custom Claude Code agents for the Lentigram project. These agents provide specialized knowledge and can be invoked via the Task tool. |
| 4 | + |
| 5 | +## What Are Agents? |
| 6 | + |
| 7 | +Agents are specialized prompt files that give Claude Code deep knowledge about specific aspects of your codebase. They travel with the repository and can be shared with your team. |
| 8 | + |
| 9 | +## Available Agents |
| 10 | + |
| 11 | +### developer.md |
| 12 | +**Core development patterns and architecture** |
| 13 | + |
| 14 | +Contains: |
| 15 | +- Architectural principles (Model as Source of Truth) |
| 16 | +- Design patterns (Action/Command/MVVM) |
| 17 | +- Performance best practices (scanLine vs pixel, threading) |
| 18 | +- Qt coding standards for Lentigram |
| 19 | +- Common pitfalls and how to avoid them |
| 20 | +- depth-lib specific knowledge (blur pyramids, depth conventions) |
| 21 | +- Code review checklist |
| 22 | + |
| 23 | +**When to use**: Working on features, refactoring, reviewing code, making architectural decisions, setting up new actions/commands/viewmodels. |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +### build-script-expert.md |
| 28 | +**Cross-platform build system specialist** |
| 29 | + |
| 30 | +Contains: |
| 31 | +- CMake patterns for Linux/Windows/macOS |
| 32 | +- Dependency compilation scripts (install-deps.sh) |
| 33 | +- MSYS2/MinGW64 path handling on Windows |
| 34 | +- x86_64 architecture enforcement on macOS |
| 35 | +- Compiler toolchain selection per platform |
| 36 | +- Build failure debugging |
| 37 | + |
| 38 | +**When to use**: Modifying install-deps.sh, adding new dependencies, fixing build issues, ensuring cross-platform compatibility. |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +### debugger.md |
| 43 | +**Error investigation and root cause analysis** |
| 44 | + |
| 45 | +Contains: |
| 46 | +- Debugging strategies for test failures |
| 47 | +- Crash investigation techniques |
| 48 | +- Performance issue diagnosis |
| 49 | +- Unexpected behavior analysis |
| 50 | +- Log analysis and tracing |
| 51 | +- Memory leak detection |
| 52 | + |
| 53 | +**When to use**: Test failures, crashes, segfaults, unexpected behavior, performance regressions. Invoke proactively when errors occur. |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +### code-reviewer.md |
| 58 | +**Code quality and best practices analysis** |
| 59 | + |
| 60 | +Contains: |
| 61 | +- Readability improvement suggestions |
| 62 | +- Performance optimization opportunities |
| 63 | +- Security vulnerability detection |
| 64 | +- Best practices verification |
| 65 | +- Code smell identification |
| 66 | +- Refactoring recommendations |
| 67 | + |
| 68 | +**When to use**: After implementing features, before submitting PRs, improving code quality, cleaning up technical debt. |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +### tech-docs-writer.md |
| 73 | +**Technical documentation creation and maintenance** |
| 74 | + |
| 75 | +Contains: |
| 76 | +- Documentation structure and style guidelines |
| 77 | +- README patterns and best practices |
| 78 | +- API documentation standards |
| 79 | +- Installation guide templates |
| 80 | +- Architecture overview formats |
| 81 | +- Consistent cross-platform documentation |
| 82 | + |
| 83 | +**When to use**: Creating README files, documenting APIs, writing installation guides, updating architecture docs, ensuring documentation consistency. |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +### testing.md |
| 88 | +**Testing strategies and best practices** |
| 89 | + |
| 90 | +Contains: |
| 91 | +- Dynamic test name patterns (no hardcoded paths) |
| 92 | +- Google Test best practices (ASSERT vs EXPECT, modern API) |
| 93 | +- Test output directory management for fixtures and non-fixtures |
| 94 | +- Image processing test patterns (format preservation, pixel comparison) |
| 95 | +- Resource finding with ResourceFinder |
| 96 | +- Parameterized test patterns |
| 97 | +- Test naming conventions |
| 98 | +- Anti-patterns to avoid |
| 99 | + |
| 100 | +**When to use**: Writing new tests, updating existing tests, fixing test failures, organizing test output, ensuring test maintainability. |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## How to Use Agents |
| 105 | + |
| 106 | +### Via Task Tool (Recommended) |
| 107 | +Claude Code can invoke agents using the Task tool with the appropriate `subagent_type`: |
| 108 | + |
| 109 | +``` |
| 110 | +"Use the developer agent to review this code for architectural best practices" |
| 111 | +"Use the build-script-expert to fix the Windows build issue" |
| 112 | +"Use the debugger agent to investigate this test failure" |
| 113 | +"Use the code-reviewer to analyze this file for improvements" |
| 114 | +"Use the tech-docs-writer to create installation documentation" |
| 115 | +"Use the testing agent to review test patterns and best practices" |
| 116 | +``` |
| 117 | + |
| 118 | +### Manual Reference |
| 119 | +You can also reference agents directly in prompts: |
| 120 | +``` |
| 121 | +"Check .claude/agents/developer.md for our threading patterns" |
| 122 | +"Following the guidelines in .claude/agents/build-script-expert.md, update install-deps.sh" |
| 123 | +``` |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## Agent Hierarchy |
| 128 | + |
| 129 | +``` |
| 130 | +CLAUDE.md (project root) |
| 131 | + ↓ (project overview, build commands) |
| 132 | + ↓ |
| 133 | +.claude/agents/ (this directory) |
| 134 | + ↓ (specialized deep knowledge) |
| 135 | + ↓ |
| 136 | + ├── developer.md → Architecture, patterns, best practices |
| 137 | + ├── build-script-expert.md → Cross-platform builds, dependencies |
| 138 | + ├── debugger.md → Error investigation, root cause analysis |
| 139 | + ├── code-reviewer.md → Code quality, refactoring suggestions |
| 140 | + ├── tech-docs-writer.md → Documentation standards, templates |
| 141 | + └── testing.md → Testing strategies, test best practices |
| 142 | + ↓ |
| 143 | +~/.claude/.../MEMORY.md (auto memory) |
| 144 | + ↓ (session-specific temporary notes) |
| 145 | +``` |
| 146 | + |
| 147 | +**Think of it as**: |
| 148 | +- `CLAUDE.md` = "What is this project?" |
| 149 | +- `.claude/agents/*.md` = "How do we build/debug/document/code this?" |
| 150 | +- `MEMORY.md` = "What am I working on right now?" |
| 151 | + |
| 152 | +--- |
| 153 | + |
| 154 | +## When to Use Which Agent |
| 155 | + |
| 156 | +| Scenario | Agent to Use | |
| 157 | +|----------|--------------| |
| 158 | +| Implementing new feature | developer.md | |
| 159 | +| Writing new tests | testing.md | |
| 160 | +| Reviewing code quality | code-reviewer.md | |
| 161 | +| Test failure or crash | debugger.md | |
| 162 | +| Modifying build scripts | build-script-expert.md | |
| 163 | +| Creating documentation | tech-docs-writer.md | |
| 164 | +| Threading/performance issue | developer.md | |
| 165 | +| Cross-platform build failure | build-script-expert.md | |
| 166 | +| Architectural decision | developer.md | |
| 167 | +| Pre-PR code review | code-reviewer.md | |
| 168 | +| API documentation | tech-docs-writer.md | |
| 169 | +| Test output organization | testing.md | |
| 170 | + |
| 171 | +--- |
| 172 | + |
| 173 | +## Benefits |
| 174 | + |
| 175 | +- **Version controlled**: Agents are checked into git with your code |
| 176 | +- **Team shared**: All developers benefit from accumulated knowledge |
| 177 | +- **Specialized**: Each agent focuses on a specific domain |
| 178 | +- **Portable**: Agents travel with the repository |
| 179 | +- **Discoverable**: Easy to find in `.claude/agents/` |
| 180 | +- **Executable**: Can be used via Task tool for autonomous work |
| 181 | +- **Maintainable**: Update agents as patterns evolve |
| 182 | + |
| 183 | +--- |
| 184 | + |
| 185 | +## Adding New Agents |
| 186 | + |
| 187 | +To add a new agent: |
| 188 | + |
| 189 | +1. Create a new `.md` file in this directory |
| 190 | +2. Follow the structure of existing agents |
| 191 | +3. Document the agent's purpose in this README |
| 192 | +4. Update MEMORY.md if needed to reference the new agent |
| 193 | + |
| 194 | +Potential new agents: |
| 195 | +- `ui-guidelines.md` - UI/UX conventions |
| 196 | +- `api-design.md` - API design principles |
| 197 | +- `security.md` - Security best practices |
| 198 | +- `performance.md` - Performance profiling and optimization |
| 199 | + |
| 200 | +--- |
| 201 | + |
| 202 | +For more information about Claude Code agents, see: https://github.com/anthropics/claude-code |
0 commit comments