agileflow 2.81.0 → 2.82.1

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.
@@ -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
@@ -0,0 +1,344 @@
1
+ ---
2
+ description: Define and run parameterized workflow templates
3
+ argument-hint: <template> [arguments...]
4
+ compact_context:
5
+ priority: normal
6
+ preserve_rules:
7
+ - "Workflows are reusable templates with arguments"
8
+ - "Template format: {{arg_name}} for substitution"
9
+ - "Built-in workflows: review, test-feature, implement, analyze"
10
+ - "Custom workflows in docs/08-project/workflows/"
11
+ ---
12
+
13
+ # /agileflow:workflow
14
+
15
+ Run parameterized workflow templates. Enables DRY patterns for common multi-step operations.
16
+
17
+ ---
18
+
19
+ ## STEP 0: Gather Context
20
+
21
+ ```bash
22
+ node .agileflow/scripts/obtain-context.js workflow
23
+ ```
24
+
25
+ ---
26
+
27
+ <!-- COMPACT_SUMMARY_START -->
28
+
29
+ ## Compact Summary
30
+
31
+ **Role**: Workflow Runner - Execute parameterized templates
32
+
33
+ **Template syntax**: `{{arg}}` for argument substitution
34
+
35
+ **Built-in workflows:**
36
+ - `review` - Code review with configurable focus
37
+ - `test-feature` - Test and verify a feature
38
+ - `implement` - Implement a story/feature
39
+ - `analyze` - Analyze codebase for issues
40
+
41
+ **Usage:**
42
+ ```
43
+ /agileflow:workflow review path=src/auth.ts focus=security
44
+ /agileflow:workflow implement story=US-0042
45
+ /agileflow:workflow analyze target=src/**/*.ts type=performance
46
+ ```
47
+
48
+ <!-- COMPACT_SUMMARY_END -->
49
+
50
+ ---
51
+
52
+ ## Usage
53
+
54
+ ```
55
+ /agileflow:workflow <template> [arg1=value1] [arg2=value2] ...
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Built-in Workflows
61
+
62
+ ### review
63
+
64
+ Review code with configurable focus.
65
+
66
+ **Arguments:**
67
+ - `path` (required): File or glob pattern to review
68
+ - `focus` (optional): Review focus (security, performance, quality, all)
69
+
70
+ **Template:**
71
+ ```markdown
72
+ ## Code Review: {{path}}
73
+
74
+ Focus: {{focus:all}}
75
+
76
+ ### Steps
77
+ 1. Read the target file(s)
78
+ 2. Analyze for {{focus}} issues
79
+ 3. Generate findings with severity
80
+ 4. Suggest fixes
81
+
82
+ ### Experts (parallel, on-fail: continue)
83
+ - agileflow-security (if focus=security|all)
84
+ - agileflow-performance (if focus=performance|all)
85
+ - agileflow-testing (if focus=quality|all)
86
+ ```
87
+
88
+ **Example:**
89
+ ```
90
+ /agileflow:workflow review path=src/auth.ts focus=security
91
+ ```
92
+
93
+ ---
94
+
95
+ ### test-feature
96
+
97
+ Test a feature end-to-end.
98
+
99
+ **Arguments:**
100
+ - `feature` (required): Feature name or path
101
+ - `coverage` (optional): Minimum coverage threshold (default: 80)
102
+
103
+ **Template:**
104
+ ```markdown
105
+ ## Test Feature: {{feature}}
106
+
107
+ Coverage threshold: {{coverage:80}}%
108
+
109
+ ### Steps
110
+ 1. Identify test files for feature
111
+ 2. Run existing tests
112
+ 3. Generate missing tests
113
+ 4. Verify coverage >= {{coverage}}%
114
+
115
+ ### Expert: agileflow-testing
116
+ Discretion condition: **coverage above {{coverage}}%**
117
+ ```
118
+
119
+ **Example:**
120
+ ```
121
+ /agileflow:workflow test-feature feature=user-auth coverage=90
122
+ ```
123
+
124
+ ---
125
+
126
+ ### implement
127
+
128
+ Implement a story or feature.
129
+
130
+ **Arguments:**
131
+ - `story` (required): Story ID or description
132
+ - `mode` (optional): Implementation mode (quick, thorough, tdd)
133
+
134
+ **Template:**
135
+ ```markdown
136
+ ## Implement: {{story}}
137
+
138
+ Mode: {{mode:thorough}}
139
+
140
+ ### Steps (based on mode)
141
+
142
+ #### If mode=quick:
143
+ 1. Minimal implementation
144
+ 2. Basic tests
145
+ 3. Quick review
146
+
147
+ #### If mode=thorough:
148
+ 1. Plan mode first
149
+ 2. Full implementation
150
+ 3. Comprehensive tests
151
+ 4. Code review
152
+ 5. Documentation
153
+
154
+ #### If mode=tdd:
155
+ 1. Write tests first
156
+ 2. Implement to pass tests
157
+ 3. Refactor
158
+ 4. Verify coverage
159
+
160
+ ### Expert selection based on story domain
161
+ ```
162
+
163
+ **Example:**
164
+ ```
165
+ /agileflow:workflow implement story=US-0042 mode=tdd
166
+ ```
167
+
168
+ ---
169
+
170
+ ### analyze
171
+
172
+ Analyze codebase for issues.
173
+
174
+ **Arguments:**
175
+ - `target` (required): Path or glob pattern
176
+ - `type` (required): Analysis type (security, performance, complexity, all)
177
+
178
+ **Template:**
179
+ ```markdown
180
+ ## Analyze: {{target}}
181
+
182
+ Type: {{type}}
183
+
184
+ ### Steps
185
+ 1. Gather files matching {{target}}
186
+ 2. Run {{type}} analysis
187
+ 3. Generate report with findings
188
+ 4. Prioritize by severity
189
+
190
+ ### Experts (parallel, strategy: all, on-fail: continue)
191
+ - agileflow-security (if type=security|all)
192
+ - agileflow-performance (if type=performance|all)
193
+ - agileflow-refactor (if type=complexity|all)
194
+
195
+ ### Output
196
+ Markdown report with:
197
+ - Summary metrics
198
+ - Findings by severity
199
+ - Recommended actions
200
+ ```
201
+
202
+ **Example:**
203
+ ```
204
+ /agileflow:workflow analyze target=src/**/*.ts type=all
205
+ ```
206
+
207
+ ---
208
+
209
+ ## Custom Workflows
210
+
211
+ Create custom workflows in `docs/08-project/workflows/`:
212
+
213
+ ```
214
+ docs/08-project/workflows/
215
+ ├── deploy-staging.md
216
+ ├── release-check.md
217
+ └── onboard-feature.md
218
+ ```
219
+
220
+ ### Custom Workflow Format
221
+
222
+ ```markdown
223
+ ---
224
+ name: deploy-staging
225
+ description: Deploy to staging environment
226
+ arguments:
227
+ - name: version
228
+ required: true
229
+ description: Version to deploy
230
+ - name: notify
231
+ required: false
232
+ default: true
233
+ description: Send Slack notification
234
+ ---
235
+
236
+ # Deploy to Staging: {{version}}
237
+
238
+ ## Pre-checks
239
+ 1. Verify tests passing
240
+ 2. Check no blocking PRs
241
+
242
+ ## Deployment
243
+ 1. Build version {{version}}
244
+ 2. Deploy to staging cluster
245
+ 3. Run smoke tests
246
+
247
+ ## Post-deploy
248
+ {{#if notify}}
249
+ 4. Send Slack notification
250
+ {{/if}}
251
+ ```
252
+
253
+ ### Using Custom Workflows
254
+
255
+ ```
256
+ /agileflow:workflow deploy-staging version=2.42.0 notify=false
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Advanced Features
262
+
263
+ ### Conditional Sections
264
+
265
+ Use `{{#if arg}}` for conditional content:
266
+
267
+ ```markdown
268
+ {{#if verbose}}
269
+ ### Verbose Output
270
+ Show detailed logs...
271
+ {{/if}}
272
+ ```
273
+
274
+ ### Default Values
275
+
276
+ Use `{{arg:default}}` for default values:
277
+
278
+ ```markdown
279
+ Coverage threshold: {{coverage:80}}%
280
+ Mode: {{mode:thorough}}
281
+ ```
282
+
283
+ ### Lists
284
+
285
+ Use `{{args...}}` for multiple values:
286
+
287
+ ```markdown
288
+ Files to process:
289
+ {{#each files}}
290
+ - {{this}}
291
+ {{/each}}
292
+ ```
293
+
294
+ ---
295
+
296
+ ## Workflow Composition
297
+
298
+ Workflows can reference other workflows:
299
+
300
+ ```markdown
301
+ ## Full Release
302
+
303
+ 1. /agileflow:workflow test-feature feature=all coverage=90
304
+ 2. /agileflow:workflow analyze target=src type=security
305
+ 3. /agileflow:workflow deploy-staging version={{version}}
306
+ ```
307
+
308
+ ---
309
+
310
+ ## Workflow Discovery
311
+
312
+ List available workflows:
313
+
314
+ ```
315
+ /agileflow:workflow --list
316
+
317
+ Built-in workflows:
318
+ - review: Code review with focus
319
+ - test-feature: Test a feature
320
+ - implement: Implement a story
321
+ - analyze: Analyze codebase
322
+
323
+ Custom workflows (docs/08-project/workflows/):
324
+ - deploy-staging: Deploy to staging
325
+ - release-check: Pre-release checklist
326
+ ```
327
+
328
+ ---
329
+
330
+ ## Best Practices
331
+
332
+ 1. **Use descriptive names**: `deploy-staging` not `ds`
333
+ 2. **Document arguments**: Include types and defaults
334
+ 3. **Keep workflows focused**: One purpose per workflow
335
+ 4. **Use composition**: Build complex flows from simple ones
336
+ 5. **Version workflows**: Track changes in git
337
+
338
+ ---
339
+
340
+ ## Integration
341
+
342
+ - Works with babysit for story implementation
343
+ - Can trigger from Ralph Loop
344
+ - Integrates with expert system for multi-domain work