agileflow 2.92.1 → 2.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/scripts/agileflow-statusline.sh +106 -0
  5. package/scripts/agileflow-welcome.js +54 -0
  6. package/scripts/document-repl.js +793 -0
  7. package/scripts/session-manager.js +230 -16
  8. package/scripts/spawn-parallel.js +53 -14
  9. package/src/core/agents/accessibility.md +19 -125
  10. package/src/core/agents/adr-writer.md +18 -1
  11. package/src/core/agents/analytics.md +19 -125
  12. package/src/core/agents/api.md +5 -130
  13. package/src/core/agents/ci.md +26 -131
  14. package/src/core/agents/compliance.md +21 -125
  15. package/src/core/agents/database.md +20 -125
  16. package/src/core/agents/datamigration.md +20 -125
  17. package/src/core/agents/design.md +19 -125
  18. package/src/core/agents/devops.md +12 -129
  19. package/src/core/agents/documentation.md +18 -1
  20. package/src/core/agents/epic-planner.md +31 -10
  21. package/src/core/agents/integrations.md +19 -125
  22. package/src/core/agents/mobile.md +19 -125
  23. package/src/core/agents/monitoring.md +19 -125
  24. package/src/core/agents/performance.md +19 -125
  25. package/src/core/agents/product.md +18 -1
  26. package/src/core/agents/qa.md +21 -125
  27. package/src/core/agents/readme-updater.md +18 -1
  28. package/src/core/agents/refactor.md +19 -125
  29. package/src/core/agents/research.md +3 -1
  30. package/src/core/agents/rlm-subcore.md +202 -0
  31. package/src/core/agents/security.md +7 -125
  32. package/src/core/agents/testing.md +20 -125
  33. package/src/core/agents/ui.md +14 -135
  34. package/src/core/commands/adr/list.md +20 -0
  35. package/src/core/commands/adr/update.md +24 -1
  36. package/src/core/commands/adr/view.md +23 -1
  37. package/src/core/commands/adr.md +2 -2
  38. package/src/core/commands/agent.md +11 -1
  39. package/src/core/commands/assign.md +15 -6
  40. package/src/core/commands/auto.md +11 -1
  41. package/src/core/commands/babysit.md +15 -4
  42. package/src/core/commands/baseline.md +11 -1
  43. package/src/core/commands/batch.md +11 -1
  44. package/src/core/commands/blockers.md +11 -1
  45. package/src/core/commands/board.md +11 -1
  46. package/src/core/commands/changelog.md +11 -0
  47. package/src/core/commands/choose.md +16 -1
  48. package/src/core/commands/ci.md +11 -1
  49. package/src/core/commands/configure.md +73 -2
  50. package/src/core/commands/context/export.md +8 -0
  51. package/src/core/commands/context/full.md +8 -0
  52. package/src/core/commands/context/note.md +8 -0
  53. package/src/core/commands/debt.md +11 -0
  54. package/src/core/commands/deploy.md +10 -0
  55. package/src/core/commands/deps.md +11 -1
  56. package/src/core/commands/diagnose.md +10 -0
  57. package/src/core/commands/docs.md +12 -2
  58. package/src/core/commands/epic/list.md +20 -0
  59. package/src/core/commands/epic/view.md +25 -0
  60. package/src/core/commands/epic.md +5 -6
  61. package/src/core/commands/feedback.md +11 -0
  62. package/src/core/commands/handoff.md +12 -2
  63. package/src/core/commands/help.md +10 -0
  64. package/src/core/commands/ideate.md +10 -0
  65. package/src/core/commands/impact.md +11 -1
  66. package/src/core/commands/metrics.md +11 -1
  67. package/src/core/commands/multi-expert.md +11 -1
  68. package/src/core/commands/packages.md +11 -0
  69. package/src/core/commands/pr.md +10 -0
  70. package/src/core/commands/readme-sync.md +10 -5
  71. package/src/core/commands/research/analyze.md +60 -3
  72. package/src/core/commands/research/ask.md +9 -1
  73. package/src/core/commands/research/import.md +8 -0
  74. package/src/core/commands/research/list.md +8 -0
  75. package/src/core/commands/research/synthesize.md +9 -1
  76. package/src/core/commands/research/view.md +8 -0
  77. package/src/core/commands/retro.md +12 -2
  78. package/src/core/commands/review.md +11 -1
  79. package/src/core/commands/rlm.md +363 -0
  80. package/src/core/commands/roadmap/analyze.md +1 -1
  81. package/src/core/commands/rpi.md +9 -1
  82. package/src/core/commands/session/cleanup.md +250 -0
  83. package/src/core/commands/session/end.md +10 -0
  84. package/src/core/commands/session/history.md +11 -1
  85. package/src/core/commands/session/init.md +10 -0
  86. package/src/core/commands/session/new.md +113 -13
  87. package/src/core/commands/session/resume.md +10 -0
  88. package/src/core/commands/session/spawn.md +8 -0
  89. package/src/core/commands/session/status.md +10 -0
  90. package/src/core/commands/skill/create.md +1 -1
  91. package/src/core/commands/skill/delete.md +11 -1
  92. package/src/core/commands/skill/edit.md +11 -1
  93. package/src/core/commands/skill/test.md +11 -1
  94. package/src/core/commands/skill/upgrade.md +11 -1
  95. package/src/core/commands/sprint.md +14 -3
  96. package/src/core/commands/status.md +15 -6
  97. package/src/core/commands/story/list.md +23 -0
  98. package/src/core/commands/story/view.md +24 -0
  99. package/src/core/commands/story.md +4 -5
  100. package/src/core/commands/template.md +10 -0
  101. package/src/core/commands/tests.md +10 -0
  102. package/src/core/commands/update.md +10 -0
  103. package/src/core/commands/validate-expertise.md +10 -1
  104. package/src/core/commands/velocity.md +11 -1
  105. package/src/core/commands/verify.md +13 -1
  106. package/src/core/commands/whats-new.md +8 -0
  107. package/src/core/commands/workflow.md +16 -1
  108. package/src/core/templates/agent-coordination-pattern.md +38 -0
  109. package/src/core/templates/agileflow-metadata.json +25 -0
  110. package/src/core/templates/preserve-rules-common.md +107 -0
  111. package/src/core/templates/preserve-rules.json +42 -0
  112. package/src/core/templates/proactive-action-spec.md +29 -0
  113. package/src/core/templates/quality-gate-priorities.md +34 -0
  114. package/src/core/templates/session-harness-protocol.md +128 -0
  115. package/tools/cli/lib/content-injector.js +338 -0
@@ -234,131 +234,8 @@ BOUNDARIES
234
234
  - Always document reasoning for schema decisions
235
235
 
236
236
 
237
- SESSION HARNESS & VERIFICATION PROTOCOL (v2.25.0+)
237
+ <!-- {{SESSION_HARNESS}} -->
238
238
 
239
- **CRITICAL**: Session Harness System prevents agents from breaking functionality, claiming work is done when tests fail, or losing context between sessions.
240
-
241
- **PRE-IMPLEMENTATION VERIFICATION**
242
-
243
- Before starting work on ANY story:
244
-
245
- 1. **Check Session Harness**:
246
- - Look for `docs/00-meta/environment.json`
247
- - If exists → Session harness is active ✅
248
- - If missing → Suggest `/agileflow:session:init` to user
249
-
250
- 2. **Test Baseline Check**:
251
- - Read `test_status` from story in `docs/09-agents/status.json`
252
- - If `"passing"` → Proceed with implementation ✅
253
- - If `"failing"` → STOP. Cannot start new work with failing baseline ⚠️
254
- - If `"not_run"` → Run `/agileflow:verify` first to establish baseline
255
- - If `"skipped"` → Check why tests are skipped, document override decision
256
-
257
- 3. **Environment Verification** (if session harness active):
258
- - Run `/agileflow:session:resume` to verify environment and load context
259
- - Check for regressions (tests were passing, now failing)
260
- - If regression detected → Fix before proceeding with new story
261
-
262
- **DURING IMPLEMENTATION**
263
-
264
- 1. **Incremental Testing**:
265
- - Run tests frequently during development (not just at end)
266
- - Fix test failures immediately (don't accumulate debt)
267
- - Use `/agileflow:verify US-XXXX` to check specific story tests
268
-
269
- 2. **Real-time Status Updates**:
270
- - Update `test_status` in status.json as tests are written/fixed
271
- - Append bus messages when tests pass milestone checkpoints
272
-
273
- **POST-IMPLEMENTATION VERIFICATION**
274
-
275
- After completing ANY changes:
276
-
277
- 1. **Run Full Test Suite**:
278
- - Execute `/agileflow:verify US-XXXX` to run tests for the story
279
- - Check exit code (0 = success required for completion)
280
- - Review test output for warnings or flaky tests
281
-
282
- 2. **Update Test Status**:
283
- - `/agileflow:verify` automatically updates `test_status` in status.json
284
- - Verify the update was successful
285
- - Expected: `test_status: "passing"` with test results metadata
286
-
287
- 3. **Regression Check**:
288
- - Compare test results to baseline (initial test status)
289
- - If new failures introduced → Fix before marking complete
290
- - If test count decreased → Investigate deleted tests
291
-
292
- 4. **Story Completion Requirements**:
293
- - Story can ONLY be marked `"in-review"` if `test_status: "passing"` ✅
294
- - If tests failing → Story remains `"in-progress"` until fixed ⚠️
295
- - No exceptions unless documented override (see below)
296
-
297
- **OVERRIDE PROTOCOL** (Use with extreme caution)
298
-
299
- If tests are failing but you need to proceed:
300
-
301
- 1. **Document Override Decision**:
302
- - Append bus message with full explanation (include agent ID, story ID, reason, tracking issue)
303
-
304
- 2. **Update Story Dev Agent Record**:
305
- - Add note to "Issues Encountered" section explaining override
306
- - Link to tracking issue for the failing test
307
- - Document risk and mitigation plan
308
-
309
- 3. **Create Follow-up Story**:
310
- - If test failure is real but out of scope → Create new story
311
- - Link dependency in status.json
312
- - Notify user of the override and follow-up story
313
-
314
- **BASELINE MANAGEMENT**
315
-
316
- After completing major milestones (epic complete, sprint end):
317
-
318
- 1. **Establish Baseline**:
319
- - Suggest `/agileflow:baseline "Epic EP-XXXX complete"` to user
320
- - Requires: All tests passing, git working tree clean
321
- - Creates git tag + metadata for reset point
322
-
323
- 2. **Baseline Benefits**:
324
- - Known-good state to reset to if needed
325
- - Regression detection reference point
326
- - Deployment readiness checkpoint
327
- - Sprint/epic completion marker
328
-
329
- **INTEGRATION WITH WORKFLOW**
330
-
331
- The verification protocol integrates into the standard workflow:
332
-
333
- 1. **Before creating feature branch**: Run pre-implementation verification
334
- 2. **Before marking in-review**: Run post-implementation verification
335
- 3. **After merge**: Verify baseline is still passing
336
-
337
- **ERROR HANDLING**
338
-
339
- If `/agileflow:verify` fails:
340
- - Read error output carefully
341
- - Check if test command is configured in `docs/00-meta/environment.json`
342
- - Verify test dependencies are installed
343
- - If project has no tests → Suggest `/agileflow:session:init` to set up testing
344
- - If tests are misconfigured → Coordinate with AG-CI
345
-
346
- **SESSION RESUME PROTOCOL**
347
-
348
- When resuming work after context loss:
349
-
350
- 1. **Run Resume Command**: `/agileflow:session:resume` loads context automatically
351
- 2. **Check Session State**: Review `docs/09-agents/session-state.json`
352
- 3. **Verify Test Status**: Ensure no regressions occurred
353
- 4. **Load Previous Insights**: Check Dev Agent Record from previous stories
354
-
355
- **KEY PRINCIPLES**
356
-
357
- - **Tests are the contract**: Passing tests = feature works as specified
358
- - **Fail fast**: Catch regressions immediately, not at PR review
359
- - **Context preservation**: Session harness maintains progress across context windows
360
- - **Transparency**: Document all override decisions fully
361
- - **Accountability**: test_status field creates audit trail
362
239
 
363
240
  SCHEMA DESIGN PRINCIPLES
364
241
 
@@ -552,7 +429,9 @@ WORKFLOW
552
429
 
553
430
  10. Sync externally if enabled
554
431
 
555
- QUALITY CHECKLIST
432
+ <!-- {{QUALITY_GATE_PRIORITIES}} -->
433
+
434
+ QUALITY CHECKLIST (AG-DATABASE Specific)
556
435
 
557
436
  Before approval:
558
437
  - [ ] Schema follows naming conventions
@@ -566,6 +445,22 @@ Before approval:
566
445
  - [ ] Comments explain complex decisions
567
446
  - [ ] Backup and recovery procedure documented
568
447
 
448
+ AGENT COORDINATION
449
+
450
+ **Coordinates with**:
451
+ - **AG-API**: Schema for API endpoints (send schema changes, receive data requirements)
452
+ - **AG-DATAMIGRATION**: Data migrations (send schema dependencies, receive migration status)
453
+ - **AG-PERFORMANCE**: Query optimization (receive slow query findings, coordinate on indexes)
454
+
455
+ **Bus Messages** (append to `docs/09-agents/bus/log.jsonl`):
456
+ ```jsonl
457
+ {"ts":"<ISO>","from":"AG-DATABASE","type":"status","story":"<US-ID>","text":"Schema migration ready: [migration name]"}
458
+ {"ts":"<ISO>","from":"AG-DATABASE","type":"unblock","story":"<US-ID>","text":"Unblocking US-XXXX: Table [name] created with required columns"}
459
+ {"ts":"<ISO>","from":"AG-DATABASE","type":"finding","story":"<US-ID>","text":"Finding: N+1 query pattern detected in [endpoint]"}
460
+ ```
461
+
462
+ **On invocation**: Check bus for AG-API requests for schema changes.
463
+
569
464
  FIRST ACTION
570
465
 
571
466
  **Proactive Knowledge Loading** (before asking user):
@@ -251,131 +251,8 @@ BOUNDARIES
251
251
  - Always prioritize data safety and business continuity
252
252
 
253
253
 
254
- SESSION HARNESS & VERIFICATION PROTOCOL (v2.25.0+)
254
+ <!-- {{SESSION_HARNESS}} -->
255
255
 
256
- **CRITICAL**: Session Harness System prevents agents from breaking functionality, claiming work is done when tests fail, or losing context between sessions.
257
-
258
- **PRE-IMPLEMENTATION VERIFICATION**
259
-
260
- Before starting work on ANY story:
261
-
262
- 1. **Check Session Harness**:
263
- - Look for `docs/00-meta/environment.json`
264
- - If exists → Session harness is active ✅
265
- - If missing → Suggest `/agileflow:session:init` to user
266
-
267
- 2. **Test Baseline Check**:
268
- - Read `test_status` from story in `docs/09-agents/status.json`
269
- - If `"passing"` → Proceed with implementation ✅
270
- - If `"failing"` → STOP. Cannot start new work with failing baseline ⚠️
271
- - If `"not_run"` → Run `/agileflow:verify` first to establish baseline
272
- - If `"skipped"` → Check why tests are skipped, document override decision
273
-
274
- 3. **Environment Verification** (if session harness active):
275
- - Run `/agileflow:session:resume` to verify environment and load context
276
- - Check for regressions (tests were passing, now failing)
277
- - If regression detected → Fix before proceeding with new story
278
-
279
- **DURING IMPLEMENTATION**
280
-
281
- 1. **Incremental Testing**:
282
- - Run tests frequently during development (not just at end)
283
- - Fix test failures immediately (don't accumulate debt)
284
- - Use `/agileflow:verify US-XXXX` to check specific story tests
285
-
286
- 2. **Real-time Status Updates**:
287
- - Update `test_status` in status.json as tests are written/fixed
288
- - Append bus messages when tests pass milestone checkpoints
289
-
290
- **POST-IMPLEMENTATION VERIFICATION**
291
-
292
- After completing ANY changes:
293
-
294
- 1. **Run Full Test Suite**:
295
- - Execute `/agileflow:verify US-XXXX` to run tests for the story
296
- - Check exit code (0 = success required for completion)
297
- - Review test output for warnings or flaky tests
298
-
299
- 2. **Update Test Status**:
300
- - `/agileflow:verify` automatically updates `test_status` in status.json
301
- - Verify the update was successful
302
- - Expected: `test_status: "passing"` with test results metadata
303
-
304
- 3. **Regression Check**:
305
- - Compare test results to baseline (initial test status)
306
- - If new failures introduced → Fix before marking complete
307
- - If test count decreased → Investigate deleted tests
308
-
309
- 4. **Story Completion Requirements**:
310
- - Story can ONLY be marked `"in-review"` if `test_status: "passing"` ✅
311
- - If tests failing → Story remains `"in-progress"` until fixed ⚠️
312
- - No exceptions unless documented override (see below)
313
-
314
- **OVERRIDE PROTOCOL** (Use with extreme caution)
315
-
316
- If tests are failing but you need to proceed:
317
-
318
- 1. **Document Override Decision**:
319
- - Append bus message with full explanation (include agent ID, story ID, reason, tracking issue)
320
-
321
- 2. **Update Story Dev Agent Record**:
322
- - Add note to "Issues Encountered" section explaining override
323
- - Link to tracking issue for the failing test
324
- - Document risk and mitigation plan
325
-
326
- 3. **Create Follow-up Story**:
327
- - If test failure is real but out of scope → Create new story
328
- - Link dependency in status.json
329
- - Notify user of the override and follow-up story
330
-
331
- **BASELINE MANAGEMENT**
332
-
333
- After completing major milestones (epic complete, sprint end):
334
-
335
- 1. **Establish Baseline**:
336
- - Suggest `/agileflow:baseline "Epic EP-XXXX complete"` to user
337
- - Requires: All tests passing, git working tree clean
338
- - Creates git tag + metadata for reset point
339
-
340
- 2. **Baseline Benefits**:
341
- - Known-good state to reset to if needed
342
- - Regression detection reference point
343
- - Deployment readiness checkpoint
344
- - Sprint/epic completion marker
345
-
346
- **INTEGRATION WITH WORKFLOW**
347
-
348
- The verification protocol integrates into the standard workflow:
349
-
350
- 1. **Before creating feature branch**: Run pre-implementation verification
351
- 2. **Before marking in-review**: Run post-implementation verification
352
- 3. **After merge**: Verify baseline is still passing
353
-
354
- **ERROR HANDLING**
355
-
356
- If `/agileflow:verify` fails:
357
- - Read error output carefully
358
- - Check if test command is configured in `docs/00-meta/environment.json`
359
- - Verify test dependencies are installed
360
- - If project has no tests → Suggest `/agileflow:session:init` to set up testing
361
- - If tests are misconfigured → Coordinate with AG-CI
362
-
363
- **SESSION RESUME PROTOCOL**
364
-
365
- When resuming work after context loss:
366
-
367
- 1. **Run Resume Command**: `/agileflow:session:resume` loads context automatically
368
- 2. **Check Session State**: Review `docs/09-agents/session-state.json`
369
- 3. **Verify Test Status**: Ensure no regressions occurred
370
- 4. **Load Previous Insights**: Check Dev Agent Record from previous stories
371
-
372
- **KEY PRINCIPLES**
373
-
374
- - **Tests are the contract**: Passing tests = feature works as specified
375
- - **Fail fast**: Catch regressions immediately, not at PR review
376
- - **Context preservation**: Session harness maintains progress across context windows
377
- - **Transparency**: Document all override decisions fully
378
- - **Accountability**: test_status field creates audit trail
379
256
 
380
257
  ZERO-DOWNTIME MIGRATION PATTERNS
381
258
 
@@ -737,7 +614,9 @@ WORKFLOW
737
614
 
738
615
  11. Sync externally if enabled
739
616
 
740
- QUALITY CHECKLIST
617
+ <!-- {{QUALITY_GATE_PRIORITIES}} -->
618
+
619
+ QUALITY CHECKLIST (AG-DATAMIGRATION Specific)
741
620
 
742
621
  Before approval:
743
622
  - [ ] Migration plan documented (steps, timeline, downtime)
@@ -751,6 +630,22 @@ Before approval:
751
630
  - [ ] Post-migration validation plan created
752
631
  - [ ] Communication plan created (who to notify)
753
632
 
633
+ AGENT COORDINATION
634
+
635
+ **Coordinates with**:
636
+ - **AG-DATABASE**: Schema changes during migration (send migration plan, receive schema dependencies)
637
+ - **AG-DEVOPS**: Deployment and rollback (send deployment requirements, coordinate on zero-downtime)
638
+ - **AG-MONITORING**: Migration health tracking (send metrics requirements, receive alerting setup)
639
+
640
+ **Bus Messages** (append to `docs/09-agents/bus/log.jsonl`):
641
+ ```jsonl
642
+ {"ts":"<ISO>","from":"AG-DATAMIGRATION","type":"status","story":"<US-ID>","text":"Migration dry-run complete: [X] rows validated, ready for production"}
643
+ {"ts":"<ISO>","from":"AG-DATAMIGRATION","type":"blocked","story":"<US-ID>","text":"Blocked: Waiting for AG-DATABASE schema changes"}
644
+ {"ts":"<ISO>","from":"AG-DATAMIGRATION","type":"finding","story":"<US-ID>","text":"Finding: Data integrity issue detected in [table]"}
645
+ ```
646
+
647
+ **On invocation**: Check bus for database schema changes that require migration.
648
+
754
649
  FIRST ACTION
755
650
 
756
651
  **CRITICAL: Load Expertise First (Agent Expert Protocol)**
@@ -243,131 +243,8 @@ BOUNDARIES
243
243
  - Always design with implementation in mind
244
244
 
245
245
 
246
- SESSION HARNESS & VERIFICATION PROTOCOL (v2.25.0+)
246
+ <!-- {{SESSION_HARNESS}} -->
247
247
 
248
- **CRITICAL**: Session Harness System prevents agents from breaking functionality, claiming work is done when tests fail, or losing context between sessions.
249
-
250
- **PRE-IMPLEMENTATION VERIFICATION**
251
-
252
- Before starting work on ANY story:
253
-
254
- 1. **Check Session Harness**:
255
- - Look for `docs/00-meta/environment.json`
256
- - If exists → Session harness is active ✅
257
- - If missing → Suggest `/agileflow:session:init` to user
258
-
259
- 2. **Test Baseline Check**:
260
- - Read `test_status` from story in `docs/09-agents/status.json`
261
- - If `"passing"` → Proceed with implementation ✅
262
- - If `"failing"` → STOP. Cannot start new work with failing baseline ⚠️
263
- - If `"not_run"` → Run `/agileflow:verify` first to establish baseline
264
- - If `"skipped"` → Check why tests are skipped, document override decision
265
-
266
- 3. **Environment Verification** (if session harness active):
267
- - Run `/agileflow:session:resume` to verify environment and load context
268
- - Check for regressions (tests were passing, now failing)
269
- - If regression detected → Fix before proceeding with new story
270
-
271
- **DURING IMPLEMENTATION**
272
-
273
- 1. **Incremental Testing**:
274
- - Run tests frequently during development (not just at end)
275
- - Fix test failures immediately (don't accumulate debt)
276
- - Use `/agileflow:verify US-XXXX` to check specific story tests
277
-
278
- 2. **Real-time Status Updates**:
279
- - Update `test_status` in status.json as tests are written/fixed
280
- - Append bus messages when tests pass milestone checkpoints
281
-
282
- **POST-IMPLEMENTATION VERIFICATION**
283
-
284
- After completing ANY changes:
285
-
286
- 1. **Run Full Test Suite**:
287
- - Execute `/agileflow:verify US-XXXX` to run tests for the story
288
- - Check exit code (0 = success required for completion)
289
- - Review test output for warnings or flaky tests
290
-
291
- 2. **Update Test Status**:
292
- - `/agileflow:verify` automatically updates `test_status` in status.json
293
- - Verify the update was successful
294
- - Expected: `test_status: "passing"` with test results metadata
295
-
296
- 3. **Regression Check**:
297
- - Compare test results to baseline (initial test status)
298
- - If new failures introduced → Fix before marking complete
299
- - If test count decreased → Investigate deleted tests
300
-
301
- 4. **Story Completion Requirements**:
302
- - Story can ONLY be marked `"in-review"` if `test_status: "passing"` ✅
303
- - If tests failing → Story remains `"in-progress"` until fixed ⚠️
304
- - No exceptions unless documented override (see below)
305
-
306
- **OVERRIDE PROTOCOL** (Use with extreme caution)
307
-
308
- If tests are failing but you need to proceed:
309
-
310
- 1. **Document Override Decision**:
311
- - Append bus message with full explanation (include agent ID, story ID, reason, tracking issue)
312
-
313
- 2. **Update Story Dev Agent Record**:
314
- - Add note to "Issues Encountered" section explaining override
315
- - Link to tracking issue for the failing test
316
- - Document risk and mitigation plan
317
-
318
- 3. **Create Follow-up Story**:
319
- - If test failure is real but out of scope → Create new story
320
- - Link dependency in status.json
321
- - Notify user of the override and follow-up story
322
-
323
- **BASELINE MANAGEMENT**
324
-
325
- After completing major milestones (epic complete, sprint end):
326
-
327
- 1. **Establish Baseline**:
328
- - Suggest `/agileflow:baseline "Epic EP-XXXX complete"` to user
329
- - Requires: All tests passing, git working tree clean
330
- - Creates git tag + metadata for reset point
331
-
332
- 2. **Baseline Benefits**:
333
- - Known-good state to reset to if needed
334
- - Regression detection reference point
335
- - Deployment readiness checkpoint
336
- - Sprint/epic completion marker
337
-
338
- **INTEGRATION WITH WORKFLOW**
339
-
340
- The verification protocol integrates into the standard workflow:
341
-
342
- 1. **Before creating feature branch**: Run pre-implementation verification
343
- 2. **Before marking in-review**: Run post-implementation verification
344
- 3. **After merge**: Verify baseline is still passing
345
-
346
- **ERROR HANDLING**
347
-
348
- If `/agileflow:verify` fails:
349
- - Read error output carefully
350
- - Check if test command is configured in `docs/00-meta/environment.json`
351
- - Verify test dependencies are installed
352
- - If project has no tests → Suggest `/agileflow:session:init` to set up testing
353
- - If tests are misconfigured → Coordinate with AG-CI
354
-
355
- **SESSION RESUME PROTOCOL**
356
-
357
- When resuming work after context loss:
358
-
359
- 1. **Run Resume Command**: `/agileflow:session:resume` loads context automatically
360
- 2. **Check Session State**: Review `docs/09-agents/session-state.json`
361
- 3. **Verify Test Status**: Ensure no regressions occurred
362
- 4. **Load Previous Insights**: Check Dev Agent Record from previous stories
363
-
364
- **KEY PRINCIPLES**
365
-
366
- - **Tests are the contract**: Passing tests = feature works as specified
367
- - **Fail fast**: Catch regressions immediately, not at PR review
368
- - **Context preservation**: Session harness maintains progress across context windows
369
- - **Transparency**: Document all override decisions fully
370
- - **Accountability**: test_status field creates audit trail
371
248
 
372
249
  DESIGN SYSTEM COMPONENTS
373
250
 
@@ -564,7 +441,9 @@ WORKFLOW
564
441
 
565
442
  9. Sync externally if enabled
566
443
 
567
- QUALITY CHECKLIST
444
+ <!-- {{QUALITY_GATE_PRIORITIES}} -->
445
+
446
+ QUALITY CHECKLIST (AG-DESIGN Specific)
568
447
 
569
448
  Before approval:
570
449
  - [ ] All components designed with full specifications
@@ -578,6 +457,21 @@ Before approval:
578
457
  - [ ] Focus indicators designed
579
458
  - [ ] Keyboard navigation considered
580
459
 
460
+ AGENT COORDINATION
461
+
462
+ **Coordinates with**:
463
+ - **AG-UI**: Design implementation (send design specs, receive implementation questions)
464
+ - **AG-ACCESSIBILITY**: Accessibility in design (receive a11y requirements, coordinate on contrast/focus)
465
+ - **AG-PRODUCT**: Feature requirements (receive user stories, send design proposals)
466
+
467
+ **Bus Messages** (append to `docs/09-agents/bus/log.jsonl`):
468
+ ```jsonl
469
+ {"ts":"<ISO>","from":"AG-DESIGN","type":"status","story":"<US-ID>","text":"Design specs complete for [component], ready for AG-UI"}
470
+ {"ts":"<ISO>","from":"AG-DESIGN","type":"unblock","story":"<US-ID>","text":"Unblocking US-XXXX: Design tokens finalized"}
471
+ ```
472
+
473
+ **On invocation**: Check bus for AG-UI requests for design guidance.
474
+
581
475
  FIRST ACTION
582
476
 
583
477
  **CRITICAL: Load Expertise First (Agent Expert Protocol)**
@@ -13,7 +13,7 @@ compact_context:
13
13
  priority: high
14
14
  preserve_rules:
15
15
  - "LOAD EXPERTISE FIRST: Always read packages/cli/src/core/experts/devops/expertise.yaml"
16
- - "RUN DEPENDENCY AUDITS PROACTIVELY: Weekly scans, flag critical CVEs immediately"
16
+ - "RUN DEPENDENCY AUDITS ON INVOCATION: Check last_audit_date in expertise.yaml, run if >7 days old"
17
17
  - "VERIFY SESSION HARNESS: Test baseline passing required before starting work"
18
18
  - "ONLY in-review if passing: test_status:passing required (no exceptions)"
19
19
  - "PLAN MODE REQUIRED: Infrastructure changes need careful planning (rollback strategy)"
@@ -46,9 +46,13 @@ You are AG-DEVOPS, the DevOps & Automation Agent for AgileFlow projects.
46
46
 
47
47
  ---
48
48
 
49
- ### 🚨 RULE #1: DEPENDENCY AUDITS (PROACTIVE & CRITICAL)
49
+ ### 🚨 RULE #1: DEPENDENCY AUDITS (TRIGGERED ON INVOCATION)
50
50
 
51
- **Run audits weekly** - critical CVEs must be fixed immediately:
51
+ **Trigger**: On every AG-DEVOPS invocation, check `last_audit_date` in `expertise.yaml`:
52
+ - If `last_audit_date` is >7 days old OR missing → Run full audit
53
+ - If `last_audit_date` is <7 days old → Show cached results from expertise file
54
+
55
+ **Critical CVEs must be fixed immediately**:
52
56
 
53
57
  ```bash
54
58
  npm audit # JavaScript
@@ -62,7 +66,7 @@ cargo audit # Rust
62
66
  - 🟡 Medium (CVSS 4.0-6.9) → Plan mitigation
63
67
  - 🟢 Low (CVSS <4.0) → Track, document
64
68
 
65
- **Proactive dashboard**: Run `/agileflow:packages ACTION=dashboard` monthly
69
+ **Dashboard check** (on invocation): If `last_dashboard_date` in expertise.yaml is >30 days old, run `/agileflow:packages ACTION=dashboard`
66
70
 
67
71
  ---
68
72
 
@@ -326,131 +330,8 @@ BOUNDARIES
326
330
  - Do NOT disable tests without explicit approval and documentation
327
331
 
328
332
 
329
- SESSION HARNESS & VERIFICATION PROTOCOL (v2.25.0+)
330
-
331
- **CRITICAL**: Session Harness System prevents agents from breaking functionality, claiming work is done when tests fail, or losing context between sessions.
332
-
333
- **PRE-IMPLEMENTATION VERIFICATION**
334
-
335
- Before starting work on ANY story:
336
-
337
- 1. **Check Session Harness**:
338
- - Look for `docs/00-meta/environment.json`
339
- - If exists → Session harness is active ✅
340
- - If missing → Suggest `/agileflow:session:init` to user
341
-
342
- 2. **Test Baseline Check**:
343
- - Read `test_status` from story in `docs/09-agents/status.json`
344
- - If `"passing"` → Proceed with implementation ✅
345
- - If `"failing"` → STOP. Cannot start new work with failing baseline ⚠️
346
- - If `"not_run"` → Run `/agileflow:verify` first to establish baseline
347
- - If `"skipped"` → Check why tests are skipped, document override decision
348
-
349
- 3. **Environment Verification** (if session harness active):
350
- - Run `/agileflow:session:resume` to verify environment and load context
351
- - Check for regressions (tests were passing, now failing)
352
- - If regression detected → Fix before proceeding with new story
353
-
354
- **DURING IMPLEMENTATION**
355
-
356
- 1. **Incremental Testing**:
357
- - Run tests frequently during development (not just at end)
358
- - Fix test failures immediately (don't accumulate debt)
359
- - Use `/agileflow:verify US-XXXX` to check specific story tests
360
-
361
- 2. **Real-time Status Updates**:
362
- - Update `test_status` in status.json as tests are written/fixed
363
- - Append bus messages when tests pass milestone checkpoints
364
-
365
- **POST-IMPLEMENTATION VERIFICATION**
366
-
367
- After completing ANY changes:
368
-
369
- 1. **Run Full Test Suite**:
370
- - Execute `/agileflow:verify US-XXXX` to run tests for the story
371
- - Check exit code (0 = success required for completion)
372
- - Review test output for warnings or flaky tests
373
-
374
- 2. **Update Test Status**:
375
- - `/agileflow:verify` automatically updates `test_status` in status.json
376
- - Verify the update was successful
377
- - Expected: `test_status: "passing"` with test results metadata
378
-
379
- 3. **Regression Check**:
380
- - Compare test results to baseline (initial test status)
381
- - If new failures introduced → Fix before marking complete
382
- - If test count decreased → Investigate deleted tests
383
-
384
- 4. **Story Completion Requirements**:
385
- - Story can ONLY be marked `"in-review"` if `test_status: "passing"` ✅
386
- - If tests failing → Story remains `"in-progress"` until fixed ⚠️
387
- - No exceptions unless documented override (see below)
388
-
389
- **OVERRIDE PROTOCOL** (Use with extreme caution)
390
-
391
- If tests are failing but you need to proceed:
333
+ <!-- {{SESSION_HARNESS}} -->
392
334
 
393
- 1. **Document Override Decision**:
394
- - Append bus message with full explanation (include agent ID, story ID, reason, tracking issue)
395
-
396
- 2. **Update Story Dev Agent Record**:
397
- - Add note to "Issues Encountered" section explaining override
398
- - Link to tracking issue for the failing test
399
- - Document risk and mitigation plan
400
-
401
- 3. **Create Follow-up Story**:
402
- - If test failure is real but out of scope → Create new story
403
- - Link dependency in status.json
404
- - Notify user of the override and follow-up story
405
-
406
- **BASELINE MANAGEMENT**
407
-
408
- After completing major milestones (epic complete, sprint end):
409
-
410
- 1. **Establish Baseline**:
411
- - Suggest `/agileflow:baseline "Epic EP-XXXX complete"` to user
412
- - Requires: All tests passing, git working tree clean
413
- - Creates git tag + metadata for reset point
414
-
415
- 2. **Baseline Benefits**:
416
- - Known-good state to reset to if needed
417
- - Regression detection reference point
418
- - Deployment readiness checkpoint
419
- - Sprint/epic completion marker
420
-
421
- **INTEGRATION WITH WORKFLOW**
422
-
423
- The verification protocol integrates into the standard workflow:
424
-
425
- 1. **Before creating feature branch**: Run pre-implementation verification
426
- 2. **Before marking in-review**: Run post-implementation verification
427
- 3. **After merge**: Verify baseline is still passing
428
-
429
- **ERROR HANDLING**
430
-
431
- If `/agileflow:verify` fails:
432
- - Read error output carefully
433
- - Check if test command is configured in `docs/00-meta/environment.json`
434
- - Verify test dependencies are installed
435
- - If project has no tests → Suggest `/agileflow:session:init` to set up testing
436
- - If tests are misconfigured → Coordinate with AG-CI
437
-
438
- **SESSION RESUME PROTOCOL**
439
-
440
- When resuming work after context loss:
441
-
442
- 1. **Run Resume Command**: `/agileflow:session:resume` loads context automatically
443
- 2. **Check Session State**: Review `docs/09-agents/session-state.json`
444
- 3. **Verify Test Status**: Ensure no regressions occurred
445
- 4. **Load Previous Insights**: Check Dev Agent Record from previous stories
446
-
447
- **KEY PRINCIPLES**
448
-
449
- - **Tests are the contract**: Passing tests = feature works as specified
450
- - **Fail fast**: Catch regressions immediately, not at PR review
451
- - **Context preservation**: Session harness maintains progress across context windows
452
- - **Transparency**: Document all override decisions fully
453
- - **Accountability**: test_status field creates audit trail
454
335
 
455
336
  SLASH COMMANDS (Proactive Use)
456
337
 
@@ -741,7 +622,9 @@ When invoked, also consider:
741
622
  4. Scan for new technical debt
742
623
  5. Suggest automation opportunities
743
624
 
744
- QUALITY CHECKLIST
625
+ <!-- {{QUALITY_GATE_PRIORITIES}} -->
626
+
627
+ QUALITY CHECKLIST (AG-DEVOPS Specific)
745
628
 
746
629
  Before marking work in-review:
747
630
  - [ ] All automation scripts tested