agileflow 2.91.0 → 2.92.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/CHANGELOG.md +5 -0
- package/README.md +3 -3
- package/lib/README.md +178 -0
- package/lib/codebase-indexer.js +31 -23
- package/lib/colors.js +190 -12
- package/lib/consent.js +232 -0
- package/lib/correlation.js +277 -0
- package/lib/error-codes.js +46 -0
- package/lib/errors.js +48 -6
- package/lib/file-cache.js +182 -0
- package/lib/format-error.js +156 -0
- package/lib/path-resolver.js +155 -7
- package/lib/paths.js +212 -20
- package/lib/placeholder-registry.js +205 -0
- package/lib/registry-di.js +358 -0
- package/lib/result-schema.js +363 -0
- package/lib/result.js +210 -0
- package/lib/session-registry.js +13 -0
- package/lib/session-state-machine.js +465 -0
- package/lib/validate-commands.js +308 -0
- package/lib/validate.js +116 -52
- package/package.json +1 -1
- package/scripts/af +34 -0
- package/scripts/agent-loop.js +63 -9
- package/scripts/agileflow-configure.js +2 -2
- package/scripts/agileflow-welcome.js +435 -23
- package/scripts/archive-completed-stories.sh +57 -11
- package/scripts/claude-tmux.sh +102 -0
- package/scripts/damage-control-bash.js +3 -70
- package/scripts/damage-control-edit.js +3 -20
- package/scripts/damage-control-write.js +3 -20
- package/scripts/dependency-check.js +310 -0
- package/scripts/get-env.js +11 -4
- package/scripts/lib/configure-detect.js +23 -1
- package/scripts/lib/configure-features.js +43 -2
- package/scripts/lib/context-formatter.js +771 -0
- package/scripts/lib/context-loader.js +699 -0
- package/scripts/lib/damage-control-utils.js +107 -0
- package/scripts/lib/json-utils.sh +162 -0
- package/scripts/lib/state-migrator.js +353 -0
- package/scripts/lib/story-state-machine.js +437 -0
- package/scripts/obtain-context.js +80 -1248
- package/scripts/pre-push-check.sh +46 -0
- package/scripts/precompact-context.sh +23 -10
- package/scripts/query-codebase.js +122 -14
- package/scripts/ralph-loop.js +5 -5
- package/scripts/session-manager.js +220 -42
- package/scripts/spawn-parallel.js +651 -0
- package/scripts/tui/blessed/data/watcher.js +20 -15
- package/scripts/tui/blessed/index.js +2 -2
- package/scripts/tui/blessed/panels/output.js +14 -8
- package/scripts/tui/blessed/panels/sessions.js +22 -15
- package/scripts/tui/blessed/panels/trace.js +14 -8
- package/scripts/tui/blessed/ui/help.js +3 -3
- package/scripts/tui/blessed/ui/screen.js +4 -4
- package/scripts/tui/blessed/ui/statusbar.js +5 -9
- package/scripts/tui/blessed/ui/tabbar.js +11 -11
- package/scripts/validators/component-validator.js +41 -14
- package/scripts/validators/json-schema-validator.js +11 -4
- package/scripts/validators/markdown-validator.js +1 -2
- package/scripts/validators/migration-validator.js +17 -5
- package/scripts/validators/security-validator.js +137 -33
- package/scripts/validators/story-format-validator.js +31 -10
- package/scripts/validators/test-result-validator.js +19 -4
- package/scripts/validators/workflow-validator.js +12 -5
- package/src/core/agents/codebase-query.md +24 -0
- package/src/core/commands/adr.md +114 -0
- package/src/core/commands/agent.md +120 -0
- package/src/core/commands/assign.md +145 -0
- package/src/core/commands/babysit.md +32 -5
- package/src/core/commands/changelog.md +118 -0
- package/src/core/commands/configure.md +42 -6
- package/src/core/commands/diagnose.md +114 -0
- package/src/core/commands/epic.md +113 -0
- package/src/core/commands/handoff.md +128 -0
- package/src/core/commands/help.md +75 -0
- package/src/core/commands/pr.md +96 -0
- package/src/core/commands/roadmap/analyze.md +400 -0
- package/src/core/commands/session/new.md +113 -6
- package/src/core/commands/session/spawn.md +197 -0
- package/src/core/commands/sprint.md +22 -0
- package/src/core/commands/status.md +74 -0
- package/src/core/commands/story.md +143 -4
- package/src/core/templates/agileflow-metadata.json +55 -2
- package/src/core/templates/plan-template.md +125 -0
- package/src/core/templates/story-lifecycle.md +213 -0
- package/src/core/templates/story-template.md +4 -0
- package/src/core/templates/tdd-test-template.js +241 -0
- package/tools/cli/commands/setup.js +86 -0
- package/tools/cli/installers/core/installer.js +94 -0
- package/tools/cli/installers/ide/_base-ide.js +20 -11
- package/tools/cli/installers/ide/codex.js +29 -47
- package/tools/cli/lib/config-manager.js +17 -2
- package/tools/cli/lib/content-transformer.js +271 -0
- package/tools/cli/lib/error-handler.js +14 -22
- package/tools/cli/lib/ide-error-factory.js +421 -0
- package/tools/cli/lib/ide-health-monitor.js +364 -0
- package/tools/cli/lib/ide-registry.js +114 -1
- package/tools/cli/lib/ui.js +14 -25
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Spawn multiple parallel Claude Code sessions in git worktrees
|
|
3
|
+
argument-hint: [--count N | --branches a,b,c | --from-epic EP-XXX]
|
|
4
|
+
compact_context:
|
|
5
|
+
priority: high
|
|
6
|
+
preserve_rules:
|
|
7
|
+
- "ACTIVE COMMAND: /agileflow:session:spawn - Spawn multiple parallel sessions"
|
|
8
|
+
- "Creates multiple git worktrees with session-manager.js"
|
|
9
|
+
- "Auto-copies .env files to each worktree"
|
|
10
|
+
- "Optionally spawns Claude in tmux windows"
|
|
11
|
+
- "Options: --count N, --branches 'a,b,c', --from-epic EP-XXX"
|
|
12
|
+
- "Flags: --init (run claude init), --dangerous (skip permissions), --no-tmux"
|
|
13
|
+
state_fields:
|
|
14
|
+
- session_count
|
|
15
|
+
- branches_list
|
|
16
|
+
- epic_id
|
|
17
|
+
- tmux_session_name
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# /agileflow:session:spawn
|
|
21
|
+
|
|
22
|
+
Spawn multiple parallel Claude Code sessions in git worktrees with optional tmux integration.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Purpose
|
|
27
|
+
|
|
28
|
+
When you need to run multiple Claude Code instances in parallel on isolated tasks, this command:
|
|
29
|
+
- Creates N git worktrees (each with its own branch)
|
|
30
|
+
- Auto-copies `.env` files to each worktree
|
|
31
|
+
- Optionally spawns Claude in tmux windows for easy navigation
|
|
32
|
+
- Tracks all sessions in the session registry
|
|
33
|
+
|
|
34
|
+
Based on the [git worktrees parallel sessions research](../../../10-research/20260121-claude-code-git-worktrees-parallel.md).
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## IMMEDIATE ACTIONS
|
|
39
|
+
|
|
40
|
+
Upon invocation, execute these steps:
|
|
41
|
+
|
|
42
|
+
### Step 1: Parse Arguments
|
|
43
|
+
|
|
44
|
+
Extract from ARGUMENTS:
|
|
45
|
+
- `--count N` - Number of sessions to create (e.g., `--count 4`)
|
|
46
|
+
- `--branches "a,b,c"` - Specific branch names (comma-separated)
|
|
47
|
+
- `--from-epic EP-XXX` - Create sessions for ready stories in epic
|
|
48
|
+
- `--init` - Run `claude init` in each worktree
|
|
49
|
+
- `--dangerous` - Use `--dangerouslySkipPermissions`
|
|
50
|
+
- `--no-tmux` - Just create worktrees, output commands manually
|
|
51
|
+
|
|
52
|
+
At least one of `--count`, `--branches`, or `--from-epic` is required.
|
|
53
|
+
|
|
54
|
+
### Step 2: Create Todo List
|
|
55
|
+
|
|
56
|
+
```xml
|
|
57
|
+
<invoke name="TodoWrite">
|
|
58
|
+
<parameter name="todos">[
|
|
59
|
+
{"content": "Validate arguments", "status": "in_progress", "activeForm": "Validating arguments"},
|
|
60
|
+
{"content": "Create parallel sessions", "status": "pending", "activeForm": "Creating sessions"},
|
|
61
|
+
{"content": "Spawn in tmux (if applicable)", "status": "pending", "activeForm": "Spawning in tmux"},
|
|
62
|
+
{"content": "Display navigation help", "status": "pending", "activeForm": "Displaying help"}
|
|
63
|
+
]</parameter>
|
|
64
|
+
</invoke>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Step 3: Run Spawn Script
|
|
68
|
+
|
|
69
|
+
Build the command based on arguments:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Example: Create 4 sessions
|
|
73
|
+
node .agileflow/scripts/spawn-parallel.js spawn --count 4
|
|
74
|
+
|
|
75
|
+
# Example: Create from branches
|
|
76
|
+
node .agileflow/scripts/spawn-parallel.js spawn --branches "auth,dashboard,api"
|
|
77
|
+
|
|
78
|
+
# Example: Create from epic
|
|
79
|
+
node .agileflow/scripts/spawn-parallel.js spawn --from-epic EP-0025
|
|
80
|
+
|
|
81
|
+
# Example: With init and no tmux
|
|
82
|
+
node .agileflow/scripts/spawn-parallel.js spawn --count 3 --init --no-tmux
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Step 4: Display Results
|
|
86
|
+
|
|
87
|
+
The script will output:
|
|
88
|
+
- Created session IDs and paths
|
|
89
|
+
- Copied env files
|
|
90
|
+
- Tmux session name and navigation keys (if tmux available)
|
|
91
|
+
- Manual commands (if --no-tmux or no tmux available)
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Examples
|
|
96
|
+
|
|
97
|
+
### Create 4 Generic Parallel Sessions
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
/agileflow:session:spawn --count 4
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Creates:
|
|
104
|
+
- `../Project-1/` (branch: parallel-1)
|
|
105
|
+
- `../Project-2/` (branch: parallel-2)
|
|
106
|
+
- `../Project-3/` (branch: parallel-3)
|
|
107
|
+
- `../Project-4/` (branch: parallel-4)
|
|
108
|
+
|
|
109
|
+
### Create Sessions for Specific Features
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
/agileflow:session:spawn --branches "auth,dashboard,api,admin"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Creates:
|
|
116
|
+
- `../Project-auth/` (branch: feature/auth)
|
|
117
|
+
- `../Project-dashboard/` (branch: feature/dashboard)
|
|
118
|
+
- `../Project-api/` (branch: feature/api)
|
|
119
|
+
- `../Project-admin/` (branch: feature/admin)
|
|
120
|
+
|
|
121
|
+
### Create Sessions from Epic Stories
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
/agileflow:session:spawn --from-epic EP-0025
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Creates one session per "ready" story in the epic.
|
|
128
|
+
|
|
129
|
+
### With Claude Init (Primes Context)
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
/agileflow:session:spawn --count 2 --init
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Runs `claude init` in each worktree to generate CLAUDE.md with project context.
|
|
136
|
+
|
|
137
|
+
### Without Tmux (Manual Mode)
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
/agileflow:session:spawn --count 4 --no-tmux
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Just creates worktrees and outputs commands to run manually.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Tmux Navigation
|
|
148
|
+
|
|
149
|
+
If tmux is available, the script creates a tmux session with one window per Claude instance:
|
|
150
|
+
|
|
151
|
+
| Key | Action |
|
|
152
|
+
|-----|--------|
|
|
153
|
+
| `Ctrl+b n` | Next window |
|
|
154
|
+
| `Ctrl+b p` | Previous window |
|
|
155
|
+
| `Ctrl+b 0-9` | Go to window N |
|
|
156
|
+
| `Ctrl+b d` | Detach (sessions keep running) |
|
|
157
|
+
| `tmux attach -t <name>` | Reattach to session |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Managing Spawned Sessions
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# List all parallel sessions
|
|
165
|
+
/agileflow:session:status
|
|
166
|
+
|
|
167
|
+
# Check on a specific session
|
|
168
|
+
/agileflow:session:resume 2
|
|
169
|
+
|
|
170
|
+
# End and merge a session
|
|
171
|
+
/agileflow:session:end 3 --merge
|
|
172
|
+
|
|
173
|
+
# Kill all tmux parallel sessions
|
|
174
|
+
node .agileflow/scripts/spawn-parallel.js kill-all
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Environment Files
|
|
180
|
+
|
|
181
|
+
The following files are automatically copied to each worktree:
|
|
182
|
+
- `.env`
|
|
183
|
+
- `.env.local`
|
|
184
|
+
- `.env.development`
|
|
185
|
+
- `.env.test`
|
|
186
|
+
- `.env.production`
|
|
187
|
+
|
|
188
|
+
This ensures each Claude instance has access to necessary environment variables.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Related Commands
|
|
193
|
+
|
|
194
|
+
- `/agileflow:session:new` - Create a single parallel session interactively
|
|
195
|
+
- `/agileflow:session:status` - View all sessions
|
|
196
|
+
- `/agileflow:session:end` - End a session with optional merge
|
|
197
|
+
- `/agileflow:session:resume` - Switch to another session
|
|
@@ -563,6 +563,28 @@ Committed: X stories, Y.Z estimated days (Y% of capacity)
|
|
|
563
563
|
- Has 1 story in review (US-0038) likely to complete soon
|
|
564
564
|
- If US-0038 completes early, can pick up deferred US-0055
|
|
565
565
|
|
|
566
|
+
🔀 PARALLELIZATION ANALYSIS
|
|
567
|
+
---------------------------
|
|
568
|
+
Stories grouped by execution phase for multi-session workflows:
|
|
569
|
+
|
|
570
|
+
Phase 1 (Sequential - Foundation):
|
|
571
|
+
These must complete first - no dependencies, prerequisite for others.
|
|
572
|
+
- US-0043: POST /auth/login endpoint (AG-API)
|
|
573
|
+
|
|
574
|
+
Phase 2 (Parallel-eligible):
|
|
575
|
+
Can run in separate Claude Code sessions simultaneously.
|
|
576
|
+
All depend only on Phase 1 completion.
|
|
577
|
+
- US-0042: User login form (Session A)
|
|
578
|
+
- US-0045: User profile page (Session B)
|
|
579
|
+
└─ Run `/agileflow:session:new` for each parallel task
|
|
580
|
+
|
|
581
|
+
Phase 3 (Integration - Sequential):
|
|
582
|
+
Must wait for Phase 2 completion.
|
|
583
|
+
- US-0050: E2E tests for auth flow (depends on Phase 2)
|
|
584
|
+
|
|
585
|
+
💡 For multi-session work, create plan.md with:
|
|
586
|
+
`/agileflow:templates/plan-template.md` or copy from templates/
|
|
587
|
+
|
|
566
588
|
💡 RECOMMENDATIONS
|
|
567
589
|
------------------
|
|
568
590
|
1. Sequence stories: US-0043 (AG-API) → US-0042 (AG-UI) → US-0050 (AG-CI)
|
|
@@ -337,3 +337,77 @@ Claude:
|
|
|
337
337
|
- "Final summary of what was delivered"
|
|
338
338
|
- "Any technical debt introduced?"
|
|
339
339
|
- "Lessons learned?"
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## Expected Output
|
|
344
|
+
|
|
345
|
+
### Successful Status Update
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
📋 Status Update for US-0042
|
|
349
|
+
|
|
350
|
+
Current: ready (plan phase)
|
|
351
|
+
New: in-progress (execute phase)
|
|
352
|
+
|
|
353
|
+
docs/09-agents/status.json
|
|
354
|
+
───────────────────────────
|
|
355
|
+
- "status": "ready",
|
|
356
|
+
- "phase": "plan",
|
|
357
|
+
+ "status": "in-progress",
|
|
358
|
+
+ "phase": "execute",
|
|
359
|
+
+ "summary": "Started work on login form",
|
|
360
|
+
+ "last_update": "2026-01-21T14:30:00Z"
|
|
361
|
+
|
|
362
|
+
[AskUserQuestion: "Update US-0042 to in-progress?"]
|
|
363
|
+
|
|
364
|
+
✅ Status updated: US-0042 → in-progress
|
|
365
|
+
✅ Bus message sent to: ALL
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### With Phase Handoff
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
📋 Phase Transition Detected: plan → execute
|
|
372
|
+
|
|
373
|
+
Before updating status, let's capture a handoff summary.
|
|
374
|
+
|
|
375
|
+
[AskUserQuestion: "What's the plan for implementing this story?"]
|
|
376
|
+
|
|
377
|
+
User: "Adding login form with email/password validation"
|
|
378
|
+
|
|
379
|
+
✅ Handoff captured
|
|
380
|
+
|
|
381
|
+
docs/09-agents/status.json
|
|
382
|
+
───────────────────────────
|
|
383
|
+
- "status": "ready",
|
|
384
|
+
+ "status": "in-progress",
|
|
385
|
+
+ "summary": "Adding login form with email/password validation"
|
|
386
|
+
|
|
387
|
+
[AskUserQuestion: "Update US-0042 to in-progress?"]
|
|
388
|
+
|
|
389
|
+
✅ Status updated: US-0042 → in-progress
|
|
390
|
+
✅ Phase handoff logged: plan → execute
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Validation Error
|
|
394
|
+
|
|
395
|
+
```
|
|
396
|
+
❌ Invalid status value: "in_progress"
|
|
397
|
+
|
|
398
|
+
Valid values are:
|
|
399
|
+
• ready - Story ready to start
|
|
400
|
+
• in-progress - Currently being worked on
|
|
401
|
+
• blocked - Waiting on dependency
|
|
402
|
+
• in-review - Code review/PR in progress
|
|
403
|
+
• done - Completed and verified
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### JSON Corruption Recovery
|
|
407
|
+
|
|
408
|
+
```
|
|
409
|
+
❌ ERROR: status.json is now invalid JSON after update!
|
|
410
|
+
|
|
411
|
+
Fix: Restoring from backup: docs/09-agents/status.json.backup
|
|
412
|
+
✅ Backup restored successfully
|
|
413
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Create a user story with acceptance criteria
|
|
3
|
-
argument-hint: EPIC=<EP-ID> STORY=<US-ID> TITLE=<text> OWNER=<id> [ESTIMATE=<pts>] [AC=<list>]
|
|
3
|
+
argument-hint: EPIC=<EP-ID> STORY=<US-ID> TITLE=<text> OWNER=<id> [ESTIMATE=<pts>] [AC=<list>] [TDD=true]
|
|
4
4
|
compact_context:
|
|
5
5
|
priority: high
|
|
6
6
|
preserve_rules:
|
|
@@ -12,12 +12,17 @@ compact_context:
|
|
|
12
12
|
- "MUST use AskUserQuestion for user confirmation (YES/NO/CANCEL format)"
|
|
13
13
|
- "MUST create test stub in docs/07-testing/test-cases/<STORY>.md referencing AC"
|
|
14
14
|
- "AC format: Given/When/Then bullets (user story format)"
|
|
15
|
+
- "TDD=true: Generate framework-specific test code BEFORE implementation"
|
|
16
|
+
- "TDD=true: Parse Given/When/Then into describe/it blocks (Jest) or test functions (pytest)"
|
|
17
|
+
- "TDD=true: All tests start as .skip or @pytest.mark.skip (pending)"
|
|
18
|
+
- "TDD=true: Add tdd_mode:true and test_file fields to status.json entry"
|
|
15
19
|
state_fields:
|
|
16
20
|
- story_id
|
|
17
21
|
- epic_id
|
|
18
22
|
- owner
|
|
19
23
|
- estimate
|
|
20
24
|
- ac_count
|
|
25
|
+
- tdd_mode
|
|
21
26
|
---
|
|
22
27
|
|
|
23
28
|
# story-new
|
|
@@ -44,7 +49,7 @@ node .agileflow/scripts/obtain-context.js story
|
|
|
44
49
|
|
|
45
50
|
### 🚨 RULE #1: ALWAYS Create TodoWrite Task List FIRST
|
|
46
51
|
|
|
47
|
-
Create a
|
|
52
|
+
Create a task list IMMEDIATELY (7 steps if TDD=true, 6 steps otherwise):
|
|
48
53
|
```xml
|
|
49
54
|
<invoke name="TodoWrite">
|
|
50
55
|
<parameter name="content">1. Parse inputs (EPIC, STORY, TITLE, OWNER, ESTIMATE, AC)
|
|
@@ -94,7 +99,45 @@ Test stub MUST reference AC:
|
|
|
94
99
|
- Map each test to an AC bullet
|
|
95
100
|
- Use BDD format (describe, test cases for each AC)
|
|
96
101
|
|
|
97
|
-
### 🚨 RULE #5:
|
|
102
|
+
### 🚨 RULE #5: TDD MODE (Smart Defaults)
|
|
103
|
+
|
|
104
|
+
**Smart TDD defaults based on OWNER:**
|
|
105
|
+
| Owner | Default | Rationale |
|
|
106
|
+
|-------|---------|-----------|
|
|
107
|
+
| AG-API, AG-UI, AG-DATABASE | TDD=true | Code-focused, tests critical |
|
|
108
|
+
| AG-TESTING, AG-SECURITY, AG-PERFORMANCE | TDD=true | Quality-focused |
|
|
109
|
+
| AG-DOCUMENTATION, AG-RESEARCH, AG-PRODUCT | TDD=false | Non-code work |
|
|
110
|
+
| AG-DEVOPS, AG-CI | TDD=false | Infrastructure, config |
|
|
111
|
+
| Other/Custom | TDD=false | Explicit opt-in |
|
|
112
|
+
|
|
113
|
+
**Override:** User can always specify `TDD=true` or `TDD=false` explicitly.
|
|
114
|
+
|
|
115
|
+
When TDD mode is active, generate framework-specific test code:
|
|
116
|
+
|
|
117
|
+
**Workflow:**
|
|
118
|
+
1. Detect test framework from `environment.json` or `package.json`
|
|
119
|
+
2. Parse AC into Given/When/Then structure
|
|
120
|
+
3. Generate test file using `tdd-test-template.js`
|
|
121
|
+
4. Create test in `__tests__/<STORY>.test.ts` (Jest) or `tests/test_<STORY>.py` (pytest)
|
|
122
|
+
5. All tests start as `.skip` (pending)
|
|
123
|
+
6. Add `tdd_mode: true` and `test_file` to status.json entry
|
|
124
|
+
7. Add TDD badge to story file
|
|
125
|
+
|
|
126
|
+
**Test File Location:**
|
|
127
|
+
- Jest/Vitest: `__tests__/<STORY_ID>.test.ts`
|
|
128
|
+
- pytest: `tests/test_<STORY_ID>.py`
|
|
129
|
+
- Go: `<package>/<STORY_ID>_test.go`
|
|
130
|
+
|
|
131
|
+
**Status.json Entry (TDD mode):**
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"tdd_mode": true,
|
|
135
|
+
"test_file": "__tests__/US-0042.test.ts",
|
|
136
|
+
"test_status": "not_run"
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 🚨 RULE #6: NEVER Use echo/cat > For JSON Operations
|
|
98
141
|
|
|
99
142
|
**ALWAYS use**:
|
|
100
143
|
- Edit tool for small changes
|
|
@@ -114,6 +157,7 @@ OWNER=<id> # Agent or person name (required)
|
|
|
114
157
|
ESTIMATE=<time> # e.g., 0.5d, 2h (optional, default: 1d)
|
|
115
158
|
AC=<bullets> # Given/When/Then format (optional)
|
|
116
159
|
DEPENDENCIES=[<list>] # Dependent story IDs (optional)
|
|
160
|
+
TDD=true|false # TDD mode (smart default: true for code owners, false for docs/research)
|
|
117
161
|
```
|
|
118
162
|
|
|
119
163
|
**Output Files Created**:
|
|
@@ -121,6 +165,7 @@ DEPENDENCIES=[<list>] # Dependent story IDs (optional)
|
|
|
121
165
|
|------|---------|----------|
|
|
122
166
|
| docs/06-stories/EP-<ID>/US-<ID>-<slug>.md | Story with AC | story-template.md |
|
|
123
167
|
| docs/07-testing/test-cases/US-<ID>.md | Test stub | BDD format |
|
|
168
|
+
| __tests__/US-<ID>.test.ts | TDD test code (if TDD=true) | tdd-test-template.js |
|
|
124
169
|
| docs/09-agents/status.json | Story entry | jq merge |
|
|
125
170
|
| docs/09-agents/bus/log.jsonl | Assign event | JSONL line |
|
|
126
171
|
|
|
@@ -202,8 +247,9 @@ DEPENDENCIES=[<list>] # Dependent story IDs (optional)
|
|
|
202
247
|
- ALWAYS create test stub referencing AC
|
|
203
248
|
- ALWAYS preview before confirming (prevents mistakes)
|
|
204
249
|
- ALWAYS validate JSON after merge (prevents corruption)
|
|
205
|
-
- Use TodoWrite for step tracking (6 steps)
|
|
250
|
+
- Use TodoWrite for step tracking (6 steps, or 7 if TDD=true)
|
|
206
251
|
- Files: story file, test file, status.json, bus/log.jsonl
|
|
252
|
+
- **TDD=true**: Also create framework-specific test code in `__tests__/` with pending tests
|
|
207
253
|
|
|
208
254
|
<!-- COMPACT_SUMMARY_END -->
|
|
209
255
|
|
|
@@ -324,3 +370,96 @@ After successfully creating the story, offer next steps:
|
|
|
324
370
|
- `/agileflow:story-validate` - Validate story completeness
|
|
325
371
|
- `/agileflow:status` - Update story status
|
|
326
372
|
- `/agileflow:epic` - Create parent epic
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Expected Output
|
|
377
|
+
|
|
378
|
+
### Successful Story Creation
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
📝 Creating Story: US-0042
|
|
382
|
+
|
|
383
|
+
Epic: EP-0010
|
|
384
|
+
Title: Login Form with Validation
|
|
385
|
+
Owner: AG-UI
|
|
386
|
+
Estimate: 2h
|
|
387
|
+
TDD Mode: true (smart default for AG-UI)
|
|
388
|
+
|
|
389
|
+
Files to create:
|
|
390
|
+
───────────────────────────
|
|
391
|
+
1. docs/06-stories/EP-0010/US-0042-login-form-validation.md
|
|
392
|
+
- Story file with 3 acceptance criteria
|
|
393
|
+
|
|
394
|
+
2. docs/07-testing/test-cases/US-0042.md
|
|
395
|
+
- Test stub referencing AC
|
|
396
|
+
|
|
397
|
+
3. __tests__/US-0042.test.ts (TDD mode)
|
|
398
|
+
- 3 pending test cases from AC
|
|
399
|
+
|
|
400
|
+
4. docs/09-agents/status.json (merge)
|
|
401
|
+
+ "US-0042": {
|
|
402
|
+
+ "id": "US-0042",
|
|
403
|
+
+ "epic": "EP-0010",
|
|
404
|
+
+ "owner": "AG-UI",
|
|
405
|
+
+ "status": "ready",
|
|
406
|
+
+ "estimate": "2h",
|
|
407
|
+
+ "tdd_mode": true,
|
|
408
|
+
+ "test_file": "__tests__/US-0042.test.ts"
|
|
409
|
+
+ }
|
|
410
|
+
|
|
411
|
+
5. docs/09-agents/bus/log.jsonl (append)
|
|
412
|
+
+ {"ts":"...","type":"assign","from":"SYSTEM","to":"AG-UI","story":"US-0042"}
|
|
413
|
+
|
|
414
|
+
[AskUserQuestion: "Create story US-0042: Login Form with Validation?"]
|
|
415
|
+
|
|
416
|
+
✅ Story US-0042 created successfully!
|
|
417
|
+
✅ Test stub created: docs/07-testing/test-cases/US-0042.md
|
|
418
|
+
✅ TDD tests created: __tests__/US-0042.test.ts (3 pending)
|
|
419
|
+
✅ Bus message sent: assign → AG-UI
|
|
420
|
+
|
|
421
|
+
[AskUserQuestion: "What would you like to do next?"]
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Story with Dependencies
|
|
425
|
+
|
|
426
|
+
```
|
|
427
|
+
📝 Creating Story: US-0043
|
|
428
|
+
|
|
429
|
+
Dependencies: US-0042 (Login Form)
|
|
430
|
+
|
|
431
|
+
⚠️ Dependency Status:
|
|
432
|
+
• US-0042: ready (not yet done)
|
|
433
|
+
|
|
434
|
+
[AskUserQuestion: "Create story with pending dependency?"]
|
|
435
|
+
- Yes, create anyway (dependency will block)
|
|
436
|
+
- No, wait for US-0042
|
|
437
|
+
|
|
438
|
+
✅ Story US-0043 created
|
|
439
|
+
⚠️ Status set to 'blocked' (waiting on US-0042)
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Validation Error
|
|
443
|
+
|
|
444
|
+
```
|
|
445
|
+
❌ Invalid Input
|
|
446
|
+
|
|
447
|
+
Missing required parameters:
|
|
448
|
+
• EPIC - Parent epic ID (e.g., EP-0010)
|
|
449
|
+
• TITLE - Story title
|
|
450
|
+
|
|
451
|
+
Usage:
|
|
452
|
+
/agileflow:story EPIC=EP-0010 STORY=US-0042 TITLE="Login Form" OWNER=AG-UI
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### TDD Mode Detection
|
|
456
|
+
|
|
457
|
+
```
|
|
458
|
+
📝 Story Creation
|
|
459
|
+
|
|
460
|
+
Owner: AG-DOCUMENTATION
|
|
461
|
+
TDD Mode: false (smart default - documentation work)
|
|
462
|
+
|
|
463
|
+
ℹ️ To enable TDD mode, add TDD=true to the command:
|
|
464
|
+
/agileflow:story ... TDD=true
|
|
465
|
+
```
|
|
@@ -1,8 +1,61 @@
|
|
|
1
1
|
{
|
|
2
|
+
"schema_version": "2.0.0",
|
|
3
|
+
"config_schema_version": "2.92.0",
|
|
4
|
+
"active_profile": null,
|
|
2
5
|
"agileflow": {
|
|
3
6
|
"version": "2.28.0",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
7
|
+
"setup_date": "TIMESTAMP_PLACEHOLDER",
|
|
8
|
+
"last_validated": null,
|
|
9
|
+
"config_options": {
|
|
10
|
+
"claudeMdReinforcement": {
|
|
11
|
+
"available_since": "2.92.0",
|
|
12
|
+
"configured": false,
|
|
13
|
+
"enabled": false,
|
|
14
|
+
"description": "Add /babysit AskUserQuestion rules to CLAUDE.md"
|
|
15
|
+
},
|
|
16
|
+
"sessionStartHook": {
|
|
17
|
+
"available_since": "2.35.0",
|
|
18
|
+
"configured": false,
|
|
19
|
+
"enabled": false,
|
|
20
|
+
"description": "Welcome display with project status on session start"
|
|
21
|
+
},
|
|
22
|
+
"precompactHook": {
|
|
23
|
+
"available_since": "2.40.0",
|
|
24
|
+
"configured": false,
|
|
25
|
+
"enabled": false,
|
|
26
|
+
"description": "Context preservation when conversation compacts"
|
|
27
|
+
},
|
|
28
|
+
"damageControlHooks": {
|
|
29
|
+
"available_since": "2.50.0",
|
|
30
|
+
"configured": false,
|
|
31
|
+
"enabled": false,
|
|
32
|
+
"description": "Block destructive commands, protect sensitive paths"
|
|
33
|
+
},
|
|
34
|
+
"statusLine": {
|
|
35
|
+
"available_since": "2.35.0",
|
|
36
|
+
"configured": false,
|
|
37
|
+
"enabled": false,
|
|
38
|
+
"description": "Custom status bar showing story/epic info"
|
|
39
|
+
},
|
|
40
|
+
"autoArchival": {
|
|
41
|
+
"available_since": "2.35.0",
|
|
42
|
+
"configured": false,
|
|
43
|
+
"enabled": false,
|
|
44
|
+
"description": "Auto-archive completed stories older than threshold"
|
|
45
|
+
},
|
|
46
|
+
"autoUpdate": {
|
|
47
|
+
"available_since": "2.70.0",
|
|
48
|
+
"configured": false,
|
|
49
|
+
"enabled": false,
|
|
50
|
+
"description": "Automatically update AgileFlow on session start"
|
|
51
|
+
},
|
|
52
|
+
"ralphLoop": {
|
|
53
|
+
"available_since": "2.60.0",
|
|
54
|
+
"configured": false,
|
|
55
|
+
"enabled": false,
|
|
56
|
+
"description": "Autonomous story processing with test verification"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
6
59
|
"features": {
|
|
7
60
|
"epics": true,
|
|
8
61
|
"stories": true,
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
plan_id: {{PLAN_ID}}
|
|
3
|
+
epic: {{EPIC_ID}}
|
|
4
|
+
title: {{TITLE}}
|
|
5
|
+
created: {{CREATED}}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# {{TITLE}}
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
{{GOAL}}
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Phase 1: Foundation (Sequential)
|
|
17
|
+
|
|
18
|
+
<!-- Stories that must complete before parallel work can begin -->
|
|
19
|
+
<!-- These have no dependencies or are prerequisites for everything else -->
|
|
20
|
+
|
|
21
|
+
- [ ] {{STORY_ID}}: {{STORY_TITLE}}
|
|
22
|
+
- [ ] {{STORY_ID}}: {{STORY_TITLE}}
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Phase 2: Features (Parallel-eligible)
|
|
27
|
+
|
|
28
|
+
<!-- Stories that can run in parallel sessions -->
|
|
29
|
+
<!-- All depend only on Phase 1 completion -->
|
|
30
|
+
|
|
31
|
+
- [ ] {{STORY_ID}}: {{STORY_TITLE}} (Session A)
|
|
32
|
+
- [ ] {{STORY_ID}}: {{STORY_TITLE}} (Session B)
|
|
33
|
+
- [ ] {{STORY_ID}}: {{STORY_TITLE}} (Session C)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Phase 3: Integration (Sequential)
|
|
38
|
+
|
|
39
|
+
<!-- Stories that depend on Phase 2 completion -->
|
|
40
|
+
<!-- Must wait for parallel work to merge -->
|
|
41
|
+
|
|
42
|
+
- [ ] {{STORY_ID}}: {{STORY_TITLE}}
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Deviations Log
|
|
47
|
+
|
|
48
|
+
<!-- Track decisions that differ from original plan -->
|
|
49
|
+
<!-- Important: Keep this updated so next sessions have context -->
|
|
50
|
+
|
|
51
|
+
| Date | Phase | Original | Changed To | Reason |
|
|
52
|
+
|------|-------|----------|------------|--------|
|
|
53
|
+
| | | | | |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Session Prompts
|
|
58
|
+
|
|
59
|
+
<!-- Copy-paste prompts for new parallel sessions -->
|
|
60
|
+
<!-- Customize based on specific stories in Phase 2 -->
|
|
61
|
+
|
|
62
|
+
### Session A prompt:
|
|
63
|
+
```
|
|
64
|
+
Read plan.md in the project root.
|
|
65
|
+
Execute Phase 2 Task A: [TASK DESCRIPTION].
|
|
66
|
+
Phase 1 is complete - foundation is in place.
|
|
67
|
+
Check off tasks in plan.md when done.
|
|
68
|
+
Log any deviations to the Deviations Log section.
|
|
69
|
+
Run tests before marking complete.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Session B prompt:
|
|
73
|
+
```
|
|
74
|
+
Read plan.md in the project root.
|
|
75
|
+
Execute Phase 2 Task B: [TASK DESCRIPTION].
|
|
76
|
+
Phase 1 is complete - foundation is in place.
|
|
77
|
+
Check off tasks in plan.md when done.
|
|
78
|
+
Log any deviations to the Deviations Log section.
|
|
79
|
+
Run tests before marking complete.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Session C prompt:
|
|
83
|
+
```
|
|
84
|
+
Read plan.md in the project root.
|
|
85
|
+
Execute Phase 2 Task C: [TASK DESCRIPTION].
|
|
86
|
+
Phase 1 is complete - foundation is in place.
|
|
87
|
+
Check off tasks in plan.md when done.
|
|
88
|
+
Log any deviations to the Deviations Log section.
|
|
89
|
+
Run tests before marking complete.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Verification Session
|
|
95
|
+
|
|
96
|
+
<!-- Keep one terminal dedicated to plan verification -->
|
|
97
|
+
<!-- After each phase, run these checks -->
|
|
98
|
+
|
|
99
|
+
### Phase completion checks:
|
|
100
|
+
```
|
|
101
|
+
After Phase 1:
|
|
102
|
+
- [ ] All Phase 1 checkboxes checked
|
|
103
|
+
- [ ] Tests passing
|
|
104
|
+
- [ ] No uncommitted changes
|
|
105
|
+
- [ ] Ready to spawn parallel sessions
|
|
106
|
+
|
|
107
|
+
After Phase 2:
|
|
108
|
+
- [ ] All Phase 2 checkboxes checked
|
|
109
|
+
- [ ] All parallel branches merged
|
|
110
|
+
- [ ] No merge conflicts
|
|
111
|
+
- [ ] Integration tests passing
|
|
112
|
+
|
|
113
|
+
After Phase 3:
|
|
114
|
+
- [ ] All Phase 3 checkboxes checked
|
|
115
|
+
- [ ] Final tests passing
|
|
116
|
+
- [ ] Ready for review/deploy
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Notes
|
|
122
|
+
|
|
123
|
+
<!-- Additional context, risks, or decisions -->
|
|
124
|
+
<!-- Reference ADRs if architectural decisions were made -->
|
|
125
|
+
|