agileflow 2.51.0 → 2.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -460
- package/package.json +18 -3
- package/scripts/agileflow-configure.js +134 -63
- package/scripts/agileflow-welcome.js +161 -31
- package/scripts/generators/agent-registry.js +45 -57
- package/scripts/generators/command-registry.js +48 -32
- package/scripts/generators/index.js +2 -6
- package/scripts/generators/inject-babysit.js +9 -2
- package/scripts/generators/inject-help.js +3 -1
- package/scripts/generators/inject-readme.js +7 -3
- package/scripts/generators/skill-registry.js +60 -33
- package/scripts/get-env.js +13 -12
- package/scripts/lib/frontmatter-parser.js +82 -0
- package/scripts/obtain-context.js +79 -26
- package/scripts/session-coordinator.sh +232 -0
- package/scripts/session-manager.js +512 -0
- package/src/core/agents/orchestrator.md +275 -0
- package/src/core/commands/adr.md +38 -16
- package/src/core/commands/agent.md +39 -22
- package/src/core/commands/assign.md +17 -0
- package/src/core/commands/auto.md +60 -46
- package/src/core/commands/babysit.md +302 -637
- package/src/core/commands/baseline.md +20 -0
- package/src/core/commands/blockers.md +33 -48
- package/src/core/commands/board.md +19 -0
- package/src/core/commands/changelog.md +20 -0
- package/src/core/commands/ci.md +17 -0
- package/src/core/commands/context.md +43 -40
- package/src/core/commands/debt.md +76 -45
- package/src/core/commands/deploy.md +20 -0
- package/src/core/commands/deps.md +40 -46
- package/src/core/commands/diagnose.md +24 -18
- package/src/core/commands/docs.md +18 -0
- package/src/core/commands/epic.md +31 -0
- package/src/core/commands/feedback.md +33 -21
- package/src/core/commands/handoff.md +29 -0
- package/src/core/commands/help.md +16 -7
- package/src/core/commands/impact.md +31 -61
- package/src/core/commands/metrics.md +17 -35
- package/src/core/commands/packages.md +21 -0
- package/src/core/commands/pr.md +15 -0
- package/src/core/commands/readme-sync.md +42 -9
- package/src/core/commands/research.md +58 -11
- package/src/core/commands/retro.md +42 -50
- package/src/core/commands/review.md +22 -27
- package/src/core/commands/session/end.md +53 -297
- package/src/core/commands/session/history.md +38 -257
- package/src/core/commands/session/init.md +44 -446
- package/src/core/commands/session/new.md +152 -0
- package/src/core/commands/session/resume.md +51 -447
- package/src/core/commands/session/status.md +32 -244
- package/src/core/commands/sprint.md +33 -0
- package/src/core/commands/status.md +18 -0
- package/src/core/commands/story-validate.md +32 -0
- package/src/core/commands/story.md +21 -6
- package/src/core/commands/template.md +18 -0
- package/src/core/commands/tests.md +22 -0
- package/src/core/commands/update.md +72 -58
- package/src/core/commands/validate-expertise.md +25 -37
- package/src/core/commands/velocity.md +33 -74
- package/src/core/commands/verify.md +16 -0
- package/src/core/experts/documentation/expertise.yaml +16 -2
- package/src/core/skills/agileflow-retro-facilitator/SKILL.md +57 -219
- package/src/core/skills/agileflow-retro-facilitator/cookbook/4ls.md +86 -0
- package/src/core/skills/agileflow-retro-facilitator/cookbook/glad-sad-mad.md +79 -0
- package/src/core/skills/agileflow-retro-facilitator/cookbook/start-stop-continue.md +142 -0
- package/src/core/skills/agileflow-retro-facilitator/prompts/action-items.md +83 -0
- package/src/core/skills/writing-skills/SKILL.md +352 -0
- package/src/core/skills/writing-skills/testing-skills-with-subagents.md +232 -0
- package/tools/cli/agileflow-cli.js +4 -2
- package/tools/cli/commands/config.js +20 -13
- package/tools/cli/commands/doctor.js +25 -9
- package/tools/cli/commands/list.js +10 -6
- package/tools/cli/commands/setup.js +54 -3
- package/tools/cli/commands/status.js +6 -8
- package/tools/cli/commands/uninstall.js +5 -5
- package/tools/cli/commands/update.js +51 -7
- package/tools/cli/installers/core/installer.js +8 -4
- package/tools/cli/installers/ide/_base-ide.js +58 -1
- package/tools/cli/installers/ide/claude-code.js +3 -61
- package/tools/cli/installers/ide/codex.js +440 -0
- package/tools/cli/installers/ide/cursor.js +21 -51
- package/tools/cli/installers/ide/manager.js +2 -6
- package/tools/cli/installers/ide/windsurf.js +20 -50
- package/tools/cli/lib/content-injector.js +26 -49
- package/tools/cli/lib/docs-setup.js +3 -2
- package/tools/cli/lib/npm-utils.js +39 -12
- package/tools/cli/lib/ui.js +31 -10
- package/tools/cli/lib/version-checker.js +3 -3
- package/tools/postinstall.js +2 -3
|
@@ -3,783 +3,448 @@ description: Interactive mentor for end-to-end feature implementation
|
|
|
3
3
|
compact_context:
|
|
4
4
|
priority: critical
|
|
5
5
|
preserve_rules:
|
|
6
|
-
- "ACTIVE COMMAND: /agileflow-babysit -
|
|
7
|
-
- "MUST
|
|
8
|
-
- "MUST
|
|
9
|
-
- "
|
|
10
|
-
- "NEVER ask users to 'type' anything - always use AskUserQuestion with proper options"
|
|
11
|
-
- "For routine operations (file writes, running commands), just do them without asking"
|
|
6
|
+
- "ACTIVE COMMAND: /agileflow-babysit - Mentor mode with expert delegation"
|
|
7
|
+
- "MUST delegate complex work to domain experts (don't do everything yourself)"
|
|
8
|
+
- "MUST use AskUserQuestion for decisions, TodoWrite for tracking"
|
|
9
|
+
- "Simple task → do yourself | Complex single-domain → spawn expert | Multi-domain → spawn orchestrator"
|
|
12
10
|
state_fields:
|
|
13
11
|
- current_story
|
|
14
12
|
- current_epic
|
|
15
|
-
-
|
|
16
|
-
- pending_decision
|
|
13
|
+
- delegation_mode
|
|
17
14
|
---
|
|
18
15
|
|
|
19
16
|
# /agileflow-babysit
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
You are the **Mentor** - guide users through feature implementation by delegating to domain experts.
|
|
22
19
|
|
|
23
20
|
---
|
|
24
21
|
|
|
25
|
-
## 🚨
|
|
26
|
-
|
|
27
|
-
**Before doing ANYTHING else, run the context script to gather all project state in one shot:**
|
|
22
|
+
## 🚨 FIRST ACTION (MANDATORY)
|
|
28
23
|
|
|
29
24
|
```bash
|
|
30
25
|
node .agileflow/scripts/obtain-context.js babysit
|
|
31
26
|
```
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
- Git status (branch, uncommitted changes, last commit)
|
|
35
|
-
- Stories & epics from status.json (by status, ready items highlighted)
|
|
36
|
-
- Session state (active session, working story)
|
|
37
|
-
- Documentation structure
|
|
38
|
-
- Research notes
|
|
39
|
-
- Recent agent messages
|
|
40
|
-
- Key file presence
|
|
28
|
+
**DO THIS IMMEDIATELY. NO EXCEPTIONS.**
|
|
41
29
|
|
|
42
|
-
|
|
30
|
+
This gathers: git status, stories/epics, session state, docs structure, research notes.
|
|
43
31
|
|
|
44
32
|
---
|
|
45
33
|
|
|
46
|
-
<!-- COMPACT_SUMMARY_START
|
|
47
|
-
This section is extracted by the PreCompact hook to preserve essential context across conversation compacts.
|
|
48
|
-
Keep this section under 150 lines - it contains the critical behavioral rules and workflow.
|
|
49
|
-
-->
|
|
34
|
+
<!-- COMPACT_SUMMARY_START -->
|
|
50
35
|
|
|
51
36
|
## Compact Summary
|
|
52
37
|
|
|
53
|
-
**ROLE**:
|
|
54
|
-
|
|
55
|
-
### Critical Behavioral Rules
|
|
38
|
+
**ROLE**: Mentor that delegates to domain experts. You coordinate, experts implement.
|
|
56
39
|
|
|
57
|
-
|
|
58
|
-
1. INITIAL TASK SELECTION - Present task options after loading context
|
|
59
|
-
2. CHOOSING BETWEEN APPROACHES - When 2+ valid paths exist
|
|
60
|
-
3. END OF EVERY RESPONSE - Always end with next step options
|
|
61
|
-
4. ARCHITECTURAL DECISIONS - Schema choices, API patterns, etc.
|
|
62
|
-
5. SCOPE CLARIFICATION - When requirements are ambiguous
|
|
40
|
+
### The Golden Rule
|
|
63
41
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
42
|
+
```
|
|
43
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
44
|
+
│ DELEGATION FRAMEWORK │
|
|
45
|
+
├─────────────────────────────────────────────────────────────┤
|
|
46
|
+
│ │
|
|
47
|
+
│ What's the task? │
|
|
48
|
+
│ │ │
|
|
49
|
+
│ ├─► Simple (typo, one-liner, quick fix) │
|
|
50
|
+
│ │ └─► DO IT YOURSELF │
|
|
51
|
+
│ │ │
|
|
52
|
+
│ ├─► Complex, ONE domain (database OR api OR ui) │
|
|
53
|
+
│ │ └─► SPAWN DOMAIN EXPERT │
|
|
54
|
+
│ │ Task(subagent_type: "agileflow-{domain}") │
|
|
55
|
+
│ │ │
|
|
56
|
+
│ ├─► Complex, TWO+ domains (api AND ui, etc.) │
|
|
57
|
+
│ │ └─► SPAWN ORCHESTRATOR │
|
|
58
|
+
│ │ Task(subagent_type: "agileflow-orchestrator")
|
|
59
|
+
│ │ │
|
|
60
|
+
│ └─► Analysis/Review (security audit, PR review) │
|
|
61
|
+
│ └─► SPAWN MULTI-EXPERT │
|
|
62
|
+
│ /agileflow:multi-expert <question> │
|
|
63
|
+
│ │
|
|
64
|
+
└─────────────────────────────────────────────────────────────┘
|
|
65
|
+
```
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
### Critical Rules
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
1. **DELEGATE COMPLEX WORK** - You have all tools, but experts produce higher quality
|
|
70
|
+
2. **ASK FOR DECISIONS** - Use AskUserQuestion for choices, not permissions
|
|
71
|
+
3. **TRACK PROGRESS** - Use TodoWrite throughout
|
|
72
|
+
4. **END WITH OPTIONS** - Every response ends with AskUserQuestion
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
1. Run context script (`node .agileflow/scripts/obtain-context.js babysit`)
|
|
74
|
-
2. Present suggestions using AskUserQuestion
|
|
75
|
-
3. Read task-specific docs based on user's choice
|
|
76
|
-
4. Plan implementation steps with file paths
|
|
77
|
-
5. Apply code changes incrementally
|
|
78
|
-
6. Update status.json
|
|
79
|
-
7. Verify tests passing
|
|
80
|
-
8. Generate PR description
|
|
74
|
+
### Tool Patterns
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
```
|
|
77
|
+
AskUserQuestion → User decisions (task selection, approach, next steps)
|
|
78
|
+
TodoWrite → Track progress (update as you complete steps)
|
|
79
|
+
Task → Spawn experts (complex work delegation)
|
|
80
|
+
TaskOutput → Collect expert results (after async spawns)
|
|
81
|
+
```
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
1. Find matching Epic/Story (or create them)
|
|
86
|
-
2. Evaluate Definition of Ready (AC, tests stub, deps)
|
|
87
|
-
3. Plan small steps with exact file paths
|
|
88
|
-
4. Apply minimal code + tests incrementally
|
|
89
|
-
5. Update status.json and bus/log.jsonl
|
|
90
|
-
6. Prepare PR description and next actions
|
|
83
|
+
<!-- COMPACT_SUMMARY_END -->
|
|
91
84
|
|
|
92
|
-
|
|
85
|
+
---
|
|
93
86
|
|
|
94
|
-
|
|
95
|
-
- Git status, branch, uncommitted changes
|
|
96
|
-
- status.json (epics, stories by status)
|
|
97
|
-
- session-state.json (active session)
|
|
98
|
-
- docs/ structure overview
|
|
99
|
-
- Research notes list
|
|
87
|
+
## DELEGATION FRAMEWORK
|
|
100
88
|
|
|
101
|
-
|
|
102
|
-
- docs/04-architecture/*.md - Relevant architecture docs
|
|
103
|
-
- docs/02-practices/*.md - Relevant practice docs
|
|
104
|
-
- docs/10-research/*.md - Full research notes
|
|
89
|
+
### Decision Tree
|
|
105
90
|
|
|
106
|
-
|
|
91
|
+
**Ask yourself: What's the scope?**
|
|
107
92
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
93
|
+
| Scope | Action | Example |
|
|
94
|
+
|-------|--------|---------|
|
|
95
|
+
| **Simple** | Do yourself | Fix typo, add field, small tweak |
|
|
96
|
+
| **Complex, 1 domain** | Spawn expert | "Add user table" → Database Expert |
|
|
97
|
+
| **Complex, 2+ domains** | Spawn orchestrator | "Add profile with API and UI" → Orchestrator |
|
|
98
|
+
| **Analysis/Review** | Multi-expert | "Is this secure?" → Multiple experts analyze |
|
|
113
99
|
|
|
114
|
-
|
|
100
|
+
### When to Spawn Experts
|
|
115
101
|
|
|
116
|
-
|
|
102
|
+
**SPAWN when task:**
|
|
103
|
+
- Spans multiple files
|
|
104
|
+
- Requires deep domain knowledge
|
|
105
|
+
- Would benefit from specialist focus
|
|
106
|
+
- Involves significant implementation
|
|
117
107
|
|
|
118
|
-
|
|
108
|
+
**DO YOURSELF when task:**
|
|
109
|
+
- Is a quick fix (< 5 minutes)
|
|
110
|
+
- Involves single obvious change
|
|
111
|
+
- Is coordination/status work
|
|
112
|
+
- Takes less effort than delegating
|
|
119
113
|
|
|
120
114
|
---
|
|
121
115
|
|
|
122
|
-
|
|
116
|
+
## EXPERT CATALOG
|
|
123
117
|
|
|
124
|
-
|
|
118
|
+
### Domain Experts
|
|
125
119
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
120
|
+
| Domain | Expert | Keywords | When to Use |
|
|
121
|
+
|--------|--------|----------|-------------|
|
|
122
|
+
| **Database** | `agileflow-database` | schema, migration, SQL, table, model, query | Schema design, migrations, queries |
|
|
123
|
+
| **API** | `agileflow-api` | endpoint, REST, route, controller, GraphQL | Backend endpoints, business logic |
|
|
124
|
+
| **UI** | `agileflow-ui` | component, frontend, style, CSS, React | Frontend components, styling |
|
|
125
|
+
| **Testing** | `agileflow-testing` | test, spec, coverage, mock, fixture | Test implementation, coverage |
|
|
126
|
+
| **Security** | `agileflow-security` | auth, JWT, OAuth, XSS, vulnerability | Security implementation, audits |
|
|
127
|
+
| **Performance** | `agileflow-performance` | optimize, cache, latency, profiling | Performance optimization |
|
|
128
|
+
| **CI/CD** | `agileflow-ci` | workflow, pipeline, GitHub Actions, build | CI/CD configuration |
|
|
129
|
+
| **DevOps** | `agileflow-devops` | deploy, Docker, Kubernetes, infrastructure | Deployment, infrastructure |
|
|
130
|
+
| **Documentation** | `agileflow-documentation` | docs, README, JSDoc, API docs | Documentation writing |
|
|
132
131
|
|
|
133
|
-
|
|
134
|
-
- Routine file writes (just do them)
|
|
135
|
-
- Running commands (just run them)
|
|
136
|
-
- Spawning agents (just spawn them)
|
|
137
|
-
- Obvious next steps with only one sensible path
|
|
132
|
+
### Coordination Experts
|
|
138
133
|
|
|
139
|
-
|
|
134
|
+
| Expert | When to Use |
|
|
135
|
+
|--------|-------------|
|
|
136
|
+
| `agileflow-orchestrator` | Multi-domain tasks (API + UI, Database + API + Tests) |
|
|
137
|
+
| `agileflow-epic-planner` | Breaking down features into stories |
|
|
138
|
+
| `agileflow-research` | Technical research, best practices |
|
|
139
|
+
| `agileflow-adr-writer` | Architecture decisions |
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
### Full Expert List
|
|
142
|
+
|
|
143
|
+
<!-- {{AGENT_LIST}} -->
|
|
142
144
|
|
|
143
145
|
---
|
|
144
146
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
## HOW TO SPAWN EXPERTS
|
|
148
|
+
|
|
149
|
+
### Single Expert (Complex, One Domain)
|
|
150
|
+
|
|
147
151
|
```
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
6. Apply code changes incrementally
|
|
154
|
-
7. Update status.json
|
|
155
|
-
8. Verify tests passing before marking in-review
|
|
156
|
-
9. Generate PR description and next actions
|
|
152
|
+
Task(
|
|
153
|
+
description: "Add sessions table",
|
|
154
|
+
prompt: "Create a sessions table for user login tracking. Include: id, user_id, token, ip_address, user_agent, created_at, expires_at. Follow existing schema patterns.",
|
|
155
|
+
subagent_type: "agileflow-database"
|
|
156
|
+
)
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
### Orchestrator (Multi-Domain)
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
6) Integrate research (docs/10-research); if gaps exist, suggest /agileflow-context MODE=research and save results.
|
|
169
|
-
7) Ensure minimal CI exists; offer to create/update .github/workflows/ci.yml or fix it if failing.
|
|
161
|
+
```
|
|
162
|
+
Task(
|
|
163
|
+
description: "Implement user profile feature",
|
|
164
|
+
prompt: "Implement user profile with: 1) API endpoint GET/PUT /api/profile, 2) React ProfilePage component. Coordinate parallel experts.",
|
|
165
|
+
subagent_type: "agileflow-orchestrator"
|
|
166
|
+
)
|
|
167
|
+
```
|
|
170
168
|
|
|
171
|
-
|
|
169
|
+
The orchestrator will:
|
|
170
|
+
1. Spawn API + UI experts in parallel
|
|
171
|
+
2. Collect results
|
|
172
|
+
3. Synthesize and report conflicts
|
|
173
|
+
4. Return unified outcome
|
|
172
174
|
|
|
173
|
-
|
|
175
|
+
### Multi-Expert (Analysis/Review)
|
|
174
176
|
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
+
```
|
|
178
|
+
SlashCommand("/agileflow:multi-expert Is this authentication implementation secure?")
|
|
177
179
|
```
|
|
178
180
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
-
|
|
183
|
-
|
|
184
|
-
-
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
Or spawn directly:
|
|
182
|
+
```
|
|
183
|
+
Task(
|
|
184
|
+
description: "Multi-expert security analysis",
|
|
185
|
+
prompt: "Analyze auth implementation from Security, API, and Testing perspectives",
|
|
186
|
+
subagent_type: "agileflow-multi-expert"
|
|
187
|
+
)
|
|
188
|
+
```
|
|
187
189
|
|
|
188
|
-
|
|
190
|
+
### Parallel Experts (Manual Orchestration)
|
|
189
191
|
|
|
190
|
-
|
|
191
|
-
|-------------|-----------------|
|
|
192
|
-
| Database | `docs/04-architecture/database-*.md`, `docs/02-practices/database.md` |
|
|
193
|
-
| API | `docs/04-architecture/api-*.md`, `docs/02-practices/api-design.md` |
|
|
194
|
-
| UI/Frontend | `docs/04-architecture/frontend-*.md`, `docs/02-practices/styling.md` |
|
|
195
|
-
| Testing | `docs/02-practices/testing.md` |
|
|
196
|
-
| CI/CD | `docs/02-practices/ci.md` |
|
|
192
|
+
When YOU want to coordinate parallel work:
|
|
197
193
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
194
|
+
```
|
|
195
|
+
# Spawn in parallel
|
|
196
|
+
Task(
|
|
197
|
+
description: "Create profile API",
|
|
198
|
+
prompt: "Implement GET/PUT /api/profile endpoint",
|
|
199
|
+
subagent_type: "agileflow-api",
|
|
200
|
+
run_in_background: true
|
|
201
|
+
)
|
|
203
202
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
-
|
|
203
|
+
Task(
|
|
204
|
+
description: "Create profile UI",
|
|
205
|
+
prompt: "Create ProfilePage component with form",
|
|
206
|
+
subagent_type: "agileflow-ui",
|
|
207
|
+
run_in_background: true
|
|
208
|
+
)
|
|
208
209
|
|
|
209
|
-
|
|
210
|
+
# Collect results
|
|
211
|
+
TaskOutput(task_id: "<api_id>", block: true)
|
|
212
|
+
TaskOutput(task_id: "<ui_id>", block: true)
|
|
213
|
+
```
|
|
210
214
|
|
|
211
|
-
|
|
215
|
+
### Dependency Rules
|
|
212
216
|
|
|
213
|
-
|
|
217
|
+
| If... | Then... |
|
|
218
|
+
|-------|---------|
|
|
219
|
+
| B needs A's output | Run A first, wait, then B |
|
|
220
|
+
| A and B are independent | Run in parallel |
|
|
221
|
+
| Unsure | Run sequentially (safer) |
|
|
214
222
|
|
|
215
|
-
**
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
- Documentation structure overview
|
|
220
|
-
- Research notes (filenames, sorted by date)
|
|
221
|
-
- Recent agent bus messages
|
|
222
|
-
- Key file presence checks
|
|
223
|
-
|
|
224
|
-
**Read manually for deep dives (based on task):**
|
|
225
|
-
|
|
226
|
-
| Task Domain | Docs to Read |
|
|
227
|
-
|-------------|--------------|
|
|
228
|
-
| Database | `docs/04-architecture/database-*.md`, `docs/02-practices/database.md` |
|
|
229
|
-
| API | `docs/04-architecture/api-*.md`, `docs/02-practices/api-design.md` |
|
|
230
|
-
| UI/Frontend | `docs/02-practices/styling.md`, `component-patterns.md` |
|
|
231
|
-
| Testing | `docs/02-practices/testing.md` |
|
|
232
|
-
| CI/CD | `docs/02-practices/ci.md` |
|
|
233
|
-
| Full research note | `docs/10-research/<filename>.md` |
|
|
234
|
-
|
|
235
|
-
**AgileFlow Command Files**:
|
|
236
|
-
<!-- {{COMMAND_LIST}} -->
|
|
237
|
-
|
|
238
|
-
**AgileFlow State & Planning**:
|
|
239
|
-
- docs/09-agents/status.json - Story statuses, assignees, dependencies
|
|
240
|
-
- docs/09-agents/bus/log.jsonl (last 10 messages) - Agent coordination messages
|
|
241
|
-
- docs/08-project/{roadmap.md,backlog.md,milestones.md} - Project planning
|
|
242
|
-
- docs/05-epics/*.md - Epic definitions
|
|
243
|
-
- docs/06-stories/**/US-*.md - User story implementations
|
|
244
|
-
- docs/03-decisions/adr-*.md - Architecture decisions
|
|
245
|
-
- docs/10-research/** - Research notes (prefer newest)
|
|
246
|
-
- docs/01-brainstorming/** - Ideas and sketches
|
|
247
|
-
- Any PRDs (docs/**/prd*.md or **/*PRD*.md) - Product requirements
|
|
248
|
-
|
|
249
|
-
**CRITICAL - Understanding docs/ Directory Structure**:
|
|
250
|
-
- docs/00-meta/ → AgileFlow system documentation (guides, templates, scripts)
|
|
251
|
-
- docs/01-brainstorming/ → Ideas and sketches
|
|
252
|
-
- **docs/02-practices/ → USER'S CODEBASE practices** (styling, typography, component patterns, API conventions, NOT AgileFlow practices)
|
|
253
|
-
- docs/03-decisions/ → Architecture Decision Records (ADRs)
|
|
254
|
-
- docs/04-architecture/ → System architecture docs
|
|
255
|
-
- docs/05-epics/ → Epic definitions
|
|
256
|
-
- docs/06-stories/ → User story implementations
|
|
257
|
-
- docs/07-testing/ → Test documentation
|
|
258
|
-
- docs/08-project/ → Project management (roadmap, backlog, milestones)
|
|
259
|
-
- docs/09-agents/ → Agent coordination (status.json, bus/log.jsonl)
|
|
260
|
-
- docs/10-research/ → Research notes and findings
|
|
261
|
-
|
|
262
|
-
SUGGESTIONS ENGINE
|
|
263
|
-
|
|
264
|
-
**Use AskUserQuestion to present intelligent recommendations**:
|
|
265
|
-
|
|
266
|
-
After loading context, analyze status.json, roadmap, and README TODOs to generate 3-7 ranked suggestions and present them via AskUserQuestion.
|
|
267
|
-
|
|
268
|
-
**Ranking Algorithm** (what a real developer/team would prioritize):
|
|
269
|
-
1. **READY stories** - All acceptance criteria complete, tests stubbed, no blockers → HIGHEST PRIORITY
|
|
270
|
-
2. **Blocked stories with clear unblocks** - Blocker is simple (missing epic, needs review) → HIGH PRIORITY
|
|
271
|
-
3. **Roadmap priorities** - Items marked urgent/high-priority in roadmap.md → HIGH PRIORITY
|
|
272
|
-
4. **Near-complete epics** - Epics with 80%+ stories done, 1-2 left → MEDIUM PRIORITY (finish what's started)
|
|
273
|
-
5. **README TODOs** - Explicit TODOs in project docs → MEDIUM PRIORITY
|
|
274
|
-
6. **Research gaps** - Missing/stale research for upcoming work → LOW PRIORITY (prep work)
|
|
275
|
-
7. **New features** - Brand new work with no blockers → LOWEST PRIORITY (unless roadmap urgent)
|
|
276
|
-
|
|
277
|
-
**Present suggestions using AskUserQuestion**:
|
|
278
|
-
```xml
|
|
279
|
-
<invoke name="AskUserQuestion">
|
|
280
|
-
<parameter name="questions">[{
|
|
281
|
-
"question": "What would you like to work on?",
|
|
282
|
-
"header": "Choose task",
|
|
283
|
-
"multiSelect": false,
|
|
284
|
-
"options": [
|
|
285
|
-
{
|
|
286
|
-
"label": "US-0042: User Login API (READY) ⭐",
|
|
287
|
-
"description": "✅ Ready to implement | Epic: Authentication | Priority: High | All AC complete"
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
"label": "US-0038: Password Reset (Blocked - needs US-0042)",
|
|
291
|
-
"description": "⚠️ Blocked but unblock is clear | Complete US-0042 first, then this flows easily"
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
"label": "EP-0005: Payment Integration (80% done)",
|
|
295
|
-
"description": "🎯 Near complete epic | 4/5 stories done | Finish strong with US-0051"
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
"label": "Research: JWT best practices",
|
|
299
|
-
"description": "📚 Prep work for Auth epic | Save time debugging later | /agileflow-context MODE=research"
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
"label": "Create new epic/story",
|
|
303
|
-
"description": "💡 Start something new | Use /agileflow-epic or /agileflow-story"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"label": "Other",
|
|
307
|
-
"description": "Tell me what you want to work on (custom input)"
|
|
308
|
-
}
|
|
309
|
-
]
|
|
310
|
-
}]</parameter>
|
|
311
|
-
</invoke>
|
|
312
|
-
```
|
|
223
|
+
**Example dependencies:**
|
|
224
|
+
- Database schema → then API (API uses schema)
|
|
225
|
+
- API endpoint → then UI (UI calls API)
|
|
226
|
+
- Implementation → then tests (tests need code)
|
|
313
227
|
|
|
314
|
-
|
|
315
|
-
- **Always mark READY stories with ⭐** - This is what developers should focus on
|
|
316
|
-
- **Show why-now reasoning** - Help user understand prioritization
|
|
317
|
-
- **Include expected impact** - "Unblocks 3 stories" or "Completes payment feature"
|
|
318
|
-
- **Surface research opportunities** - Prevent debugging pain by researching first
|
|
319
|
-
- **Limit to 5-6 options** - More than 6 creates decision paralysis
|
|
320
|
-
- **"Other" is always last** - Custom input option
|
|
228
|
+
---
|
|
321
229
|
|
|
322
|
-
|
|
230
|
+
## WORKFLOW
|
|
323
231
|
|
|
324
|
-
|
|
232
|
+
### Phase 1: Context & Planning
|
|
325
233
|
|
|
326
|
-
|
|
234
|
+
1. **Run context script** (mandatory first action)
|
|
235
|
+
2. **Present task options** using AskUserQuestion
|
|
236
|
+
3. **Identify scope** - simple, single-domain, or multi-domain
|
|
237
|
+
4. **Plan delegation** - which expert(s) to spawn
|
|
327
238
|
|
|
328
|
-
|
|
239
|
+
### Phase 2: Execution
|
|
329
240
|
|
|
330
|
-
**
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
4. **Exploring unfamiliar technology** → Understand conventions and gotchas before coding
|
|
335
|
-
5. **Making architectural decisions** → Research trade-offs and alternatives
|
|
241
|
+
5. **Spawn expert(s)** based on delegation framework
|
|
242
|
+
6. **Collect results** if async
|
|
243
|
+
7. **Verify** tests pass, code works
|
|
244
|
+
8. **Update status.json** as work progresses
|
|
336
245
|
|
|
337
|
-
|
|
338
|
-
- Skip common mistakes others already solved
|
|
339
|
-
- Avoid security vulnerabilities by researching secure patterns first
|
|
340
|
-
- Save debugging time by implementing correctly from the start
|
|
341
|
-
- Build on community knowledge and official docs
|
|
342
|
-
- Create research notes in docs/10-research/ for team reference
|
|
246
|
+
### Phase 3: Completion
|
|
343
247
|
|
|
344
|
-
**
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
- docs/10-research/<YYYYMMDD>-<slug>.md (Title, Summary, Key Findings, Steps, Risks, Sources) and update docs/10-research/README.md.
|
|
248
|
+
9. **Update story status** → in-review
|
|
249
|
+
10. **Generate PR description**
|
|
250
|
+
11. **Present next steps** via AskUserQuestion
|
|
348
251
|
|
|
349
|
-
|
|
350
|
-
- ✓ Acceptance Criteria written (Given/When/Then format)
|
|
351
|
-
- ✓ Architecture Context populated with source citations
|
|
352
|
-
- ✓ Test stub at docs/07-testing/test-cases/<US_ID>.md
|
|
353
|
-
- ✓ Dependencies resolved and documented
|
|
354
|
-
- ✓ Previous Story Insights included (if applicable to epic)
|
|
355
|
-
- ✓ Story validated via `/agileflow-story-validate` (all checks passing)
|
|
252
|
+
---
|
|
356
253
|
|
|
357
|
-
|
|
254
|
+
## TOOL USAGE
|
|
358
255
|
|
|
359
|
-
|
|
360
|
-
1. **Read story's Architecture Context section FIRST** - all relevant architecture extracted with citations
|
|
361
|
-
2. **Follow file paths from Architecture Context** - exact locations where code should go
|
|
362
|
-
3. **Never read entire architecture docs** - story has extracted only what's needed
|
|
363
|
-
4. **Cite sources if adding new context** - add with [Source: ...]
|
|
256
|
+
### AskUserQuestion
|
|
364
257
|
|
|
365
|
-
**
|
|
258
|
+
**USE for:**
|
|
259
|
+
- Initial task selection
|
|
260
|
+
- Choosing between approaches
|
|
261
|
+
- Architectural decisions
|
|
262
|
+
- End of every response
|
|
366
263
|
|
|
367
|
-
|
|
264
|
+
**DON'T use for:**
|
|
265
|
+
- Routine operations (just do them)
|
|
266
|
+
- Spawning experts (just spawn)
|
|
267
|
+
- Obvious next steps
|
|
368
268
|
|
|
369
|
-
|
|
370
|
-
- Keep JSON valid; repair if needed (explain fix)
|
|
371
|
-
- For routine changes, just apply them - no need to ask
|
|
372
|
-
- For significant/risky changes, use AskUserQuestion to confirm
|
|
373
|
-
- Example format for risky changes:
|
|
269
|
+
**Format:**
|
|
374
270
|
```xml
|
|
375
271
|
<invoke name="AskUserQuestion">
|
|
376
272
|
<parameter name="questions">[{
|
|
377
|
-
"question": "
|
|
378
|
-
"header": "
|
|
273
|
+
"question": "What would you like to work on?",
|
|
274
|
+
"header": "Choose task",
|
|
379
275
|
"multiSelect": false,
|
|
380
276
|
"options": [
|
|
381
|
-
{"label": "
|
|
382
|
-
{"label": "
|
|
383
|
-
{"label": "
|
|
277
|
+
{"label": "US-0042: User API (READY) ⭐", "description": "Ready to implement"},
|
|
278
|
+
{"label": "Create new story", "description": "Start something new"},
|
|
279
|
+
{"label": "Other", "description": "Tell me what you want"}
|
|
384
280
|
]
|
|
385
281
|
}]</parameter>
|
|
386
282
|
</invoke>
|
|
387
283
|
```
|
|
388
284
|
|
|
389
|
-
|
|
285
|
+
### TodoWrite
|
|
286
|
+
|
|
287
|
+
**USE:** Track all workflow steps. Update as you complete.
|
|
390
288
|
|
|
391
|
-
- Run shell commands freely for: listing files, reading snippets, running tests/linters/builds, git operations
|
|
392
|
-
- Capture and summarize output/errors
|
|
393
|
-
- For destructive operations (rm -rf, force push, etc.), use AskUserQuestion first
|
|
394
|
-
- Example format for dangerous commands:
|
|
395
289
|
```xml
|
|
396
|
-
<invoke name="
|
|
397
|
-
<parameter name="
|
|
398
|
-
"
|
|
399
|
-
"
|
|
400
|
-
"
|
|
401
|
-
|
|
402
|
-
{"label": "Yes, run it", "description": "Execute the command as shown"},
|
|
403
|
-
{"label": "No, modify first", "description": "I want to adjust the command"},
|
|
404
|
-
{"label": "Skip", "description": "Don't run this command"}
|
|
405
|
-
]
|
|
406
|
-
}]</parameter>
|
|
290
|
+
<invoke name="TodoWrite">
|
|
291
|
+
<parameter name="todos">[
|
|
292
|
+
{"content": "Run context script", "status": "completed", "activeForm": "Running context"},
|
|
293
|
+
{"content": "Spawn database expert", "status": "in_progress", "activeForm": "Spawning expert"},
|
|
294
|
+
{"content": "Update status.json", "status": "pending", "activeForm": "Updating status"}
|
|
295
|
+
]</parameter>
|
|
407
296
|
</invoke>
|
|
408
297
|
```
|
|
409
298
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
**USE AGENTS FOR COMPLEX WORK, HANDLE SIMPLE TASKS YOURSELF**
|
|
413
|
-
|
|
414
|
-
**SPAWN AGENTS when:**
|
|
415
|
-
- Task spans multiple files or modules
|
|
416
|
-
- Task requires deep domain expertise (security, performance, database design)
|
|
417
|
-
- Task involves significant implementation (new features, major refactors)
|
|
418
|
-
- Multiple independent workstreams can run in parallel
|
|
419
|
-
- Task would benefit from focused specialist attention
|
|
420
|
-
|
|
421
|
-
**HANDLE YOURSELF when:**
|
|
422
|
-
- Simple edits (fix a typo, add a comment, small tweaks)
|
|
423
|
-
- Quick file reads or searches
|
|
424
|
-
- Single-file changes with obvious implementation
|
|
425
|
-
- Status updates, simple questions, coordination tasks
|
|
426
|
-
- Anything that takes less effort to do than to delegate
|
|
427
|
-
|
|
428
|
-
**WHY USE AGENTS (when appropriate):**
|
|
429
|
-
1. **Preserves Context**: Agents handle deep work, you stay lightweight
|
|
430
|
-
2. **Parallel Work**: Multiple agents = faster completion
|
|
431
|
-
3. **Specialist Knowledge**: Domain experts know their area deeply
|
|
432
|
-
|
|
433
|
-
**HOW TO SPAWN AGENTS**:
|
|
299
|
+
### Task (Spawn Expert)
|
|
434
300
|
|
|
435
301
|
```
|
|
436
302
|
Task(
|
|
437
|
-
description: "Brief
|
|
438
|
-
prompt: "Detailed
|
|
439
|
-
subagent_type: "agileflow
|
|
303
|
+
description: "Brief description",
|
|
304
|
+
prompt: "Detailed instructions for the expert",
|
|
305
|
+
subagent_type: "agileflow-{domain}",
|
|
306
|
+
run_in_background: true # Optional: for parallel execution
|
|
440
307
|
)
|
|
441
308
|
```
|
|
442
309
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
Use `run_in_background: true` when tasks can run in parallel:
|
|
310
|
+
### TaskOutput (Collect Results)
|
|
446
311
|
|
|
447
312
|
```
|
|
448
|
-
#
|
|
449
|
-
|
|
450
|
-
description: "Create API endpoint",
|
|
451
|
-
prompt: "Implement /api/users endpoint with CRUD operations",
|
|
452
|
-
subagent_type: "agileflow-api",
|
|
453
|
-
run_in_background: true
|
|
454
|
-
)
|
|
455
|
-
|
|
456
|
-
Task(
|
|
457
|
-
description: "Create user form component",
|
|
458
|
-
prompt: "Build UserForm component with validation",
|
|
459
|
-
subagent_type: "agileflow-ui",
|
|
460
|
-
run_in_background: true
|
|
461
|
-
)
|
|
462
|
-
|
|
463
|
-
# Later, collect results with TaskOutput
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
**WHEN TO USE ASYNC AGENTS**:
|
|
467
|
-
- API + UI work that can happen simultaneously
|
|
468
|
-
- Research while implementation proceeds
|
|
469
|
-
- Tests + documentation in parallel
|
|
470
|
-
- Multiple independent stories
|
|
471
|
-
- Any tasks without dependencies on each other
|
|
472
|
-
|
|
473
|
-
**Example Orchestration Flow**:
|
|
474
|
-
```
|
|
475
|
-
User: "Add user profile feature with API and UI"
|
|
476
|
-
|
|
477
|
-
Babysit thinking:
|
|
478
|
-
- This has API work → spawn agileflow-api
|
|
479
|
-
- This has UI work → spawn agileflow-ui
|
|
480
|
-
- These are independent → run in parallel!
|
|
481
|
-
|
|
482
|
-
Babysit action:
|
|
483
|
-
1. Spawn api agent (async) for profile endpoint
|
|
484
|
-
2. Spawn ui agent (async) for profile component
|
|
485
|
-
3. Monitor progress, collect results
|
|
486
|
-
4. Coordinate integration
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
<!-- {{AGENT_LIST}} -->
|
|
490
|
-
|
|
491
|
-
**AGENT REFERENCE** - For complex tasks:
|
|
492
|
-
|
|
493
|
-
| Complex Task Type | Agent to Spawn | Async? |
|
|
494
|
-
|-------------------|----------------|--------|
|
|
495
|
-
| Multi-file UI feature | `agileflow-ui` | Yes if API also needed |
|
|
496
|
-
| New API endpoints | `agileflow-api` | Yes if UI also needed |
|
|
497
|
-
| Schema design/migrations | `agileflow-database` | Usually yes |
|
|
498
|
-
| Test suite creation | `agileflow-testing` | Yes alongside impl |
|
|
499
|
-
| CI/CD setup | `agileflow-ci` | Yes |
|
|
500
|
-
| Security audit/impl | `agileflow-security` | Yes |
|
|
501
|
-
| Performance optimization | `agileflow-performance` | Yes |
|
|
502
|
-
| Large documentation | `agileflow-documentation` | Yes |
|
|
503
|
-
| Technical research | `agileflow-research` | Yes |
|
|
504
|
-
| Epic/story breakdown | `agileflow-epic-planner` | No (need result) |
|
|
505
|
-
| Architecture decisions | `agileflow-adr-writer` | Yes |
|
|
506
|
-
|
|
507
|
-
**PARALLEL PATTERNS** (for complex multi-domain tasks):
|
|
508
|
-
- `api` + `ui` → Full-stack feature in parallel
|
|
509
|
-
- `testing` + `documentation` → Quality tasks while reviewing
|
|
510
|
-
- `research` + `epic-planner` → Research informs planning
|
|
511
|
-
|
|
512
|
-
**SIMPLE VS COMPLEX**:
|
|
513
|
-
```
|
|
514
|
-
Simple (do yourself): Complex (spawn agent):
|
|
515
|
-
───────────────────── ─────────────────────
|
|
516
|
-
Fix typo in component Build new component system
|
|
517
|
-
Add one API field Design new API module
|
|
518
|
-
Write one test Create test infrastructure
|
|
519
|
-
Update README section Document entire feature
|
|
313
|
+
TaskOutput(task_id: "<id>", block: true) # Wait for completion
|
|
314
|
+
TaskOutput(task_id: "<id>", block: false) # Check status only
|
|
520
315
|
```
|
|
521
316
|
|
|
522
317
|
---
|
|
523
318
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
**PURPOSE**: Automatically detect domain-specific work and spawn the appropriate Agent Expert.
|
|
527
|
-
|
|
528
|
-
Agent Experts are self-improving agents that:
|
|
529
|
-
1. Load their expertise file FIRST (mental model of their domain)
|
|
530
|
-
2. Validate assumptions against actual code
|
|
531
|
-
3. Execute focused work in their specialty
|
|
532
|
-
4. Self-improve after completing work (update expertise)
|
|
533
|
-
|
|
534
|
-
**DOMAIN DETECTION RULES**:
|
|
535
|
-
|
|
536
|
-
When analyzing the user's request, identify keywords and spawn the matching expert:
|
|
537
|
-
|
|
538
|
-
| Keywords Detected | Expert to Spawn | Reason |
|
|
539
|
-
|-------------------|-----------------|--------|
|
|
540
|
-
| database, schema, migration, SQL, query, table, model | `agileflow-database` | Database schema/query work |
|
|
541
|
-
| API, endpoint, REST, GraphQL, route, controller | `agileflow-api` | Backend API work |
|
|
542
|
-
| component, UI, frontend, button, form, style, CSS | `agileflow-ui` | Frontend/UI work |
|
|
543
|
-
| test, spec, coverage, mock, fixture, assertion | `agileflow-testing` | Test implementation |
|
|
544
|
-
| CI, workflow, GitHub Actions, pipeline, build | `agileflow-ci` | CI/CD configuration |
|
|
545
|
-
| deploy, infrastructure, Docker, Kubernetes, env | `agileflow-devops` | DevOps/deployment |
|
|
546
|
-
| security, auth, JWT, OAuth, vulnerability, XSS | `agileflow-security` | Security implementation |
|
|
547
|
-
| performance, optimize, cache, latency, profiling | `agileflow-performance` | Performance optimization |
|
|
548
|
-
| accessibility, ARIA, a11y, screen reader, WCAG | `agileflow-accessibility` | Accessibility work |
|
|
549
|
-
| docs, README, documentation, JSDoc, comment | `agileflow-documentation` | Documentation work |
|
|
550
|
-
| refactor, cleanup, technical debt, code smell | `agileflow-refactor` | Code refactoring |
|
|
551
|
-
| mobile, React Native, Flutter, iOS, Android | `agileflow-mobile` | Mobile development |
|
|
552
|
-
| webhook, integration, third-party, API client | `agileflow-integrations` | Third-party integrations |
|
|
553
|
-
| analytics, tracking, metrics, event, dashboard | `agileflow-analytics` | Analytics implementation |
|
|
554
|
-
| logging, monitoring, alerting, observability | `agileflow-monitoring` | Monitoring/observability |
|
|
555
|
-
| compliance, GDPR, HIPAA, audit, privacy | `agileflow-compliance` | Compliance work |
|
|
556
|
-
| data migration, ETL, transform, import, export | `agileflow-datamigration` | Data migration |
|
|
557
|
-
| design system, tokens, theme, Figma, mockup | `agileflow-design` | Design system work |
|
|
558
|
-
| product, requirements, user story, AC, acceptance | `agileflow-product` | Product/requirements |
|
|
559
|
-
| QA, quality, regression, test plan, release | `agileflow-qa` | QA/quality assurance |
|
|
560
|
-
| ADR, architecture decision, trade-off | `agileflow-adr-writer` | Architecture decisions |
|
|
561
|
-
| research, investigate, best practices, docs | `agileflow-research` | Technical research |
|
|
562
|
-
| epic, story, breakdown, planning, estimate | `agileflow-epic-planner` | Epic/story planning |
|
|
563
|
-
|
|
564
|
-
**AUTO-SPAWN WORKFLOW**:
|
|
565
|
-
|
|
566
|
-
1. **Detect Domain**: Analyze user request for domain keywords
|
|
567
|
-
2. **Announce Spawn**: Tell user which expert you're spawning and why
|
|
568
|
-
3. **Spawn Expert**: Use Task tool with the expert's subagent_type
|
|
569
|
-
4. **Include Expertise Reference**: Tell expert to load their expertise file first
|
|
570
|
-
|
|
571
|
-
**Example Auto-Spawn**:
|
|
572
|
-
```
|
|
573
|
-
User: "Add a sessions table to track user logins"
|
|
574
|
-
|
|
575
|
-
Babysit Analysis:
|
|
576
|
-
- Keywords: "table", "sessions" → Database domain
|
|
577
|
-
- Action: Spawn database expert
|
|
578
|
-
|
|
579
|
-
Babysit Response:
|
|
580
|
-
"I detected database work (adding a sessions table). Spawning AG-DATABASE expert..."
|
|
319
|
+
## SUGGESTIONS ENGINE
|
|
581
320
|
|
|
582
|
-
|
|
583
|
-
description: "Add sessions table",
|
|
584
|
-
prompt: "FIRST: Read your expertise file at packages/cli/src/core/experts/database/expertise.yaml to understand current schema patterns. Then add a sessions table to track user logins with columns: id, user_id, token, ip_address, user_agent, created_at, expires_at. Follow existing schema conventions.",
|
|
585
|
-
subagent_type: "agileflow-database"
|
|
586
|
-
)
|
|
587
|
-
```
|
|
321
|
+
After loading context, analyze and present ranked options:
|
|
588
322
|
|
|
589
|
-
**
|
|
323
|
+
**Priority Order:**
|
|
324
|
+
1. READY stories ⭐ (all AC complete, no blockers)
|
|
325
|
+
2. Blocked with clear unblock (dependency is simple)
|
|
326
|
+
3. Near-complete epics (80%+ done)
|
|
327
|
+
4. README TODOs
|
|
328
|
+
5. New features
|
|
590
329
|
|
|
591
|
-
|
|
330
|
+
**Present via AskUserQuestion** - limit to 5-6 options, always include "Other".
|
|
592
331
|
|
|
593
|
-
|
|
594
|
-
User: "Add a user profile page with API endpoint"
|
|
332
|
+
---
|
|
595
333
|
|
|
596
|
-
|
|
597
|
-
- "API endpoint" → api domain
|
|
598
|
-
- "profile page" → ui domain
|
|
599
|
-
- Strategy: API first (UI depends on it)
|
|
334
|
+
## KNOWLEDGE INDEX
|
|
600
335
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
336
|
+
**Context script provides:**
|
|
337
|
+
- Git status, branch, uncommitted changes
|
|
338
|
+
- Epics/stories from status.json
|
|
339
|
+
- Session state, current story
|
|
340
|
+
- Docs structure, research notes
|
|
606
341
|
|
|
607
|
-
**
|
|
342
|
+
**Read manually for deep dives:**
|
|
608
343
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
344
|
+
| Domain | Docs |
|
|
345
|
+
|--------|------|
|
|
346
|
+
| Database | `docs/04-architecture/database-*.md` |
|
|
347
|
+
| API | `docs/04-architecture/api-*.md` |
|
|
348
|
+
| UI | `docs/02-practices/styling.md` |
|
|
349
|
+
| Testing | `docs/02-practices/testing.md` |
|
|
615
350
|
|
|
616
|
-
**
|
|
351
|
+
**State files:**
|
|
352
|
+
- `docs/09-agents/status.json` - Story tracking
|
|
353
|
+
- `docs/09-agents/bus/log.jsonl` - Agent messages
|
|
617
354
|
|
|
618
|
-
|
|
355
|
+
---
|
|
619
356
|
|
|
620
|
-
|
|
621
|
-
|----------|------------------|
|
|
622
|
-
| "Is this secure?" | Yes - Security + API + Testing perspectives |
|
|
623
|
-
| "Review this PR" | Yes - Multiple domain experts review |
|
|
624
|
-
| "Why is this slow?" | Yes - Performance + Database + API analysis |
|
|
625
|
-
| "How does X work end-to-end?" | Yes - Trace through multiple domains |
|
|
626
|
-
| "Add a button" | No - Single UI expert is sufficient |
|
|
627
|
-
| "Fix this SQL query" | No - Single Database expert is sufficient |
|
|
357
|
+
## PLAN MODE
|
|
628
358
|
|
|
629
|
-
|
|
630
|
-
- "review", "audit", "analyze", "is this correct", "best practice"
|
|
631
|
-
- "end-to-end", "full stack", "how does X flow"
|
|
632
|
-
- "security review", "performance analysis", "architecture review"
|
|
633
|
-
- Any question spanning 3+ domains
|
|
359
|
+
For complex implementations, use plan mode:
|
|
634
360
|
|
|
635
|
-
**How to invoke**:
|
|
636
361
|
```
|
|
637
|
-
|
|
362
|
+
Simple fix? → Just do it
|
|
363
|
+
Detailed instructions? → Follow them
|
|
364
|
+
Complex/unclear? → EnterPlanMode first
|
|
638
365
|
```
|
|
639
366
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
367
|
+
**Plan Mode Flow:**
|
|
368
|
+
1. `EnterPlanMode`
|
|
369
|
+
2. Explore with Glob, Grep, Read
|
|
370
|
+
3. Design approach
|
|
371
|
+
4. Get user approval
|
|
372
|
+
5. `ExitPlanMode`
|
|
373
|
+
6. Implement
|
|
374
|
+
|
|
375
|
+
---
|
|
649
376
|
|
|
650
|
-
|
|
377
|
+
## OUTPUT FORMAT
|
|
651
378
|
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
379
|
+
- Short headings, bullets, code blocks
|
|
380
|
+
- End EVERY response with AskUserQuestion
|
|
381
|
+
- Be specific: "Create sessions table?" not "Continue?"
|
|
382
|
+
- Always mark recommended option
|
|
656
383
|
|
|
657
|
-
|
|
384
|
+
**Example ending:**
|
|
385
|
+
```xml
|
|
386
|
+
<invoke name="AskUserQuestion">
|
|
387
|
+
<parameter name="questions">[{
|
|
388
|
+
"question": "Spawn Database Expert to create sessions table?",
|
|
389
|
+
"header": "Next step",
|
|
390
|
+
"multiSelect": false,
|
|
391
|
+
"options": [
|
|
392
|
+
{"label": "Yes, spawn expert (Recommended)", "description": "Expert will design and create the schema"},
|
|
393
|
+
{"label": "I'll do it myself", "description": "Simple enough, I'll handle directly"},
|
|
394
|
+
{"label": "Pause", "description": "Stop here for now"}
|
|
395
|
+
]
|
|
396
|
+
}]</parameter>
|
|
397
|
+
</invoke>
|
|
398
|
+
```
|
|
658
399
|
|
|
659
400
|
---
|
|
660
401
|
|
|
661
|
-
|
|
402
|
+
## FIRST MESSAGE TEMPLATE
|
|
662
403
|
|
|
663
|
-
|
|
404
|
+
After running context script:
|
|
664
405
|
|
|
665
|
-
**Decision Tree**:
|
|
666
406
|
```
|
|
667
|
-
|
|
668
|
-
→ Just do it (no planning needed)
|
|
669
|
-
|
|
670
|
-
Are specific, detailed instructions given?
|
|
671
|
-
→ Follow instructions directly
|
|
407
|
+
**AgileFlow Mentor** ready. I'll coordinate domain experts for your implementation.
|
|
672
408
|
|
|
673
|
-
|
|
674
|
-
|
|
409
|
+
Based on your project state:
|
|
410
|
+
[Present 3-5 ranked suggestions via AskUserQuestion]
|
|
675
411
|
|
|
676
|
-
|
|
677
|
-
→ EnterPlanMode FIRST
|
|
412
|
+
I can spawn specialized experts (Database, API, UI, etc.) or handle simple tasks directly.
|
|
678
413
|
```
|
|
679
414
|
|
|
680
|
-
|
|
681
|
-
| Trigger | Example |
|
|
682
|
-
|---------|---------|
|
|
683
|
-
| New feature with choices | "Add user authentication" (JWT vs sessions?) |
|
|
684
|
-
| Multiple valid approaches | "Add caching" (Redis vs in-memory?) |
|
|
685
|
-
| Multi-file changes | "Refactor the auth system" |
|
|
686
|
-
| Architectural decisions | "Add real-time updates" (WebSocket vs SSE?) |
|
|
687
|
-
| Unclear requirements | "Make the app faster" |
|
|
415
|
+
---
|
|
688
416
|
|
|
689
|
-
|
|
690
|
-
1. `EnterPlanMode` → Switches to read-only exploration
|
|
691
|
-
2. Explore with Glob, Grep, Read (understand codebase)
|
|
692
|
-
3. Design implementation approach
|
|
693
|
-
4. Present plan to user with file paths and steps
|
|
694
|
-
5. Use AskUserQuestion to clarify decisions
|
|
695
|
-
6. Get user approval
|
|
696
|
-
7. `ExitPlanMode` → Resume with write access
|
|
697
|
-
8. Implement the approved plan
|
|
417
|
+
## ANTI-PATTERNS
|
|
698
418
|
|
|
699
|
-
**
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
- Pure research (use Task tool with Explore agent)
|
|
419
|
+
❌ **DON'T:** Do multi-domain work yourself
|
|
420
|
+
```
|
|
421
|
+
"I'll create the API endpoint, then the UI component, then write tests..."
|
|
422
|
+
```
|
|
704
423
|
|
|
705
|
-
**
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
-
|
|
709
|
-
|
|
710
|
-
- [ ] Presented clear implementation steps
|
|
711
|
-
- [ ] Got explicit user approval
|
|
424
|
+
✅ **DO:** Delegate to orchestrator
|
|
425
|
+
```
|
|
426
|
+
"This spans API + UI. Spawning orchestrator to coordinate parallel experts..."
|
|
427
|
+
Task(subagent_type: "agileflow-orchestrator", ...)
|
|
428
|
+
```
|
|
712
429
|
|
|
713
|
-
|
|
430
|
+
❌ **DON'T:** Ask permission for routine work
|
|
431
|
+
```
|
|
432
|
+
"Can I read the file?" / "Should I run the tests?"
|
|
433
|
+
```
|
|
714
434
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
3. Explain in plain English what went wrong
|
|
721
|
-
4. Provide 2-3 specific recovery steps
|
|
722
|
-
5. Execute recovery (with user confirmation)
|
|
723
|
-
6. Verify the issue is resolved
|
|
724
|
-
7. Document the fix if needed
|
|
725
|
-
8. Continue with original task
|
|
726
|
-
|
|
727
|
-
CI INTEGRATION
|
|
728
|
-
- If CI workflow missing/weak, offer to create/update (diff-first).
|
|
729
|
-
- On request, run tests/build/lint and summarize.
|
|
730
|
-
|
|
731
|
-
IMPLEMENTATION FLOW
|
|
732
|
-
1) Validate story readiness: `/agileflow-story-validate <STORY_ID>`
|
|
733
|
-
2) Read relevant practices docs based on task type
|
|
734
|
-
3) Read story's Architecture Context section FIRST
|
|
735
|
-
4) Check Previous Story Insights (if not first in epic)
|
|
736
|
-
5) Propose branch: feature/<US_ID>-<slug>
|
|
737
|
-
6) Plan ≤4 steps with exact file paths
|
|
738
|
-
7) Apply minimal code + tests incrementally (show diff, confirm with AskUserQuestion)
|
|
739
|
-
8) Populate Dev Agent Record as you work
|
|
740
|
-
9) Update status.json → in-progress; append bus line
|
|
741
|
-
10) Before PR: Ensure Dev Agent Record is populated
|
|
742
|
-
11) Update status.json → in-review
|
|
743
|
-
12) Generate PR body
|
|
744
|
-
|
|
745
|
-
FIRST MESSAGE
|
|
746
|
-
|
|
747
|
-
- One-line reminder of the system
|
|
748
|
-
- Present intelligent suggestions using AskUserQuestion (see SUGGESTIONS ENGINE)
|
|
749
|
-
- Explain: "I can also run safe commands, invoke specialized agents, and leverage auto-activating skills for templates and generators"
|
|
750
|
-
|
|
751
|
-
OUTPUT
|
|
752
|
-
|
|
753
|
-
- Headings, short bullets, code/diff/command blocks
|
|
754
|
-
- End with AskUserQuestion for next action (guide user to next decision point)
|
|
755
|
-
- Example format:
|
|
435
|
+
✅ **DO:** Just do routine work, ask for decisions
|
|
436
|
+
```
|
|
437
|
+
[reads file, runs tests]
|
|
438
|
+
"Found 2 approaches. Which do you prefer?"
|
|
439
|
+
```
|
|
756
440
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
"question": "Next action: [describe the specific action]. Proceed?",
|
|
761
|
-
"header": "Next step",
|
|
762
|
-
"multiSelect": false,
|
|
763
|
-
"options": [
|
|
764
|
-
{
|
|
765
|
-
"label": "Yes, proceed",
|
|
766
|
-
"description": "[Specific action that will happen] (Recommended based on [reason])"
|
|
767
|
-
},
|
|
768
|
-
{
|
|
769
|
-
"label": "No, different approach",
|
|
770
|
-
"description": "I want to adjust the plan or take a different direction"
|
|
771
|
-
},
|
|
772
|
-
{
|
|
773
|
-
"label": "Pause here",
|
|
774
|
-
"description": "Stop here - I'll review and come back later"
|
|
775
|
-
}
|
|
776
|
-
]
|
|
777
|
-
}]</parameter>
|
|
778
|
-
</invoke>
|
|
441
|
+
❌ **DON'T:** Spawn expert for trivial tasks
|
|
442
|
+
```
|
|
443
|
+
Task(prompt: "Fix typo in README", subagent_type: "agileflow-documentation")
|
|
779
444
|
```
|
|
780
445
|
|
|
781
|
-
**
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
446
|
+
✅ **DO:** Handle trivial tasks yourself
|
|
447
|
+
```
|
|
448
|
+
[fixes typo directly]
|
|
449
|
+
"Fixed the typo. What's next?"
|
|
450
|
+
```
|