agileflow 2.90.7 → 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 +10 -0
- package/README.md +6 -6
- package/lib/README.md +178 -0
- package/lib/codebase-indexer.js +818 -0
- 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-names.js +3 -3
- package/lib/validate.js +116 -52
- package/package.json +4 -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 +118 -1048
- package/scripts/pre-push-check.sh +46 -0
- package/scripts/precompact-context.sh +36 -11
- package/scripts/query-codebase.js +538 -0
- 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 +180 -0
- package/scripts/tui/blessed/index.js +244 -0
- package/scripts/tui/blessed/panels/output.js +101 -0
- package/scripts/tui/blessed/panels/sessions.js +150 -0
- package/scripts/tui/blessed/panels/trace.js +97 -0
- package/scripts/tui/blessed/ui/help.js +77 -0
- package/scripts/tui/blessed/ui/screen.js +52 -0
- package/scripts/tui/blessed/ui/statusbar.js +47 -0
- package/scripts/tui/blessed/ui/tabbar.js +99 -0
- package/scripts/tui/index.js +38 -30
- package/scripts/validators/README.md +143 -0
- package/scripts/validators/component-validator.js +239 -0
- package/scripts/validators/json-schema-validator.js +186 -0
- package/scripts/validators/markdown-validator.js +152 -0
- package/scripts/validators/migration-validator.js +129 -0
- package/scripts/validators/security-validator.js +380 -0
- package/scripts/validators/story-format-validator.js +197 -0
- package/scripts/validators/test-result-validator.js +114 -0
- package/scripts/validators/workflow-validator.js +247 -0
- package/src/core/agents/accessibility.md +6 -0
- package/src/core/agents/adr-writer.md +6 -0
- package/src/core/agents/analytics.md +6 -0
- package/src/core/agents/api.md +6 -0
- package/src/core/agents/ci.md +6 -0
- package/src/core/agents/codebase-query.md +261 -0
- package/src/core/agents/compliance.md +6 -0
- package/src/core/agents/configuration-damage-control.md +6 -0
- package/src/core/agents/configuration-visual-e2e.md +6 -0
- package/src/core/agents/database.md +10 -0
- package/src/core/agents/datamigration.md +6 -0
- package/src/core/agents/design.md +6 -0
- package/src/core/agents/devops.md +6 -0
- package/src/core/agents/documentation.md +6 -0
- package/src/core/agents/epic-planner.md +6 -0
- package/src/core/agents/integrations.md +6 -0
- package/src/core/agents/mentor.md +6 -0
- package/src/core/agents/mobile.md +6 -0
- package/src/core/agents/monitoring.md +6 -0
- package/src/core/agents/multi-expert.md +6 -0
- package/src/core/agents/performance.md +6 -0
- package/src/core/agents/product.md +6 -0
- package/src/core/agents/qa.md +6 -0
- package/src/core/agents/readme-updater.md +6 -0
- package/src/core/agents/refactor.md +6 -0
- package/src/core/agents/research.md +6 -0
- package/src/core/agents/security.md +6 -0
- package/src/core/agents/testing.md +10 -0
- package/src/core/agents/ui.md +6 -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/audit.md +401 -0
- package/src/core/commands/babysit.md +32 -5
- package/src/core/commands/board.md +1 -0
- 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 +205 -1
- package/src/core/commands/handoff.md +128 -0
- package/src/core/commands/help.md +76 -0
- package/src/core/commands/metrics.md +1 -0
- package/src/core/commands/pr.md +96 -0
- package/src/core/commands/research/analyze.md +1 -0
- package/src/core/commands/research/ask.md +2 -0
- package/src/core/commands/research/import.md +1 -0
- package/src/core/commands/research/list.md +2 -0
- package/src/core/commands/research/synthesize.md +584 -0
- package/src/core/commands/research/view.md +2 -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 +200 -1
- package/src/core/commands/story/list.md +9 -9
- package/src/core/commands/story/view.md +1 -0
- package/src/core/commands/story.md +143 -4
- package/src/core/experts/codebase-query/expertise.yaml +190 -0
- package/src/core/experts/codebase-query/question.md +73 -0
- package/src/core/experts/codebase-query/self-improve.md +105 -0
- 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)
|
|
@@ -12,11 +12,14 @@ compact_context:
|
|
|
12
12
|
- "MUST show diff preview before confirming (diff-first pattern)"
|
|
13
13
|
- "Status values: ready|in-progress|blocked|in-review|done"
|
|
14
14
|
- "MUST escape user text automatically (jq handles escaping)"
|
|
15
|
+
- "PHASE HANDOFF: Prompt for summary on phase transitions (ready→in-progress, in-progress→in-review, in-review→done)"
|
|
15
16
|
state_fields:
|
|
16
17
|
- story_id
|
|
17
18
|
- current_status
|
|
18
19
|
- new_status
|
|
19
20
|
- pr_url
|
|
21
|
+
- phase_from
|
|
22
|
+
- phase_to
|
|
20
23
|
---
|
|
21
24
|
|
|
22
25
|
# status
|
|
@@ -105,6 +108,7 @@ TO=<agent-id> # Recipient agent for bus message (optional)
|
|
|
105
108
|
"stories": {
|
|
106
109
|
"US-0042": {
|
|
107
110
|
"status": "in-progress",
|
|
111
|
+
"phase": "execute",
|
|
108
112
|
"summary": "Started work on login form",
|
|
109
113
|
"pr": "https://github.com/.../pull/42",
|
|
110
114
|
"last_update": "ISO-timestamp"
|
|
@@ -113,6 +117,15 @@ TO=<agent-id> # Recipient agent for bus message (optional)
|
|
|
113
117
|
}
|
|
114
118
|
```
|
|
115
119
|
|
|
120
|
+
**Phase Field** (auto-set based on status):
|
|
121
|
+
| Status | Phase |
|
|
122
|
+
|--------|-------|
|
|
123
|
+
| ready | plan |
|
|
124
|
+
| in-progress | execute |
|
|
125
|
+
| blocked | execute |
|
|
126
|
+
| in-review | audit |
|
|
127
|
+
| done | complete |
|
|
128
|
+
|
|
116
129
|
**Append to bus/log.jsonl**:
|
|
117
130
|
```json
|
|
118
131
|
{"ts":"ISO-timestamp","from":"SYSTEM","to":"<TO or ALL>","type":"status","story":"<STORY>","status":"<STATUS>","text":"<SUMMARY>"}
|
|
@@ -146,6 +159,7 @@ docs/09-agents/status.json
|
|
|
146
159
|
|
|
147
160
|
- "status": "ready",
|
|
148
161
|
+ "status": "in-progress",
|
|
162
|
+
+ "phase": "execute",
|
|
149
163
|
+ "summary": "Started work on login form",
|
|
150
164
|
+ "pr": "https://github.com/.../pull/42",
|
|
151
165
|
```
|
|
@@ -178,6 +192,7 @@ docs/09-agents/status.json
|
|
|
178
192
|
- ALWAYS show diff before confirming
|
|
179
193
|
- Status values: ready, in-progress, blocked, in-review, done
|
|
180
194
|
- Text escaping handled automatically by jq
|
|
195
|
+
- **PHASE HANDOFF**: On phase transitions (ready→in-progress, in-progress→in-review, in-review→done), prompt for handoff summary and log to bus/log.jsonl with type "phase_handoff"
|
|
181
196
|
|
|
182
197
|
<!-- COMPACT_SUMMARY_END -->
|
|
183
198
|
|
|
@@ -192,7 +207,8 @@ STORY=<US-ID> STATUS=in-progress|blocked|in-review|done
|
|
|
192
207
|
SUMMARY=<1–2 lines> PR=<url optional> TO=<agent id optional>
|
|
193
208
|
|
|
194
209
|
ACTIONS
|
|
195
|
-
1) Update docs/09-agents/status.json (status,summary,last_update,pr).
|
|
210
|
+
1) Update docs/09-agents/status.json (status,phase,summary,last_update,pr).
|
|
211
|
+
- Set phase based on status: ready→plan, in-progress/blocked→execute, in-review→audit, done→complete
|
|
196
212
|
**CRITICAL**: Always use jq for JSON operations to prevent corruption.
|
|
197
213
|
2) **Validate JSON after update**:
|
|
198
214
|
```bash
|
|
@@ -212,3 +228,186 @@ ACTIONS
|
|
|
212
228
|
- If validation fails, restore from backup: docs/09-agents/status.json.backup
|
|
213
229
|
|
|
214
230
|
Diff-first; YES/NO.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Phase Handoff (GSD Integration)
|
|
235
|
+
|
|
236
|
+
When status transitions indicate a phase change, prompt for a handoff summary to capture context for the next phase.
|
|
237
|
+
|
|
238
|
+
### Phase Transitions
|
|
239
|
+
|
|
240
|
+
| Status Change | Phase Transition | Handoff Prompt |
|
|
241
|
+
|--------------|------------------|----------------|
|
|
242
|
+
| ready → in-progress | plan → execute | "What's the plan for implementing this story?" |
|
|
243
|
+
| in-progress → in-review | execute → audit | "What was implemented? Any issues encountered?" |
|
|
244
|
+
| in-review → done | audit → complete | "Final summary: What was delivered?" |
|
|
245
|
+
|
|
246
|
+
### Handoff Workflow
|
|
247
|
+
|
|
248
|
+
**Step 1: Detect Phase Transition**
|
|
249
|
+
|
|
250
|
+
Before updating status, check if this is a phase-changing transition:
|
|
251
|
+
```javascript
|
|
252
|
+
const phaseTransitions = {
|
|
253
|
+
'ready→in-progress': { from: 'plan', to: 'execute' },
|
|
254
|
+
'in-progress→in-review': { from: 'execute', to: 'audit' },
|
|
255
|
+
'in-review→done': { from: 'audit', to: 'complete' }
|
|
256
|
+
};
|
|
257
|
+
const key = `${currentStatus}→${newStatus}`;
|
|
258
|
+
const transition = phaseTransitions[key];
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**Step 2: Prompt for Handoff Summary**
|
|
262
|
+
|
|
263
|
+
If a phase transition is detected, prompt BEFORE the status confirmation:
|
|
264
|
+
|
|
265
|
+
```xml
|
|
266
|
+
<invoke name="AskUserQuestion">
|
|
267
|
+
<parameter name="questions">[{
|
|
268
|
+
"question": "Phase transition: {{FROM}} → {{TO}}. Summarize what was accomplished:",
|
|
269
|
+
"header": "Handoff",
|
|
270
|
+
"multiSelect": false,
|
|
271
|
+
"options": [
|
|
272
|
+
{"label": "Enter summary", "description": "Capture context for next phase"},
|
|
273
|
+
{"label": "Skip handoff", "description": "No summary needed"}
|
|
274
|
+
]
|
|
275
|
+
}]</parameter>
|
|
276
|
+
</invoke>
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**Step 3: Log Phase Handoff**
|
|
280
|
+
|
|
281
|
+
If summary provided, append to bus/log.jsonl:
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
"ts": "2026-01-19T12:00:00Z",
|
|
285
|
+
"type": "phase_handoff",
|
|
286
|
+
"story": "US-0130",
|
|
287
|
+
"from": "plan",
|
|
288
|
+
"to": "execute",
|
|
289
|
+
"summary": "User's handoff summary here"
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Example Flow
|
|
294
|
+
|
|
295
|
+
```
|
|
296
|
+
User: /agileflow:status US-0042 STATUS=in-progress
|
|
297
|
+
|
|
298
|
+
Claude:
|
|
299
|
+
📋 Phase Transition Detected: plan → execute
|
|
300
|
+
|
|
301
|
+
Before updating status, let's capture a handoff summary.
|
|
302
|
+
|
|
303
|
+
[AskUserQuestion: "What's the plan for implementing this story?"]
|
|
304
|
+
|
|
305
|
+
User: "Adding login form with email/password validation, using React Hook Form"
|
|
306
|
+
|
|
307
|
+
Claude:
|
|
308
|
+
✅ Handoff captured
|
|
309
|
+
|
|
310
|
+
docs/09-agents/status.json
|
|
311
|
+
- "status": "ready",
|
|
312
|
+
+ "status": "in-progress",
|
|
313
|
+
+ "last_update": "2026-01-19T12:00:00Z"
|
|
314
|
+
|
|
315
|
+
[AskUserQuestion: "Update US-0042 to in-progress?"]
|
|
316
|
+
|
|
317
|
+
User: "Yes, update"
|
|
318
|
+
|
|
319
|
+
Claude:
|
|
320
|
+
✅ Status updated: US-0042 → in-progress
|
|
321
|
+
✅ Phase handoff logged: plan → execute
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Handoff Prompts by Transition
|
|
325
|
+
|
|
326
|
+
**plan → execute** (ready → in-progress):
|
|
327
|
+
- "What's the implementation approach?"
|
|
328
|
+
- "Any architectural decisions made?"
|
|
329
|
+
- "Key files to be modified?"
|
|
330
|
+
|
|
331
|
+
**execute → audit** (in-progress → in-review):
|
|
332
|
+
- "What was implemented?"
|
|
333
|
+
- "Any issues or blockers encountered?"
|
|
334
|
+
- "Tests passing? Coverage notes?"
|
|
335
|
+
|
|
336
|
+
**audit → complete** (in-review → done):
|
|
337
|
+
- "Final summary of what was delivered"
|
|
338
|
+
- "Any technical debt introduced?"
|
|
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
|
+
```
|
|
@@ -76,17 +76,17 @@ Format output as table grouped by epic:
|
|
|
76
76
|
## Stories
|
|
77
77
|
|
|
78
78
|
### EP-0001: Authentication System
|
|
79
|
-
| Story | Title | Status | Owner | Estimate |
|
|
80
|
-
|
|
81
|
-
| US-0001 | Login form | done | AG-UI | 2h |
|
|
82
|
-
| US-0002 | Password reset | in_progress | AG-API | 3h |
|
|
83
|
-
| US-0003 | Session management | ready | AG-API | 4h |
|
|
79
|
+
| Story | Title | Status | Phase | Owner | Estimate |
|
|
80
|
+
|-------|-------|--------|-------|-------|----------|
|
|
81
|
+
| US-0001 | Login form | done | complete | AG-UI | 2h |
|
|
82
|
+
| US-0002 | Password reset | in_progress | execute | AG-API | 3h |
|
|
83
|
+
| US-0003 | Session management | ready | plan | AG-API | 4h |
|
|
84
84
|
|
|
85
85
|
### EP-0002: User Dashboard
|
|
86
|
-
| Story | Title | Status | Owner | Estimate |
|
|
87
|
-
|
|
88
|
-
| US-0004 | Dashboard layout | ready | AG-UI | 2h |
|
|
89
|
-
| US-0005 | Activity feed | ready | AG-UI | 3h |
|
|
86
|
+
| Story | Title | Status | Phase | Owner | Estimate |
|
|
87
|
+
|-------|-------|--------|-------|-------|----------|
|
|
88
|
+
| US-0004 | Dashboard layout | ready | plan | AG-UI | 2h |
|
|
89
|
+
| US-0005 | Activity feed | ready | plan | AG-UI | 3h |
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
**Summary**: 5 stories (1 done, 1 in_progress, 3 ready)
|