agileflow 2.80.0 → 2.82.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 +6 -6
- package/package.json +1 -1
- package/scripts/agent-loop.js +765 -0
- package/scripts/agileflow-configure.js +3 -1
- package/scripts/agileflow-welcome.js +65 -0
- package/scripts/damage-control-bash.js +22 -115
- package/scripts/damage-control-edit.js +19 -156
- package/scripts/damage-control-write.js +19 -156
- package/scripts/lib/damage-control-utils.js +251 -0
- package/scripts/obtain-context.js +57 -2
- package/scripts/ralph-loop.js +516 -32
- package/scripts/session-manager.js +434 -20
- package/src/core/agents/configuration-visual-e2e.md +300 -0
- package/src/core/agents/orchestrator.md +301 -6
- package/src/core/commands/babysit.md +193 -15
- package/src/core/commands/batch.md +362 -0
- package/src/core/commands/choose.md +337 -0
- package/src/core/commands/configure.md +372 -100
- package/src/core/commands/session/end.md +332 -103
- package/src/core/commands/workflow.md +344 -0
- package/src/core/commands/setup/visual-e2e.md +0 -462
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: AI-directed decision making with structured options
|
|
3
|
+
argument-hint: <decision> [context]
|
|
4
|
+
compact_context:
|
|
5
|
+
priority: normal
|
|
6
|
+
preserve_rules:
|
|
7
|
+
- "Present structured options with trade-offs"
|
|
8
|
+
- "AI selects best option based on context"
|
|
9
|
+
- "Always explain selection rationale"
|
|
10
|
+
- "Can delegate to experts for analysis before choosing"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# /agileflow:choose
|
|
14
|
+
|
|
15
|
+
AI-directed decision making. Use when multiple valid approaches exist and you want Claude to analyze trade-offs and recommend the best option.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## STEP 0: Gather Context
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
node .agileflow/scripts/obtain-context.js choose
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<!-- COMPACT_SUMMARY_START -->
|
|
28
|
+
|
|
29
|
+
## Compact Summary
|
|
30
|
+
|
|
31
|
+
**Role**: Decision Advisor - Analyze options and recommend best approach
|
|
32
|
+
|
|
33
|
+
**When to use:**
|
|
34
|
+
- Multiple valid approaches exist
|
|
35
|
+
- Trade-offs need analysis
|
|
36
|
+
- Expert judgment required
|
|
37
|
+
- Not a simple yes/no question
|
|
38
|
+
|
|
39
|
+
**Choice block syntax:**
|
|
40
|
+
```
|
|
41
|
+
choice **<decision criteria>**:
|
|
42
|
+
option "<name>":
|
|
43
|
+
- Description
|
|
44
|
+
- Trade-offs
|
|
45
|
+
option "<name>":
|
|
46
|
+
- Description
|
|
47
|
+
- Trade-offs
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Output format:**
|
|
51
|
+
```
|
|
52
|
+
## Decision: <question>
|
|
53
|
+
|
|
54
|
+
### Options Analyzed
|
|
55
|
+
1. Option A: [analysis]
|
|
56
|
+
2. Option B: [analysis]
|
|
57
|
+
|
|
58
|
+
### Recommendation
|
|
59
|
+
**Selected: Option X**
|
|
60
|
+
Rationale: [why this is best]
|
|
61
|
+
|
|
62
|
+
### Trade-offs Accepted
|
|
63
|
+
- [trade-off 1]
|
|
64
|
+
- [trade-off 2]
|
|
65
|
+
|
|
66
|
+
### Next Steps
|
|
67
|
+
1. [action 1]
|
|
68
|
+
2. [action 2]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
<!-- COMPACT_SUMMARY_END -->
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Usage
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
/agileflow:choose <decision>
|
|
79
|
+
/agileflow:choose <decision> CONTEXT=<additional_context>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## How It Works
|
|
85
|
+
|
|
86
|
+
### 1. Analyze the Decision
|
|
87
|
+
|
|
88
|
+
First, understand what's being decided:
|
|
89
|
+
- What are the constraints?
|
|
90
|
+
- What matters most? (speed, quality, maintainability, etc.)
|
|
91
|
+
- What's the current context?
|
|
92
|
+
|
|
93
|
+
### 2. Generate Options
|
|
94
|
+
|
|
95
|
+
For each viable approach:
|
|
96
|
+
- **Name**: Clear label
|
|
97
|
+
- **Description**: What this approach entails
|
|
98
|
+
- **Pros**: Benefits and strengths
|
|
99
|
+
- **Cons**: Drawbacks and risks
|
|
100
|
+
- **Effort**: Relative implementation cost
|
|
101
|
+
- **Risk**: Potential failure modes
|
|
102
|
+
|
|
103
|
+
### 3. Evaluate Against Criteria
|
|
104
|
+
|
|
105
|
+
Score each option against relevant factors:
|
|
106
|
+
- **Fit**: How well it matches requirements
|
|
107
|
+
- **Feasibility**: How practical to implement
|
|
108
|
+
- **Future-proof**: How well it handles change
|
|
109
|
+
- **Team capacity**: Skills and time available
|
|
110
|
+
|
|
111
|
+
### 4. Make Recommendation
|
|
112
|
+
|
|
113
|
+
Select the best option and explain:
|
|
114
|
+
- Why this option wins
|
|
115
|
+
- What trade-offs are accepted
|
|
116
|
+
- What risks to monitor
|
|
117
|
+
- What next steps to take
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Examples
|
|
122
|
+
|
|
123
|
+
### Performance Optimization
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
/agileflow:choose best approach to fix slow API response times
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Decision**: Best approach to fix slow API response times
|
|
130
|
+
|
|
131
|
+
**Options:**
|
|
132
|
+
1. **Add Caching (Redis)**
|
|
133
|
+
- Pros: Fast reads, reduces DB load
|
|
134
|
+
- Cons: Cache invalidation complexity, added infrastructure
|
|
135
|
+
- Effort: Medium
|
|
136
|
+
- Risk: Stale data issues
|
|
137
|
+
|
|
138
|
+
2. **Optimize Database Queries**
|
|
139
|
+
- Pros: Addresses root cause, no new dependencies
|
|
140
|
+
- Cons: May have diminishing returns, requires deep analysis
|
|
141
|
+
- Effort: High
|
|
142
|
+
- Risk: May not be enough
|
|
143
|
+
|
|
144
|
+
3. **Add Pagination**
|
|
145
|
+
- Pros: Reduces data transfer, simple to implement
|
|
146
|
+
- Cons: UI changes needed, doesn't fix underlying issue
|
|
147
|
+
- Effort: Low
|
|
148
|
+
- Risk: Just masks the problem
|
|
149
|
+
|
|
150
|
+
**Recommendation**: Start with **Option 2 (Optimize Queries)**, then add **Option 1 (Caching)** if needed.
|
|
151
|
+
|
|
152
|
+
**Rationale**: Optimizing queries addresses the root cause. Adding caching on top of slow queries just hides the problem. Start with the foundation, then layer caching for frequently accessed data.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### Architecture Decision
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
/agileflow:choose authentication approach for new API CONTEXT="multi-tenant SaaS, 50K users"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Decision**: Authentication approach for multi-tenant SaaS (50K users)
|
|
163
|
+
|
|
164
|
+
**Options:**
|
|
165
|
+
1. **JWT with Short Expiry**
|
|
166
|
+
- Pros: Stateless, scalable, industry standard
|
|
167
|
+
- Cons: Can't revoke tokens instantly, need refresh token logic
|
|
168
|
+
- Effort: Medium
|
|
169
|
+
- Risk: Token theft requires expiry wait
|
|
170
|
+
|
|
171
|
+
2. **Session-based Auth**
|
|
172
|
+
- Pros: Instant revocation, simple mental model
|
|
173
|
+
- Cons: Server state, horizontal scaling needs session store
|
|
174
|
+
- Effort: Medium
|
|
175
|
+
- Risk: Session store becomes bottleneck
|
|
176
|
+
|
|
177
|
+
3. **OAuth 2.0 with Identity Provider**
|
|
178
|
+
- Pros: SSO support, enterprise ready, offloads auth complexity
|
|
179
|
+
- Cons: External dependency, more complex integration
|
|
180
|
+
- Effort: High
|
|
181
|
+
- Risk: Vendor lock-in, latency from external calls
|
|
182
|
+
|
|
183
|
+
**Recommendation**: **Option 3 (OAuth 2.0 with Identity Provider)**
|
|
184
|
+
|
|
185
|
+
**Rationale**: For multi-tenant SaaS with 50K users:
|
|
186
|
+
- Enterprises will expect SSO
|
|
187
|
+
- Managing auth in-house is a liability
|
|
188
|
+
- Auth0/Okta handle the complexity
|
|
189
|
+
- Worth the integration effort upfront
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### Development Approach
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
/agileflow:choose how to implement the new dashboard feature
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Decision**: Development approach for new dashboard
|
|
200
|
+
|
|
201
|
+
**Options:**
|
|
202
|
+
1. **Quick Prototype**
|
|
203
|
+
- Pros: Fast iteration, early feedback
|
|
204
|
+
- Cons: Tech debt, may need rewrite
|
|
205
|
+
- Effort: Low
|
|
206
|
+
- Risk: Prototype becomes production
|
|
207
|
+
|
|
208
|
+
2. **Full Architecture First**
|
|
209
|
+
- Pros: Solid foundation, scalable
|
|
210
|
+
- Cons: Slow, may over-engineer
|
|
211
|
+
- Effort: High
|
|
212
|
+
- Risk: Analysis paralysis
|
|
213
|
+
|
|
214
|
+
3. **Incremental TDD**
|
|
215
|
+
- Pros: Quality + speed balance, refactorable
|
|
216
|
+
- Cons: Requires discipline, initial slowdown
|
|
217
|
+
- Effort: Medium
|
|
218
|
+
- Risk: Tests may constrain design
|
|
219
|
+
|
|
220
|
+
**Recommendation**: **Option 3 (Incremental TDD)**
|
|
221
|
+
|
|
222
|
+
**Rationale**: Dashboard is user-facing with many edge cases. TDD ensures:
|
|
223
|
+
- Components work correctly from the start
|
|
224
|
+
- Refactoring is safe when design evolves
|
|
225
|
+
- Tests serve as documentation
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Integration with Experts
|
|
230
|
+
|
|
231
|
+
For complex decisions, delegate analysis to domain experts:
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
choice **best database for this workload**:
|
|
235
|
+
experts:
|
|
236
|
+
- agileflow-database (analyze data patterns)
|
|
237
|
+
- agileflow-performance (analyze scaling needs)
|
|
238
|
+
options:
|
|
239
|
+
- PostgreSQL
|
|
240
|
+
- MongoDB
|
|
241
|
+
- DynamoDB
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
This spawns experts in parallel to analyze, then synthesizes their recommendations.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Choice Block Syntax (Advanced)
|
|
249
|
+
|
|
250
|
+
For embedding choice blocks in workflows:
|
|
251
|
+
|
|
252
|
+
```markdown
|
|
253
|
+
## Decision Point
|
|
254
|
+
|
|
255
|
+
choice **<criteria>**:
|
|
256
|
+
option "<name>":
|
|
257
|
+
- Description line 1
|
|
258
|
+
- Description line 2
|
|
259
|
+
option "<name>":
|
|
260
|
+
- Description line 1
|
|
261
|
+
- Description line 2
|
|
262
|
+
|
|
263
|
+
### After Choice
|
|
264
|
+
|
|
265
|
+
Proceed with selected option...
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
The AI evaluates options against the criteria and selects the best one.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Output Format
|
|
273
|
+
|
|
274
|
+
Every choice decision outputs:
|
|
275
|
+
|
|
276
|
+
```markdown
|
|
277
|
+
## Decision: [question]
|
|
278
|
+
|
|
279
|
+
### Context
|
|
280
|
+
[Summary of situation and constraints]
|
|
281
|
+
|
|
282
|
+
### Options Analyzed
|
|
283
|
+
|
|
284
|
+
#### Option 1: [name]
|
|
285
|
+
**Description**: [what it is]
|
|
286
|
+
**Pros**: [benefits]
|
|
287
|
+
**Cons**: [drawbacks]
|
|
288
|
+
**Effort**: [low/medium/high]
|
|
289
|
+
**Risk**: [potential issues]
|
|
290
|
+
|
|
291
|
+
#### Option 2: [name]
|
|
292
|
+
...
|
|
293
|
+
|
|
294
|
+
### Analysis
|
|
295
|
+
|
|
296
|
+
[Comparison matrix or discussion]
|
|
297
|
+
|
|
298
|
+
### Recommendation
|
|
299
|
+
|
|
300
|
+
**Selected: [option name]**
|
|
301
|
+
|
|
302
|
+
**Rationale**: [why this option is best for this situation]
|
|
303
|
+
|
|
304
|
+
**Trade-offs Accepted**:
|
|
305
|
+
- [trade-off 1]
|
|
306
|
+
- [trade-off 2]
|
|
307
|
+
|
|
308
|
+
### Next Steps
|
|
309
|
+
1. [immediate action]
|
|
310
|
+
2. [follow-up action]
|
|
311
|
+
3. [verification step]
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## When NOT to Use
|
|
317
|
+
|
|
318
|
+
- Simple yes/no questions (just answer directly)
|
|
319
|
+
- Only one viable option (just proceed)
|
|
320
|
+
- User has already decided (just implement)
|
|
321
|
+
- Trivial decisions (don't over-engineer the process)
|
|
322
|
+
|
|
323
|
+
Use `/agileflow:choose` for decisions that:
|
|
324
|
+
- Have 2+ viable options
|
|
325
|
+
- Involve trade-offs worth analyzing
|
|
326
|
+
- Benefit from structured thinking
|
|
327
|
+
- Need documented rationale
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Best Practices
|
|
332
|
+
|
|
333
|
+
1. **Include context**: More context = better recommendations
|
|
334
|
+
2. **Define success criteria**: What matters most?
|
|
335
|
+
3. **Be honest about trade-offs**: Every option has downsides
|
|
336
|
+
4. **Document decisions**: Use `/agileflow:adr` for important architectural choices
|
|
337
|
+
5. **Revisit decisions**: Circumstances change; choices may need updating
|