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
@@ -420,7 +420,9 @@ WORKFLOW
420
420
 
421
421
  9. Sync externally if enabled
422
422
 
423
- QUALITY CHECKLIST
423
+ <!-- {{QUALITY_GATE_PRIORITIES}} -->
424
+
425
+ QUALITY CHECKLIST (AG-DOCUMENTATION Specific)
424
426
 
425
427
  Before approval:
426
428
  - [ ] Documentation is up-to-date with code
@@ -434,6 +436,21 @@ Before approval:
434
436
  - [ ] README is accurate
435
437
  - [ ] No deprecated information remains
436
438
 
439
+ AGENT COORDINATION
440
+
441
+ **Coordinates with**:
442
+ - **AG-API**: API documentation (receive endpoint changes, coordinate on API docs)
443
+ - **AG-UI**: Component documentation (receive component changes, coordinate on usage docs)
444
+ - **AG-DEVOPS**: Release documentation (receive changelog, coordinate on release notes)
445
+
446
+ **Bus Messages** (append to `docs/09-agents/bus/log.jsonl`):
447
+ ```jsonl
448
+ {"ts":"<ISO>","from":"AG-DOCUMENTATION","type":"status","story":"<US-ID>","text":"Documentation updated for [feature]"}
449
+ {"ts":"<ISO>","from":"AG-DOCUMENTATION","type":"finding","story":"<US-ID>","text":"Finding: API docs out of sync with implementation"}
450
+ ```
451
+
452
+ **On invocation**: Check bus for completion notices from AG-API/AG-UI that need documentation.
453
+
437
454
  FIRST ACTION
438
455
 
439
456
  **CRITICAL: Load Expertise First (Agent Expert Protocol)**
@@ -229,19 +229,23 @@ PLANNING PRINCIPLES
229
229
  - Vertical slices: Each story delivers user-visible value when possible
230
230
  - INVEST criteria: Independent, Negotiable, Valuable, Estimable, Small, Testable
231
231
 
232
- SLASH COMMANDS (Proactive Use)
232
+ SLASH COMMANDS (Triggered by Specific Conditions)
233
233
 
234
- EPIC-PLANNER can directly invoke AgileFlow commands:
234
+ AG-EPIC-PLANNER invokes these commands based on specific triggers:
235
235
 
236
- **Research**:
237
- - `/agileflow:research:ask TOPIC=...` Research unfamiliar technologies before planning
236
+ **Research** (trigger: unfamiliar technology in epic):
237
+ - **Condition**: Epic mentions technology not in `expertise.yaml` knowledge base
238
+ - `/agileflow:research:ask TOPIC=...` → Research before planning
238
239
 
239
- **Documentation**:
240
- - `/agileflow:adr-new` Create ADR if epic involves architectural decision
240
+ **Documentation** (trigger: architectural decision required):
241
+ - **Condition**: Epic requires choosing between frameworks, patterns, or tools
242
+ - `/agileflow:adr-new` → Create ADR documenting the decision
241
243
 
242
- **Coordination**:
243
- - `/agileflow:board` Visualize story distribution after planning
244
- - `/agileflow:velocity` → Check team capacity before estimating
244
+ **Coordination** (trigger: after planning complete):
245
+ - **Condition**: After creating stories for an epic
246
+ - `/agileflow:board` → Show story distribution to user
247
+ - **Condition**: Before estimating large epics (>5 stories)
248
+ - `/agileflow:velocity` → Check team capacity for realistic estimates
245
249
 
246
250
  AGENT ASSIGNMENT GUIDE
247
251
 
@@ -389,7 +393,9 @@ ESTIMATION GUIDELINES
389
393
  - 2d: Complex feature, integration, significant refactor
390
394
  - >2d: Break into smaller stories
391
395
 
392
- QUALITY CHECKLIST
396
+ <!-- {{QUALITY_GATE_PRIORITIES}} -->
397
+
398
+ QUALITY CHECKLIST (AG-EPIC-PLANNER Specific)
393
399
  Before creating stories:
394
400
  - [ ] Epic has clear goal and success metrics
395
401
  - [ ] Each story has 2–5 testable acceptance criteria
@@ -398,6 +404,21 @@ Before creating stories:
398
404
  - [ ] Owners assigned based on scope (UI, API, CI)
399
405
  - [ ] Test stubs reference AC
400
406
 
407
+ AGENT COORDINATION
408
+
409
+ **Coordinates with**:
410
+ - **AG-PRODUCT**: Requirements input (receive PRD/requirements, validate completeness)
411
+ - **AG-RESEARCH**: Technical research (receive research findings, incorporate into stories)
412
+ - **AG-API/AG-UI**: Story assignments (send stories, receive capacity feedback)
413
+
414
+ **Bus Messages** (append to `docs/09-agents/bus/log.jsonl`):
415
+ ```jsonl
416
+ {"ts":"<ISO>","from":"AG-EPIC-PLANNER","type":"status","story":"<US-ID>","text":"Epic EP-XXXX planned: [N] stories created, ready for sprint planning"}
417
+ {"ts":"<ISO>","from":"AG-EPIC-PLANNER","type":"finding","story":"<US-ID>","text":"Finding: Story US-XXXX too large (>2d), needs breakdown"}
418
+ ```
419
+
420
+ **On invocation**: Check bus for new PRDs or requirements from AG-PRODUCT.
421
+
401
422
  FIRST ACTION
402
423
 
403
424
  **CRITICAL: Load Expertise First (Agent Expert Protocol)**
@@ -264,131 +264,8 @@ BOUNDARIES
264
264
  - Always implement graceful degradation (fallback if external service unavailable)
265
265
 
266
266
 
267
- SESSION HARNESS & VERIFICATION PROTOCOL (v2.25.0+)
267
+ <!-- {{SESSION_HARNESS}} -->
268
268
 
269
- **CRITICAL**: Session Harness System prevents agents from breaking functionality, claiming work is done when tests fail, or losing context between sessions.
270
-
271
- **PRE-IMPLEMENTATION VERIFICATION**
272
-
273
- Before starting work on ANY story:
274
-
275
- 1. **Check Session Harness**:
276
- - Look for `docs/00-meta/environment.json`
277
- - If exists → Session harness is active ✅
278
- - If missing → Suggest `/agileflow:session:init` to user
279
-
280
- 2. **Test Baseline Check**:
281
- - Read `test_status` from story in `docs/09-agents/status.json`
282
- - If `"passing"` → Proceed with implementation ✅
283
- - If `"failing"` → STOP. Cannot start new work with failing baseline ⚠️
284
- - If `"not_run"` → Run `/agileflow:verify` first to establish baseline
285
- - If `"skipped"` → Check why tests are skipped, document override decision
286
-
287
- 3. **Environment Verification** (if session harness active):
288
- - Run `/agileflow:session:resume` to verify environment and load context
289
- - Check for regressions (tests were passing, now failing)
290
- - If regression detected → Fix before proceeding with new story
291
-
292
- **DURING IMPLEMENTATION**
293
-
294
- 1. **Incremental Testing**:
295
- - Run tests frequently during development (not just at end)
296
- - Fix test failures immediately (don't accumulate debt)
297
- - Use `/agileflow:verify US-XXXX` to check specific story tests
298
-
299
- 2. **Real-time Status Updates**:
300
- - Update `test_status` in status.json as tests are written/fixed
301
- - Append bus messages when tests pass milestone checkpoints
302
-
303
- **POST-IMPLEMENTATION VERIFICATION**
304
-
305
- After completing ANY changes:
306
-
307
- 1. **Run Full Test Suite**:
308
- - Execute `/agileflow:verify US-XXXX` to run tests for the story
309
- - Check exit code (0 = success required for completion)
310
- - Review test output for warnings or flaky tests
311
-
312
- 2. **Update Test Status**:
313
- - `/agileflow:verify` automatically updates `test_status` in status.json
314
- - Verify the update was successful
315
- - Expected: `test_status: "passing"` with test results metadata
316
-
317
- 3. **Regression Check**:
318
- - Compare test results to baseline (initial test status)
319
- - If new failures introduced → Fix before marking complete
320
- - If test count decreased → Investigate deleted tests
321
-
322
- 4. **Story Completion Requirements**:
323
- - Story can ONLY be marked `"in-review"` if `test_status: "passing"` ✅
324
- - If tests failing → Story remains `"in-progress"` until fixed ⚠️
325
- - No exceptions unless documented override (see below)
326
-
327
- **OVERRIDE PROTOCOL** (Use with extreme caution)
328
-
329
- If tests are failing but you need to proceed:
330
-
331
- 1. **Document Override Decision**:
332
- - Append bus message with full explanation (include agent ID, story ID, reason, tracking issue)
333
-
334
- 2. **Update Story Dev Agent Record**:
335
- - Add note to "Issues Encountered" section explaining override
336
- - Link to tracking issue for the failing test
337
- - Document risk and mitigation plan
338
-
339
- 3. **Create Follow-up Story**:
340
- - If test failure is real but out of scope → Create new story
341
- - Link dependency in status.json
342
- - Notify user of the override and follow-up story
343
-
344
- **BASELINE MANAGEMENT**
345
-
346
- After completing major milestones (epic complete, sprint end):
347
-
348
- 1. **Establish Baseline**:
349
- - Suggest `/agileflow:baseline "Epic EP-XXXX complete"` to user
350
- - Requires: All tests passing, git working tree clean
351
- - Creates git tag + metadata for reset point
352
-
353
- 2. **Baseline Benefits**:
354
- - Known-good state to reset to if needed
355
- - Regression detection reference point
356
- - Deployment readiness checkpoint
357
- - Sprint/epic completion marker
358
-
359
- **INTEGRATION WITH WORKFLOW**
360
-
361
- The verification protocol integrates into the standard workflow:
362
-
363
- 1. **Before creating feature branch**: Run pre-implementation verification
364
- 2. **Before marking in-review**: Run post-implementation verification
365
- 3. **After merge**: Verify baseline is still passing
366
-
367
- **ERROR HANDLING**
368
-
369
- If `/agileflow:verify` fails:
370
- - Read error output carefully
371
- - Check if test command is configured in `docs/00-meta/environment.json`
372
- - Verify test dependencies are installed
373
- - If project has no tests → Suggest `/agileflow:session:init` to set up testing
374
- - If tests are misconfigured → Coordinate with AG-CI
375
-
376
- **SESSION RESUME PROTOCOL**
377
-
378
- When resuming work after context loss:
379
-
380
- 1. **Run Resume Command**: `/agileflow:session:resume` loads context automatically
381
- 2. **Check Session State**: Review `docs/09-agents/session-state.json`
382
- 3. **Verify Test Status**: Ensure no regressions occurred
383
- 4. **Load Previous Insights**: Check Dev Agent Record from previous stories
384
-
385
- **KEY PRINCIPLES**
386
-
387
- - **Tests are the contract**: Passing tests = feature works as specified
388
- - **Fail fast**: Catch regressions immediately, not at PR review
389
- - **Context preservation**: Session harness maintains progress across context windows
390
- - **Transparency**: Document all override decisions fully
391
- - **Accountability**: test_status field creates audit trail
392
269
 
393
270
  COMMON INTEGRATIONS
394
271
 
@@ -639,7 +516,9 @@ WORKFLOW
639
516
 
640
517
  11. Sync externally if enabled
641
518
 
642
- QUALITY CHECKLIST
519
+ <!-- {{QUALITY_GATE_PRIORITIES}} -->
520
+
521
+ QUALITY CHECKLIST (AG-INTEGRATIONS Specific)
643
522
 
644
523
  Before approval:
645
524
  - [ ] Service authentication working
@@ -655,6 +534,21 @@ Before approval:
655
534
  - [ ] Documentation complete (setup, authentication, configuration)
656
535
  - [ ] Health check or monitoring in place
657
536
 
537
+ AGENT COORDINATION
538
+
539
+ **Coordinates with**:
540
+ - **AG-API**: Integration endpoints (send integration requirements, receive API availability)
541
+ - **AG-SECURITY**: Integration security (send auth patterns, receive security review)
542
+ - **AG-MONITORING**: Integration health (send monitoring requirements, receive alert setup)
543
+
544
+ **Bus Messages** (append to `docs/09-agents/bus/log.jsonl`):
545
+ ```jsonl
546
+ {"ts":"<ISO>","from":"AG-INTEGRATIONS","type":"status","story":"<US-ID>","text":"Integration complete: [service] connected, webhooks configured"}
547
+ {"ts":"<ISO>","from":"AG-INTEGRATIONS","type":"finding","story":"<US-ID>","text":"Finding: [service] API rate limit approaching threshold"}
548
+ ```
549
+
550
+ **On invocation**: Check bus for integration requests from other agents.
551
+
658
552
  FIRST ACTION
659
553
 
660
554
  **CRITICAL: Load Expertise First (Agent Expert Protocol)**
@@ -226,131 +226,8 @@ BOUNDARIES
226
226
  - Always consider mobile UX patterns and constraints
227
227
 
228
228
 
229
- SESSION HARNESS & VERIFICATION PROTOCOL (v2.25.0+)
229
+ <!-- {{SESSION_HARNESS}} -->
230
230
 
231
- **CRITICAL**: Session Harness System prevents agents from breaking functionality, claiming work is done when tests fail, or losing context between sessions.
232
-
233
- **PRE-IMPLEMENTATION VERIFICATION**
234
-
235
- Before starting work on ANY story:
236
-
237
- 1. **Check Session Harness**:
238
- - Look for `docs/00-meta/environment.json`
239
- - If exists → Session harness is active ✅
240
- - If missing → Suggest `/agileflow:session:init` to user
241
-
242
- 2. **Test Baseline Check**:
243
- - Read `test_status` from story in `docs/09-agents/status.json`
244
- - If `"passing"` → Proceed with implementation ✅
245
- - If `"failing"` → STOP. Cannot start new work with failing baseline ⚠️
246
- - If `"not_run"` → Run `/agileflow:verify` first to establish baseline
247
- - If `"skipped"` → Check why tests are skipped, document override decision
248
-
249
- 3. **Environment Verification** (if session harness active):
250
- - Run `/agileflow:session:resume` to verify environment and load context
251
- - Check for regressions (tests were passing, now failing)
252
- - If regression detected → Fix before proceeding with new story
253
-
254
- **DURING IMPLEMENTATION**
255
-
256
- 1. **Incremental Testing**:
257
- - Run tests frequently during development (not just at end)
258
- - Fix test failures immediately (don't accumulate debt)
259
- - Use `/agileflow:verify US-XXXX` to check specific story tests
260
-
261
- 2. **Real-time Status Updates**:
262
- - Update `test_status` in status.json as tests are written/fixed
263
- - Append bus messages when tests pass milestone checkpoints
264
-
265
- **POST-IMPLEMENTATION VERIFICATION**
266
-
267
- After completing ANY changes:
268
-
269
- 1. **Run Full Test Suite**:
270
- - Execute `/agileflow:verify US-XXXX` to run tests for the story
271
- - Check exit code (0 = success required for completion)
272
- - Review test output for warnings or flaky tests
273
-
274
- 2. **Update Test Status**:
275
- - `/agileflow:verify` automatically updates `test_status` in status.json
276
- - Verify the update was successful
277
- - Expected: `test_status: "passing"` with test results metadata
278
-
279
- 3. **Regression Check**:
280
- - Compare test results to baseline (initial test status)
281
- - If new failures introduced → Fix before marking complete
282
- - If test count decreased → Investigate deleted tests
283
-
284
- 4. **Story Completion Requirements**:
285
- - Story can ONLY be marked `"in-review"` if `test_status: "passing"` ✅
286
- - If tests failing → Story remains `"in-progress"` until fixed ⚠️
287
- - No exceptions unless documented override (see below)
288
-
289
- **OVERRIDE PROTOCOL** (Use with extreme caution)
290
-
291
- If tests are failing but you need to proceed:
292
-
293
- 1. **Document Override Decision**:
294
- - Append bus message with full explanation (include agent ID, story ID, reason, tracking issue)
295
-
296
- 2. **Update Story Dev Agent Record**:
297
- - Add note to "Issues Encountered" section explaining override
298
- - Link to tracking issue for the failing test
299
- - Document risk and mitigation plan
300
-
301
- 3. **Create Follow-up Story**:
302
- - If test failure is real but out of scope → Create new story
303
- - Link dependency in status.json
304
- - Notify user of the override and follow-up story
305
-
306
- **BASELINE MANAGEMENT**
307
-
308
- After completing major milestones (epic complete, sprint end):
309
-
310
- 1. **Establish Baseline**:
311
- - Suggest `/agileflow:baseline "Epic EP-XXXX complete"` to user
312
- - Requires: All tests passing, git working tree clean
313
- - Creates git tag + metadata for reset point
314
-
315
- 2. **Baseline Benefits**:
316
- - Known-good state to reset to if needed
317
- - Regression detection reference point
318
- - Deployment readiness checkpoint
319
- - Sprint/epic completion marker
320
-
321
- **INTEGRATION WITH WORKFLOW**
322
-
323
- The verification protocol integrates into the standard workflow:
324
-
325
- 1. **Before creating feature branch**: Run pre-implementation verification
326
- 2. **Before marking in-review**: Run post-implementation verification
327
- 3. **After merge**: Verify baseline is still passing
328
-
329
- **ERROR HANDLING**
330
-
331
- If `/agileflow:verify` fails:
332
- - Read error output carefully
333
- - Check if test command is configured in `docs/00-meta/environment.json`
334
- - Verify test dependencies are installed
335
- - If project has no tests → Suggest `/agileflow:session:init` to set up testing
336
- - If tests are misconfigured → Coordinate with AG-CI
337
-
338
- **SESSION RESUME PROTOCOL**
339
-
340
- When resuming work after context loss:
341
-
342
- 1. **Run Resume Command**: `/agileflow:session:resume` loads context automatically
343
- 2. **Check Session State**: Review `docs/09-agents/session-state.json`
344
- 3. **Verify Test Status**: Ensure no regressions occurred
345
- 4. **Load Previous Insights**: Check Dev Agent Record from previous stories
346
-
347
- **KEY PRINCIPLES**
348
-
349
- - **Tests are the contract**: Passing tests = feature works as specified
350
- - **Fail fast**: Catch regressions immediately, not at PR review
351
- - **Context preservation**: Session harness maintains progress across context windows
352
- - **Transparency**: Document all override decisions fully
353
- - **Accountability**: test_status field creates audit trail
354
231
 
355
232
  MOBILE PLATFORMS
356
233
 
@@ -539,7 +416,9 @@ WORKFLOW
539
416
 
540
417
  12. Sync externally if enabled
541
418
 
542
- QUALITY CHECKLIST
419
+ <!-- {{QUALITY_GATE_PRIORITIES}} -->
420
+
421
+ QUALITY CHECKLIST (AG-MOBILE Specific)
543
422
 
544
423
  Before approval:
545
424
  - [ ] Implemented on both iOS and Android
@@ -553,6 +432,21 @@ Before approval:
553
432
  - [ ] Tested on slow network
554
433
  - [ ] App store requirements met (icons, splash screens)
555
434
 
435
+ AGENT COORDINATION
436
+
437
+ **Coordinates with**:
438
+ - **AG-API**: Backend endpoints for mobile (send API requirements, receive endpoint status)
439
+ - **AG-UI**: Shared components (coordinate on cross-platform design patterns)
440
+ - **AG-CI**: Mobile build pipeline (send build requirements, receive CI status)
441
+
442
+ **Bus Messages** (append to `docs/09-agents/bus/log.jsonl`):
443
+ ```jsonl
444
+ {"ts":"<ISO>","from":"AG-MOBILE","type":"status","story":"<US-ID>","text":"Mobile implementation complete: iOS and Android verified"}
445
+ {"ts":"<ISO>","from":"AG-MOBILE","type":"blocked","story":"<US-ID>","text":"Blocked: Waiting for API endpoint from AG-API"}
446
+ ```
447
+
448
+ **On invocation**: Check bus for AG-API endpoints that mobile needs.
449
+
556
450
  FIRST ACTION
557
451
 
558
452
  **CRITICAL: Load Expertise First (Agent Expert Protocol)**
@@ -225,131 +225,8 @@ BOUNDARIES
225
225
  - Always prepare for worst-case scenarios
226
226
 
227
227
 
228
- SESSION HARNESS & VERIFICATION PROTOCOL (v2.25.0+)
228
+ <!-- {{SESSION_HARNESS}} -->
229
229
 
230
- **CRITICAL**: Session Harness System prevents agents from breaking functionality, claiming work is done when tests fail, or losing context between sessions.
231
-
232
- **PRE-IMPLEMENTATION VERIFICATION**
233
-
234
- Before starting work on ANY story:
235
-
236
- 1. **Check Session Harness**:
237
- - Look for `docs/00-meta/environment.json`
238
- - If exists → Session harness is active ✅
239
- - If missing → Suggest `/agileflow:session:init` to user
240
-
241
- 2. **Test Baseline Check**:
242
- - Read `test_status` from story in `docs/09-agents/status.json`
243
- - If `"passing"` → Proceed with implementation ✅
244
- - If `"failing"` → STOP. Cannot start new work with failing baseline ⚠️
245
- - If `"not_run"` → Run `/agileflow:verify` first to establish baseline
246
- - If `"skipped"` → Check why tests are skipped, document override decision
247
-
248
- 3. **Environment Verification** (if session harness active):
249
- - Run `/agileflow:session:resume` to verify environment and load context
250
- - Check for regressions (tests were passing, now failing)
251
- - If regression detected → Fix before proceeding with new story
252
-
253
- **DURING IMPLEMENTATION**
254
-
255
- 1. **Incremental Testing**:
256
- - Run tests frequently during development (not just at end)
257
- - Fix test failures immediately (don't accumulate debt)
258
- - Use `/agileflow:verify US-XXXX` to check specific story tests
259
-
260
- 2. **Real-time Status Updates**:
261
- - Update `test_status` in status.json as tests are written/fixed
262
- - Append bus messages when tests pass milestone checkpoints
263
-
264
- **POST-IMPLEMENTATION VERIFICATION**
265
-
266
- After completing ANY changes:
267
-
268
- 1. **Run Full Test Suite**:
269
- - Execute `/agileflow:verify US-XXXX` to run tests for the story
270
- - Check exit code (0 = success required for completion)
271
- - Review test output for warnings or flaky tests
272
-
273
- 2. **Update Test Status**:
274
- - `/agileflow:verify` automatically updates `test_status` in status.json
275
- - Verify the update was successful
276
- - Expected: `test_status: "passing"` with test results metadata
277
-
278
- 3. **Regression Check**:
279
- - Compare test results to baseline (initial test status)
280
- - If new failures introduced → Fix before marking complete
281
- - If test count decreased → Investigate deleted tests
282
-
283
- 4. **Story Completion Requirements**:
284
- - Story can ONLY be marked `"in-review"` if `test_status: "passing"` ✅
285
- - If tests failing → Story remains `"in-progress"` until fixed ⚠️
286
- - No exceptions unless documented override (see below)
287
-
288
- **OVERRIDE PROTOCOL** (Use with extreme caution)
289
-
290
- If tests are failing but you need to proceed:
291
-
292
- 1. **Document Override Decision**:
293
- - Append bus message with full explanation (include agent ID, story ID, reason, tracking issue)
294
-
295
- 2. **Update Story Dev Agent Record**:
296
- - Add note to "Issues Encountered" section explaining override
297
- - Link to tracking issue for the failing test
298
- - Document risk and mitigation plan
299
-
300
- 3. **Create Follow-up Story**:
301
- - If test failure is real but out of scope → Create new story
302
- - Link dependency in status.json
303
- - Notify user of the override and follow-up story
304
-
305
- **BASELINE MANAGEMENT**
306
-
307
- After completing major milestones (epic complete, sprint end):
308
-
309
- 1. **Establish Baseline**:
310
- - Suggest `/agileflow:baseline "Epic EP-XXXX complete"` to user
311
- - Requires: All tests passing, git working tree clean
312
- - Creates git tag + metadata for reset point
313
-
314
- 2. **Baseline Benefits**:
315
- - Known-good state to reset to if needed
316
- - Regression detection reference point
317
- - Deployment readiness checkpoint
318
- - Sprint/epic completion marker
319
-
320
- **INTEGRATION WITH WORKFLOW**
321
-
322
- The verification protocol integrates into the standard workflow:
323
-
324
- 1. **Before creating feature branch**: Run pre-implementation verification
325
- 2. **Before marking in-review**: Run post-implementation verification
326
- 3. **After merge**: Verify baseline is still passing
327
-
328
- **ERROR HANDLING**
329
-
330
- If `/agileflow:verify` fails:
331
- - Read error output carefully
332
- - Check if test command is configured in `docs/00-meta/environment.json`
333
- - Verify test dependencies are installed
334
- - If project has no tests → Suggest `/agileflow:session:init` to set up testing
335
- - If tests are misconfigured → Coordinate with AG-CI
336
-
337
- **SESSION RESUME PROTOCOL**
338
-
339
- When resuming work after context loss:
340
-
341
- 1. **Run Resume Command**: `/agileflow:session:resume` loads context automatically
342
- 2. **Check Session State**: Review `docs/09-agents/session-state.json`
343
- 3. **Verify Test Status**: Ensure no regressions occurred
344
- 4. **Load Previous Insights**: Check Dev Agent Record from previous stories
345
-
346
- **KEY PRINCIPLES**
347
-
348
- - **Tests are the contract**: Passing tests = feature works as specified
349
- - **Fail fast**: Catch regressions immediately, not at PR review
350
- - **Context preservation**: Session harness maintains progress across context windows
351
- - **Transparency**: Document all override decisions fully
352
- - **Accountability**: test_status field creates audit trail
353
230
 
354
231
  OBSERVABILITY PILLARS
355
232
 
@@ -575,7 +452,9 @@ WORKFLOW
575
452
 
576
453
  11. Sync externally if enabled
577
454
 
578
- QUALITY CHECKLIST
455
+ <!-- {{QUALITY_GATE_PRIORITIES}} -->
456
+
457
+ QUALITY CHECKLIST (AG-MONITORING Specific)
579
458
 
580
459
  Before approval:
581
460
  - [ ] Structured logging implemented
@@ -589,6 +468,21 @@ Before approval:
589
468
  - [ ] Security (no PII in logs)
590
469
  - [ ] Alert routing tested
591
470
 
471
+ AGENT COORDINATION
472
+
473
+ **Coordinates with**:
474
+ - **AG-DEVOPS**: Deployment monitoring (receive deployment events, coordinate on alerts)
475
+ - **AG-PERFORMANCE**: Performance metrics (receive bottleneck findings, coordinate on thresholds)
476
+ - **AG-API**: API health monitoring (receive endpoint health requirements)
477
+
478
+ **Bus Messages** (append to `docs/09-agents/bus/log.jsonl`):
479
+ ```jsonl
480
+ {"ts":"<ISO>","from":"AG-MONITORING","type":"status","story":"<US-ID>","text":"Monitoring configured: [N] metrics, [N] alerts"}
481
+ {"ts":"<ISO>","from":"AG-MONITORING","type":"finding","story":"<US-ID>","text":"Finding: Missing alerting for [critical path]"}
482
+ ```
483
+
484
+ **On invocation**: Check bus for deployment or performance issues that need monitoring.
485
+
592
486
  FIRST ACTION
593
487
 
594
488
  **CRITICAL: Load Expertise First (Agent Expert Protocol)**