@uniswap/ai-toolkit-nx-claude 0.5.15 → 0.5.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/content/agents/agnostic/CLAUDE.md +282 -0
- package/dist/content/agents/agnostic/pr-reviewer.md +1 -1
- package/dist/content/agents/agnostic/stack-splitter.md +642 -0
- package/dist/content/commands/agnostic/CLAUDE.md +205 -0
- package/dist/content/commands/agnostic/claude-init-plus.md +439 -0
- package/dist/content/commands/agnostic/perf-analyze.md +214 -0
- package/dist/content/commands/agnostic/split-stack.md +705 -0
- package/dist/content/commands/agnostic/update-claude-md.md +401 -0
- package/dist/generators/add-agent/CLAUDE.md +130 -0
- package/dist/generators/add-agent/schema.json +1 -1
- package/dist/generators/add-command/CLAUDE.md +131 -0
- package/dist/generators/addons/CLAUDE.md +277 -0
- package/dist/generators/init/generator.cjs +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# AI Agents (Agnostic)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Language-agnostic AI agent definitions for Claude Code. Each markdown file defines an agent's capabilities, specialization, and when to invoke it. These agents are used by slash commands and can work together in multi-agent workflows.
|
|
6
|
+
|
|
7
|
+
## Agent Files (32 total)
|
|
8
|
+
|
|
9
|
+
### Code Quality Agents
|
|
10
|
+
|
|
11
|
+
- `code-generator.md` - Generate production-ready code with tests
|
|
12
|
+
- `code-explainer.md` - Explain code with deep analysis
|
|
13
|
+
- `refactorer.md` - Advanced refactoring with safety checks
|
|
14
|
+
- `style-enforcer.md` - Enforce code style and conventions
|
|
15
|
+
- `security-analyzer.md` - Security vulnerability assessment
|
|
16
|
+
- `performance-analyzer.md` - Performance analysis and optimization
|
|
17
|
+
|
|
18
|
+
### Review & Analysis
|
|
19
|
+
|
|
20
|
+
- `pr-reviewer.md` - Review PRs and address comments
|
|
21
|
+
- `plan-reviewer.md` - Review implementation plans
|
|
22
|
+
- `doc-writer.md` - Generate comprehensive documentation
|
|
23
|
+
- `debug-assistant.md` - Advanced debugging with root cause analysis
|
|
24
|
+
|
|
25
|
+
### Architecture & Design
|
|
26
|
+
|
|
27
|
+
- `planner.md` - Create implementation plans
|
|
28
|
+
- `researcher.md` - Conduct research (web + codebase)
|
|
29
|
+
- `pattern-learner.md` - Learn and extract reusable patterns
|
|
30
|
+
- `migration-assistant.md` - Guide version upgrades and migrations
|
|
31
|
+
|
|
32
|
+
### Testing
|
|
33
|
+
|
|
34
|
+
- `test-writer.md` - Generate comprehensive test suites
|
|
35
|
+
- `test-runner.md` - Validate agent behaviors and test variations
|
|
36
|
+
|
|
37
|
+
### Infrastructure & Operations
|
|
38
|
+
|
|
39
|
+
- `infrastructure-agent.md` - Infrastructure automation and scaling
|
|
40
|
+
- `cicd-agent.md` - CI/CD pipeline specialist
|
|
41
|
+
- `deployment-engineer.md` - Configure deployments and CI/CD
|
|
42
|
+
|
|
43
|
+
### Context & Documentation
|
|
44
|
+
|
|
45
|
+
- `context-manager.md` - Manage context across agents
|
|
46
|
+
- `context-loader.md` - Deep codebase understanding
|
|
47
|
+
- `claude-docs-initializer.md` - Discover and create CLAUDE.md files
|
|
48
|
+
- `claude-docs-manager.md` - Update CLAUDE.md based on changes
|
|
49
|
+
- `claude-docs-fact-checker.md` - Verify CLAUDE.md accuracy
|
|
50
|
+
|
|
51
|
+
### Git & Version Control
|
|
52
|
+
|
|
53
|
+
- `pr-creator.md` - Create PRs with auto-generated messages
|
|
54
|
+
- `commit-message-generator.md` - Generate structured commit messages
|
|
55
|
+
- `stack-splitter.md` - Split Graphite PR stacks
|
|
56
|
+
|
|
57
|
+
### Meta & Orchestration
|
|
58
|
+
|
|
59
|
+
- `agent-orchestrator.md` - Coordinate multi-agent workflows
|
|
60
|
+
- `agent-capability-analyst.md` - Analyze agent capabilities
|
|
61
|
+
- `agent-optimizer.md` - Optimize agent performance
|
|
62
|
+
- `prompt-engineer.md` - Analyze and optimize prompts
|
|
63
|
+
- `feedback-collector.md` - Gather and analyze execution feedback
|
|
64
|
+
- `claude-agent-discovery.md` - Discover and catalog agents
|
|
65
|
+
|
|
66
|
+
## Agent Structure
|
|
67
|
+
|
|
68
|
+
Each agent file follows a consistent markdown format:
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
# Agent Name
|
|
72
|
+
|
|
73
|
+
## Capabilities
|
|
74
|
+
|
|
75
|
+
What this agent can do
|
|
76
|
+
|
|
77
|
+
## Specialization
|
|
78
|
+
|
|
79
|
+
Specific domain expertise
|
|
80
|
+
|
|
81
|
+
## When to Invoke
|
|
82
|
+
|
|
83
|
+
Conditions that warrant using this agent
|
|
84
|
+
|
|
85
|
+
## Tools Available
|
|
86
|
+
|
|
87
|
+
Tools this agent has access to
|
|
88
|
+
|
|
89
|
+
## Output Format
|
|
90
|
+
|
|
91
|
+
Expected output structure
|
|
92
|
+
|
|
93
|
+
## Integration
|
|
94
|
+
|
|
95
|
+
How it works with other agents
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Agent Categories
|
|
99
|
+
|
|
100
|
+
### Proactive Agents
|
|
101
|
+
|
|
102
|
+
Automatically invoked when their conditions are met:
|
|
103
|
+
|
|
104
|
+
- `style-enforcer.md` - Auto-runs after code changes
|
|
105
|
+
- `claude-docs-manager.md` - Auto-updates documentation
|
|
106
|
+
- `security-analyzer.md` - Auto-scans for vulnerabilities
|
|
107
|
+
|
|
108
|
+
### On-Demand Agents
|
|
109
|
+
|
|
110
|
+
Explicitly invoked by commands or users:
|
|
111
|
+
|
|
112
|
+
- `planner.md` - Called by `/plan` command
|
|
113
|
+
- `researcher.md` - Called by `/research` command
|
|
114
|
+
- `pr-reviewer.md` - Called by `/review-pr` command
|
|
115
|
+
|
|
116
|
+
### Orchestration Agents
|
|
117
|
+
|
|
118
|
+
Coordinate other agents:
|
|
119
|
+
|
|
120
|
+
- `agent-orchestrator.md` - Routes tasks to specialists
|
|
121
|
+
- `context-manager.md` - Manages shared context
|
|
122
|
+
- `agent-optimizer.md` - Improves agent performance
|
|
123
|
+
|
|
124
|
+
## Multi-Agent Workflows
|
|
125
|
+
|
|
126
|
+
### Review Workflow
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
pr-reviewer → security-analyzer → performance-analyzer → doc-writer
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Refactoring Workflow
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
code-explainer → pattern-learner → refactorer → test-writer
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Planning Workflow
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
researcher → planner → plan-reviewer → context-manager
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Documentation Workflow
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
claude-docs-initializer → claude-docs-manager → claude-docs-fact-checker
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Development
|
|
151
|
+
|
|
152
|
+
### Adding New Agents
|
|
153
|
+
|
|
154
|
+
1. Create `new-agent.md` in this directory
|
|
155
|
+
2. Follow the standard format (see existing files)
|
|
156
|
+
3. Add to `index.ts` exports
|
|
157
|
+
4. Update this CLAUDE.md file
|
|
158
|
+
5. Test agent behavior in Claude Code
|
|
159
|
+
|
|
160
|
+
### Modifying Existing Agents
|
|
161
|
+
|
|
162
|
+
1. Edit the markdown file
|
|
163
|
+
2. Test changes in multi-agent scenarios
|
|
164
|
+
3. Update integration documentation
|
|
165
|
+
4. Update this CLAUDE.md if capabilities change
|
|
166
|
+
|
|
167
|
+
## Usage in Claude Code
|
|
168
|
+
|
|
169
|
+
Agents are automatically discovered and loaded:
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
import * as agents from '@ai-toolkit/agents-agnostic';
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Direct Invocation
|
|
176
|
+
|
|
177
|
+
Via Task tool with subagent_type:
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
Task(
|
|
181
|
+
subagent_type="planner",
|
|
182
|
+
prompt="Create plan for authentication feature"
|
|
183
|
+
)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Via Commands
|
|
187
|
+
|
|
188
|
+
Commands invoke agents automatically:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
/review-code # Invokes multiple review agents
|
|
192
|
+
/plan # Invokes planner agent
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Agent Chaining
|
|
196
|
+
|
|
197
|
+
Agents can spawn other agents:
|
|
198
|
+
|
|
199
|
+
```markdown
|
|
200
|
+
After analyzing, I'll invoke the refactorer agent...
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Agent Selection
|
|
204
|
+
|
|
205
|
+
### Automatic Selection
|
|
206
|
+
|
|
207
|
+
`agent-orchestrator` analyzes tasks and selects appropriate agents based on:
|
|
208
|
+
|
|
209
|
+
- Task requirements
|
|
210
|
+
- Agent capabilities
|
|
211
|
+
- Current context
|
|
212
|
+
- Performance history
|
|
213
|
+
|
|
214
|
+
### Manual Selection
|
|
215
|
+
|
|
216
|
+
Users/commands specify agents explicitly:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
/review-code --agent=security-analyzer
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Best Practices
|
|
223
|
+
|
|
224
|
+
### Agent Design
|
|
225
|
+
|
|
226
|
+
- **Clear specialization**: Each agent has distinct expertise
|
|
227
|
+
- **Tool access**: Request only necessary tools
|
|
228
|
+
- **Output format**: Standardized, parseable outputs
|
|
229
|
+
- **Error handling**: Graceful degradation
|
|
230
|
+
- **Context awareness**: Use shared context efficiently
|
|
231
|
+
|
|
232
|
+
### Multi-Agent Coordination
|
|
233
|
+
|
|
234
|
+
- **Sequential**: When agents need each other's outputs
|
|
235
|
+
- **Parallel**: When agents work independently
|
|
236
|
+
- **Hierarchical**: Orchestrator → specialists
|
|
237
|
+
- **Consensus**: Multiple agents vote on decisions
|
|
238
|
+
|
|
239
|
+
### Performance
|
|
240
|
+
|
|
241
|
+
- **Caching**: Reuse analysis across agents
|
|
242
|
+
- **Batching**: Group similar operations
|
|
243
|
+
- **Early exit**: Skip unnecessary agents
|
|
244
|
+
- **Timeouts**: Prevent hanging workflows
|
|
245
|
+
|
|
246
|
+
## Agent Communication
|
|
247
|
+
|
|
248
|
+
### Shared Context
|
|
249
|
+
|
|
250
|
+
Agents share data via `context-manager`:
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
context.set('analysis', analysisResult);
|
|
254
|
+
const prev = context.get('analysis');
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Agent Messages
|
|
258
|
+
|
|
259
|
+
Agents can send structured messages:
|
|
260
|
+
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"from": "security-analyzer",
|
|
264
|
+
"to": "pr-reviewer",
|
|
265
|
+
"type": "finding",
|
|
266
|
+
"data": { "severity": "high", "issue": "..." }
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Related Packages
|
|
271
|
+
|
|
272
|
+
- `@ai-toolkit/commands-agnostic` - Commands that invoke agents
|
|
273
|
+
- `@uniswap/ai-toolkit-nx-claude` - Nx integration and CLI
|
|
274
|
+
- `@ai-toolkit/utils` - Shared utilities for agents
|
|
275
|
+
|
|
276
|
+
## Orchestration Files
|
|
277
|
+
|
|
278
|
+
- `index.ts` - TypeScript exports for agent registration
|
|
279
|
+
|
|
280
|
+
## Auto-Update Instructions
|
|
281
|
+
|
|
282
|
+
IMPORTANT: After changes to files in this directory, Claude Code MUST run `/update-claude-md` before presenting results to ensure this documentation stays synchronized with the codebase.
|