@itz4blitz/agentful 1.2.0 → 1.3.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.
- package/README.md +28 -1
- package/bin/cli.js +11 -1055
- package/bin/hooks/block-file-creation.js +271 -0
- package/bin/hooks/product-spec-watcher.js +151 -0
- package/lib/index.js +0 -11
- package/lib/init.js +2 -21
- package/lib/parallel-execution.js +235 -0
- package/lib/presets.js +26 -4
- package/package.json +4 -7
- package/template/.claude/agents/architect.md +2 -2
- package/template/.claude/agents/backend.md +17 -30
- package/template/.claude/agents/frontend.md +17 -39
- package/template/.claude/agents/orchestrator.md +63 -4
- package/template/.claude/agents/product-analyzer.md +1 -1
- package/template/.claude/agents/tester.md +16 -29
- package/template/.claude/commands/agentful-generate.md +221 -14
- package/template/.claude/commands/agentful-init.md +621 -0
- package/template/.claude/commands/agentful-product.md +1 -1
- package/template/.claude/commands/agentful-start.md +99 -1
- package/template/.claude/product/EXAMPLES.md +2 -2
- package/template/.claude/product/index.md +1 -1
- package/template/.claude/settings.json +22 -0
- package/template/.claude/skills/research/SKILL.md +432 -0
- package/template/CLAUDE.md +5 -6
- package/template/bin/hooks/architect-drift-detector.js +242 -0
- package/template/bin/hooks/product-spec-watcher.js +151 -0
- package/version.json +1 -1
- package/bin/hooks/post-agent.js +0 -101
- package/bin/hooks/post-feature.js +0 -227
- package/bin/hooks/pre-agent.js +0 -118
- package/bin/hooks/pre-feature.js +0 -138
- package/lib/VALIDATION_README.md +0 -455
- package/lib/ci/claude-action-integration.js +0 -641
- package/lib/ci/index.js +0 -10
- package/lib/core/analyzer.js +0 -497
- package/lib/core/cli.js +0 -141
- package/lib/core/detectors/conventions.js +0 -342
- package/lib/core/detectors/framework.js +0 -276
- package/lib/core/detectors/index.js +0 -15
- package/lib/core/detectors/language.js +0 -199
- package/lib/core/detectors/patterns.js +0 -356
- package/lib/core/generator.js +0 -626
- package/lib/core/index.js +0 -9
- package/lib/core/output-parser.js +0 -458
- package/lib/core/storage.js +0 -515
- package/lib/core/templates.js +0 -556
- package/lib/pipeline/cli.js +0 -423
- package/lib/pipeline/engine.js +0 -928
- package/lib/pipeline/executor.js +0 -440
- package/lib/pipeline/index.js +0 -33
- package/lib/pipeline/integrations.js +0 -559
- package/lib/pipeline/schemas.js +0 -288
- package/lib/remote/client.js +0 -361
- package/lib/server/auth.js +0 -270
- package/lib/server/client-example.js +0 -190
- package/lib/server/executor.js +0 -477
- package/lib/server/index.js +0 -494
- package/lib/update-helpers.js +0 -505
- package/lib/validation.js +0 -460
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parallel Execution Module for agentful
|
|
5
|
+
*
|
|
6
|
+
* Enables parallel agent delegation using Claude Code's TeammateTool when available.
|
|
7
|
+
* Falls back to sequential execution when TeammateTool is not enabled.
|
|
8
|
+
*
|
|
9
|
+
* Phase 1: Detect and optionally enable TeammateTool via swarm mode patch
|
|
10
|
+
* Phase 2: Graceful cutover when Claude Code SDK adds native support
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import fs from 'fs';
|
|
14
|
+
import path from 'path';
|
|
15
|
+
import { execSync } from 'child_process';
|
|
16
|
+
import { fileURLToPath } from 'url';
|
|
17
|
+
|
|
18
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
19
|
+
const __dirname = path.dirname(__filename);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Detect if TeammateTool is available in current Claude Code installation
|
|
23
|
+
* Auto-enables if possible
|
|
24
|
+
*/
|
|
25
|
+
export function detectTeammateTool() {
|
|
26
|
+
try {
|
|
27
|
+
// Find Claude Code installation
|
|
28
|
+
const claudePath = findClaudeCodeBinary();
|
|
29
|
+
if (!claudePath) {
|
|
30
|
+
return { available: false, reason: 'Claude Code binary not found' };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Read CLI content
|
|
34
|
+
const cliContent = fs.readFileSync(claudePath, 'utf8');
|
|
35
|
+
|
|
36
|
+
// Check for TeammateTool presence
|
|
37
|
+
const hasTeammateTool = /TeammateTool|teammate_mailbox|launchSwarm/.test(cliContent);
|
|
38
|
+
|
|
39
|
+
if (!hasTeammateTool) {
|
|
40
|
+
return { available: false, reason: 'TeammateTool code not present (Claude Code version too old)' };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Check if swarm gate is enabled
|
|
44
|
+
const gateState = detectSwarmGateState(cliContent);
|
|
45
|
+
|
|
46
|
+
if (gateState === 'enabled') {
|
|
47
|
+
return { available: true, method: 'native' };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (gateState === 'disabled') {
|
|
51
|
+
// AUTO-ENABLE: Patch on first detection
|
|
52
|
+
const enableResult = enableTeammateTool();
|
|
53
|
+
if (enableResult.success) {
|
|
54
|
+
return { available: true, method: 'native', autoEnabled: true };
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
available: false,
|
|
58
|
+
reason: 'TeammateTool present but failed to auto-enable',
|
|
59
|
+
canEnable: true
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return { available: false, reason: 'Unknown gate state' };
|
|
64
|
+
} catch (error) {
|
|
65
|
+
return { available: false, reason: `Detection error: ${error.message}` };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Find Claude Code binary path
|
|
71
|
+
*/
|
|
72
|
+
function findClaudeCodeBinary() {
|
|
73
|
+
try {
|
|
74
|
+
// Try standard npm global install location
|
|
75
|
+
const npmRoot = execSync('npm root -g', { encoding: 'utf8' }).trim();
|
|
76
|
+
const cliPath = path.join(npmRoot, '@anthropic-ai', 'claude-code', 'cli.js');
|
|
77
|
+
|
|
78
|
+
if (fs.existsSync(cliPath)) {
|
|
79
|
+
return cliPath;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Try which/where command
|
|
83
|
+
const whichCmd = process.platform === 'win32' ? 'where' : 'which';
|
|
84
|
+
const claudeBin = execSync(`${whichCmd} claude`, { encoding: 'utf8' }).trim().split('\n')[0];
|
|
85
|
+
|
|
86
|
+
if (claudeBin && fs.existsSync(claudeBin)) {
|
|
87
|
+
// Resolve symlinks
|
|
88
|
+
const realPath = fs.realpathSync(claudeBin);
|
|
89
|
+
return realPath;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return null;
|
|
93
|
+
} catch (error) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Detect swarm gate state in CLI content
|
|
100
|
+
*/
|
|
101
|
+
function detectSwarmGateState(content) {
|
|
102
|
+
// Pattern: function XX(){if(Yz(process.env.CLAUDE_CODE_AGENT_SWARMS))return!1;return xK("tengu_brass_pebble",!1)}
|
|
103
|
+
const SWARM_GATE_MARKER = /tengu_brass_pebble/;
|
|
104
|
+
const SWARM_GATE_FN_RE = /function\s+([a-zA-Z_$][\w$]*)\(\)\{if\([\w$]+\(process\.env\.CLAUDE_CODE_AGENT_SWARMS\)\)return!1;return\s*[\w$]+\("tengu_brass_pebble",!1\)\}/;
|
|
105
|
+
|
|
106
|
+
// Check if gate function exists (disabled state)
|
|
107
|
+
if (SWARM_GATE_FN_RE.test(content)) {
|
|
108
|
+
return 'disabled';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Check if swarm code exists but marker is gone (likely patched)
|
|
112
|
+
if (!SWARM_GATE_MARKER.test(content)) {
|
|
113
|
+
const hasSwarmCode = /TeammateTool|teammate_mailbox|launchSwarm/.test(content);
|
|
114
|
+
if (hasSwarmCode) {
|
|
115
|
+
return 'enabled';
|
|
116
|
+
}
|
|
117
|
+
return 'unknown';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return 'unknown';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Enable TeammateTool by patching Claude Code CLI
|
|
125
|
+
*/
|
|
126
|
+
export function enableTeammateTool() {
|
|
127
|
+
try {
|
|
128
|
+
const claudePath = findClaudeCodeBinary();
|
|
129
|
+
if (!claudePath) {
|
|
130
|
+
throw new Error('Claude Code binary not found');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Backup original
|
|
134
|
+
const backupPath = `${claudePath}.backup-${Date.now()}`;
|
|
135
|
+
fs.copyFileSync(claudePath, backupPath);
|
|
136
|
+
|
|
137
|
+
// Read and patch
|
|
138
|
+
let content = fs.readFileSync(claudePath, 'utf8');
|
|
139
|
+
const patchResult = patchSwarmGate(content);
|
|
140
|
+
|
|
141
|
+
if (!patchResult.changed) {
|
|
142
|
+
fs.unlinkSync(backupPath); // Remove backup if no changes
|
|
143
|
+
return { success: true, message: 'Already enabled', alreadyEnabled: true };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Write patched version
|
|
147
|
+
fs.writeFileSync(claudePath, patchResult.content, 'utf8');
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
success: true,
|
|
151
|
+
message: 'TeammateTool enabled successfully',
|
|
152
|
+
backupPath,
|
|
153
|
+
alreadyEnabled: false
|
|
154
|
+
};
|
|
155
|
+
} catch (error) {
|
|
156
|
+
return { success: false, error: error.message };
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Patch swarm gate function to always return true
|
|
162
|
+
*/
|
|
163
|
+
function patchSwarmGate(content) {
|
|
164
|
+
const SWARM_GATE_FN_RE = /function\s+([a-zA-Z_$][\w$]*)\(\)\{if\([\w$]+\(process\.env\.CLAUDE_CODE_AGENT_SWARMS\)\)return!1;return\s*[\w$]+\("tengu_brass_pebble",!1\)\}/;
|
|
165
|
+
|
|
166
|
+
const match = content.match(SWARM_GATE_FN_RE);
|
|
167
|
+
if (!match) {
|
|
168
|
+
return { content, changed: false, state: 'unknown' };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const fnName = match[1];
|
|
172
|
+
const fullMatch = match[0];
|
|
173
|
+
|
|
174
|
+
// Replace with simple return true
|
|
175
|
+
const patched = content.replace(fullMatch, `function ${fnName}(){return!0}`);
|
|
176
|
+
|
|
177
|
+
return { content: patched, changed: true, state: 'enabled' };
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Get parallel execution capability information
|
|
182
|
+
*/
|
|
183
|
+
export function getParallelCapabilities() {
|
|
184
|
+
const detection = detectTeammateTool();
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
parallel: detection.available,
|
|
188
|
+
method: detection.available ? detection.method : 'sequential',
|
|
189
|
+
canEnable: detection.canEnable || false,
|
|
190
|
+
reason: detection.reason || 'Available'
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Format task delegation for parallel execution
|
|
196
|
+
*
|
|
197
|
+
* @param {Array} tasks - Array of {agent, description} objects
|
|
198
|
+
* @returns {string} Formatted delegation prompt
|
|
199
|
+
*/
|
|
200
|
+
export function formatDelegation(tasks) {
|
|
201
|
+
const taskList = tasks.map((t, i) => `${i + 1}. ${t.agent}: ${t.description}`).join('\n');
|
|
202
|
+
|
|
203
|
+
return `Launch ${tasks.length} agents in parallel to work on these tasks simultaneously:
|
|
204
|
+
|
|
205
|
+
${taskList}
|
|
206
|
+
|
|
207
|
+
Use the Task tool to spawn all agents in parallel. Each agent should work independently on their assigned task.`;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// CLI interface for manual testing
|
|
211
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
212
|
+
const command = process.argv[2];
|
|
213
|
+
|
|
214
|
+
if (command === 'detect') {
|
|
215
|
+
console.log('Detecting TeammateTool availability...\n');
|
|
216
|
+
const result = detectTeammateTool();
|
|
217
|
+
console.log(JSON.stringify(result, null, 2));
|
|
218
|
+
} else if (command === 'enable') {
|
|
219
|
+
console.log('Enabling TeammateTool...\n');
|
|
220
|
+
const result = enableTeammateTool();
|
|
221
|
+
console.log(JSON.stringify(result, null, 2));
|
|
222
|
+
} else if (command === 'capabilities') {
|
|
223
|
+
const caps = getParallelCapabilities();
|
|
224
|
+
console.log(JSON.stringify(caps, null, 2));
|
|
225
|
+
} else {
|
|
226
|
+
console.log(`
|
|
227
|
+
agentful Parallel Execution Tool
|
|
228
|
+
|
|
229
|
+
Usage:
|
|
230
|
+
node lib/parallel-execution.js detect Check if TeammateTool is available
|
|
231
|
+
node lib/parallel-execution.js enable Enable TeammateTool via patch
|
|
232
|
+
node lib/parallel-execution.js capabilities Show current capabilities
|
|
233
|
+
`);
|
|
234
|
+
}
|
|
235
|
+
}
|
package/lib/presets.js
CHANGED
|
@@ -18,14 +18,14 @@ export const presets = {
|
|
|
18
18
|
default: {
|
|
19
19
|
description: 'Complete agentful installation (recommended)',
|
|
20
20
|
agents: ['orchestrator', 'architect', 'backend', 'frontend', 'tester', 'reviewer', 'fixer', 'product-analyzer'],
|
|
21
|
-
skills: ['product-tracking', 'validation', 'testing', 'conversation', 'product-planning', 'deployment'],
|
|
22
|
-
hooks: ['health-check'],
|
|
21
|
+
skills: ['product-tracking', 'validation', 'testing', 'conversation', 'product-planning', 'deployment', 'research'],
|
|
22
|
+
hooks: ['health-check', 'block-random-docs', 'block-file-creation', 'product-spec-watcher', 'architect-drift-detector'],
|
|
23
23
|
gates: ['types', 'tests', 'coverage', 'lint', 'security', 'dead-code']
|
|
24
24
|
},
|
|
25
25
|
|
|
26
26
|
minimal: {
|
|
27
|
-
description: 'Minimal setup
|
|
28
|
-
agents: ['orchestrator'
|
|
27
|
+
description: 'Minimal setup - orchestrator only, you create custom agents',
|
|
28
|
+
agents: ['orchestrator'],
|
|
29
29
|
skills: ['validation'],
|
|
30
30
|
hooks: [],
|
|
31
31
|
gates: ['types', 'tests']
|
|
@@ -47,6 +47,28 @@ export const hookConfigurations = {
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
|
|
50
|
+
'block-random-docs': {
|
|
51
|
+
event: 'PreToolUse',
|
|
52
|
+
matcher: 'Write',
|
|
53
|
+
config: {
|
|
54
|
+
type: 'command',
|
|
55
|
+
command: 'node bin/hooks/block-random-docs.js',
|
|
56
|
+
blocking: true,
|
|
57
|
+
description: 'Prevent creation of random markdown files'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
'block-file-creation': {
|
|
62
|
+
event: 'PreToolUse',
|
|
63
|
+
matcher: 'Write',
|
|
64
|
+
config: {
|
|
65
|
+
type: 'command',
|
|
66
|
+
command: 'node bin/hooks/block-file-creation.js',
|
|
67
|
+
blocking: true,
|
|
68
|
+
description: 'Prevent creation of arbitrary JSON/TXT/LOG files'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
|
|
50
72
|
'typescript-validation': {
|
|
51
73
|
event: 'PostToolUse',
|
|
52
74
|
matcher: 'Write|Edit',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itz4blitz/agentful",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Pre-configured AI
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Pre-configured AI toolkit with self-hosted execution - works with any LLM, any tech stack, any platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"agentful": "bin/cli.js"
|
|
@@ -70,17 +70,14 @@
|
|
|
70
70
|
"@semantic-release/npm": "^13.1.3",
|
|
71
71
|
"@semantic-release/release-notes-generator": "^14.0.1",
|
|
72
72
|
"@vitest/coverage-v8": "^1.2.0",
|
|
73
|
-
"ajv": "^8.12.0",
|
|
74
|
-
"ajv-formats": "^3.0.1",
|
|
75
73
|
"eslint": "^9.39.2",
|
|
76
|
-
"qrcode.react": "^4.2.0",
|
|
77
74
|
"semantic-release": "^25.0.2",
|
|
78
75
|
"vitest": "^1.2.0",
|
|
79
76
|
"vocs": "^1.4.1"
|
|
80
77
|
},
|
|
81
78
|
"dependencies": {
|
|
82
|
-
"@xyflow/react": "^12.10.0",
|
|
83
79
|
"handlebars": "^4.7.8",
|
|
84
|
-
"js-yaml": "^4.1.0"
|
|
80
|
+
"js-yaml": "^4.1.0",
|
|
81
|
+
"qrcode.react": "^4.2.0"
|
|
85
82
|
}
|
|
86
83
|
}
|
|
@@ -162,7 +162,7 @@ From analyzing this project:
|
|
|
162
162
|
"project_type": "new",
|
|
163
163
|
"analysis_source": "declared",
|
|
164
164
|
"declared_stack": {
|
|
165
|
-
"frontend": "Next.js
|
|
165
|
+
"frontend": "Next.js 15",
|
|
166
166
|
"backend": "Node.js",
|
|
167
167
|
"database": "PostgreSQL"
|
|
168
168
|
},
|
|
@@ -179,7 +179,7 @@ From analyzing this project:
|
|
|
179
179
|
"project_type": "existing",
|
|
180
180
|
"analysis_source": "detected",
|
|
181
181
|
"detected_patterns": {
|
|
182
|
-
"framework": "Next.js
|
|
182
|
+
"framework": "Next.js 15 (App Router)",
|
|
183
183
|
"language": "TypeScript",
|
|
184
184
|
"database": "PostgreSQL via Prisma",
|
|
185
185
|
"component_style": "Functional with hooks",
|
|
@@ -9,36 +9,23 @@ tools: Read, Write, Edit, Glob, Grep, Bash
|
|
|
9
9
|
|
|
10
10
|
You are the **Backend Agent**. You implement server-side code using clean architecture patterns.
|
|
11
11
|
|
|
12
|
-
## Step 1:
|
|
13
|
-
|
|
14
|
-
**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# Detect database
|
|
30
|
-
Read config files for database connection strings
|
|
31
|
-
Check for ORM/query builder in dependencies
|
|
32
|
-
|
|
33
|
-
# Detect patterns
|
|
34
|
-
Read existing backend code to understand:
|
|
35
|
-
- File organization (controllers, services, repositories)
|
|
36
|
-
- Naming conventions (camelCase, snake_case, PascalCase)
|
|
37
|
-
- Error handling patterns
|
|
38
|
-
- Authentication approach
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Reference the testing skill** (`.claude/skills/testing/SKILL.md`) for stack-specific testing patterns.
|
|
12
|
+
## Step 1: Understand Project Context
|
|
13
|
+
|
|
14
|
+
**Check architecture analysis first:**
|
|
15
|
+
- Read `.agentful/architecture.json` for detected stack and patterns
|
|
16
|
+
- If missing or `needs_reanalysis: true`, architect will run automatically
|
|
17
|
+
|
|
18
|
+
**Reference skills for tech-specific guidance:**
|
|
19
|
+
- Look in `.claude/skills/` for framework-specific patterns
|
|
20
|
+
- Skills contain project-specific conventions, not generic framework docs
|
|
21
|
+
|
|
22
|
+
**Sample existing code to understand conventions:**
|
|
23
|
+
- Read 2-3 existing backend files to understand structure
|
|
24
|
+
- Match file organization, naming, error handling patterns
|
|
25
|
+
|
|
26
|
+
**Use your base knowledge:**
|
|
27
|
+
- You already know Next.js, Django, Flask, Spring Boot, Express, etc.
|
|
28
|
+
- Apply framework best practices based on detected stack
|
|
42
29
|
|
|
43
30
|
## Your Scope
|
|
44
31
|
|
|
@@ -9,45 +9,23 @@ tools: Read, Write, Edit, Glob, Grep, Bash
|
|
|
9
9
|
|
|
10
10
|
You are the **Frontend Agent**. You implement user interfaces and client-side code.
|
|
11
11
|
|
|
12
|
-
## Step 1:
|
|
13
|
-
|
|
14
|
-
**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- Styled Components (import styled from)
|
|
30
|
-
- Emotion (@emotion packages)
|
|
31
|
-
- CSS-in-JS (style objects in code)
|
|
32
|
-
- Plain CSS/SCSS
|
|
33
|
-
|
|
34
|
-
# Detect state management
|
|
35
|
-
Check dependencies for:
|
|
36
|
-
- Zustand, Redux, Pinia, MobX, Jotai, Recoil, Context API
|
|
37
|
-
|
|
38
|
-
# Detect form library
|
|
39
|
-
Check for:
|
|
40
|
-
- React Hook Form, Formik, VeeValidate, etc.
|
|
41
|
-
|
|
42
|
-
# Detect patterns
|
|
43
|
-
Read existing components to understand:
|
|
44
|
-
- File organization (components/, pages/, hooks/)
|
|
45
|
-
- Naming conventions (PascalCase, kebab-case)
|
|
46
|
-
- Component structure patterns
|
|
47
|
-
- Props patterns
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Reference the testing skill** (`.claude/skills/testing/SKILL.md`) for stack-specific testing patterns.
|
|
12
|
+
## Step 1: Understand Project Context
|
|
13
|
+
|
|
14
|
+
**Check architecture analysis first:**
|
|
15
|
+
- Read `.agentful/architecture.json` for detected stack and patterns
|
|
16
|
+
- If missing or `needs_reanalysis: true`, architect will run automatically
|
|
17
|
+
|
|
18
|
+
**Reference skills for tech-specific guidance:**
|
|
19
|
+
- Look in `.claude/skills/` for framework-specific patterns
|
|
20
|
+
- Skills contain project-specific conventions (styling, state management, forms)
|
|
21
|
+
|
|
22
|
+
**Sample existing code to understand conventions:**
|
|
23
|
+
- Read 2-3 existing components to understand structure
|
|
24
|
+
- Match file organization, naming, component patterns
|
|
25
|
+
|
|
26
|
+
**Use your base knowledge:**
|
|
27
|
+
- You already know React, Vue, Angular, Svelte, Next.js, etc.
|
|
28
|
+
- Apply framework best practices based on detected stack
|
|
51
29
|
|
|
52
30
|
## Your Scope
|
|
53
31
|
|
|
@@ -133,6 +133,32 @@ else:
|
|
|
133
133
|
capabilities = ["feature_development", "bugfixes", "enhancements"]
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
### Step 2.5: Ensure Architecture Analysis (First Run Only)
|
|
137
|
+
|
|
138
|
+
**Before any development work**, ensure architect has analyzed the project:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Check if architecture.json exists
|
|
142
|
+
if NOT exists(".agentful/architecture.json"):
|
|
143
|
+
# First run - trigger architect
|
|
144
|
+
Task("architect", "Analyze project stack, patterns, and generate skills")
|
|
145
|
+
# Architect creates architecture.json and necessary skills
|
|
146
|
+
# Continue to Step 3 after architect completes
|
|
147
|
+
|
|
148
|
+
# Check if re-analysis needed
|
|
149
|
+
if exists(".agentful/architecture.json"):
|
|
150
|
+
arch = Read(".agentful/architecture.json")
|
|
151
|
+
|
|
152
|
+
if arch.needs_reanalysis == true:
|
|
153
|
+
Task("architect", "Re-analyze project with updated patterns")
|
|
154
|
+
# Continue after architect updates skills
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**This ensures:**
|
|
158
|
+
- Backend/frontend/tester agents have architecture.json to reference
|
|
159
|
+
- Project-specific skills exist in `.claude/skills/`
|
|
160
|
+
- Core agents can use base knowledge + project patterns
|
|
161
|
+
|
|
136
162
|
### Step 3: Route to Workflow
|
|
137
163
|
|
|
138
164
|
| Work Type | Loop? | Key Steps |
|
|
@@ -327,18 +353,51 @@ else:
|
|
|
327
353
|
|
|
328
354
|
## Delegation Pattern
|
|
329
355
|
|
|
330
|
-
**NEVER implement yourself.** Always use Task tool
|
|
356
|
+
**NEVER implement yourself.** Always use Task tool.
|
|
357
|
+
|
|
358
|
+
### Parallel Delegation (Preferred)
|
|
359
|
+
|
|
360
|
+
When tasks are independent (no file conflicts, no dependencies), delegate in parallel for 2-3x speed:
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
# Parallel execution (backend, frontend, tester work simultaneously)
|
|
364
|
+
"Launch these agents in parallel:
|
|
365
|
+
1. backend: Implement JWT login API per .claude/product/domains/authentication/features/login.md
|
|
366
|
+
2. frontend: Create login form UI per .claude/product/domains/authentication/features/login.md
|
|
367
|
+
3. tester: Write test fixtures for login feature
|
|
368
|
+
|
|
369
|
+
Use the Task tool to spawn all agents in parallel."
|
|
370
|
+
|
|
371
|
+
# After parallel work completes, run sequential validation
|
|
372
|
+
Task("reviewer agent", "Review all changes in src/auth/")
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Sequential Delegation (Fallback)
|
|
376
|
+
|
|
377
|
+
When tasks have dependencies or file conflicts, use sequential:
|
|
331
378
|
|
|
332
379
|
```bash
|
|
333
|
-
#
|
|
380
|
+
# Sequential execution (one after another)
|
|
334
381
|
Task("backend agent", "Implement JWT login API per .claude/product/domains/authentication/features/login.md")
|
|
335
382
|
Task("frontend agent", "Create login form UI per .claude/product/domains/authentication/features/login.md")
|
|
336
383
|
Task("tester agent", "Write tests for login feature")
|
|
337
|
-
|
|
338
|
-
# ALWAYS run reviewer after implementation
|
|
339
384
|
Task("reviewer agent", "Review all changes in src/auth/")
|
|
340
385
|
```
|
|
341
386
|
|
|
387
|
+
### When to Use Parallel vs Sequential
|
|
388
|
+
|
|
389
|
+
**Use Parallel:**
|
|
390
|
+
- ✅ Backend + Frontend (different files: src/api/* vs src/components/*)
|
|
391
|
+
- ✅ Multiple test types (unit tests, integration tests, fixtures)
|
|
392
|
+
- ✅ Independent features (auth + dashboard)
|
|
393
|
+
- ✅ Analysis tasks (architect analyzing patterns while backend codes)
|
|
394
|
+
|
|
395
|
+
**Use Sequential:**
|
|
396
|
+
- ❌ Frontend needs API response shape from backend first
|
|
397
|
+
- ❌ Tester needs implementation complete before writing integration tests
|
|
398
|
+
- ❌ Fixer needs reviewer results before fixing issues
|
|
399
|
+
- ❌ Quality gates (must validate sequentially)
|
|
400
|
+
|
|
342
401
|
## Decision Handling
|
|
343
402
|
|
|
344
403
|
When you need user input:
|
|
@@ -659,7 +659,7 @@ For each issue, provide actionable recommendations:
|
|
|
659
659
|
"recommendation": {
|
|
660
660
|
"action": "Specify frontend framework in Tech Stack section",
|
|
661
661
|
"options": [
|
|
662
|
-
"Next.js
|
|
662
|
+
"Next.js 15 (recommended for full-stack TypeScript)",
|
|
663
663
|
"React + Vite (recommended for SPA)",
|
|
664
664
|
"Vue + Nuxt (recommended for Vue developers)",
|
|
665
665
|
"SvelteKit (recommended for performance)",
|
|
@@ -9,36 +9,23 @@ tools: Read, Write, Edit, Glob, Grep, Bash
|
|
|
9
9
|
|
|
10
10
|
You are the **Tester Agent**. You ensure code quality through comprehensive testing.
|
|
11
11
|
|
|
12
|
-
## Step 1:
|
|
13
|
-
|
|
14
|
-
**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Check for: JUnit, TestNG, Mockito
|
|
26
|
-
if exists("Gemfile"):
|
|
27
|
-
Check for: RSpec, Minitest
|
|
28
|
-
|
|
29
|
-
# Detect test runner command
|
|
30
|
-
Look for "test" script in package.json/Makefile/justfile
|
|
31
|
-
Try common patterns: npm test, pytest, go test, mvn test
|
|
32
|
-
|
|
33
|
-
# Detect existing test patterns
|
|
34
|
-
Read existing test files to understand:
|
|
35
|
-
- Test file naming (*.test.js, *_test.py, *Test.java)
|
|
36
|
-
- Test organization (describe/it, def test_, @Test)
|
|
37
|
-
- Assertion library (expect, assert, should)
|
|
38
|
-
- Mocking approach (jest.mock, unittest.mock, testify/mock)
|
|
39
|
-
```
|
|
12
|
+
## Step 1: Understand Testing Context
|
|
13
|
+
|
|
14
|
+
**Check architecture analysis first:**
|
|
15
|
+
- Read `.agentful/architecture.json` for detected testing framework
|
|
16
|
+
- If missing or `needs_reanalysis: true`, architect will run automatically
|
|
17
|
+
|
|
18
|
+
**Reference skills for testing guidance:**
|
|
19
|
+
- Read `.claude/skills/testing/SKILL.md` for comprehensive testing strategies
|
|
20
|
+
- Skills contain project-specific test patterns and conventions
|
|
21
|
+
|
|
22
|
+
**Sample existing tests to understand conventions:**
|
|
23
|
+
- Read 2-3 existing test files to understand structure
|
|
24
|
+
- Match test file naming, organization, assertion patterns
|
|
40
25
|
|
|
41
|
-
**
|
|
26
|
+
**Use your base knowledge:**
|
|
27
|
+
- You already know Jest, Pytest, JUnit, RSpec, Go testing, etc.
|
|
28
|
+
- Apply testing best practices based on detected stack
|
|
42
29
|
|
|
43
30
|
## Your Scope
|
|
44
31
|
|