agileflow 2.77.0 → 2.79.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.
Files changed (128) hide show
  1. package/README.md +6 -6
  2. package/package.json +6 -1
  3. package/scripts/agileflow-configure.js +174 -2
  4. package/scripts/agileflow-statusline.sh +171 -78
  5. package/scripts/agileflow-welcome.js +88 -64
  6. package/scripts/auto-self-improve.js +23 -45
  7. package/scripts/check-update.js +35 -42
  8. package/scripts/damage-control/bash-tool-damage-control.js +257 -0
  9. package/scripts/damage-control/edit-tool-damage-control.js +279 -0
  10. package/scripts/damage-control/patterns.yaml +227 -0
  11. package/scripts/damage-control/write-tool-damage-control.js +274 -0
  12. package/scripts/damage-control-bash.js +232 -0
  13. package/scripts/damage-control-edit.js +243 -0
  14. package/scripts/damage-control-write.js +243 -0
  15. package/scripts/obtain-context.js +22 -3
  16. package/scripts/ralph-loop.js +191 -63
  17. package/scripts/screenshot-verifier.js +213 -0
  18. package/scripts/session-manager.js +12 -33
  19. package/src/core/agents/accessibility.md +124 -53
  20. package/src/core/agents/adr-writer.md +192 -52
  21. package/src/core/agents/analytics.md +139 -60
  22. package/src/core/agents/api.md +173 -63
  23. package/src/core/agents/ci.md +139 -57
  24. package/src/core/agents/compliance.md +159 -68
  25. package/src/core/agents/configuration/damage-control.md +356 -0
  26. package/src/core/agents/configuration-damage-control.md +248 -0
  27. package/src/core/agents/database.md +162 -61
  28. package/src/core/agents/datamigration.md +179 -66
  29. package/src/core/agents/design.md +179 -57
  30. package/src/core/agents/devops.md +160 -3
  31. package/src/core/agents/documentation.md +204 -60
  32. package/src/core/agents/epic-planner.md +147 -55
  33. package/src/core/agents/integrations.md +197 -69
  34. package/src/core/agents/mentor.md +158 -57
  35. package/src/core/agents/mobile.md +159 -67
  36. package/src/core/agents/monitoring.md +154 -65
  37. package/src/core/agents/multi-expert.md +115 -43
  38. package/src/core/agents/orchestrator.md +77 -24
  39. package/src/core/agents/performance.md +130 -75
  40. package/src/core/agents/product.md +151 -55
  41. package/src/core/agents/qa.md +162 -74
  42. package/src/core/agents/readme-updater.md +178 -76
  43. package/src/core/agents/refactor.md +148 -95
  44. package/src/core/agents/research.md +143 -72
  45. package/src/core/agents/security.md +154 -65
  46. package/src/core/agents/testing.md +176 -97
  47. package/src/core/agents/ui.md +170 -79
  48. package/src/core/commands/adr/list.md +171 -0
  49. package/src/core/commands/adr/update.md +235 -0
  50. package/src/core/commands/adr/view.md +252 -0
  51. package/src/core/commands/adr.md +207 -50
  52. package/src/core/commands/agent.md +16 -0
  53. package/src/core/commands/assign.md +148 -44
  54. package/src/core/commands/auto.md +18 -1
  55. package/src/core/commands/babysit.md +391 -38
  56. package/src/core/commands/baseline.md +14 -0
  57. package/src/core/commands/blockers.md +170 -51
  58. package/src/core/commands/board.md +144 -66
  59. package/src/core/commands/changelog.md +15 -0
  60. package/src/core/commands/ci.md +179 -69
  61. package/src/core/commands/compress.md +18 -0
  62. package/src/core/commands/configure.md +16 -0
  63. package/src/core/commands/context/export.md +193 -4
  64. package/src/core/commands/context/full.md +191 -18
  65. package/src/core/commands/context/note.md +248 -4
  66. package/src/core/commands/debt.md +17 -0
  67. package/src/core/commands/deploy.md +208 -65
  68. package/src/core/commands/deps.md +15 -0
  69. package/src/core/commands/diagnose.md +16 -0
  70. package/src/core/commands/docs.md +196 -64
  71. package/src/core/commands/epic/list.md +170 -0
  72. package/src/core/commands/epic/view.md +242 -0
  73. package/src/core/commands/epic.md +192 -69
  74. package/src/core/commands/feedback.md +191 -71
  75. package/src/core/commands/handoff.md +162 -48
  76. package/src/core/commands/help.md +9 -0
  77. package/src/core/commands/ideate.md +446 -0
  78. package/src/core/commands/impact.md +16 -0
  79. package/src/core/commands/metrics.md +141 -37
  80. package/src/core/commands/multi-expert.md +77 -0
  81. package/src/core/commands/packages.md +16 -0
  82. package/src/core/commands/pr.md +161 -67
  83. package/src/core/commands/readme-sync.md +16 -0
  84. package/src/core/commands/research/analyze.md +568 -0
  85. package/src/core/commands/research/ask.md +345 -20
  86. package/src/core/commands/research/import.md +562 -19
  87. package/src/core/commands/research/list.md +173 -5
  88. package/src/core/commands/research/view.md +181 -8
  89. package/src/core/commands/retro.md +135 -48
  90. package/src/core/commands/review.md +219 -47
  91. package/src/core/commands/session/end.md +209 -0
  92. package/src/core/commands/session/history.md +210 -0
  93. package/src/core/commands/session/init.md +116 -0
  94. package/src/core/commands/session/new.md +296 -0
  95. package/src/core/commands/session/resume.md +166 -0
  96. package/src/core/commands/session/status.md +166 -0
  97. package/src/core/commands/setup/visual-e2e.md +462 -0
  98. package/src/core/commands/skill/create.md +115 -17
  99. package/src/core/commands/skill/delete.md +117 -0
  100. package/src/core/commands/skill/edit.md +104 -0
  101. package/src/core/commands/skill/list.md +128 -0
  102. package/src/core/commands/skill/test.md +135 -0
  103. package/src/core/commands/skill/upgrade.md +542 -0
  104. package/src/core/commands/sprint.md +17 -1
  105. package/src/core/commands/status.md +133 -21
  106. package/src/core/commands/story/list.md +176 -0
  107. package/src/core/commands/story/view.md +265 -0
  108. package/src/core/commands/story-validate.md +101 -1
  109. package/src/core/commands/story.md +204 -51
  110. package/src/core/commands/template.md +16 -1
  111. package/src/core/commands/tests.md +226 -64
  112. package/src/core/commands/update.md +17 -1
  113. package/src/core/commands/validate-expertise.md +16 -0
  114. package/src/core/commands/velocity.md +140 -36
  115. package/src/core/commands/verify.md +14 -0
  116. package/src/core/commands/whats-new.md +30 -0
  117. package/src/core/skills/_learnings/README.md +91 -0
  118. package/src/core/skills/_learnings/_template.yaml +106 -0
  119. package/src/core/skills/_learnings/code-review.yaml +118 -0
  120. package/src/core/skills/_learnings/commit.yaml +69 -0
  121. package/src/core/skills/_learnings/story-writer.yaml +71 -0
  122. package/src/core/templates/damage-control-patterns.yaml +234 -0
  123. package/src/core/templates/skill-template.md +53 -11
  124. package/tools/cli/commands/start.js +180 -0
  125. package/tools/cli/installers/ide/claude-code.js +127 -0
  126. package/tools/cli/tui/Dashboard.js +66 -0
  127. package/tools/cli/tui/StoryList.js +69 -0
  128. package/tools/cli/tui/index.js +16 -0
@@ -1,6 +1,20 @@
1
1
  ---
2
2
  description: View past session history and metrics
3
3
  argument-hint: "[DAYS=7|30|90|all]"
4
+ compact_context:
5
+ priority: medium
6
+ preserve_rules:
7
+ - "ACTIVE COMMAND: /agileflow:session:history - Show sessions filtered by age"
8
+ - "Accepts DAYS argument: 7, 30, 90, or all (default: 30)"
9
+ - "Filters sessions by created timestamp"
10
+ - "Shows table with creation date, branch, story, status"
11
+ - "Read-only display (no prompts)"
12
+ - "Shows summary: total sessions, active count, inactive count"
13
+ state_fields:
14
+ - timeframe_days
15
+ - filtered_sessions
16
+ - active_count
17
+ - inactive_count
4
18
  ---
5
19
 
6
20
  # /agileflow:session:history
@@ -71,3 +85,199 @@ Try /agileflow:session:history DAYS=all to see all sessions.
71
85
 
72
86
  - `/agileflow:session:status` - Current status
73
87
  - `/agileflow:session:resume` - Switch sessions
88
+
89
+ ---
90
+
91
+ <!-- COMPACT_SUMMARY_START -->
92
+
93
+ ## ⚠️ COMPACT SUMMARY - /agileflow:session:history IS ACTIVE
94
+
95
+ **CRITICAL**: This command shows historical session data. It NEVER prompts for action - read-only display only.
96
+
97
+ ---
98
+
99
+ ### 🚨 RULE #1: PARSE DAYS ARGUMENT
100
+
101
+ Valid values: `7`, `30`, `90`, `all`
102
+
103
+ ```
104
+ /agileflow:session:history DAYS=7 → Last 7 days
105
+ /agileflow:session:history DAYS=30 → Last 30 days (default)
106
+ /agileflow:session:history DAYS=90 → Last 90 days
107
+ /agileflow:session:history DAYS=all → All sessions
108
+ /agileflow:session:history → Default to 30 days
109
+ ```
110
+
111
+ ---
112
+
113
+ ### 🚨 RULE #2: FILTER BY CREATED TIMESTAMP
114
+
115
+ After getting all sessions, filter by their `created` timestamp:
116
+ ```javascript
117
+ const cutoffDate = new Date(Date.now() - days * 24 * 60 * 60 * 1000);
118
+ filtered = sessions.filter(s => new Date(s.created) >= cutoffDate);
119
+ ```
120
+
121
+ For `DAYS=all`, include all sessions.
122
+
123
+ ---
124
+
125
+ ### 🚨 RULE #3: DISPLAY FORMAT
126
+
127
+ **Structure:**
128
+ 1. Header with emoji: `📜 Session History (Last {DAYS} days)`
129
+ 2. Table with columns: #, Created, Name/Branch, Story, Status
130
+ 3. Summary: `Summary: X sessions │ Y active │ Z inactive`
131
+ 4. Tips (optional)
132
+
133
+ **Example:**
134
+ ```
135
+ 📜 Session History (Last 30 days)
136
+
137
+ ┌─────┬────────────┬──────────────────┬─────────────┬────────────┐
138
+ │ # │ Created │ Name/Branch │ Story │ Status │
139
+ ├─────┼────────────┼──────────────────┼─────────────┼────────────┤
140
+ │ 1 │ Dec 20 │ main │ - │ ● Active │
141
+ │ 2 │ Dec 22 │ "auth" │ US-0042 │ ● Active │
142
+ │ 3 │ Dec 23 │ feature/payments │ US-0051 │ ○ Inactive │
143
+ │ 4 │ Dec 25 │ "bugfix" │ US-0038 │ ○ Inactive │
144
+ └─────┴────────────┴──────────────────┴─────────────┴────────────┘
145
+
146
+ Summary: 4 sessions │ 2 active │ 2 inactive
147
+ ```
148
+
149
+ ---
150
+
151
+ ### 🚨 RULE #4: DATE FORMATTING
152
+
153
+ Show dates in compact form:
154
+ - Format: `Dec 20` (month + day)
155
+ - No year needed (assumed current year or implied by context)
156
+ - Makes table compact
157
+
158
+ ---
159
+
160
+ ### 🚨 RULE #5: READ-ONLY DISPLAY (NO PROMPTS)
161
+
162
+ **NEVER use AskUserQuestion.** This command is informational only.
163
+
164
+ For user actions, show tips:
165
+ ```
166
+ 💡 Tips:
167
+ • /agileflow:session:new to create a new session
168
+ • /agileflow:session:delete {id} to remove old sessions
169
+ • Inactive sessions can be resumed with /agileflow:session:resume
170
+ ```
171
+
172
+ ---
173
+
174
+ ### 🚨 RULE #6: HANDLE EMPTY RESULTS
175
+
176
+ If no sessions in timeframe:
177
+ ```
178
+ 📜 Session History
179
+
180
+ No sessions found in the last {DAYS} days.
181
+
182
+ Try /agileflow:session:history DAYS=all to see all sessions.
183
+ ```
184
+
185
+ ---
186
+
187
+ ### FORMATTING RULES
188
+
189
+ | Element | Format | Example |
190
+ |---------|--------|---------|
191
+ | Date | Month + day | `Dec 20` |
192
+ | Session name | Nickname or branch | `"auth"` or `feature/payments` |
193
+ | Story | US-#### or dash | `US-0042` or `-` |
194
+ | Status | ● Active or ○ Inactive | `● Active` |
195
+ | Summary | Count format | `4 sessions │ 2 active │ 2 inactive` |
196
+
197
+ ---
198
+
199
+ ### KEY FILES TO REMEMBER
200
+
201
+ | File | Purpose |
202
+ |------|---------|
203
+ | `.agileflow/sessions/registry.json` | All sessions with created timestamps |
204
+ | `.agileflow/scripts/session-manager.js` | Data source via list --json |
205
+
206
+ ---
207
+
208
+ ### WORKFLOW
209
+
210
+ 1. **Parse DAYS argument** → Default to 30 if not provided
211
+ 2. **Get all sessions** → `session-manager.js list --json`
212
+ 3. **Filter by date** → Compare created timestamp to cutoff
213
+ 4. **Count active/inactive** → Check status field
214
+ 5. **Build table** → Format with proper columns
215
+ 6. **Show summary** → Total and active counts
216
+ 7. **Optionally show** → Tips for actions
217
+
218
+ ---
219
+
220
+ ### SESSION DATA STRUCTURE
221
+
222
+ From `session-manager.js list --json`:
223
+ ```json
224
+ {
225
+ "id": 1,
226
+ "branch": "main",
227
+ "nickname": null,
228
+ "status": "active",
229
+ "created": "2025-12-20T10:00:00Z",
230
+ "last_active": "2025-12-20T10:30:00Z"
231
+ }
232
+ ```
233
+
234
+ Use `created` for filtering.
235
+
236
+ ---
237
+
238
+ ### ARGUMENT VALIDATION
239
+
240
+ ```
241
+ DAYS=7 ✅ Valid
242
+ DAYS=30 ✅ Valid
243
+ DAYS=90 ✅ Valid
244
+ DAYS=all ✅ Valid
245
+ DAYS=14 ❌ Invalid (suggest 7, 30, 90, or all)
246
+ DAYS=xyz ❌ Invalid (suggest 7, 30, 90, or all)
247
+ (no arg) ✅ Valid (default to 30)
248
+ ```
249
+
250
+ ---
251
+
252
+ ### ANTI-PATTERNS (DON'T DO THESE)
253
+
254
+ ❌ Use AskUserQuestion to prompt for action
255
+ ❌ Show "Delete old sessions?" or similar prompts
256
+ ❌ Accept arbitrary DAYS values (only 7, 30, 90, all)
257
+ ❌ Show full ISO timestamp (use compact date)
258
+ ❌ Show absolute paths (too much info)
259
+ ❌ Forget summary line with counts
260
+
261
+ ### DO THESE INSTEAD
262
+
263
+ ✅ Display as read-only information
264
+ ✅ Use ● and ○ bullets for status
265
+ ✅ Accept only: 7, 30, 90, all
266
+ ✅ Format dates compactly: Dec 20
267
+ ✅ Show summary with active/inactive counts
268
+ ✅ Optionally show tips for related commands
269
+
270
+ ---
271
+
272
+ ### REMEMBER AFTER COMPACTION
273
+
274
+ - `/agileflow:session:history` IS ACTIVE
275
+ - Accepts DAYS: 7, 30, 90, all (default: 30)
276
+ - Filter by created timestamp
277
+ - Format: header + table + summary
278
+ - Use ● for active, ○ for inactive
279
+ - NEVER prompt for action (read-only)
280
+ - Show date as "Dec 20" (compact format)
281
+ - Optionally show tips
282
+
283
+ <!-- COMPACT_SUMMARY_END -->
@@ -1,6 +1,19 @@
1
1
  ---
2
2
  description: Initialize session harness with test verification
3
3
  argument-hint: (no arguments)
4
+ compact_context:
5
+ priority: high
6
+ preserve_rules:
7
+ - "ACTIVE COMMAND: /agileflow:session:init - Initialize session tracking"
8
+ - "Creates `.agileflow/sessions/` directory and `registry.json` if missing"
9
+ - "Registers current directory as active session with lock file"
10
+ - "Runs automatically via SessionStart hook on session begin"
11
+ - "Safe to run multiple times (idempotent operation)"
12
+ - "If registry.json exists, validates schema before use"
13
+ state_fields:
14
+ - session_id
15
+ - registry_status
16
+ - active_session_count
4
17
  ---
5
18
 
6
19
  # /agileflow:session:init
@@ -82,3 +95,106 @@ If session is already registered:
82
95
 
83
96
  - `/agileflow:session:status` - View all sessions
84
97
  - `/agileflow:session:new` - Create parallel session
98
+
99
+ ---
100
+
101
+ <!-- COMPACT_SUMMARY_START -->
102
+
103
+ ## ⚠️ COMPACT SUMMARY - /agileflow:session:init IS ACTIVE
104
+
105
+ **CRITICAL**: This command sets up session tracking infrastructure. It MUST run before any session management features work.
106
+
107
+ ---
108
+
109
+ ### 🚨 RULE #1: IDEMPOTENT OPERATION
110
+
111
+ This command is **safe to run multiple times**. It:
112
+ - Creates `.agileflow/sessions/` if missing
113
+ - Creates `registry.json` with schema if missing
114
+ - Registers current directory if not already registered
115
+ - Updates lock file if already registered
116
+
117
+ **No data is lost, no conflicts occur on repeated runs.**
118
+
119
+ ---
120
+
121
+ ### 🚨 RULE #2: AUTOMATIC INVOCATION
122
+
123
+ This command runs automatically via **SessionStart hook**. You typically don't call it manually unless:
124
+ - Debugging session tracking
125
+ - Setting up manually without hook
126
+ - Recovering from corrupted session state
127
+
128
+ ---
129
+
130
+ ### 🚨 RULE #3: REGISTRY SCHEMA
131
+
132
+ The generated `registry.json` has this structure:
133
+ ```json
134
+ {
135
+ "version": "1.0",
136
+ "sessions": [
137
+ {
138
+ "id": 1,
139
+ "path": "/home/user/project",
140
+ "branch": "main",
141
+ "created": "2025-12-20T10:00:00Z",
142
+ "last_active": "2025-12-20T10:30:00Z",
143
+ "is_main": true,
144
+ "nickname": null,
145
+ "status": "active"
146
+ }
147
+ ]
148
+ }
149
+ ```
150
+
151
+ ---
152
+
153
+ ### 🚨 RULE #4: LOCK FILE MANAGEMENT
154
+
155
+ Session tracking uses lock files at `.agileflow/sessions/{id}.lock`:
156
+ - Lock file = session is **active** (has running Claude process)
157
+ - No lock file = session is **inactive** (can be resumed)
158
+ - Lock files are created on init, removed on `/agileflow:session:end`
159
+
160
+ ---
161
+
162
+ ### KEY FILES TO REMEMBER
163
+
164
+ | File | Purpose |
165
+ |------|---------|
166
+ | `.agileflow/sessions/` | Session directory (created by init) |
167
+ | `.agileflow/sessions/registry.json` | Master registry of all sessions |
168
+ | `.agileflow/sessions/{id}.lock` | Lock file marking session active |
169
+ | `.agileflow/scripts/session-manager.js` | Script that does the work |
170
+
171
+ ---
172
+
173
+ ### TYPICAL WORKFLOW
174
+
175
+ 1. **First time in project**:
176
+ - SessionStart hook runs → `/agileflow:session:init` called automatically
177
+ - Creates infrastructure, registers main session
178
+ - You never see this happening
179
+
180
+ 2. **Debugging session state**:
181
+ - Run `/agileflow:session:init` manually
182
+ - Check `.agileflow/sessions/registry.json` for current state
183
+ - Use `/agileflow:session:status` to view readable output
184
+
185
+ 3. **Manual setup**:
186
+ - If hook is disabled, run this to initialize
187
+ - Then use other session commands
188
+
189
+ ---
190
+
191
+ ### REMEMBER AFTER COMPACTION
192
+
193
+ - `/agileflow:session:init` IS ACTIVE
194
+ - Creates `.agileflow/sessions/` directory and registry
195
+ - Runs automatically via SessionStart hook
196
+ - Safe to run multiple times (idempotent)
197
+ - Lock files track active vs inactive sessions
198
+ - Check `registry.json` for current session state
199
+
200
+ <!-- COMPACT_SUMMARY_END -->
@@ -1,6 +1,20 @@
1
1
  ---
2
2
  description: Create a new parallel session with git worktree
3
3
  argument-hint: (no arguments)
4
+ compact_context:
5
+ priority: high
6
+ preserve_rules:
7
+ - "ACTIVE COMMAND: /agileflow:session:new - Create parallel session with worktree"
8
+ - "Validates git repo and prerequisites before proceeding"
9
+ - "Prompts user with 3 creation options: auto-create / named / existing branch"
10
+ - "Each option leads to different AskUserQuestion prompt"
11
+ - "Returns success message with `cd` command to activate new session"
12
+ - "Worktrees created in ../project-{id} or ../project-{name} directories"
13
+ state_fields:
14
+ - session_count
15
+ - user_choice
16
+ - new_session_id
17
+ - new_session_path
4
18
  ---
5
19
 
6
20
  # /agileflow:session:new
@@ -150,3 +164,285 @@ Show the created session details and the command to start working:
150
164
  - `/agileflow:session:resume` - Switch between sessions
151
165
  - `/agileflow:session:status` - View all sessions
152
166
  - `/agileflow:session:end` - End current session
167
+
168
+ ---
169
+
170
+ <!-- COMPACT_SUMMARY_START -->
171
+
172
+ ## ⚠️ COMPACT SUMMARY - /agileflow:session:new IS ACTIVE
173
+
174
+ **CRITICAL**: This command creates new parallel sessions with git worktrees. Three-step process: validate → present options → create.
175
+
176
+ ---
177
+
178
+ ### 🚨 RULE #1: VALIDATE PREREQUISITES
179
+
180
+ Before doing anything, check:
181
+ ```bash
182
+ git rev-parse --is-inside-work-tree
183
+ ```
184
+
185
+ If NOT in a git repo:
186
+ ```
187
+ Error: You're not in a git repository. Session creation requires git.
188
+ ```
189
+
190
+ Then exit.
191
+
192
+ ---
193
+
194
+ ### 🚨 RULE #2: PRESENT THREE OPTIONS WITH AskUserQuestion
195
+
196
+ Get current session count first:
197
+ ```bash
198
+ node .agileflow/scripts/session-manager.js status
199
+ ```
200
+
201
+ Then show exactly these 3 options:
202
+ ```xml
203
+ <invoke name="AskUserQuestion">
204
+ <parameter name="questions">[{
205
+ "question": "How would you like to create your new session?",
206
+ "header": "New session",
207
+ "multiSelect": false,
208
+ "options": [
209
+ {"label": "Auto-create Session 2 (Recommended)",
210
+ "description": "Creates ../project-2 with new branch session-2"},
211
+ {"label": "Name this session",
212
+ "description": "Give it a memorable name like 'auth' or 'bugfix'"},
213
+ {"label": "Use existing branch",
214
+ "description": "Create session from one of your existing branches"}
215
+ ]
216
+ }]</parameter>
217
+ </invoke>
218
+ ```
219
+
220
+ Increment session number based on current count.
221
+
222
+ ---
223
+
224
+ ### 🚨 RULE #3: HANDLE OPTION #1 - AUTO-CREATE
225
+
226
+ If user selects "Auto-create":
227
+ ```bash
228
+ node .agileflow/scripts/session-manager.js create
229
+ ```
230
+
231
+ Display:
232
+ ```
233
+ ✓ Created Session {id}
234
+
235
+ Workspace: ../project-{id}
236
+ Branch: session-{id}
237
+
238
+ ┌─────────────────────────────────────────────────────────┐
239
+ │ To start working in this session, run: │
240
+ │ │
241
+ │ cd ../project-{id} && claude │
242
+ │ │
243
+ └─────────────────────────────────────────────────────────┘
244
+
245
+ 💡 Tip: Use /agileflow:session:resume to see all sessions
246
+ ```
247
+
248
+ ---
249
+
250
+ ### 🚨 RULE #4: HANDLE OPTION #2 - NAME THIS SESSION
251
+
252
+ If user selects "Name this session", present suggestions:
253
+ ```xml
254
+ <invoke name="AskUserQuestion">
255
+ <parameter name="questions">[{
256
+ "question": "What should this session be called?",
257
+ "header": "Session name",
258
+ "multiSelect": false,
259
+ "options": [
260
+ {"label": "auth", "description": "Working on authentication"},
261
+ {"label": "bugfix", "description": "Fixing bugs"},
262
+ {"label": "feature", "description": "New feature work"},
263
+ {"label": "experiment", "description": "Trying something out"},
264
+ {"label": "Other", "description": "Custom name"}
265
+ ]
266
+ }]</parameter>
267
+ </invoke>
268
+ ```
269
+
270
+ If user selects "Other", prompt for custom input (AskUserQuestion with text input if available).
271
+
272
+ Then create:
273
+ ```bash
274
+ node .agileflow/scripts/session-manager.js create --nickname {name}
275
+ ```
276
+
277
+ Display:
278
+ ```
279
+ ✓ Created Session {id} "{name}"
280
+
281
+ Workspace: ../project-{name}
282
+ Branch: session-{id}-{name}
283
+
284
+ ┌─────────────────────────────────────────────────────────┐
285
+ │ To start working in this session, run: │
286
+ │ │
287
+ │ cd ../project-{name} && claude │
288
+ │ │
289
+ └─────────────────────────────────────────────────────────┘
290
+
291
+ 💡 Tip: Use /agileflow:session:resume to see all sessions
292
+ ```
293
+
294
+ ---
295
+
296
+ ### 🚨 RULE #5: HANDLE OPTION #3 - USE EXISTING BRANCH
297
+
298
+ If user selects "Use existing branch":
299
+
300
+ 1. Get branches:
301
+ ```bash
302
+ git branch --format='%(refname:short)'
303
+ ```
304
+
305
+ 2. Limit to 5-6 most recent and present:
306
+ ```xml
307
+ <invoke name="AskUserQuestion">
308
+ <parameter name="questions">[{
309
+ "question": "Which branch?",
310
+ "header": "Select branch",
311
+ "multiSelect": false,
312
+ "options": [
313
+ {"label": "feature/auth", "description": ""},
314
+ {"label": "bugfix/login", "description": ""},
315
+ {"label": "feature/payments", "description": ""},
316
+ {"label": "main", "description": "Default branch"},
317
+ {"label": "Other", "description": "See all branches"}
318
+ ]
319
+ }]</parameter>
320
+ </invoke>
321
+ ```
322
+
323
+ 3. If user selects "Other", show all branches.
324
+
325
+ 4. Create with selected branch:
326
+ ```bash
327
+ node .agileflow/scripts/session-manager.js create --branch {branch_name}
328
+ ```
329
+
330
+ Display success as above.
331
+
332
+ ---
333
+
334
+ ### 🚨 RULE #6: ERROR HANDLING
335
+
336
+ **If directory exists:**
337
+ ```
338
+ Error: ../project-{name} already exists.
339
+
340
+ Suggestions:
341
+ • Choose a different name
342
+ • Remove the directory: rm -rf ../project-{name}
343
+ • Use an existing directory as a session (advanced)
344
+ ```
345
+
346
+ **If branch conflict:**
347
+ ```
348
+ Error: Branch session-{id}-{name} already exists.
349
+
350
+ Try a different name or use /agileflow:session:new again.
351
+ ```
352
+
353
+ **If git error:**
354
+ ```
355
+ Error: Git operation failed
356
+
357
+ {error_message}
358
+
359
+ Try running: git status
360
+ ```
361
+
362
+ ---
363
+
364
+ ### 🚨 RULE #7: SUCCESS MESSAGE FORMAT
365
+
366
+ All three options show same format:
367
+ ```
368
+ ✓ Created Session {id} ["{nickname}" OR empty]
369
+
370
+ Workspace: ../project-{path}
371
+ Branch: {branch_name}
372
+
373
+ ┌─────────────────────────────────────────────────────────┐
374
+ │ To start working in this session, run: │
375
+ │ │
376
+ │ {cd_command} │
377
+ │ │
378
+ └─────────────────────────────────────────────────────────┘
379
+
380
+ 💡 Tip: Use /agileflow:session:resume to see all sessions
381
+ ```
382
+
383
+ ---
384
+
385
+ ### KEY FILES TO REMEMBER
386
+
387
+ | File | Purpose |
388
+ |------|---------|
389
+ | `.agileflow/sessions/registry.json` | Session registry (updated) |
390
+ | `.agileflow/scripts/session-manager.js` | Create session |
391
+ | `../project-{id/name}/` | New worktree directory |
392
+
393
+ ---
394
+
395
+ ### WORKFLOW
396
+
397
+ 1. **Validate git** → `git rev-parse --is-inside-work-tree`
398
+ 2. **Get session count** → `session-manager.js status`
399
+ 3. **Present options** → AskUserQuestion with 3 choices
400
+ 4. **User selects** → Option 1, 2, or 3
401
+ 5. **Handle selection** → Different flow for each
402
+ 6. **Create session** → Call manager script
403
+ 7. **Show success** → Display cd command
404
+
405
+ ---
406
+
407
+ ### SESSION CREATION METHODS
408
+
409
+ | Method | Path | Branch | Command |
410
+ |--------|------|--------|---------|
411
+ | Auto-create | ../project-{id} | session-{id} | create |
412
+ | Named | ../project-{name} | session-{id}-{name} | create --nickname {name} |
413
+ | Existing branch | ../project-{name} | {branch_name} | create --branch {branch} |
414
+
415
+ ---
416
+
417
+ ### ANTI-PATTERNS (DON'T DO THESE)
418
+
419
+ ❌ Don't validate git repo in the middle of process
420
+ ❌ Don't show more/fewer than 3 initial options
421
+ ❌ Don't create session without explicit user choice
422
+ ❌ Don't skip error handling (directory exists, branch conflict)
423
+ ❌ Don't forget cd command in success message
424
+ ❌ Show different success formats for different methods
425
+
426
+ ### DO THESE INSTEAD
427
+
428
+ ✅ Validate git first, exit if not in repo
429
+ ✅ Always show exactly 3 options
430
+ ✅ Wait for user to select before creating
431
+ ✅ Handle all error cases gracefully
432
+ ✅ Always show cd command in success
433
+ ✅ Use consistent success format
434
+
435
+ ---
436
+
437
+ ### REMEMBER AFTER COMPACTION
438
+
439
+ - `/agileflow:session:new` IS ACTIVE
440
+ - ALWAYS validate git repo first
441
+ - Present 3 options: auto-create / named / existing branch
442
+ - Each option leads to different flow
443
+ - Use AskUserQuestion for user selections
444
+ - Handle all error cases (directory, branch, git)
445
+ - Return success with cd command
446
+ - Show tip to use /agileflow:session:resume
447
+
448
+ <!-- COMPACT_SUMMARY_END -->