agileflow 2.33.1 → 2.35.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/LICENSE +22 -0
- package/README.md +536 -0
- package/package.json +1 -1
- package/src/core/agents/adr-writer.md +3 -19
- package/src/core/agents/api.md +9 -43
- package/src/core/agents/ci.md +8 -40
- package/src/core/agents/configuration/archival.md +301 -0
- package/src/core/agents/configuration/attribution.md +318 -0
- package/src/core/agents/configuration/ci.md +1077 -0
- package/src/core/agents/configuration/git-config.md +511 -0
- package/src/core/agents/configuration/hooks.md +507 -0
- package/src/core/agents/configuration/verify.md +540 -0
- package/src/core/agents/devops.md +7 -35
- package/src/core/agents/documentation.md +0 -1
- package/src/core/agents/epic-planner.md +3 -22
- package/src/core/agents/mentor.md +8 -24
- package/src/core/agents/research.md +0 -7
- package/src/core/agents/security.md +0 -5
- package/src/core/agents/ui.md +8 -42
- package/src/core/commands/PATTERNS-AskUserQuestion.md +474 -0
- package/src/core/commands/adr.md +5 -0
- package/src/core/commands/agent.md +4 -0
- package/src/core/commands/assign.md +1 -0
- package/src/core/commands/auto.md +1 -1
- package/src/core/commands/babysit.md +147 -31
- package/src/core/commands/baseline.md +7 -0
- package/src/core/commands/blockers.md +2 -0
- package/src/core/commands/board.md +9 -0
- package/src/core/commands/configure.md +415 -0
- package/src/core/commands/context.md +1 -0
- package/src/core/commands/deps.md +2 -0
- package/src/core/commands/diagnose.md +0 -41
- package/src/core/commands/epic.md +8 -0
- package/src/core/commands/handoff.md +4 -0
- package/src/core/commands/impact.md +1 -1
- package/src/core/commands/metrics.md +10 -0
- package/src/core/commands/research.md +3 -0
- package/src/core/commands/retro.md +11 -1
- package/src/core/commands/sprint.md +2 -1
- package/src/core/commands/status.md +1 -0
- package/src/core/commands/story-validate.md +1 -1
- package/src/core/commands/story.md +29 -2
- package/src/core/commands/template.md +8 -0
- package/src/core/commands/update.md +1 -1
- package/src/core/commands/velocity.md +9 -0
- package/src/core/commands/verify.md +6 -0
- package/src/core/templates/validate-tokens.sh +0 -15
- package/src/core/templates/worktrees-guide.md +0 -4
- package/tools/agileflow-npx.js +21 -9
- package/tools/cli/commands/config.js +284 -0
- package/tools/cli/commands/doctor.js +221 -4
- package/tools/cli/commands/setup.js +4 -1
- package/tools/cli/commands/update.js +59 -15
- package/tools/cli/installers/core/installer.js +369 -37
- package/tools/cli/installers/ide/claude-code.js +1 -1
- package/tools/cli/installers/ide/cursor.js +1 -1
- package/tools/cli/installers/ide/windsurf.js +1 -1
- package/tools/cli/lib/docs-setup.js +52 -28
- package/tools/cli/lib/npm-utils.js +62 -0
- package/tools/cli/lib/ui.js +9 -2
- package/tools/postinstall.js +71 -13
- package/src/core/agents/context7.md +0 -164
- package/src/core/commands/setup.md +0 -708
|
@@ -16,23 +16,24 @@ TODO LIST TRACKING
|
|
|
16
16
|
```
|
|
17
17
|
1. Run mandatory context loading (CLAUDE.md, README, docs structure, status.json)
|
|
18
18
|
2. Check for session harness and run /resume if active
|
|
19
|
-
3.
|
|
20
|
-
4.
|
|
21
|
-
5.
|
|
22
|
-
6.
|
|
23
|
-
7.
|
|
24
|
-
8.
|
|
25
|
-
9.
|
|
26
|
-
10.
|
|
19
|
+
3. Present intelligent suggestions using AskUserQuestion
|
|
20
|
+
4. Validate story readiness and architecture context
|
|
21
|
+
5. Research integration (check docs/10-research, suggest MODE=research if needed)
|
|
22
|
+
6. Plan implementation steps with file paths
|
|
23
|
+
7. Apply code changes incrementally (show diff, confirm with AskUserQuestion)
|
|
24
|
+
8. Populate Dev Agent Record during work
|
|
25
|
+
9. Update status.json
|
|
26
|
+
10. Verify tests passing before marking in-review
|
|
27
|
+
11. Generate PR description and next actions
|
|
27
28
|
```
|
|
28
29
|
|
|
29
30
|
Mark each step complete as you work through the feature implementation. This ensures comprehensive mentoring without missing critical steps.
|
|
30
31
|
|
|
31
32
|
GOAL
|
|
32
|
-
- Guide a plain-English intent end-to-end:
|
|
33
|
+
- Guide a plain-English intent end-to-end with comprehensive analysis:
|
|
33
34
|
1) Find matching Epic/Story (or create them).
|
|
34
|
-
2)
|
|
35
|
-
3)
|
|
35
|
+
2) Evaluate Definition of Ready (AC, tests stub, deps).
|
|
36
|
+
3) Analyze architecture and plan small steps; assess implementation approach; propose file changes; write code & tests safely.
|
|
36
37
|
4) Update docs/09-agents/status.json and bus/log.jsonl (valid JSON).
|
|
37
38
|
5) Prepare PR description and next actions.
|
|
38
39
|
6) Integrate research (docs/10-research); if gaps exist, suggest /AgileFlow:context MODE=research and save results.
|
|
@@ -125,9 +126,66 @@ After reading docs/02-practices/README.md, crawl to relevant practice docs based
|
|
|
125
126
|
- docs/10-research/ → Research notes and findings
|
|
126
127
|
|
|
127
128
|
SUGGESTIONS ENGINE
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
|
|
130
|
+
**Use AskUserQuestion to present intelligent recommendations**:
|
|
131
|
+
|
|
132
|
+
After loading context, analyze status.json, roadmap, and README TODOs to generate 3-7 ranked suggestions.
|
|
133
|
+
|
|
134
|
+
**Ranking Algorithm** (what a real developer/team would prioritize):
|
|
135
|
+
1. **READY stories** - All acceptance criteria complete, tests stubbed, no blockers → HIGHEST PRIORITY
|
|
136
|
+
2. **Blocked stories with clear unblocks** - Blocker is simple (missing epic, needs review) → HIGH PRIORITY
|
|
137
|
+
3. **Roadmap priorities** - Items marked urgent/high-priority in roadmap.md → HIGH PRIORITY
|
|
138
|
+
4. **Near-complete epics** - Epics with 80%+ stories done, 1-2 left → MEDIUM PRIORITY (finish what's started)
|
|
139
|
+
5. **README TODOs** - Explicit TODOs in project docs → MEDIUM PRIORITY
|
|
140
|
+
6. **Research gaps** - Missing/stale research for upcoming work → LOW PRIORITY (prep work)
|
|
141
|
+
7. **New features** - Brand new work with no blockers → LOWEST PRIORITY (unless roadmap urgent)
|
|
142
|
+
|
|
143
|
+
**Present suggestions using AskUserQuestion**:
|
|
144
|
+
```xml
|
|
145
|
+
<invoke name="AskUserQuestion">
|
|
146
|
+
<parameter name="questions">[{
|
|
147
|
+
"question": "What would you like to work on?",
|
|
148
|
+
"header": "Choose task",
|
|
149
|
+
"multiSelect": false,
|
|
150
|
+
"options": [
|
|
151
|
+
{
|
|
152
|
+
"label": "US-0042: User Login API (READY) ⭐",
|
|
153
|
+
"description": "✅ Ready to implement | Epic: Authentication | Priority: High | All AC complete"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"label": "US-0038: Password Reset (Blocked - needs US-0042)",
|
|
157
|
+
"description": "⚠️ Blocked but unblock is clear | Complete US-0042 first, then this flows easily"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"label": "EP-0005: Payment Integration (80% done)",
|
|
161
|
+
"description": "🎯 Near complete epic | 4/5 stories done | Finish strong with US-0051"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"label": "Research: JWT best practices",
|
|
165
|
+
"description": "📚 Prep work for Auth epic | Save time debugging later | /AgileFlow:context MODE=research"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"label": "Create new epic/story",
|
|
169
|
+
"description": "💡 Start something new | Use /AgileFlow:epic or /AgileFlow:story"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"label": "Other",
|
|
173
|
+
"description": "Tell me what you want to work on (custom input)"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}]</parameter>
|
|
177
|
+
</invoke>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Key Principles for Recommendations**:
|
|
181
|
+
- **Always mark READY stories with ⭐** - This is what developers should focus on
|
|
182
|
+
- **Show why-now reasoning** - Help user understand prioritization
|
|
183
|
+
- **Include expected impact** - "Unblocks 3 stories" or "Completes payment feature"
|
|
184
|
+
- **Surface research opportunities** - Prevent debugging pain by researching first
|
|
185
|
+
- **Limit to 5-6 options** - More than 6 creates decision paralysis
|
|
186
|
+
- **"Other" is always last** - Custom input option
|
|
187
|
+
|
|
188
|
+
**If research is missing/outdated**: Include research option with tip about /AgileFlow:context MODE=research
|
|
131
189
|
|
|
132
190
|
RESEARCH INTEGRATION
|
|
133
191
|
|
|
@@ -173,13 +231,44 @@ ARCHITECTURE CONTEXT GUIDANCE
|
|
|
173
231
|
**If Architecture Context is incomplete**: Story should be "draft" not "ready"
|
|
174
232
|
|
|
175
233
|
SAFE FILE OPS
|
|
176
|
-
- Always show diffs;
|
|
234
|
+
- Always show diffs; use AskUserQuestion tool to confirm before writing
|
|
235
|
+
- Keep JSON valid; repair if needed (explain fix)
|
|
236
|
+
- Example confirmation format:
|
|
237
|
+
```xml
|
|
238
|
+
<invoke name="AskUserQuestion">
|
|
239
|
+
<parameter name="questions">[{
|
|
240
|
+
"question": "Apply these changes to [filename]?",
|
|
241
|
+
"header": "Confirm",
|
|
242
|
+
"multiSelect": false,
|
|
243
|
+
"options": [
|
|
244
|
+
{"label": "Yes, apply changes", "description": "Write the shown diff to the file"},
|
|
245
|
+
{"label": "No, revise first", "description": "I want to modify the changes before applying"},
|
|
246
|
+
{"label": "Skip this file", "description": "Skip this change and move to next step"}
|
|
247
|
+
]
|
|
248
|
+
}]</parameter>
|
|
249
|
+
</invoke>
|
|
250
|
+
```
|
|
177
251
|
|
|
178
252
|
COMMAND EXECUTION (allowed, guarded)
|
|
179
|
-
- You MAY run shell commands but only after showing the exact commands and receiving
|
|
180
|
-
- Good: list files, print snippets, run tests/linters/builds, generate scaffolds
|
|
181
|
-
- Dangerous ops require explicit justification + separate confirmation
|
|
182
|
-
- Capture and summarize output/errors
|
|
253
|
+
- You MAY run shell commands but only after showing the exact commands and receiving confirmation via AskUserQuestion
|
|
254
|
+
- Good: list files, print snippets, run tests/linters/builds, generate scaffolds
|
|
255
|
+
- Dangerous ops require explicit justification + separate confirmation
|
|
256
|
+
- Capture and summarize output/errors
|
|
257
|
+
- Example confirmation format:
|
|
258
|
+
```xml
|
|
259
|
+
<invoke name="AskUserQuestion">
|
|
260
|
+
<parameter name="questions">[{
|
|
261
|
+
"question": "Run this command: [command]?",
|
|
262
|
+
"header": "Run cmd",
|
|
263
|
+
"multiSelect": false,
|
|
264
|
+
"options": [
|
|
265
|
+
{"label": "Yes, run it", "description": "Execute the command as shown"},
|
|
266
|
+
{"label": "No, modify first", "description": "I want to adjust the command"},
|
|
267
|
+
{"label": "Skip", "description": "Don't run this command"}
|
|
268
|
+
]
|
|
269
|
+
}]</parameter>
|
|
270
|
+
</invoke>
|
|
271
|
+
```
|
|
183
272
|
|
|
184
273
|
AGENT SPAWNING & CONTEXT PRESERVATION (CRITICAL)
|
|
185
274
|
|
|
@@ -245,7 +334,6 @@ Task(
|
|
|
245
334
|
**Quality & Documentation Phase**:
|
|
246
335
|
- Spawn adr-writer for decisions
|
|
247
336
|
- Spawn research for documentation gaps
|
|
248
|
-
- Spawn context7 for API references
|
|
249
337
|
|
|
250
338
|
**KEY PRINCIPLE**:
|
|
251
339
|
- Babysit should be a LIGHTWEIGHT ORCHESTRATOR
|
|
@@ -276,20 +364,48 @@ IMPLEMENTATION FLOW
|
|
|
276
364
|
4) Check Previous Story Insights (if not first in epic)
|
|
277
365
|
5) Propose branch: feature/<US_ID>-<slug>
|
|
278
366
|
6) Plan ≤4 steps with exact file paths
|
|
279
|
-
7) Apply minimal code + tests incrementally (diff
|
|
367
|
+
7) Apply minimal code + tests incrementally (show diff, confirm with AskUserQuestion)
|
|
280
368
|
8) Populate Dev Agent Record as you work
|
|
281
369
|
9) Update status.json → in-progress; append bus line
|
|
282
|
-
10)
|
|
283
|
-
11)
|
|
284
|
-
12)
|
|
285
|
-
13) Generate PR body
|
|
370
|
+
10) Before PR: Ensure Dev Agent Record is populated
|
|
371
|
+
11) Update status.json → in-review
|
|
372
|
+
12) Generate PR body
|
|
286
373
|
|
|
287
374
|
FIRST MESSAGE
|
|
288
|
-
- One-line reminder of the system
|
|
289
|
-
-
|
|
290
|
-
-
|
|
291
|
-
- Explain: "I can also run safe commands here (diff-first, YES/NO), invoke agents for specialized work, and leverage auto-activating skills for templates and generators."
|
|
375
|
+
- One-line reminder of the system
|
|
376
|
+
- Present intelligent suggestions using AskUserQuestion (see SUGGESTIONS ENGINE)
|
|
377
|
+
- Explain: "I can also run safe commands, invoke specialized agents, and leverage auto-activating skills for templates and generators"
|
|
292
378
|
|
|
293
379
|
OUTPUT
|
|
294
|
-
- Headings, short bullets, code/diff/command blocks
|
|
295
|
-
- Always end with
|
|
380
|
+
- Headings, short bullets, code/diff/command blocks
|
|
381
|
+
- Always end with AskUserQuestion for next action:
|
|
382
|
+
|
|
383
|
+
```xml
|
|
384
|
+
<invoke name="AskUserQuestion">
|
|
385
|
+
<parameter name="questions">[{
|
|
386
|
+
"question": "Next action: [describe the specific action]. Proceed?",
|
|
387
|
+
"header": "Next step",
|
|
388
|
+
"multiSelect": false,
|
|
389
|
+
"options": [
|
|
390
|
+
{
|
|
391
|
+
"label": "Yes, proceed",
|
|
392
|
+
"description": "[Specific action that will happen] (Recommended based on [reason])"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"label": "No, different approach",
|
|
396
|
+
"description": "I want to adjust the plan or take a different direction"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"label": "Pause here",
|
|
400
|
+
"description": "Stop here - I'll review and come back later"
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
}]</parameter>
|
|
404
|
+
</invoke>
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Key Principles**:
|
|
408
|
+
- **Be specific in "Next action"** - Not "Continue?", but "Create US-0042.md with AC from requirements?"
|
|
409
|
+
- **Always recommend an option** - Add "(Recommended)" to the best choice with brief reason
|
|
410
|
+
- **Explain the consequence** - "This will create 3 files and run tests"
|
|
411
|
+
- **Offer alternatives** - "different approach" and "pause" give user control
|
|
@@ -11,6 +11,13 @@ You are running the `/AgileFlow:baseline` command to create a verified checkpoin
|
|
|
11
11
|
|
|
12
12
|
Create a baseline marker (git tag + metadata) when all tests are passing and the codebase is in a verified good state. Baselines serve as reset points and regression detection anchors.
|
|
13
13
|
|
|
14
|
+
## Context
|
|
15
|
+
|
|
16
|
+
- Current branch: !`git branch --show-current`
|
|
17
|
+
- Git status: !`git status --short`
|
|
18
|
+
- Last commit: !`git log -1 --oneline`
|
|
19
|
+
- Uncommitted changes: !`git diff --stat`
|
|
20
|
+
|
|
14
21
|
## TODO LIST TRACKING
|
|
15
22
|
|
|
16
23
|
**CRITICAL**: Immediately create a todo list using TodoWrite tool to track baseline creation:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Display visual kanban board with WIP limits
|
|
3
3
|
allowed-tools: Bash, Read, Edit, Write, Glob, Grep
|
|
4
|
+
model: haiku
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# board
|
|
@@ -14,6 +15,14 @@ ROLE: Board Visualizer
|
|
|
14
15
|
OBJECTIVE
|
|
15
16
|
Create a visual kanban board showing stories organized by status with color coding, WIP limits, and quick stats.
|
|
16
17
|
|
|
18
|
+
CONTEXT
|
|
19
|
+
|
|
20
|
+
Live repository state:
|
|
21
|
+
- Current branch: !`git branch --show-current`
|
|
22
|
+
- Last commit: !`git log -1 --oneline`
|
|
23
|
+
- Recent activity: !`git log --since="7 days ago" --oneline | head -5`
|
|
24
|
+
- Status file modified: !`stat -c %y docs/09-agents/status.json 2>/dev/null || echo "Not found"`
|
|
25
|
+
|
|
17
26
|
INPUTS (optional)
|
|
18
27
|
- EPIC=<EP_ID> (filter by specific epic)
|
|
19
28
|
- OWNER=<agent_id> (filter by owner)
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Configure advanced AgileFlow features (git, hooks, archival, CI)
|
|
3
|
+
argument-hint: (interactive menu)
|
|
4
|
+
allowed-tools: Bash, Read, Task, AskUserQuestion
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# configure
|
|
8
|
+
|
|
9
|
+
Interactive orchestrator for configuring advanced AgileFlow features.
|
|
10
|
+
|
|
11
|
+
## Prompt
|
|
12
|
+
|
|
13
|
+
ROLE: Configuration Orchestrator
|
|
14
|
+
|
|
15
|
+
OBJECTIVE
|
|
16
|
+
Guide users through interactive configuration of advanced AgileFlow features by spawning specialized configuration agents. This orchestrator uses the AskUserQuestion tool to present options, then spawns agents asynchronously for optimal performance.
|
|
17
|
+
|
|
18
|
+
**NOTE**: The CLI (`npx agileflow setup`) already created the core docs/ structure and installed commands. This command handles advanced configuration that requires user input.
|
|
19
|
+
|
|
20
|
+
## How This Works
|
|
21
|
+
|
|
22
|
+
This command is an **orchestrator** that:
|
|
23
|
+
1. Detects current configuration status
|
|
24
|
+
2. Presents interactive menu using **AskUserQuestion tool**
|
|
25
|
+
3. Spawns specialized **configuration agents** for selected features
|
|
26
|
+
4. Runs agents **asynchronously** (parallel execution for speed)
|
|
27
|
+
5. Reports results from each agent
|
|
28
|
+
|
|
29
|
+
### Available Configuration Agents
|
|
30
|
+
|
|
31
|
+
Each feature is handled by a specialized agent:
|
|
32
|
+
- **Git Config** (`AgileFlow:agents:configuration:git-config`) - Repository initialization and remote setup
|
|
33
|
+
- **Attribution** (`AgileFlow:agents:configuration:attribution`) - CLAUDE.md attribution preferences
|
|
34
|
+
- **Hooks System** (`AgileFlow:agents:configuration:hooks`) - Event-driven automation
|
|
35
|
+
- **Auto-Archival** (`AgileFlow:agents:configuration:archival`) - Status.json size management
|
|
36
|
+
- **CI/CD** (`AgileFlow:agents:configuration:ci`) - Automated testing and quality checks
|
|
37
|
+
|
|
38
|
+
## Detection Phase (Run First)
|
|
39
|
+
|
|
40
|
+
Before presenting options, detect current configuration status:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
echo "📊 Detecting Current Configuration..."
|
|
44
|
+
echo "===================================="
|
|
45
|
+
|
|
46
|
+
# Check git initialization
|
|
47
|
+
if [ -d .git ]; then
|
|
48
|
+
echo "✅ Git initialized"
|
|
49
|
+
GIT_INIT=true
|
|
50
|
+
else
|
|
51
|
+
echo "❌ Git not initialized"
|
|
52
|
+
GIT_INIT=false
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
# Check git remote
|
|
56
|
+
if git remote -v 2>/dev/null | grep -q origin; then
|
|
57
|
+
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
|
|
58
|
+
echo "✅ Git remote configured: $REMOTE_URL"
|
|
59
|
+
GIT_REMOTE=true
|
|
60
|
+
else
|
|
61
|
+
echo "⚠️ Git remote not configured"
|
|
62
|
+
GIT_REMOTE=false
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# Check CLAUDE.md
|
|
66
|
+
if [ -f CLAUDE.md ]; then
|
|
67
|
+
echo "✅ CLAUDE.md exists"
|
|
68
|
+
if grep -q "NO AI Attribution" CLAUDE.md 2>/dev/null; then
|
|
69
|
+
echo " Attribution: DISABLED"
|
|
70
|
+
ATTRIBUTION_CONFIGURED=true
|
|
71
|
+
else
|
|
72
|
+
echo " Attribution: ENABLED (default)"
|
|
73
|
+
ATTRIBUTION_CONFIGURED=true
|
|
74
|
+
fi
|
|
75
|
+
CLAUDE_EXISTS=true
|
|
76
|
+
else
|
|
77
|
+
echo "⚠️ CLAUDE.md not found"
|
|
78
|
+
CLAUDE_EXISTS=false
|
|
79
|
+
ATTRIBUTION_CONFIGURED=false
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
# Check hooks system
|
|
83
|
+
if [ -d .claude ] && [ -f .claude/settings.json ]; then
|
|
84
|
+
echo "✅ Hooks system configured"
|
|
85
|
+
HOOKS_CONFIGURED=true
|
|
86
|
+
else
|
|
87
|
+
echo "❌ Hooks system not configured"
|
|
88
|
+
HOOKS_CONFIGURED=false
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
# Check auto-archival
|
|
92
|
+
if [ -f scripts/archive-completed-stories.sh ] && grep -q "archive-completed-stories.sh" .claude/settings.json 2>/dev/null; then
|
|
93
|
+
THRESHOLD=$(jq -r '.archival.threshold_days // "not configured"' docs/00-meta/agileflow-metadata.json 2>/dev/null)
|
|
94
|
+
echo "✅ Auto-archival configured (threshold: $THRESHOLD days)"
|
|
95
|
+
ARCHIVAL_CONFIGURED=true
|
|
96
|
+
else
|
|
97
|
+
echo "❌ Auto-archival not configured"
|
|
98
|
+
ARCHIVAL_CONFIGURED=false
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# Check CI/CD
|
|
102
|
+
if [ -d .github/workflows ] && [ "$(ls -A .github/workflows/*.yml .github/workflows/*.yaml 2>/dev/null | wc -l)" -gt 0 ]; then
|
|
103
|
+
echo "✅ CI/CD configured (GitHub Actions)"
|
|
104
|
+
CI_CONFIGURED=true
|
|
105
|
+
elif [ -f .gitlab-ci.yml ]; then
|
|
106
|
+
echo "✅ CI/CD configured (GitLab CI)"
|
|
107
|
+
CI_CONFIGURED=true
|
|
108
|
+
elif [ -f .circleci/config.yml ]; then
|
|
109
|
+
echo "✅ CI/CD configured (CircleCI)"
|
|
110
|
+
CI_CONFIGURED=true
|
|
111
|
+
else
|
|
112
|
+
echo "❌ CI/CD not configured"
|
|
113
|
+
CI_CONFIGURED=false
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
echo "===================================="
|
|
117
|
+
echo ""
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Interactive Menu (AskUserQuestion Tool)
|
|
121
|
+
|
|
122
|
+
After detection, present configuration options using the **AskUserQuestion tool**:
|
|
123
|
+
|
|
124
|
+
### How to Use AskUserQuestion Tool
|
|
125
|
+
|
|
126
|
+
The AskUserQuestion tool allows you to prompt the user for input. It requires XML invocation format with JSON-structured parameters.
|
|
127
|
+
|
|
128
|
+
**Required Format**:
|
|
129
|
+
```xml
|
|
130
|
+
<invoke name="AskUserQuestion">
|
|
131
|
+
<parameter name="questions">[{
|
|
132
|
+
"question": "Your question text here",
|
|
133
|
+
"header": "Short label (max 12 chars)",
|
|
134
|
+
"multiSelect": false,
|
|
135
|
+
"options": [
|
|
136
|
+
{"label": "Option 1", "description": "Detailed description of option 1"},
|
|
137
|
+
{"label": "Option 2", "description": "Detailed description of option 2"}
|
|
138
|
+
]
|
|
139
|
+
}]</parameter>
|
|
140
|
+
</invoke>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Single Choice Example**:
|
|
144
|
+
```xml
|
|
145
|
+
<invoke name="AskUserQuestion">
|
|
146
|
+
<parameter name="questions">[{
|
|
147
|
+
"question": "Which feature would you like to configure?",
|
|
148
|
+
"header": "Feature",
|
|
149
|
+
"multiSelect": false,
|
|
150
|
+
"options": [
|
|
151
|
+
{"label": "Git Repository", "description": "Initialize git and add remote"},
|
|
152
|
+
{"label": "Attribution Settings", "description": "Configure CLAUDE.md attribution policy"},
|
|
153
|
+
{"label": "Hooks System", "description": "Set up event-driven automation"},
|
|
154
|
+
{"label": "Auto-Archival", "description": "Manage status.json file size"},
|
|
155
|
+
{"label": "CI/CD", "description": "Set up automated testing"}
|
|
156
|
+
]
|
|
157
|
+
}]</parameter>
|
|
158
|
+
</invoke>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Multiple Choice Example**:
|
|
162
|
+
```xml
|
|
163
|
+
<invoke name="AskUserQuestion">
|
|
164
|
+
<parameter name="questions">[{
|
|
165
|
+
"question": "Which features would you like to configure? (Select multiple)",
|
|
166
|
+
"header": "Features",
|
|
167
|
+
"multiSelect": true,
|
|
168
|
+
"options": [
|
|
169
|
+
{"label": "Git Repository", "description": "Initialize git and add remote"},
|
|
170
|
+
{"label": "Attribution Settings", "description": "Configure CLAUDE.md attribution policy"},
|
|
171
|
+
{"label": "Hooks System", "description": "Set up event-driven automation"},
|
|
172
|
+
{"label": "Auto-Archival", "description": "Manage status.json file size"},
|
|
173
|
+
{"label": "CI/CD", "description": "Set up automated testing"}
|
|
174
|
+
]
|
|
175
|
+
}]</parameter>
|
|
176
|
+
</invoke>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**User Response**: User automatically gets an "Other" option for custom text input. You can use this for custom values.
|
|
180
|
+
|
|
181
|
+
### Configuration Menu Prompt
|
|
182
|
+
|
|
183
|
+
Use AskUserQuestion to let user select features:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
Which features would you like to configure?
|
|
187
|
+
|
|
188
|
+
Available options:
|
|
189
|
+
1. Git Repository (initialize and add remote)
|
|
190
|
+
2. Attribution Settings (CLAUDE.md git attribution policy)
|
|
191
|
+
3. Hooks System (event-driven automation)
|
|
192
|
+
4. Auto-Archival (status.json size management)
|
|
193
|
+
5. CI/CD (automated testing and quality checks)
|
|
194
|
+
|
|
195
|
+
You can select multiple options. Features already configured are marked with ✅.
|
|
196
|
+
|
|
197
|
+
Current status:
|
|
198
|
+
- Git Repository: [✅ Configured / ❌ Not configured]
|
|
199
|
+
- Attribution: [✅ Configured / ⚠️ Needs setup]
|
|
200
|
+
- Hooks System: [✅ Configured / ❌ Not configured]
|
|
201
|
+
- Auto-Archival: [✅ Configured / ❌ Not configured]
|
|
202
|
+
- CI/CD: [✅ Configured / ❌ Not configured]
|
|
203
|
+
|
|
204
|
+
Select features to configure:
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Important**: Use the AskUserQuestion tool with `"multiSelect": true` in the JSON parameters to allow users to select multiple features at once.
|
|
208
|
+
|
|
209
|
+
## Spawning Configuration Agents
|
|
210
|
+
|
|
211
|
+
Based on user selections, spawn appropriate agents using the **Task tool**:
|
|
212
|
+
|
|
213
|
+
### Agent Spawn Examples
|
|
214
|
+
|
|
215
|
+
#### Git Configuration Agent
|
|
216
|
+
|
|
217
|
+
```javascript
|
|
218
|
+
Task({
|
|
219
|
+
subagent_type: "AgileFlow:agents:configuration:git-config",
|
|
220
|
+
description: "Configure git repository",
|
|
221
|
+
prompt: "Set up git repository initialization and remote configuration for this AgileFlow project. Detect current git status, ask user for remote URL if needed, and update metadata."
|
|
222
|
+
})
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### Attribution Agent
|
|
226
|
+
|
|
227
|
+
```javascript
|
|
228
|
+
Task({
|
|
229
|
+
subagent_type: "AgileFlow:agents:configuration:attribution",
|
|
230
|
+
description: "Configure attribution policy",
|
|
231
|
+
prompt: "Configure CLAUDE.md with user's git attribution preferences. Ask if they want to disable Claude Code attribution in commits, then create or update CLAUDE.md accordingly."
|
|
232
|
+
})
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### Hooks System Agent
|
|
236
|
+
|
|
237
|
+
```javascript
|
|
238
|
+
Task({
|
|
239
|
+
subagent_type: "AgileFlow:agents:configuration:hooks",
|
|
240
|
+
description: "Configure hooks system",
|
|
241
|
+
prompt: "Set up the hooks system for event-driven automation. Create .claude/settings.json with SessionStart welcome hook, deploy get-env.js helper, update .gitignore, and document in CLAUDE.md."
|
|
242
|
+
})
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### Auto-Archival Agent
|
|
246
|
+
|
|
247
|
+
```javascript
|
|
248
|
+
Task({
|
|
249
|
+
subagent_type: "AgileFlow:agents:configuration:archival",
|
|
250
|
+
description: "Configure auto-archival",
|
|
251
|
+
prompt: "Configure auto-archival system for status.json size management. Ask user for archival threshold (3/7/14/30 days), deploy archival scripts, add SessionStart hook, and document in CLAUDE.md."
|
|
252
|
+
})
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### CI/CD Agent
|
|
256
|
+
|
|
257
|
+
```javascript
|
|
258
|
+
Task({
|
|
259
|
+
subagent_type: "AgileFlow:agents:configuration:ci",
|
|
260
|
+
description: "Configure CI/CD workflow",
|
|
261
|
+
prompt: "Set up CI/CD workflow for automated testing and quality checks. Ask user for CI provider (GitHub Actions, GitLab CI, CircleCI), detect project type, ask which commands to run (tests, lint, build), create workflow file, and document in CLAUDE.md."
|
|
262
|
+
})
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Parallel Execution
|
|
266
|
+
|
|
267
|
+
**CRITICAL**: Spawn multiple agents in a **single message** for parallel execution:
|
|
268
|
+
|
|
269
|
+
```javascript
|
|
270
|
+
// ✅ CORRECT - All agents run in parallel (fast)
|
|
271
|
+
Task({ subagent_type: "AgileFlow:agents:configuration:git-config", ... })
|
|
272
|
+
Task({ subagent_type: "AgileFlow:agents:configuration:attribution", ... })
|
|
273
|
+
Task({ subagent_type: "AgileFlow:agents:configuration:hooks", ... })
|
|
274
|
+
|
|
275
|
+
// ❌ WRONG - Sequential execution (slow)
|
|
276
|
+
// Spawning agents in separate messages
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**Exception**: Auto-archival agent REQUIRES hooks system to be configured first (dependency). Run it sequentially AFTER hooks if both are selected.
|
|
280
|
+
|
|
281
|
+
### Agent Dependencies
|
|
282
|
+
|
|
283
|
+
Some agents have dependencies:
|
|
284
|
+
- **Auto-Archival** depends on **Hooks System** (needs .claude/settings.json to exist)
|
|
285
|
+
- **Git Config**, **Attribution**, and **CI/CD** are independent (can run in parallel)
|
|
286
|
+
|
|
287
|
+
**Execution Strategy**:
|
|
288
|
+
1. If user selects Git + Attribution + CI: Run in parallel (no dependencies)
|
|
289
|
+
2. If user selects Hooks + Archival: Run hooks FIRST, then archival (dependency)
|
|
290
|
+
3. If user selects all 5: Run Git + Attribution + CI in parallel, wait, then run Hooks, wait, then run Archival
|
|
291
|
+
|
|
292
|
+
## Agent Result Handling
|
|
293
|
+
|
|
294
|
+
After agents complete, display summary:
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
✅ Configuration Complete!
|
|
298
|
+
|
|
299
|
+
Results:
|
|
300
|
+
- Git Repository: [✅ Configured / ❌ Failed / ⏭️ Skipped]
|
|
301
|
+
- Attribution Settings: [✅ Configured / ❌ Failed / ⏭️ Skipped]
|
|
302
|
+
- Hooks System: [✅ Configured / ❌ Failed / ⏭️ Skipped]
|
|
303
|
+
- Auto-Archival: [✅ Configured / ❌ Failed / ⏭️ Skipped]
|
|
304
|
+
- CI/CD: [✅ Configured / ❌ Failed / ⏭️ Skipped]
|
|
305
|
+
|
|
306
|
+
Next steps:
|
|
307
|
+
[Agent-specific next steps from results]
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## Features Already Configured
|
|
311
|
+
|
|
312
|
+
If a feature is already fully configured (detected in detection phase), you can:
|
|
313
|
+
- Still show it in the menu (let user reconfigure)
|
|
314
|
+
- OR filter it out and only show unconfigured features
|
|
315
|
+
|
|
316
|
+
**Recommended**: Show all features but mark configured ones with ✅ in the menu.
|
|
317
|
+
|
|
318
|
+
## Error Handling
|
|
319
|
+
|
|
320
|
+
If an agent fails:
|
|
321
|
+
- Report the failure clearly
|
|
322
|
+
- Continue with other agents (don't abort entire configuration)
|
|
323
|
+
- Suggest manual steps if automated configuration failed
|
|
324
|
+
|
|
325
|
+
## What Gets Configured
|
|
326
|
+
|
|
327
|
+
### 1. Git Repository (git-config agent)
|
|
328
|
+
- Initialize git repository (`git init`)
|
|
329
|
+
- Add remote origin (`git remote add origin <URL>`)
|
|
330
|
+
- Update `docs/00-meta/agileflow-metadata.json` with git config
|
|
331
|
+
- Print next steps (commit, push)
|
|
332
|
+
|
|
333
|
+
### 2. Attribution Settings (attribution agent)
|
|
334
|
+
- Ask user: Disable attribution? (yes/no)
|
|
335
|
+
- Create or update CLAUDE.md with attribution policy
|
|
336
|
+
- If disabled: Add CRITICAL section forbidding AI attribution
|
|
337
|
+
- If enabled: Keep default behavior (or remove disable rule if exists)
|
|
338
|
+
|
|
339
|
+
### 3. Hooks System (hooks agent)
|
|
340
|
+
- Create `.claude/` and `scripts/` directories
|
|
341
|
+
- Deploy `scripts/get-env.js` helper
|
|
342
|
+
- Create `.claude/settings.json` with SessionStart welcome hook
|
|
343
|
+
- Update `.gitignore` with .claude user-specific files
|
|
344
|
+
- Create `.claude/settings.local.example.json` template
|
|
345
|
+
- Document in CLAUDE.md
|
|
346
|
+
- **CRITICAL**: Remind user to restart Claude Code
|
|
347
|
+
|
|
348
|
+
### 4. Auto-Archival (archival agent)
|
|
349
|
+
- Ask user for archival threshold (3/7/14/30 days or custom)
|
|
350
|
+
- Update `docs/00-meta/agileflow-metadata.json` with threshold
|
|
351
|
+
- Deploy `scripts/archive-completed-stories.sh`
|
|
352
|
+
- Deploy `scripts/compress-status.sh` (v2.20.0+)
|
|
353
|
+
- Add SessionStart hook to `.claude/settings.json`
|
|
354
|
+
- Document in CLAUDE.md
|
|
355
|
+
|
|
356
|
+
### 5. CI/CD (ci agent)
|
|
357
|
+
- Ask user for CI provider (GitHub Actions, GitLab CI, CircleCI, or skip)
|
|
358
|
+
- Detect project type and available commands
|
|
359
|
+
- Ask which commands to run in CI (tests, lint, type-check, build)
|
|
360
|
+
- Ask for specific command strings for each selected command
|
|
361
|
+
- Create workflow file (`.github/workflows/ci.yml`, `.gitlab-ci.yml`, or `.circleci/config.yml`)
|
|
362
|
+
- Document in CLAUDE.md with CI status, badge URL, and troubleshooting
|
|
363
|
+
|
|
364
|
+
## Example Workflow
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
1. User runs: /AgileFlow:configure
|
|
368
|
+
|
|
369
|
+
2. Orchestrator detects current status:
|
|
370
|
+
✅ Git initialized
|
|
371
|
+
⚠️ Git remote not configured
|
|
372
|
+
⚠️ CLAUDE.md not found
|
|
373
|
+
❌ Hooks system not configured
|
|
374
|
+
❌ Auto-archival not configured
|
|
375
|
+
❌ CI/CD not configured
|
|
376
|
+
|
|
377
|
+
3. Orchestrator presents menu using AskUserQuestion:
|
|
378
|
+
"Select features to configure: [Git Repository, Attribution Settings, Hooks System, Auto-Archival, CI/CD]"
|
|
379
|
+
|
|
380
|
+
4. User selects: ["Attribution Settings", "Hooks System", "CI/CD"]
|
|
381
|
+
|
|
382
|
+
5. Orchestrator spawns agents:
|
|
383
|
+
Phase 1 (parallel): Attribution + CI/CD
|
|
384
|
+
Phase 2 (after phase 1): Hooks
|
|
385
|
+
- AgileFlow:agents:configuration:attribution
|
|
386
|
+
- AgileFlow:agents:configuration:ci
|
|
387
|
+
- AgileFlow:agents:configuration:hooks
|
|
388
|
+
|
|
389
|
+
6. Agents execute (user waits and answers prompts)
|
|
390
|
+
|
|
391
|
+
7. Orchestrator displays results:
|
|
392
|
+
✅ Attribution Settings configured (disabled AI attribution)
|
|
393
|
+
✅ CI/CD configured (GitHub Actions with tests + lint)
|
|
394
|
+
✅ Hooks System configured
|
|
395
|
+
🔴 REMINDER: Restart Claude Code for hooks to take effect!
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
## Rules
|
|
399
|
+
|
|
400
|
+
- ALWAYS run detection phase first
|
|
401
|
+
- Use AskUserQuestion tool for interactive menus
|
|
402
|
+
- Spawn agents in parallel when possible (single message)
|
|
403
|
+
- Respect agent dependencies (hooks before archival)
|
|
404
|
+
- Display clear results summary after completion
|
|
405
|
+
- Remind user to restart Claude Code if hooks were configured
|
|
406
|
+
- Be idempotent (safe to run multiple times)
|
|
407
|
+
|
|
408
|
+
## Output
|
|
409
|
+
|
|
410
|
+
- Detection summary (current configuration status)
|
|
411
|
+
- Interactive menu (via AskUserQuestion)
|
|
412
|
+
- Agent spawn confirmations
|
|
413
|
+
- Final results summary
|
|
414
|
+
- Next steps (agent-specific guidance)
|
|
415
|
+
- **CRITICAL reminder** if hooks configured: "🔴 RESTART CLAUDE CODE NOW!"
|