@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
|
@@ -9,7 +9,105 @@ This command initiates the structured product development loop with human checkp
|
|
|
9
9
|
|
|
10
10
|
## Startup Sequence
|
|
11
11
|
|
|
12
|
-
### 0.
|
|
12
|
+
### 0. First-Run Detection
|
|
13
|
+
|
|
14
|
+
Check if this is the user's first time running agentful:
|
|
15
|
+
|
|
16
|
+
```javascript
|
|
17
|
+
const isFirstRun = !exists('.agentful/state.json') &&
|
|
18
|
+
!exists('.agentful/architecture.json');
|
|
19
|
+
|
|
20
|
+
if (isFirstRun) {
|
|
21
|
+
const hasProductSpec = exists('.claude/product/index.md') &&
|
|
22
|
+
Read('.claude/product/index.md').length > 200;
|
|
23
|
+
|
|
24
|
+
if (!hasProductSpec) {
|
|
25
|
+
// No product spec - guide user to setup
|
|
26
|
+
const response = AskUserQuestion({
|
|
27
|
+
question: `
|
|
28
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
29
|
+
Welcome to agentful!
|
|
30
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
31
|
+
|
|
32
|
+
This is your first time running agentful in this project.
|
|
33
|
+
|
|
34
|
+
To get started, I need to understand what you're building.
|
|
35
|
+
|
|
36
|
+
Would you like to:
|
|
37
|
+
`,
|
|
38
|
+
options: [
|
|
39
|
+
'Use guided setup (/agentful-init) - 5 minutes',
|
|
40
|
+
'Manually edit .claude/product/index.md first',
|
|
41
|
+
'Skip setup and explore agentful commands'
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if (response.includes('guided setup')) {
|
|
46
|
+
console.log(`
|
|
47
|
+
Launching guided setup...
|
|
48
|
+
|
|
49
|
+
This will ask 7 quick questions to understand your product,
|
|
50
|
+
then automatically generate specialized agents for your stack.
|
|
51
|
+
`);
|
|
52
|
+
// User should run /agentful-init
|
|
53
|
+
// SlashCommand('/agentful-init');
|
|
54
|
+
return;
|
|
55
|
+
} else if (response.includes('Manually edit')) {
|
|
56
|
+
console.log(`
|
|
57
|
+
Please edit .claude/product/index.md with:
|
|
58
|
+
- Product description
|
|
59
|
+
- Key features
|
|
60
|
+
- Business domains
|
|
61
|
+
- Priority levels
|
|
62
|
+
|
|
63
|
+
Template: https://github.com/itz4blitz/agentful#product-spec
|
|
64
|
+
|
|
65
|
+
When done, run /agentful-start again.
|
|
66
|
+
`);
|
|
67
|
+
return;
|
|
68
|
+
} else {
|
|
69
|
+
// Skip setup - show help
|
|
70
|
+
console.log(`
|
|
71
|
+
agentful commands:
|
|
72
|
+
/agentful-init - Guided setup (recommended for first-time)
|
|
73
|
+
/agentful-product - Analyze product requirements
|
|
74
|
+
/agentful-status - Show progress
|
|
75
|
+
/agentful - Quick reference
|
|
76
|
+
|
|
77
|
+
Edit .claude/product/index.md when ready to start development.
|
|
78
|
+
`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
// Has product spec but no agents - generate them
|
|
83
|
+
console.log(`
|
|
84
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
85
|
+
First Run Detected
|
|
86
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
87
|
+
|
|
88
|
+
I found your product specification at .claude/product/index.md
|
|
89
|
+
|
|
90
|
+
Before starting development, let me generate specialized agents
|
|
91
|
+
for your tech stack and domains.
|
|
92
|
+
|
|
93
|
+
This takes about 30-60 seconds...
|
|
94
|
+
`);
|
|
95
|
+
|
|
96
|
+
// Auto-trigger /agentful-generate
|
|
97
|
+
// SlashCommand('/agentful-generate');
|
|
98
|
+
|
|
99
|
+
console.log(`
|
|
100
|
+
After agent generation completes, run /agentful-start again
|
|
101
|
+
to begin development.
|
|
102
|
+
`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Not first run - continue with normal startup
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 1. State File Validation
|
|
13
111
|
|
|
14
112
|
Before processing any state files, validate their existence and structure. This prevents corrupted or missing state from causing failures.
|
|
15
113
|
|
|
@@ -18,7 +18,7 @@ agentful supports two product specification formats.
|
|
|
18
18
|
|
|
19
19
|
## Tech Stack
|
|
20
20
|
|
|
21
|
-
- **Frontend**: Next.js
|
|
21
|
+
- **Frontend**: Next.js 15, TypeScript, Tailwind
|
|
22
22
|
- **Backend**: Node.js, Prisma, PostgreSQL
|
|
23
23
|
- **Testing**: Vitest, Playwright
|
|
24
24
|
|
|
@@ -98,7 +98,7 @@ agentful supports two product specification formats.
|
|
|
98
98
|
|
|
99
99
|
## Tech Stack
|
|
100
100
|
|
|
101
|
-
- **Frontend**: Next.js
|
|
101
|
+
- **Frontend**: Next.js 15, TypeScript, Tailwind
|
|
102
102
|
- **Backend**: Node.js, Prisma, PostgreSQL
|
|
103
103
|
|
|
104
104
|
## Domains
|
|
@@ -22,7 +22,7 @@ Example:
|
|
|
22
22
|
## Tech Stack
|
|
23
23
|
|
|
24
24
|
### Frontend
|
|
25
|
-
- **Framework**: [Next.js
|
|
25
|
+
- **Framework**: [Next.js 15 / React + Vite / Vue + Nuxt / SvelteKit]
|
|
26
26
|
- **Language**: [TypeScript / JavaScript]
|
|
27
27
|
- **Styling**: [Tailwind CSS / CSS Modules / styled-components / shadcn/ui]
|
|
28
28
|
- **State Management**: [Zustand / Context API / Redux / Jotai]
|
|
@@ -30,6 +30,17 @@
|
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
32
|
"PostToolUse": [
|
|
33
|
+
{
|
|
34
|
+
"matcher": "Write|Edit",
|
|
35
|
+
"hooks": [
|
|
36
|
+
{
|
|
37
|
+
"type": "command",
|
|
38
|
+
"command": "node bin/hooks/product-spec-watcher.js",
|
|
39
|
+
"timeout": 3,
|
|
40
|
+
"description": "Watch for product spec changes and auto-trigger generation"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
33
44
|
{
|
|
34
45
|
"matcher": "Write|Edit",
|
|
35
46
|
"hooks": [
|
|
@@ -41,6 +52,17 @@
|
|
|
41
52
|
}
|
|
42
53
|
]
|
|
43
54
|
},
|
|
55
|
+
{
|
|
56
|
+
"matcher": "Write|Edit",
|
|
57
|
+
"hooks": [
|
|
58
|
+
{
|
|
59
|
+
"type": "command",
|
|
60
|
+
"command": "node bin/hooks/architect-drift-detector.js",
|
|
61
|
+
"timeout": 3,
|
|
62
|
+
"description": "Detect when architect needs to re-analyze project"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
44
66
|
{
|
|
45
67
|
"matcher": "Write|Edit",
|
|
46
68
|
"hooks": [
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research
|
|
3
|
+
description: Research best practices for tech stacks and product domains using Context7 or WebSearch
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Research Skill
|
|
7
|
+
|
|
8
|
+
Enables agents to research current best practices, design patterns, and implementation approaches for technologies and product domains.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- **Tech Stack Analysis**: Learning current best practices for detected frameworks/languages
|
|
13
|
+
- **Domain Patterns**: Understanding implementation approaches for specific business domains
|
|
14
|
+
- **Agent Generation**: Informing specialized agent creation with research findings
|
|
15
|
+
- **Architecture Decisions**: Comparing approaches before implementation
|
|
16
|
+
- **Trend Analysis**: Understanding what's current vs deprecated
|
|
17
|
+
|
|
18
|
+
## Available Research Methods
|
|
19
|
+
|
|
20
|
+
### 1. Context7 MCP (Preferred)
|
|
21
|
+
|
|
22
|
+
Context7 provides curated, high-quality technical documentation and best practices.
|
|
23
|
+
|
|
24
|
+
**Advantages**:
|
|
25
|
+
- ✅ Curated, accurate results
|
|
26
|
+
- ✅ Up-to-date framework documentation
|
|
27
|
+
- ✅ Language-specific patterns
|
|
28
|
+
- ✅ Faster than web search
|
|
29
|
+
- ✅ No noise or outdated content
|
|
30
|
+
|
|
31
|
+
**Check Availability**:
|
|
32
|
+
```javascript
|
|
33
|
+
function hasContext7() {
|
|
34
|
+
// Check if Context7 MCP is connected
|
|
35
|
+
// Claude Code automatically exposes MCP tools
|
|
36
|
+
return typeof mcp__context7__search !== 'undefined';
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Usage**:
|
|
41
|
+
```javascript
|
|
42
|
+
// Example: Research Next.js 15 patterns
|
|
43
|
+
const results = await mcp__context7__search({
|
|
44
|
+
query: 'Next.js 15 app router best practices',
|
|
45
|
+
limit: 5
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Results include:
|
|
49
|
+
// - Official documentation
|
|
50
|
+
// - Verified patterns
|
|
51
|
+
// - Current recommendations
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 2. WebSearch (Fallback)
|
|
55
|
+
|
|
56
|
+
When Context7 is unavailable, use WebSearch for broader coverage.
|
|
57
|
+
|
|
58
|
+
**Advantages**:
|
|
59
|
+
- ✅ Always available
|
|
60
|
+
- ✅ Broader coverage (blogs, forums, etc.)
|
|
61
|
+
- ✅ Real-world examples
|
|
62
|
+
- ✅ Community insights
|
|
63
|
+
|
|
64
|
+
**Limitations**:
|
|
65
|
+
- ⚠️ May include outdated content
|
|
66
|
+
- ⚠️ Requires filtering and verification
|
|
67
|
+
- ⚠️ More noise
|
|
68
|
+
|
|
69
|
+
**Usage**:
|
|
70
|
+
```javascript
|
|
71
|
+
const results = await WebSearch({
|
|
72
|
+
query: 'Next.js 15 app router best practices 2026',
|
|
73
|
+
limit: 5
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Always include current year in query for freshness
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Research Workflow
|
|
80
|
+
|
|
81
|
+
### Step 1: Determine Research Method
|
|
82
|
+
|
|
83
|
+
```javascript
|
|
84
|
+
const researchMethod = hasContext7() ? 'context7' : 'websearch';
|
|
85
|
+
|
|
86
|
+
console.log(`Research method: ${researchMethod}`);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Step 2: Formulate Queries
|
|
90
|
+
|
|
91
|
+
Create specific, targeted queries:
|
|
92
|
+
|
|
93
|
+
**Good queries**:
|
|
94
|
+
- "Next.js 15 server components best practices"
|
|
95
|
+
- "React 19 concurrent rendering patterns"
|
|
96
|
+
- "PostgreSQL connection pooling with Prisma"
|
|
97
|
+
- "Authentication implementation patterns 2026"
|
|
98
|
+
|
|
99
|
+
**Bad queries**:
|
|
100
|
+
- "Next.js" (too broad)
|
|
101
|
+
- "How to code" (too generic)
|
|
102
|
+
- "Best JavaScript framework" (subjective, not actionable)
|
|
103
|
+
|
|
104
|
+
**Query Template**:
|
|
105
|
+
```
|
|
106
|
+
[Technology/Framework] + [Specific Topic] + [Year]
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Step 3: Execute Research
|
|
110
|
+
|
|
111
|
+
```javascript
|
|
112
|
+
async function researchTopic(topic, context = {}) {
|
|
113
|
+
const queries = generateQueries(topic, context);
|
|
114
|
+
const findings = [];
|
|
115
|
+
|
|
116
|
+
for (const query of queries) {
|
|
117
|
+
let result;
|
|
118
|
+
|
|
119
|
+
if (hasContext7()) {
|
|
120
|
+
result = await mcp__context7__search({
|
|
121
|
+
query,
|
|
122
|
+
limit: 3
|
|
123
|
+
});
|
|
124
|
+
} else {
|
|
125
|
+
result = await WebSearch({
|
|
126
|
+
query: `${query} ${new Date().getFullYear()}`,
|
|
127
|
+
limit: 3
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
findings.push({
|
|
132
|
+
query,
|
|
133
|
+
results: result,
|
|
134
|
+
source: hasContext7() ? 'context7' : 'websearch'
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return findings;
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Step 4: Synthesize Findings
|
|
143
|
+
|
|
144
|
+
Extract actionable insights from research results:
|
|
145
|
+
|
|
146
|
+
```javascript
|
|
147
|
+
function synthesizeResearch(findings, context) {
|
|
148
|
+
// Aggregate findings by category
|
|
149
|
+
const synthesis = {
|
|
150
|
+
techStackPatterns: {},
|
|
151
|
+
domainPatterns: {},
|
|
152
|
+
bestPractices: [],
|
|
153
|
+
commonPitfalls: [],
|
|
154
|
+
references: []
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
for (const finding of findings) {
|
|
158
|
+
// Extract tech stack patterns
|
|
159
|
+
if (finding.query.includes(context.techStack.framework)) {
|
|
160
|
+
synthesis.techStackPatterns[context.techStack.framework] = extractPatterns(finding.results);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Extract domain-specific patterns
|
|
164
|
+
for (const domain of context.domains || []) {
|
|
165
|
+
if (finding.query.includes(domain)) {
|
|
166
|
+
synthesis.domainPatterns[domain] = extractPatterns(finding.results);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Collect best practices
|
|
171
|
+
synthesis.bestPractices.push(...extractBestPractices(finding.results));
|
|
172
|
+
|
|
173
|
+
// Collect common pitfalls
|
|
174
|
+
synthesis.commonPitfalls.push(...extractPitfalls(finding.results));
|
|
175
|
+
|
|
176
|
+
// Store references
|
|
177
|
+
synthesis.references.push({
|
|
178
|
+
query: finding.query,
|
|
179
|
+
source: finding.source,
|
|
180
|
+
url: extractURL(finding.results)
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Deduplicate and rank
|
|
185
|
+
synthesis.bestPractices = deduplicateAndRank(synthesis.bestPractices);
|
|
186
|
+
synthesis.commonPitfalls = deduplicateAndRank(synthesis.commonPitfalls);
|
|
187
|
+
|
|
188
|
+
return synthesis;
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Research Use Cases
|
|
193
|
+
|
|
194
|
+
### Use Case 1: Tech Stack Research
|
|
195
|
+
|
|
196
|
+
Research current best practices for detected technologies:
|
|
197
|
+
|
|
198
|
+
```javascript
|
|
199
|
+
// Called by /agentful-generate after tech stack detection
|
|
200
|
+
const techStack = {
|
|
201
|
+
framework: 'Next.js',
|
|
202
|
+
version: '15.1.0',
|
|
203
|
+
language: 'TypeScript',
|
|
204
|
+
database: 'PostgreSQL',
|
|
205
|
+
orm: 'Prisma'
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const queries = [
|
|
209
|
+
`${techStack.framework} ${techStack.version} best practices`,
|
|
210
|
+
`${techStack.framework} project structure patterns`,
|
|
211
|
+
`${techStack.orm} with ${techStack.database} optimization`,
|
|
212
|
+
`TypeScript configuration for ${techStack.framework}`
|
|
213
|
+
];
|
|
214
|
+
|
|
215
|
+
const findings = await researchTopic('tech-stack', { techStack, queries });
|
|
216
|
+
const synthesis = synthesizeResearch(findings, { techStack });
|
|
217
|
+
|
|
218
|
+
// Use synthesis to inform:
|
|
219
|
+
// - Agent generation (what agents should know)
|
|
220
|
+
// - Skill creation (patterns to document)
|
|
221
|
+
// - Architecture decisions
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Use Case 2: Domain Research
|
|
225
|
+
|
|
226
|
+
Research implementation patterns for product domains:
|
|
227
|
+
|
|
228
|
+
```javascript
|
|
229
|
+
// Called by /agentful-generate after domain discovery
|
|
230
|
+
const product = {
|
|
231
|
+
type: 'task management app',
|
|
232
|
+
domains: ['authentication', 'tasks', 'collaboration']
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const queries = [
|
|
236
|
+
`${product.type} architecture patterns`,
|
|
237
|
+
`authentication implementation best practices ${techStack.framework}`,
|
|
238
|
+
`task management data model design`,
|
|
239
|
+
`real-time collaboration implementation`
|
|
240
|
+
];
|
|
241
|
+
|
|
242
|
+
const findings = await researchTopic('domains', { product, queries });
|
|
243
|
+
const synthesis = synthesizeResearch(findings, { domains: product.domains });
|
|
244
|
+
|
|
245
|
+
// Use synthesis to inform:
|
|
246
|
+
// - Domain agent specialization
|
|
247
|
+
// - Database schema design
|
|
248
|
+
// - API design patterns
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Use Case 3: Pre-Implementation Research
|
|
252
|
+
|
|
253
|
+
Research before implementing a complex feature:
|
|
254
|
+
|
|
255
|
+
```javascript
|
|
256
|
+
// Called by orchestrator before delegating complex work
|
|
257
|
+
const feature = {
|
|
258
|
+
name: 'Real-time notifications',
|
|
259
|
+
complexity: 'high',
|
|
260
|
+
technologies: ['WebSockets', 'Redis', 'React']
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
const queries = [
|
|
264
|
+
`WebSocket implementation ${techStack.framework}`,
|
|
265
|
+
`Redis pub/sub patterns for notifications`,
|
|
266
|
+
`React real-time updates best practices`,
|
|
267
|
+
`scaling WebSocket connections`
|
|
268
|
+
];
|
|
269
|
+
|
|
270
|
+
const findings = await researchTopic('feature', { feature, queries });
|
|
271
|
+
const synthesis = synthesizeResearch(findings, { feature });
|
|
272
|
+
|
|
273
|
+
// Share findings with specialist agent before implementation
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Quality Criteria
|
|
277
|
+
|
|
278
|
+
When evaluating research findings:
|
|
279
|
+
|
|
280
|
+
1. **Recency**: Prefer results from current year
|
|
281
|
+
2. **Authority**: Official docs > verified blogs > forums
|
|
282
|
+
3. **Specificity**: Specific patterns > general advice
|
|
283
|
+
4. **Actionability**: Code examples > theory
|
|
284
|
+
5. **Relevance**: Exact version match > general version
|
|
285
|
+
|
|
286
|
+
## Integration Points
|
|
287
|
+
|
|
288
|
+
### /agentful-generate
|
|
289
|
+
|
|
290
|
+
Research is integrated into agent generation:
|
|
291
|
+
|
|
292
|
+
```javascript
|
|
293
|
+
// Step 3 of /agentful-generate workflow
|
|
294
|
+
console.log('Researching best practices...');
|
|
295
|
+
|
|
296
|
+
const research = await researchTopic('generation', {
|
|
297
|
+
techStack,
|
|
298
|
+
domains,
|
|
299
|
+
productType
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const synthesis = synthesizeResearch(research, { techStack, domains });
|
|
303
|
+
|
|
304
|
+
// Use synthesis when generating:
|
|
305
|
+
// - Domain agent responsibilities
|
|
306
|
+
// - Tech skill documentation
|
|
307
|
+
// - Best practices sections
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Orchestrator
|
|
311
|
+
|
|
312
|
+
Research can inform architectural decisions:
|
|
313
|
+
|
|
314
|
+
```javascript
|
|
315
|
+
// Before implementing complex features
|
|
316
|
+
if (feature.complexity === 'high') {
|
|
317
|
+
console.log(`Researching implementation approaches for ${feature.name}...`);
|
|
318
|
+
|
|
319
|
+
const research = await researchTopic('feature-planning', {
|
|
320
|
+
feature,
|
|
321
|
+
techStack
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
const synthesis = synthesizeResearch(research, { feature });
|
|
325
|
+
|
|
326
|
+
// Present findings to user for decision
|
|
327
|
+
AskUserQuestion({
|
|
328
|
+
question: `
|
|
329
|
+
Research findings for ${feature.name}:
|
|
330
|
+
|
|
331
|
+
Recommended approach:
|
|
332
|
+
${synthesis.bestPractices[0]}
|
|
333
|
+
|
|
334
|
+
Alternatives:
|
|
335
|
+
${synthesis.bestPractices.slice(1, 3).join('\n')}
|
|
336
|
+
|
|
337
|
+
Which approach should we use?
|
|
338
|
+
`,
|
|
339
|
+
options: synthesis.bestPractices.map(p => p.summary)
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Example: Full Research Flow
|
|
345
|
+
|
|
346
|
+
```javascript
|
|
347
|
+
// 1. Detect tech stack
|
|
348
|
+
const techStack = detectTechStack();
|
|
349
|
+
|
|
350
|
+
// 2. Read product requirements
|
|
351
|
+
const product = Read('.claude/product/index.md');
|
|
352
|
+
const productType = extractProductType(product);
|
|
353
|
+
const domains = extractDomains(product);
|
|
354
|
+
|
|
355
|
+
// 3. Research
|
|
356
|
+
console.log('Researching best practices...');
|
|
357
|
+
|
|
358
|
+
const method = hasContext7() ? 'Context7' : 'WebSearch';
|
|
359
|
+
console.log(`Method: ${method}`);
|
|
360
|
+
|
|
361
|
+
// Tech stack research
|
|
362
|
+
const techResearch = await researchTopic('tech-stack', {
|
|
363
|
+
techStack,
|
|
364
|
+
queries: [
|
|
365
|
+
`${techStack.framework} ${techStack.version} best practices`,
|
|
366
|
+
`${techStack.framework} project structure`,
|
|
367
|
+
`${techStack.orm} patterns`
|
|
368
|
+
]
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
// Domain research
|
|
372
|
+
const domainResearch = await researchTopic('domains', {
|
|
373
|
+
domains,
|
|
374
|
+
queries: domains.map(d => `${d} domain implementation patterns`)
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
// Product type research
|
|
378
|
+
const productResearch = await researchTopic('product-type', {
|
|
379
|
+
productType,
|
|
380
|
+
queries: [`${productType} application architecture`]
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// 4. Synthesize
|
|
384
|
+
const synthesis = synthesizeResearch(
|
|
385
|
+
[...techResearch, ...domainResearch, ...productResearch],
|
|
386
|
+
{ techStack, domains, productType }
|
|
387
|
+
);
|
|
388
|
+
|
|
389
|
+
// 5. Apply findings
|
|
390
|
+
console.log('Research complete. Applying findings to agent generation...');
|
|
391
|
+
|
|
392
|
+
// Generate agents with research-informed patterns
|
|
393
|
+
generateAgentsWithResearch(synthesis);
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
## Error Handling
|
|
397
|
+
|
|
398
|
+
```javascript
|
|
399
|
+
async function safeResearch(query, context = {}) {
|
|
400
|
+
try {
|
|
401
|
+
if (hasContext7()) {
|
|
402
|
+
return await mcp__context7__search({ query, limit: 3 });
|
|
403
|
+
} else {
|
|
404
|
+
return await WebSearch({ query: `${query} ${new Date().getFullYear()}`, limit: 3 });
|
|
405
|
+
}
|
|
406
|
+
} catch (error) {
|
|
407
|
+
console.warn(`Research failed for query "${query}": ${error.message}`);
|
|
408
|
+
return {
|
|
409
|
+
query,
|
|
410
|
+
results: [],
|
|
411
|
+
error: error.message,
|
|
412
|
+
fallback: true
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
## Best Practices
|
|
419
|
+
|
|
420
|
+
1. **Always check Context7 availability first** - More accurate results
|
|
421
|
+
2. **Include year in WebSearch queries** - Ensure freshness
|
|
422
|
+
3. **Limit queries to 5-10** - Balance coverage vs speed
|
|
423
|
+
4. **Synthesize findings** - Don't just dump raw results
|
|
424
|
+
5. **Cache research results** - Avoid redundant queries
|
|
425
|
+
6. **Provide references** - Link to source material
|
|
426
|
+
7. **Time-box research** - Don't spend hours researching
|
|
427
|
+
|
|
428
|
+
## References
|
|
429
|
+
|
|
430
|
+
- Context7 MCP Documentation
|
|
431
|
+
- Claude Code WebSearch API
|
|
432
|
+
- Research methodology best practices
|
package/template/CLAUDE.md
CHANGED
|
@@ -26,7 +26,7 @@ npx @itz4blitz/agentful presets
|
|
|
26
26
|
|
|
27
27
|
1. Edit `.claude/product/index.md` to define your product requirements
|
|
28
28
|
2. Run: `claude`
|
|
29
|
-
3. Type: `/agentful-
|
|
29
|
+
3. Type: `/agentful-generate`
|
|
30
30
|
|
|
31
31
|
For extended sessions:
|
|
32
32
|
```bash
|
|
@@ -68,9 +68,6 @@ claude --dangerously-skip-permissions
|
|
|
68
68
|
**Want to add features?**
|
|
69
69
|
→ Edit `.claude/product/index.md`, then run `/agentful-start` (picks up changes automatically)
|
|
70
70
|
|
|
71
|
-
**Need remote execution?**
|
|
72
|
-
→ Run `agentful serve` on a VPS, then use `agentful remote` CLI to trigger agents from anywhere
|
|
73
|
-
|
|
74
71
|
## File Structure
|
|
75
72
|
|
|
76
73
|
**Product Specification** (you edit these):
|
|
@@ -81,7 +78,9 @@ claude --dangerously-skip-permissions
|
|
|
81
78
|
- `.agentful/state.json` - Current work phase and progress
|
|
82
79
|
- `.agentful/completion.json` - Feature completion % and quality gates
|
|
83
80
|
- `.agentful/decisions.json` - Pending and resolved decisions
|
|
84
|
-
- `.agentful/
|
|
81
|
+
- `.agentful/conversation-state.json` - Natural language conversation context
|
|
82
|
+
- `.agentful/conversation-history.json` - Message history for context tracking
|
|
83
|
+
- `.agentful/agent-metrics.json` - Agent lifecycle hooks and metrics
|
|
85
84
|
- `.agentful/architecture.json` - Detected tech stack and generated agents
|
|
86
85
|
|
|
87
86
|
**Configuration** (auto-generated, customizable):
|
|
@@ -129,7 +128,7 @@ The `reviewer` agent runs these checks automatically. The `fixer` agent resolves
|
|
|
129
128
|
→ Edit completion % in `.agentful/completion.json` for specific feature, then run `/agentful-start`.
|
|
130
129
|
|
|
131
130
|
**"Want to work on multiple features in parallel?"**
|
|
132
|
-
→ Use git worktrees for branch-based parallel development
|
|
131
|
+
→ Use git worktrees for branch-based parallel development.
|
|
133
132
|
|
|
134
133
|
## Getting Help
|
|
135
134
|
|