claude-autopm 1.16.0 ā 1.18.0
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.
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Agent Usage - MANDATORY
|
|
2
|
+
|
|
3
|
+
**šØ CRITICAL: This rule has HIGHEST PRIORITY and MUST be followed for ALL tasks.**
|
|
4
|
+
|
|
5
|
+
## Core Requirement
|
|
6
|
+
|
|
7
|
+
**YOU MUST USE SPECIALIZED AGENTS FOR ALL NON-TRIVIAL TASKS.**
|
|
8
|
+
|
|
9
|
+
Do NOT perform complex tasks yourself. Use the Task tool to delegate to appropriate agents.
|
|
10
|
+
|
|
11
|
+
## When to Use Agents
|
|
12
|
+
|
|
13
|
+
### ā
ALWAYS Use Agents For:
|
|
14
|
+
|
|
15
|
+
1. **Writing Code** (any language)
|
|
16
|
+
- Use: `python-backend-engineer`, `react-frontend-engineer`, `nodejs-backend-engineer`
|
|
17
|
+
- Example: "I need to create an API endpoint" ā Use python-backend-engineer
|
|
18
|
+
|
|
19
|
+
2. **Testing**
|
|
20
|
+
- Use: `test-runner`, `frontend-testing-engineer`, `e2e-test-engineer`
|
|
21
|
+
- Example: "Run the test suite" ā Use test-runner
|
|
22
|
+
|
|
23
|
+
3. **Infrastructure/DevOps**
|
|
24
|
+
- Use: `kubernetes-orchestrator`, `docker-containerization-expert`, `terraform-infrastructure-expert`
|
|
25
|
+
- Example: "Deploy to Kubernetes" ā Use kubernetes-orchestrator
|
|
26
|
+
|
|
27
|
+
4. **Database Work**
|
|
28
|
+
- Use: `postgresql-expert`, `mongodb-expert`, `bigquery-expert`
|
|
29
|
+
- Example: "Design database schema" ā Use postgresql-expert
|
|
30
|
+
|
|
31
|
+
5. **Code Analysis**
|
|
32
|
+
- Use: `code-analyzer`
|
|
33
|
+
- Example: "Review this code for bugs" ā Use code-analyzer
|
|
34
|
+
|
|
35
|
+
6. **GitHub/Azure DevOps Operations**
|
|
36
|
+
- Use: `github-operations-specialist`, `azure-devops-specialist`
|
|
37
|
+
- Example: "Create a PR" ā Use github-operations-specialist
|
|
38
|
+
|
|
39
|
+
7. **Large File Analysis**
|
|
40
|
+
- Use: `file-analyzer`
|
|
41
|
+
- Example: "Summarize this 10k line log file" ā Use file-analyzer
|
|
42
|
+
|
|
43
|
+
### āŖ Can Do Yourself:
|
|
44
|
+
|
|
45
|
+
1. **Simple file reads** (1-2 files, quick lookup)
|
|
46
|
+
2. **Simple bash commands** (ls, pwd, basic git commands)
|
|
47
|
+
3. **Answering questions** about existing code/documentation
|
|
48
|
+
4. **Creating todo lists** with TodoWrite
|
|
49
|
+
|
|
50
|
+
## Agent Selection Guide
|
|
51
|
+
|
|
52
|
+
### By Task Type
|
|
53
|
+
|
|
54
|
+
| Task | Agent | Example |
|
|
55
|
+
|------|-------|---------|
|
|
56
|
+
| Python API development | `python-backend-engineer` | Build FastAPI endpoint |
|
|
57
|
+
| React component | `react-frontend-engineer` | Create dashboard UI |
|
|
58
|
+
| Database schema | `postgresql-expert` | Design user tables |
|
|
59
|
+
| Kubernetes deployment | `kubernetes-orchestrator` | Deploy to K8s cluster |
|
|
60
|
+
| Docker container | `docker-containerization-expert` | Create Dockerfile |
|
|
61
|
+
| GitHub workflow | `github-operations-specialist` | Setup CI/CD |
|
|
62
|
+
| Code review | `code-analyzer` | Find bugs in PR |
|
|
63
|
+
| Test execution | `test-runner` | Run test suite |
|
|
64
|
+
| Log analysis | `file-analyzer` | Parse 50MB log file |
|
|
65
|
+
|
|
66
|
+
### By Technology
|
|
67
|
+
|
|
68
|
+
| Technology | Primary Agent | Secondary Agent |
|
|
69
|
+
|------------|---------------|-----------------|
|
|
70
|
+
| Python/FastAPI | `python-backend-engineer` | `postgresql-expert` for DB |
|
|
71
|
+
| React/Next.js | `react-frontend-engineer` | `tailwindcss-expert` for styles |
|
|
72
|
+
| Node.js/Express | `nodejs-backend-engineer` | `mongodb-expert` for DB |
|
|
73
|
+
| TypeScript | `javascript-frontend-engineer` | Language-specific |
|
|
74
|
+
| Kubernetes | `kubernetes-orchestrator` | `docker-containerization-expert` |
|
|
75
|
+
| Terraform | `terraform-infrastructure-expert` | Cloud-specific architects |
|
|
76
|
+
| Testing | `test-runner` | `frontend-testing-engineer` |
|
|
77
|
+
|
|
78
|
+
## Violation Examples
|
|
79
|
+
|
|
80
|
+
### ā WRONG - Doing It Yourself:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
User: "Create a FastAPI endpoint for user registration"
|
|
84
|
+
You: *writes Python code directly*
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### ā
CORRECT - Using Agent:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
User: "Create a FastAPI endpoint for user registration"
|
|
91
|
+
You: "I'll use the python-backend-engineer agent to create this endpoint"
|
|
92
|
+
*Uses Task tool with python-backend-engineer*
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### ā WRONG - Not Using Agent for Analysis:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
User: "Review this 5000 line file for security issues"
|
|
99
|
+
You: *reads file and tries to analyze*
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### ā
CORRECT - Using Agent:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
User: "Review this 5000 line file for security issues"
|
|
106
|
+
You: "I'll use the code-analyzer agent to review this file"
|
|
107
|
+
*Uses Task tool with code-analyzer*
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## How to Use Agents
|
|
111
|
+
|
|
112
|
+
### Single Task:
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
I'll use the [agent-name] agent to [task description].
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Then invoke Task tool:
|
|
119
|
+
- `subagent_type`: Agent name (e.g., "python-backend-engineer")
|
|
120
|
+
- `description`: Short task description
|
|
121
|
+
- `prompt`: Detailed task requirements
|
|
122
|
+
|
|
123
|
+
### Multiple Parallel Tasks:
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
I'll launch multiple agents in parallel:
|
|
127
|
+
1. python-backend-engineer - Create API endpoints
|
|
128
|
+
2. react-frontend-engineer - Build dashboard UI
|
|
129
|
+
3. postgresql-expert - Design database schema
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Then invoke multiple Task tools IN SINGLE MESSAGE.
|
|
133
|
+
|
|
134
|
+
## Active Team Agents
|
|
135
|
+
|
|
136
|
+
**Check the "Active Team Agents" section at the top of CLAUDE.md** for the current list of available agents in this project.
|
|
137
|
+
|
|
138
|
+
If you need an agent that's not listed, you can still use any agent from the registry. The active team list is just a convenience reference.
|
|
139
|
+
|
|
140
|
+
## Common Mistakes to Avoid
|
|
141
|
+
|
|
142
|
+
1. ā **Not reading Active Team Agents section** - Always check what agents are available
|
|
143
|
+
2. ā **Writing code yourself for non-trivial tasks** - Use appropriate agent
|
|
144
|
+
3. ā **Not using parallel agents** - Launch multiple agents when tasks are independent
|
|
145
|
+
4. ā **Using wrong agent for task** - Match agent specialty to task type
|
|
146
|
+
5. ā **Forgetting file-analyzer for large files** - Use it for files >1000 lines or logs
|
|
147
|
+
|
|
148
|
+
## Enforcement
|
|
149
|
+
|
|
150
|
+
This rule is enforced through:
|
|
151
|
+
|
|
152
|
+
1. **Git Hooks** - Pre-commit checks for agent usage patterns
|
|
153
|
+
2. **Code Review** - Human reviewers check for proper agent delegation
|
|
154
|
+
3. **Self-Monitoring** - You must self-enforce and explain why you're using/not using agents
|
|
155
|
+
|
|
156
|
+
## Questions?
|
|
157
|
+
|
|
158
|
+
If you're unsure whether to use an agent:
|
|
159
|
+
- **Default: YES, use an agent**
|
|
160
|
+
- When in doubt, delegate to specialist
|
|
161
|
+
- Better to over-use agents than under-use them
|
|
162
|
+
|
|
163
|
+
## Summary
|
|
164
|
+
|
|
165
|
+
**Before doing ANY complex task, ask yourself:**
|
|
166
|
+
1. Is there a specialized agent for this?
|
|
167
|
+
2. Would an agent do this better/faster/more thoroughly?
|
|
168
|
+
3. Am I trying to do something I should delegate?
|
|
169
|
+
|
|
170
|
+
**If answer is YES to any ā USE THE AGENT!**
|
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
> Think carefully and implement the most concise solution that changes as little code as possible.
|
|
4
4
|
|
|
5
|
+
## šØ AGENT USAGE - MANDATORY
|
|
6
|
+
|
|
7
|
+
**CRITICAL: You MUST use specialized agents for ALL non-trivial tasks.**
|
|
8
|
+
|
|
9
|
+
See: `.claude/rules/agent-mandatory.md` for complete enforcement rules.
|
|
10
|
+
|
|
11
|
+
### Quick Reference - When to Use Agents:
|
|
12
|
+
|
|
13
|
+
| Task Type | Agent | Example |
|
|
14
|
+
|-----------|-------|---------|
|
|
15
|
+
| Python code | `python-backend-engineer` | Build FastAPI endpoint |
|
|
16
|
+
| React/UI | `react-frontend-engineer` | Create dashboard component |
|
|
17
|
+
| Testing | `test-runner` | Run test suite |
|
|
18
|
+
| Database | `postgresql-expert`, `mongodb-expert` | Design schema |
|
|
19
|
+
| DevOps | `kubernetes-orchestrator`, `docker-containerization-expert` | Deploy app |
|
|
20
|
+
| Code review | `code-analyzer` | Find bugs/security issues |
|
|
21
|
+
| Large files | `file-analyzer` | Parse logs >1000 lines |
|
|
22
|
+
|
|
23
|
+
**Before doing ANY complex task**: Check if there's a specialized agent. If YES ā USE IT!
|
|
24
|
+
|
|
5
25
|
## Active Team Agents
|
|
6
26
|
|
|
7
27
|
<!-- AGENTS_START -->
|
|
@@ -13,10 +33,14 @@
|
|
|
13
33
|
|
|
14
34
|
All rule files in `.claude/rules/` define mandatory behaviors and must be followed:
|
|
15
35
|
|
|
16
|
-
###
|
|
36
|
+
### šØ HIGHEST PRIORITY Rules
|
|
17
37
|
|
|
18
|
-
- **
|
|
38
|
+
- **agent-mandatory.md** - MANDATORY agent usage for all non-trivial tasks. READ THIS FIRST!
|
|
39
|
+
- **tdd.enforcement.md** - Test-Driven Development cycle (RED-GREEN-REFACTOR)
|
|
19
40
|
- **pipeline-mandatory.md** - Required pipelines for errors, features, bugs, code search, and log analysis
|
|
41
|
+
|
|
42
|
+
### Core Development Rules
|
|
43
|
+
|
|
20
44
|
- **naming-conventions.md** - Naming standards, code quality requirements, and prohibited patterns
|
|
21
45
|
- **context-optimization.md** - Agent usage patterns for context preservation (<20% data return)
|
|
22
46
|
- **development-workflow.md** - Development patterns, search-before-create, and best practices
|
package/bin/commands/team.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const MCPHandler = require('../../scripts/mcp-handler.js');
|
|
5
6
|
|
|
6
7
|
// Paths
|
|
7
8
|
const projectRoot = process.cwd();
|
|
@@ -68,6 +69,69 @@ function validateAgentFiles(agents, projectRoot) {
|
|
|
68
69
|
return missingAgents;
|
|
69
70
|
}
|
|
70
71
|
|
|
72
|
+
// Helper function to validate MCP dependencies for agents
|
|
73
|
+
function validateAgentMCPDependencies(agents, projectRoot) {
|
|
74
|
+
const warnings = [];
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
const mcpHandler = new MCPHandler();
|
|
78
|
+
const config = mcpHandler.loadConfig();
|
|
79
|
+
const activeServers = config.mcp?.activeServers || [];
|
|
80
|
+
|
|
81
|
+
// Track all required MCP servers across all agents
|
|
82
|
+
const requiredServers = new Map(); // server -> [agents that need it]
|
|
83
|
+
|
|
84
|
+
agents.forEach(agentPath => {
|
|
85
|
+
// Extract agent name from path
|
|
86
|
+
// Handle both "core/test-runner.md" and "test-runner.md" formats
|
|
87
|
+
let agentName = agentPath;
|
|
88
|
+
if (agentName.endsWith('.md')) {
|
|
89
|
+
agentName = agentName.slice(0, -3); // Remove .md extension
|
|
90
|
+
}
|
|
91
|
+
// Get just the filename without directory
|
|
92
|
+
agentName = path.basename(agentName);
|
|
93
|
+
|
|
94
|
+
// Get MCP dependencies for this agent
|
|
95
|
+
const agentMCP = mcpHandler.getAgentMCP(agentName);
|
|
96
|
+
|
|
97
|
+
if (agentMCP.found && agentMCP.mcpServers.length > 0) {
|
|
98
|
+
agentMCP.mcpServers.forEach(serverName => {
|
|
99
|
+
if (!requiredServers.has(serverName)) {
|
|
100
|
+
requiredServers.set(serverName, []);
|
|
101
|
+
}
|
|
102
|
+
requiredServers.get(serverName).push(agentName);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Check which required servers are missing or inactive
|
|
108
|
+
requiredServers.forEach((agentNames, serverName) => {
|
|
109
|
+
const isActive = activeServers.includes(serverName);
|
|
110
|
+
const serverExists = mcpHandler.getServer(serverName);
|
|
111
|
+
|
|
112
|
+
if (!serverExists) {
|
|
113
|
+
warnings.push({
|
|
114
|
+
type: 'not_installed',
|
|
115
|
+
server: serverName,
|
|
116
|
+
agents: agentNames
|
|
117
|
+
});
|
|
118
|
+
} else if (!isActive) {
|
|
119
|
+
warnings.push({
|
|
120
|
+
type: 'not_active',
|
|
121
|
+
server: serverName,
|
|
122
|
+
agents: agentNames
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
} catch (error) {
|
|
128
|
+
// If MCP validation fails, just warn but don't block
|
|
129
|
+
console.warn('ā ļø Warning: Could not validate MCP dependencies');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return warnings;
|
|
133
|
+
}
|
|
134
|
+
|
|
71
135
|
// Helper function to generate agent include list in Markdown format
|
|
72
136
|
function generateAgentIncludes(agents) {
|
|
73
137
|
return agents
|
|
@@ -216,6 +280,28 @@ const commands = {
|
|
|
216
280
|
});
|
|
217
281
|
}
|
|
218
282
|
|
|
283
|
+
// Validate MCP dependencies
|
|
284
|
+
const mcpWarnings = validateAgentMCPDependencies(agents, projectRoot);
|
|
285
|
+
if (mcpWarnings.length > 0) {
|
|
286
|
+
console.warn('\nā ļø MCP Dependency Warnings:\n');
|
|
287
|
+
|
|
288
|
+
mcpWarnings.forEach(warning => {
|
|
289
|
+
if (warning.type === 'not_installed') {
|
|
290
|
+
console.warn(`ā MCP server '${warning.server}' is NOT INSTALLED`);
|
|
291
|
+
console.warn(` Required by: ${warning.agents.join(', ')}`);
|
|
292
|
+
console.warn(` Fix: autopm mcp install ${warning.server}`);
|
|
293
|
+
} else if (warning.type === 'not_active') {
|
|
294
|
+
console.warn(`āŖ MCP server '${warning.server}' is NOT ACTIVE`);
|
|
295
|
+
console.warn(` Required by: ${warning.agents.join(', ')}`);
|
|
296
|
+
console.warn(` Fix: autopm mcp enable ${warning.server}`);
|
|
297
|
+
}
|
|
298
|
+
console.warn('');
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
console.warn('š” Tip: Run "autopm mcp list" to see all MCP servers');
|
|
302
|
+
console.warn('š” Tip: Run "autopm mcp setup" for interactive configuration\n');
|
|
303
|
+
}
|
|
304
|
+
|
|
219
305
|
// Update CLAUDE.md with the new agent list
|
|
220
306
|
updateClaudeMd(agents);
|
|
221
307
|
console.log('ā Updated CLAUDE.md with team agents');
|
package/install/install.js
CHANGED