agileflow 3.4.0 → 3.4.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +4 -4
  3. package/package.json +1 -1
  4. package/scripts/agileflow-welcome.js +79 -0
  5. package/scripts/claude-tmux.sh +12 -36
  6. package/scripts/lib/ac-test-matcher.js +452 -0
  7. package/scripts/lib/audit-registry.js +58 -2
  8. package/scripts/lib/configure-features.js +35 -0
  9. package/scripts/lib/model-profiles.js +25 -5
  10. package/scripts/lib/quality-gates.js +163 -0
  11. package/scripts/lib/signal-detectors.js +43 -0
  12. package/scripts/lib/status-writer.js +255 -0
  13. package/scripts/lib/story-claiming.js +128 -45
  14. package/scripts/lib/task-sync.js +32 -38
  15. package/scripts/lib/tmux-audit-monitor.js +611 -0
  16. package/scripts/lib/tool-registry.yaml +241 -0
  17. package/scripts/lib/tool-shed.js +441 -0
  18. package/scripts/native-team-observer.js +219 -0
  19. package/scripts/obtain-context.js +14 -0
  20. package/scripts/ralph-loop.js +30 -5
  21. package/scripts/smart-detect.js +21 -0
  22. package/scripts/spawn-audit-sessions.js +372 -44
  23. package/scripts/team-manager.js +19 -0
  24. package/src/core/agents/a11y-analyzer-aria.md +155 -0
  25. package/src/core/agents/a11y-analyzer-forms.md +162 -0
  26. package/src/core/agents/a11y-analyzer-keyboard.md +175 -0
  27. package/src/core/agents/a11y-analyzer-semantic.md +153 -0
  28. package/src/core/agents/a11y-analyzer-visual.md +158 -0
  29. package/src/core/agents/a11y-consensus.md +248 -0
  30. package/src/core/agents/ads-consensus.md +74 -0
  31. package/src/core/agents/ads-generate.md +145 -0
  32. package/src/core/agents/ads-performance-tracker.md +197 -0
  33. package/src/core/agents/api-quality-analyzer-conventions.md +148 -0
  34. package/src/core/agents/api-quality-analyzer-docs.md +176 -0
  35. package/src/core/agents/api-quality-analyzer-errors.md +183 -0
  36. package/src/core/agents/api-quality-analyzer-pagination.md +171 -0
  37. package/src/core/agents/api-quality-analyzer-versioning.md +143 -0
  38. package/src/core/agents/api-quality-consensus.md +214 -0
  39. package/src/core/agents/arch-analyzer-circular.md +148 -0
  40. package/src/core/agents/arch-analyzer-complexity.md +171 -0
  41. package/src/core/agents/arch-analyzer-coupling.md +146 -0
  42. package/src/core/agents/arch-analyzer-layering.md +151 -0
  43. package/src/core/agents/arch-analyzer-patterns.md +162 -0
  44. package/src/core/agents/arch-consensus.md +227 -0
  45. package/src/core/commands/adr.md +1 -0
  46. package/src/core/commands/ads/generate.md +238 -0
  47. package/src/core/commands/ads/health.md +327 -0
  48. package/src/core/commands/ads/test-plan.md +317 -0
  49. package/src/core/commands/ads/track.md +288 -0
  50. package/src/core/commands/ads.md +28 -16
  51. package/src/core/commands/assign.md +1 -0
  52. package/src/core/commands/audit.md +43 -6
  53. package/src/core/commands/babysit.md +90 -6
  54. package/src/core/commands/baseline.md +1 -0
  55. package/src/core/commands/blockers.md +1 -0
  56. package/src/core/commands/board.md +1 -0
  57. package/src/core/commands/changelog.md +1 -0
  58. package/src/core/commands/choose.md +1 -0
  59. package/src/core/commands/ci.md +1 -0
  60. package/src/core/commands/code/accessibility.md +347 -0
  61. package/src/core/commands/code/api.md +297 -0
  62. package/src/core/commands/code/architecture.md +297 -0
  63. package/src/core/commands/code/completeness.md +43 -6
  64. package/src/core/commands/code/legal.md +43 -6
  65. package/src/core/commands/code/logic.md +43 -6
  66. package/src/core/commands/code/performance.md +43 -6
  67. package/src/core/commands/code/security.md +43 -6
  68. package/src/core/commands/code/test.md +43 -6
  69. package/src/core/commands/configure.md +1 -0
  70. package/src/core/commands/council.md +1 -0
  71. package/src/core/commands/deploy.md +1 -0
  72. package/src/core/commands/diagnose.md +1 -0
  73. package/src/core/commands/docs.md +1 -0
  74. package/src/core/commands/epic/edit.md +213 -0
  75. package/src/core/commands/epic.md +1 -0
  76. package/src/core/commands/export.md +238 -0
  77. package/src/core/commands/help.md +16 -1
  78. package/src/core/commands/ideate/discover.md +7 -3
  79. package/src/core/commands/ideate/features.md +65 -4
  80. package/src/core/commands/ideate/new.md +158 -124
  81. package/src/core/commands/impact.md +1 -0
  82. package/src/core/commands/learn/explain.md +118 -0
  83. package/src/core/commands/learn/glossary.md +135 -0
  84. package/src/core/commands/learn/patterns.md +138 -0
  85. package/src/core/commands/learn/tour.md +126 -0
  86. package/src/core/commands/migrate/codemods.md +151 -0
  87. package/src/core/commands/migrate/plan.md +131 -0
  88. package/src/core/commands/migrate/scan.md +114 -0
  89. package/src/core/commands/migrate/validate.md +119 -0
  90. package/src/core/commands/multi-expert.md +1 -0
  91. package/src/core/commands/pr.md +1 -0
  92. package/src/core/commands/review.md +1 -0
  93. package/src/core/commands/sprint.md +1 -0
  94. package/src/core/commands/status/undo.md +191 -0
  95. package/src/core/commands/status.md +1 -0
  96. package/src/core/commands/story/edit.md +204 -0
  97. package/src/core/commands/story/view.md +29 -7
  98. package/src/core/commands/story-validate.md +1 -0
  99. package/src/core/commands/story.md +1 -0
  100. package/src/core/commands/tdd.md +1 -0
  101. package/src/core/commands/team/start.md +10 -6
  102. package/src/core/commands/tests.md +1 -0
  103. package/src/core/commands/verify.md +27 -1
  104. package/src/core/commands/workflow.md +2 -0
  105. package/src/core/teams/backend.json +41 -0
  106. package/src/core/teams/frontend.json +41 -0
  107. package/src/core/teams/qa.json +41 -0
  108. package/src/core/teams/solo.json +35 -0
  109. package/src/core/templates/agileflow-metadata.json +5 -0
  110. package/tools/cli/commands/setup.js +85 -3
  111. package/tools/cli/commands/update.js +42 -0
  112. package/tools/cli/installers/ide/claude-code.js +68 -0
@@ -0,0 +1,288 @@
1
+ ---
2
+ description: Ads performance tracker — ingest performance CSVs, establish baselines, detect winners and anomalies, output KPI dashboard with trend analysis
3
+ argument-hint: "<performance-data> [PERIOD=7d] [BASELINE=auto]"
4
+ compact_context:
5
+ priority: medium
6
+ preserve_rules:
7
+ - "ACTIVE COMMAND: /agileflow:ads:track - Performance tracking and winner detection"
8
+ - "Ingest CSV/pasted performance data, establish baselines, detect anomalies"
9
+ - "Winner detection: statistical significance, cost efficiency, trend direction"
10
+ - "Delegate to ads-performance-tracker agent for analysis"
11
+ - "State persisted in docs/08-project/ads-tracking/"
12
+ state_fields:
13
+ - period
14
+ - baseline
15
+ - campaigns_tracked
16
+ - winners
17
+ - anomalies
18
+ ---
19
+
20
+ # /agileflow:ads:track
21
+
22
+ Ingest ad performance data (CSVs or pasted), establish baselines, detect winners and anomalies, and output a KPI dashboard with trend analysis and actionable recommendations.
23
+
24
+ ---
25
+
26
+ ## Quick Reference
27
+
28
+ ```
29
+ /agileflow:ads:track <performance-data> # Analyze performance data
30
+ /agileflow:ads:track <csv-file> PERIOD=30d # 30-day trend analysis
31
+ /agileflow:ads:track <data> BASELINE=last-report # Compare against last saved baseline
32
+ /agileflow:ads:track compare <old-csv> <new-csv> # Period-over-period comparison
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Arguments
38
+
39
+ | Argument | Values | Default | Description |
40
+ |----------|--------|---------|-------------|
41
+ | performance-data | CSV, pasted text, or file path | Required | Performance metrics to analyze |
42
+ | PERIOD | 1d, 7d, 14d, 30d, 90d | 7d | Analysis period |
43
+ | BASELINE | auto, last-report, or specific date | auto | Baseline for comparison |
44
+ | FORMAT | dashboard, csv, both | dashboard | Output format |
45
+
46
+ ---
47
+
48
+ ## Data Formats Accepted
49
+
50
+ ### CSV Export (preferred)
51
+ ```csv
52
+ Campaign,Ad Set,Ad,Impressions,Clicks,CTR,CPC,Spend,Conversions,CVR,CPA,ROAS,Date
53
+ Brand - Search,Brand Terms,Ad 1,15234,1843,12.1%,$0.45,$829,234,12.7%,$3.54,8.2,2026-02-28
54
+ ```
55
+
56
+ ### Pasted Table
57
+ ```
58
+ Campaign | Spend | Clicks | CPA | ROAS
59
+ Brand Search | $829 | 1,843 | $3.54 | 8.2x
60
+ Non-Brand Search | $2,341 | 987 | $15.20 | 2.1x
61
+ Meta Prospecting | $1,560 | 2,104 | $28.40 | 1.4x
62
+ ```
63
+
64
+ ### Platform-Specific Exports
65
+ - Google Ads: Campaign/Ad Group/Keyword reports
66
+ - Meta Ads Manager: Campaign/Ad Set/Ad performance export
67
+ - LinkedIn: Campaign Manager CSV export
68
+ - TikTok: Business Center export
69
+
70
+ ---
71
+
72
+ ## Analysis Framework
73
+
74
+ ### STEP 1: Parse & Normalize Data
75
+
76
+ Delegate to the `ads-performance-tracker` agent:
77
+
78
+ ```xml
79
+ <invoke name="Agent">
80
+ <parameter name="description">Analyze ad performance data</parameter>
81
+ <parameter name="prompt">TASK: Analyze ad performance data and generate KPI dashboard.
82
+
83
+ PERFORMANCE DATA:
84
+ {data}
85
+
86
+ PERIOD: {period}
87
+ BASELINE: {baseline}
88
+
89
+ Follow the full analysis framework in your instructions.
90
+
91
+ OUTPUT: Complete KPI dashboard with winner detection, anomaly alerts, and recommendations.</parameter>
92
+ <parameter name="subagent_type">ads-performance-tracker</parameter>
93
+ </invoke>
94
+ ```
95
+
96
+ ### STEP 2: Establish Baselines
97
+
98
+ If this is the first analysis or BASELINE=auto:
99
+ - Calculate median and mean for each metric across all campaigns
100
+ - Set thresholds at 1 standard deviation from mean
101
+ - Save baseline to `docs/08-project/ads-tracking/baseline-{YYYYMMDD}.json`
102
+
103
+ If BASELINE=last-report:
104
+ - Load the most recent baseline from `docs/08-project/ads-tracking/`
105
+ - Compare current metrics against saved baseline
106
+
107
+ ### STEP 3: Winner Detection
108
+
109
+ Apply statistical winner detection:
110
+
111
+ | Metric | Winner Threshold | Confidence Requirement |
112
+ |--------|-----------------|----------------------|
113
+ | CPC | < 0.7x median CPC | 100+ clicks |
114
+ | CTR | > 1.5x median CTR | 1000+ impressions |
115
+ | CVR | > 1.5x median CVR | 50+ clicks |
116
+ | CPA | < 0.7x median CPA | 20+ conversions |
117
+ | ROAS | > 1.5x median ROAS | $500+ spend |
118
+
119
+ **Winner Classification:**
120
+ | Class | Criteria | Action |
121
+ |-------|----------|--------|
122
+ | **Strong Winner** | Beats threshold on 3+ metrics | Scale 20%/week |
123
+ | **Emerging Winner** | Beats threshold on 1-2 metrics | Continue monitoring |
124
+ | **Stable Performer** | Within 1 SD of median on all metrics | Maintain |
125
+ | **Underperformer** | Below median on 2+ metrics | Optimize or pause |
126
+ | **Kill** | CPA > 3x target OR ROAS < 0.5x target | Pause immediately |
127
+
128
+ ### STEP 4: Anomaly Detection
129
+
130
+ Flag anomalies when:
131
+ - **Spend spike**: Daily spend > 2x average (possible budget cap issue)
132
+ - **CTR drop**: CTR drops > 30% day-over-day (ad fatigue, audience saturation)
133
+ - **CPC surge**: CPC increases > 50% week-over-week (competition, quality score)
134
+ - **Conversion drop**: Conversions drop > 40% with stable traffic (tracking break, landing page issue)
135
+ - **ROAS collapse**: ROAS drops below 1:1 (unprofitable, needs immediate action)
136
+
137
+ ### STEP 5: Trend Analysis
138
+
139
+ For each campaign, calculate:
140
+ - **7-day rolling average** for CPC, CTR, CVR, CPA
141
+ - **Trend direction**: Improving, Stable, Declining
142
+ - **Velocity**: Rate of change (slow, moderate, rapid)
143
+ - **Projected trajectory**: If trend continues, estimated metrics in 7/14/30 days
144
+
145
+ ---
146
+
147
+ ## Output Format
148
+
149
+ ```markdown
150
+ # Ads Performance Dashboard
151
+
152
+ **Generated**: {YYYY-MM-DD}
153
+ **Period**: {start_date} to {end_date} ({N} days)
154
+ **Platforms**: {platforms}
155
+ **Total Spend**: ${total_spend}
156
+ **Baseline**: {baseline_source}
157
+
158
+ ---
159
+
160
+ ## Executive Summary
161
+
162
+ | Metric | Current | Baseline | Change | Trend |
163
+ |--------|---------|----------|--------|-------|
164
+ | Total Spend | ${current} | ${baseline} | {+/-}% | {→/↑/↓} |
165
+ | Avg CPC | ${current} | ${baseline} | {+/-}% | {→/↑/↓} |
166
+ | Avg CTR | {current}% | {baseline}% | {+/-}% | {→/↑/↓} |
167
+ | Total Conversions | {current} | {baseline} | {+/-}% | {→/↑/↓} |
168
+ | Avg CPA | ${current} | ${baseline} | {+/-}% | {→/↑/↓} |
169
+ | Blended ROAS | {current}x | {baseline}x | {+/-}% | {→/↑/↓} |
170
+
171
+ ---
172
+
173
+ ## Winner Detection
174
+
175
+ ### Strong Winners (scale these)
176
+ | Campaign | CPC | CTR | CVR | CPA | ROAS | Action |
177
+ |----------|-----|-----|-----|-----|------|--------|
178
+ | {name} | ${cpc} ✅ | {ctr}% ✅ | {cvr}% ✅ | ${cpa} ✅ | {roas}x | Scale 20%/wk |
179
+
180
+ ### Emerging Winners (monitor closely)
181
+ | Campaign | CPC | CTR | CVR | CPA | ROAS | Action |
182
+ |----------|-----|-----|-----|-----|------|--------|
183
+ | {name} | ${cpc} | {ctr}% ✅ | {cvr}% | ${cpa} | {roas}x | Continue 7d |
184
+
185
+ ### Kill List (pause immediately)
186
+ | Campaign | Issue | CPA vs Target | Spend Wasted | Action |
187
+ |----------|-------|--------------|-------------|--------|
188
+ | {name} | CPA 3.2x target | ${cpa} vs ${target} | ${wasted} | **PAUSE NOW** |
189
+
190
+ ---
191
+
192
+ ## Anomaly Alerts
193
+
194
+ | Alert | Campaign | Metric | Expected | Actual | Severity |
195
+ |-------|----------|--------|----------|--------|----------|
196
+ | ⚠️ | {name} | CPC | ${expected} | ${actual} | HIGH |
197
+ | 🔴 | {name} | Conversions | {expected} | {actual} | CRITICAL |
198
+
199
+ ---
200
+
201
+ ## Campaign Performance
202
+
203
+ ### {Campaign Name}
204
+
205
+ | Metric | Value | vs Baseline | Trend (7d) |
206
+ |--------|-------|-------------|------------|
207
+ | Spend | ${spend} | {+/-}% | {→/↑/↓} |
208
+ | Impressions | {impr} | {+/-}% | {→/↑/↓} |
209
+ | Clicks | {clicks} | {+/-}% | {→/↑/↓} |
210
+ | CTR | {ctr}% | {+/-}% | {→/↑/↓} |
211
+ | CPC | ${cpc} | {+/-}% | {→/↑/↓} |
212
+ | Conversions | {conv} | {+/-}% | {→/↑/↓} |
213
+ | CVR | {cvr}% | {+/-}% | {→/↑/↓} |
214
+ | CPA | ${cpa} | {+/-}% | {→/↑/↓} |
215
+ | ROAS | {roas}x | {+/-}% | {→/↑/↓} |
216
+
217
+ **Classification**: {Strong Winner / Emerging / Stable / Underperformer / Kill}
218
+
219
+ ---
220
+
221
+ ## Budget Reallocation Recommendation
222
+
223
+ | Campaign | Current Budget | Recommended | Change | Reason |
224
+ |----------|---------------|-------------|--------|--------|
225
+ | {winner} | ${current} | ${recommended} | +20% | Strong winner, scale |
226
+ | {loser} | ${current} | ${recommended} | -100% | 3x kill rule |
227
+
228
+ **Estimated Impact**: Reallocating ${amount} from underperformers to winners = estimated {X}% CPA reduction
229
+
230
+ ---
231
+
232
+ ## Recommendations
233
+
234
+ ### Immediate (this session)
235
+ 1. **Pause {campaign}** — CPA ${X} exceeds 3x target (${target})
236
+ 2. **Scale {campaign}** — Strong winner, increase budget 20%
237
+
238
+ ### This Week
239
+ 3. **Refresh creative for {campaign}** — CTR declining 15% WoW (ad fatigue)
240
+ 4. **Check tracking for {campaign}** — Conversions dropped 40% with stable clicks
241
+
242
+ ### This Month
243
+ 5. **Test new angles** — Run /agileflow:ads:generate + /agileflow:ads:test-plan
244
+ 6. **Platform diversification** — {platform} ROAS declining, test {other_platform}
245
+ ```
246
+
247
+ Save dashboard to `docs/08-project/ads-tracking/dashboard-{YYYYMMDD}.md`.
248
+ Save baseline to `docs/08-project/ads-tracking/baseline-{YYYYMMDD}.json`.
249
+
250
+ ---
251
+
252
+ ## Present Results
253
+
254
+ ```xml
255
+ <invoke name="AskUserQuestion">
256
+ <parameter name="questions">[{
257
+ "question": "Performance dashboard generated. {winners} winners, {kills} to kill, {anomalies} anomalies. Total spend: ${spend}, blended ROAS: {roas}x.",
258
+ "header": "Next steps",
259
+ "multiSelect": false,
260
+ "options": [
261
+ {"label": "Pause kill-list campaigns now (Recommended)", "description": "Stop wasting ${wasted_amount}/mo on {kill_count} underperforming campaigns"},
262
+ {"label": "Generate replacement ad copy", "description": "Run /agileflow:ads:generate for fatigued campaigns"},
263
+ {"label": "Create test plan for winners", "description": "Run /agileflow:ads:test-plan to scale winning angles"},
264
+ {"label": "Run full ads audit", "description": "Run /agileflow:ads:audit for comprehensive 190-check analysis"}
265
+ ]
266
+ }]</parameter>
267
+ </invoke>
268
+ ```
269
+
270
+ ---
271
+
272
+ <!-- COMPACT_SUMMARY_START -->
273
+ ## Compact Summary
274
+
275
+ **Command**: `/agileflow:ads:track` - Performance tracking with winner detection
276
+
277
+ **Input**: Performance CSV/data from ad platforms
278
+
279
+ **Analysis**: Baselines, winner detection (5 classes), anomaly alerts, trend analysis, budget reallocation
280
+
281
+ **Key Rules**: 3x Kill Rule for CPA, 20% max scaling per week, 100+ clicks for CPC confidence
282
+
283
+ **Output**: KPI dashboard + baseline JSON + recommendations
284
+
285
+ **Usage**: `/agileflow:ads:track <data> [PERIOD=7d] [BASELINE=auto]`
286
+
287
+ **Files**: `docs/08-project/ads-tracking/dashboard-{YYYYMMDD}.md`, `baseline-{YYYYMMDD}.json`
288
+ <!-- COMPACT_SUMMARY_END -->
@@ -22,6 +22,10 @@ Paid advertising audit & planning toolkit for multi-platform account optimizatio
22
22
 
23
23
  ```
24
24
  /agileflow:ads:audit <account-data> # Full multi-platform audit (6 parallel analyzers)
25
+ /agileflow:ads:health <data+url> # Unified marketing health scorecard (ads+SEO+landing)
26
+ /agileflow:ads:generate <product-description> # Bulk ad copy generation (40+ variants)
27
+ /agileflow:ads:test-plan # CPC-first test planning with decision criteria
28
+ /agileflow:ads:track <performance-csv> # Performance tracking with winner detection
25
29
  /agileflow:ads:plan # Campaign planning with industry templates
26
30
  /agileflow:ads:google <account-data> # Google Ads deep-dive (74 checks)
27
31
  /agileflow:ads:meta <account-data> # Meta/Facebook audit (46 checks)
@@ -42,6 +46,10 @@ Paid advertising audit & planning toolkit for multi-platform account optimizatio
42
46
  | Command | Purpose | When to Use |
43
47
  |---------|---------|-------------|
44
48
  | **audit** | Full multi-platform audit with Ads Health Score | Starting point for any account |
49
+ | **health** | Unified marketing scorecard (ads+SEO+landing+tracking) | Executive overview of full marketing funnel |
50
+ | **generate** | Bulk ad copy generation (40+ variants) | Creating new ad creative at scale |
51
+ | **test-plan** | CPC-first test planning with decision criteria | Structuring A/B tests with winner/kill rules |
52
+ | **track** | Performance tracking with winner detection | Ongoing campaign monitoring and optimization |
45
53
  | **plan** | Campaign planning with industry templates | New campaigns or restructuring |
46
54
  | **google** | Google Ads deep-dive (74 checks) | Google-specific optimization |
47
55
  | **meta** | Meta/Facebook audit (46 checks) | Meta-specific optimization |
@@ -80,18 +88,22 @@ For best results, include:
80
88
  If the user provides data without a sub-command, determine intent:
81
89
 
82
90
  1. **"audit my ads"** -> `/agileflow:ads:audit`
83
- 2. **"plan a campaign"** -> `/agileflow:ads:plan`
84
- 3. **"check my Google Ads"** -> `/agileflow:ads:google`
85
- 4. **"Meta" / "Facebook ads"** -> `/agileflow:ads:meta`
86
- 5. **"creative review"** -> `/agileflow:ads:creative`
87
- 6. **"budget" / "spend" / "bidding"** -> `/agileflow:ads:budget`
88
- 7. **"landing page"** -> `/agileflow:ads:landing`
89
- 8. **"competitor" / "competitive"** -> `/agileflow:ads:competitor`
90
- 9. **"LinkedIn"** -> `/agileflow:ads:linkedin`
91
- 10. **"TikTok"** -> `/agileflow:ads:tiktok`
92
- 11. **"Microsoft" / "Bing"** -> `/agileflow:ads:microsoft`
93
- 12. **"YouTube" / "video ads"** -> `/agileflow:ads:youtube`
94
- 13. **Unclear** -> Show the quick reference and ask which analysis they want
91
+ 2. **"health check" / "marketing score" / "full scorecard"** -> `/agileflow:ads:health`
92
+ 3. **"generate ad copy" / "write ads" / "bulk ads" / "ad variants"** -> `/agileflow:ads:generate`
93
+ 4. **"test plan" / "A/B test" / "split test" / "CPC test"** -> `/agileflow:ads:test-plan`
94
+ 5. **"track performance" / "dashboard" / "winners" / "KPIs"** -> `/agileflow:ads:track`
95
+ 6. **"plan a campaign"** -> `/agileflow:ads:plan`
96
+ 7. **"check my Google Ads"** -> `/agileflow:ads:google`
97
+ 8. **"Meta" / "Facebook ads"** -> `/agileflow:ads:meta`
98
+ 9. **"creative review"** -> `/agileflow:ads:creative`
99
+ 10. **"budget" / "spend" / "bidding"** -> `/agileflow:ads:budget`
100
+ 11. **"landing page"** -> `/agileflow:ads:landing`
101
+ 12. **"competitor" / "competitive"** -> `/agileflow:ads:competitor`
102
+ 13. **"LinkedIn"** -> `/agileflow:ads:linkedin`
103
+ 14. **"TikTok"** -> `/agileflow:ads:tiktok`
104
+ 15. **"Microsoft" / "Bing"** -> `/agileflow:ads:microsoft`
105
+ 16. **"YouTube" / "video ads"** -> `/agileflow:ads:youtube`
106
+ 17. **Unclear** -> Show the quick reference and ask which analysis they want
95
107
 
96
108
  ---
97
109
 
@@ -107,9 +119,9 @@ Show the quick reference table above and ask:
107
119
  "multiSelect": false,
108
120
  "options": [
109
121
  {"label": "Full multi-platform audit (Recommended)", "description": "Comprehensive 6-analyzer audit with Ads Health Score 0-100"},
110
- {"label": "Campaign planning", "description": "Industry-specific campaign templates with budget allocation"},
111
- {"label": "Platform-specific audit", "description": "Deep-dive into Google, Meta, LinkedIn, TikTok, Microsoft, or YouTube"},
112
- {"label": "Budget & bidding strategy", "description": "Optimize spend allocation and bidding across platforms"}
122
+ {"label": "Marketing health scorecard", "description": "Unified score across ads + SEO + landing pages + tracking"},
123
+ {"label": "Generate ad copy (40+ variants)", "description": "Bulk ad copy from product description with ICP angles + platform CSV"},
124
+ {"label": "Create A/B test plan", "description": "CPC-first testing with budget allocation and winner/kill rules"}
113
125
  ]
114
126
  }]</parameter>
115
127
  </invoke>
@@ -122,7 +134,7 @@ Show the quick reference table above and ask:
122
134
 
123
135
  **Command**: `/agileflow:ads` - Paid advertising audit & planning router
124
136
 
125
- **Sub-commands**: audit, plan, google, meta, creative, budget, landing, competitor, linkedin, tiktok, microsoft, youtube
137
+ **Sub-commands**: audit, health, generate, test-plan, track, plan, google, meta, creative, budget, landing, competitor, linkedin, tiktok, microsoft, youtube
126
138
 
127
139
  **Quick start**: `/agileflow:ads:audit <account-data>` for full analysis
128
140
  <!-- COMPACT_SUMMARY_END -->
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Assign or reassign a story to an owner
3
+ phase: pre-story
3
4
  argument-hint: "STORY=<US-ID> NEW_OWNER=<id> [NEW_STATUS=<status>] [NOTE=<text>]"
4
5
  compact_context:
5
6
  priority: high
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Audit story completion - tests + acceptance criteria verification (GSD pattern)
3
+ phase: post-impl
3
4
  argument-hint: "STORY=<US-ID>"
4
5
  compact_context:
5
6
  priority: high
@@ -162,25 +163,61 @@ Parse results:
162
163
 
163
164
  ### Step 3: Verify Acceptance Criteria
164
165
 
165
- Display each AC from status.json and ask user to verify:
166
+ **3a. Run AC-to-Test Matcher (automated pre-check)**
167
+
168
+ Before asking the user to verify AC manually, run the automated AC-to-test matcher:
169
+
170
+ ```bash
171
+ node -e "
172
+ const { matchACToTests } = require('./.agileflow/scripts/lib/ac-test-matcher');
173
+ const result = matchACToTests('{{STORY_ID}}');
174
+ console.log(JSON.stringify(result, null, 2));
175
+ "
176
+ ```
177
+
178
+ This returns matched/unmatched AC with confidence levels. Use the results to pre-populate the checklist.
179
+
180
+ **3b. Display AC checklist with auto-matched items**
181
+
182
+ Show each AC with auto-match status. High-confidence matches are pre-checked:
166
183
 
167
184
  ```xml
168
185
  <invoke name="AskUserQuestion">
169
186
  <parameter name="questions">[{
170
- "question": "Verify each acceptance criterion is met for {{STORY_ID}}:",
187
+ "question": "Verify acceptance criteria for {{STORY_ID}} ({{matched}}/{{total}} auto-matched to tests):",
171
188
  "header": "AC Check",
172
189
  "multiSelect": true,
173
190
  "options": [
174
- {"label": "{{AC_1}}", "description": "Mark if complete"},
175
- {"label": "{{AC_2}}", "description": "Mark if complete"},
176
- {"label": "{{AC_3}}", "description": "Mark if complete"}
191
+ {"label": "AC1: {{AC_1}} [auto-verified]", "description": "Matched to {{test_file}} (high confidence)"},
192
+ {"label": "AC2: {{AC_2}} [auto-verified]", "description": "Matched to {{test_file}} (medium confidence)"},
193
+ {"label": "AC3: {{AC_3}} [needs manual check]", "description": "No matching tests found - verify manually"}
177
194
  ]
178
195
  }]</parameter>
179
196
  </invoke>
180
197
  ```
181
198
 
199
+ Auto-matched AC (high/medium confidence) should be pre-selected. Unmatched AC require manual verification.
200
+
201
+ **3c. Write ac_status to status.json**
202
+
203
+ After verification, write structured `ac_status` to the story in status.json:
204
+
205
+ ```json
206
+ {
207
+ "ac_status": {
208
+ "0": "auto-verified",
209
+ "1": "auto-verified",
210
+ "2": "verified",
211
+ "3": "unverified"
212
+ },
213
+ "ac_coverage": 0.75
214
+ }
215
+ ```
216
+
217
+ Values: `auto-verified` (test match), `verified` (manual confirm), `likely-covered` (medium confidence), `unverified` (not confirmed)
218
+
182
219
  Calculate verification rate:
183
- - Count selected (verified) vs total AC
220
+ - Count verified + auto-verified vs total AC
184
221
  - 100% = All verified
185
222
  - <100% = Partial
186
223
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Interactive mentor for end-to-end feature implementation
3
- argument-hint: "[EPIC=<EP-ID>] [MODE=loop|once] [VISUAL=true|false] [COVERAGE=<percent>] [MAX=<iterations>] [STRICT=true|false] [TDD=true|false]"
3
+ phase: implementation
4
+ argument-hint: "[EPIC=<EP-ID>] [MODE=loop|once] [VISUAL=true|false] [COVERAGE=<percent>] [MAX=<iterations>] [STRICT=true|false] [TDD=true|false] [VERIFY=suggest|recommend|require|block] [CI_ROUNDS=<N>]"
4
5
  compact_context:
5
6
  priority: critical
6
7
  preserve_rules:
@@ -18,6 +19,8 @@ compact_context:
18
19
  - "OBTAIN-CONTEXT: NEVER pipe obtain-context.js through head/tail/truncation - run it bare, it has built-in smart output limits"
19
20
  - "STRICT MODE: When STRICT=true, enforce gates - hide commit option until tests pass, auto-trigger code review for 5+ files, remove skip options"
20
21
  - "TDD MODE: When TDD=true, start stories in RED phase via /agileflow:tdd. Follow RED→GREEN→REFACTOR phases."
22
+ - "VERIFY MODE: suggest=current behavior, recommend=show AC summary + (Recommended) framing, require=auto-run verify + AC checklist + gate commit, block=require + browser QA for UI stories. STRICT=true implies VERIFY=require."
23
+ - "CI FEEDBACK LOOP: When tests fail, auto-retry up to CI_ROUNDS (default 3) before escalating. Uses executeCIFeedbackLoop() from quality-gates.js."
21
24
  state_fields:
22
25
  - current_story
23
26
  - current_epic
@@ -25,6 +28,8 @@ compact_context:
25
28
  - claimed_story_id
26
29
  - strict_mode
27
30
  - tdd_mode
31
+ - verify_mode
32
+ - ci_rounds
28
33
  ---
29
34
 
30
35
  # /agileflow-babysit
@@ -56,13 +61,17 @@ All parameters are optional. Most are auto-detected by the Contextual Feature Ro
56
61
  | `COVERAGE` | auto | `80` | Test coverage threshold (%). Set `0` to disable |
57
62
  | `STRICT` | `false` | `true` | Enforce workflow gates (tests required before commit, code review for 5+ files) |
58
63
  | `TDD` | `false` | `true` | Enable TDD mode (RED→GREEN→REFACTOR phases) for each story |
64
+ | `VERIFY` | `recommend` | `require` | AC verification enforcement level (see VERIFY MODE below) |
65
+ | `CI_ROUNDS` | `3` | `5` | Max auto-retry rounds when tests fail before escalating to human |
59
66
 
60
- **Auto-detection**: When `EPIC` is specified with 3+ ready stories, `MODE=loop` is auto-enabled. `VISUAL` auto-enables for UI-tagged stories. `COVERAGE` auto-enables when a coverage baseline exists.
67
+ **Auto-detection**: When `EPIC` is specified with 3+ ready stories, `MODE=loop` is auto-enabled. `VISUAL` auto-enables for UI-tagged stories. `COVERAGE` auto-enables when a coverage baseline exists. `STRICT=true` implies `VERIFY=require` unless explicitly overridden.
61
68
 
62
69
  ```
63
70
  /agileflow:babysit EPIC=EP-0042 # Auto-detect everything
64
71
  /agileflow:babysit EPIC=EP-0042 MODE=once # Single story only
65
72
  /agileflow:babysit STRICT=true TDD=true # Full discipline: TDD + strict gates
73
+ /agileflow:babysit VERIFY=require # Enforce AC verification before commit
74
+ /agileflow:babysit STRICT=true VERIFY=suggest # Strict gates but relaxed AC verification
66
75
  ```
67
76
 
68
77
  ---
@@ -114,6 +123,80 @@ When both enabled: stories start in TDD RED phase, phase gates enforced (RED nee
114
123
 
115
124
  ---
116
125
 
126
+ ## VERIFY MODE (AC Verification Enforcement)
127
+
128
+ Graduated verification of acceptance criteria before story completion.
129
+
130
+ | Level | Behavior | Use Case |
131
+ |-------|----------|----------|
132
+ | `suggest` | Current behavior - AC verification available but not prompted | Exploratory work |
133
+ | `recommend` (default) | Show AC summary after tests pass, (Recommended) framing for verify | Normal development |
134
+ | `require` | Auto-run ac-test-matcher, show AC checklist, gate commit on AC verification | Team/production |
135
+ | `block` | All of `require` + browser QA for UI stories | Critical/regulated |
136
+
137
+ `STRICT=true` implies `VERIFY=require` unless explicitly overridden.
138
+
139
+ ### How It Works
140
+
141
+ 1. After tests pass, run `ac-test-matcher.js` to find test-covered AC
142
+ 2. Auto-verified AC (high confidence match) are pre-checked
143
+ 3. Unmatched AC require manual confirmation via AskUserQuestion
144
+ 4. At `require`/`block` level, commit option hidden until all AC confirmed
145
+
146
+ ### AC Summary in AskUserQuestion
147
+
148
+ After tests pass with `VERIFY=recommend` or higher:
149
+ ```json
150
+ [
151
+ {"label": "Verify AC for US-0042 (Recommended)", "description": "3/5 AC auto-matched to tests, 2 need manual check"},
152
+ {"label": "Commit: 'feat: add session tracking'", "description": "Tests pass, skip AC verification"},
153
+ {"label": "🔍 Run logic audit", "description": "5 analyzers catch edge cases tests miss"}
154
+ ]
155
+ ```
156
+
157
+ At `require` level, the "Commit" option is hidden until AC verified:
158
+ ```json
159
+ [
160
+ {"label": "Verify AC for US-0042 (Required)", "description": "3/5 AC auto-matched, 2 need manual confirmation"},
161
+ {"label": "🔍 Run logic audit", "description": "5 analyzers catch edge cases tests miss"}
162
+ ]
163
+ ```
164
+
165
+ Track verification state:
166
+ ```
167
+ ⬜ tests_passed → Run /agileflow:verify
168
+ ⬜ ac_verified → Run ac-test-matcher + manual check
169
+ ⬜ review_done → Auto-triggered at 5+ files
170
+ ⬜ logic_audit → Optional (advisory)
171
+ ```
172
+
173
+ ---
174
+
175
+ ## CI FEEDBACK LOOP (`CI_ROUNDS=<N>`)
176
+
177
+ Auto-retry when tests fail, inspired by Stripe's Blueprint Engine pattern. Instead of immediately escalating to the human when tests fail, the agent gets structured CI feedback and retries up to N rounds.
178
+
179
+ | Round | What Happens |
180
+ |-------|-------------|
181
+ | 1..N-1 | Tests fail → agent receives failure output → fixes and retries |
182
+ | N | Tests fail → escalate to human with full failure context |
183
+ | Any | Tests pass → proceed to next workflow step |
184
+
185
+ **Configuration**: Set `ci_feedback_loops.max_rounds` in `docs/00-meta/agileflow-metadata.json` (default: 3). Override per-session with `CI_ROUNDS=N`.
186
+
187
+ **Integration with quality-gates.js**: Uses `executeCIFeedbackLoop()` which wraps `executeGates()` with round tracking and structured agent feedback.
188
+
189
+ **When active**: After implementation, instead of asking the user about test failures, automatically re-attempt fixes. After exhausting rounds, present:
190
+ ```json
191
+ [
192
+ {"label": "Review CI failures manually (Recommended)", "description": "3/3 auto-fix rounds exhausted, 2 tests still failing"},
193
+ {"label": "Run /agileflow:research:ask with failure context", "description": "Get external guidance on persistent failures"},
194
+ {"label": "Skip failing tests and commit", "description": "Tests may be flaky or unrelated"}
195
+ ]
196
+ ```
197
+
198
+ ---
199
+
117
200
  ## SCALE-ADAPTIVE BEHAVIOR
118
201
 
119
202
  | Scale | Planning Depth | Expert Usage | Workflow |
@@ -170,7 +253,8 @@ User parameters override smart detection (`MODE=once` overrides loop, `VISUAL=fa
170
253
  | After context | Most impactful ready story |
171
254
  | After plan approval | "Start implementing now" |
172
255
  | After code written | "Run tests (Recommended)" + logic audit option |
173
- | After tests pass | "🔍 Run logic audit (Recommended)" or "Commit" |
256
+ | After tests pass | "Verify AC (Recommended)" if VERIFY>=recommend, else "🔍 Run logic audit (Recommended)" or "Commit" |
257
+ | After AC verified | "🔍 Run logic audit (Recommended)" or "Commit" |
174
258
  | After logic audit | "Commit: '[type]: [summary]' (Recommended)" |
175
259
  | After error | "Try [specific alternative]" |
176
260
 
@@ -263,9 +347,9 @@ Don't wait for smart-detect. Auto-trigger based on these rules:
263
347
  10. Verify tests pass
264
348
 
265
349
  **Phase 4: Review & Completion**
266
- 11. Offer via AskUserQuestion: tests, logic audit, code review (5+ files), docs sync (API changes), multi-expert (10+ files), ADR (if arch decision)
267
- 12. STRICT gate check: hide commit until gates pass
268
- 13. Update status.json, release story claim: `node .agileflow/scripts/lib/story-claiming.js release <id>`
350
+ 11. Offer via AskUserQuestion: tests, AC verification (VERIFY mode), logic audit, code review (5+ files), docs sync (API changes), multi-expert (10+ files), ADR (if arch decision)
351
+ 12. STRICT/VERIFY gate check: hide commit until gates pass (tests + AC at require/block level)
352
+ 13. Update status.json (including ac_status), release story claim: `node .agileflow/scripts/lib/story-claiming.js release <id>`
269
353
 
270
354
  ---
271
355
 
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Mark current state as verified baseline
3
+ phase: planning
3
4
  argument-hint: "[<message>]"
4
5
  compact_context:
5
6
  priority: critical
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Track and resolve blockers with actionable suggestions
3
+ phase: pre-story
3
4
  argument-hint: "[AGENT=<id>] [SHOW_RESOLVED=true|false] [DETAILED=true|false]"
4
5
  model: haiku
5
6
  compact_context:
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Display visual kanban board with WIP limits
3
+ phase: pre-story
3
4
  argument-hint: "[EPIC=<EP-ID>] [OWNER=<id>] [FORMAT=ascii|markdown|html] [GROUP_BY=status|owner|epic]"
4
5
  model: haiku
5
6
  type: output-only # Board display - read-only visualization, not an ongoing task
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Auto-generate changelog from commit history
3
+ phase: post-impl
3
4
  argument-hint: "(no arguments)"
4
5
  compact_context:
5
6
  priority: high
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: AI-directed decision making with structured options
3
+ phase: pre-story
3
4
  argument-hint: "<decision> [<context>]"
4
5
  compact_context:
5
6
  priority: normal
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Bootstrap CI/CD workflow with testing and quality checks
3
+ phase: implementation
3
4
  argument-hint: "(no arguments)"
4
5
  compact_context:
5
6
  priority: high