@bonesofspring/ai-rules 0.2.22 → 0.2.23

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 (213) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +6 -2
  3. package/bin/cli.js +32 -8
  4. package/bin/mavis-install.js +441 -0
  5. package/package.json +9 -2
  6. package/presets/_shared/core/meta/preset-pr-checklist.md +1 -0
  7. package/presets/_shared/core/meta/preset-twin-sync.md +16 -0
  8. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  9. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +16 -0
  10. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  11. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +16 -0
  12. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  13. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +16 -0
  14. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  15. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +16 -0
  16. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  17. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +16 -0
  18. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  19. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +16 -0
  20. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  21. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +16 -0
  22. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  23. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +16 -0
  24. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  25. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +16 -0
  26. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +1 -0
  27. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +16 -0
  28. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +1 -0
  29. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +16 -0
  30. package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -0
  31. package/presets/cursor/go/rules/preset-twin-sync.mdc +16 -0
  32. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -0
  33. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +16 -0
  34. package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -0
  35. package/presets/cursor/java/rules/preset-twin-sync.mdc +16 -0
  36. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -0
  37. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +16 -0
  38. package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -0
  39. package/presets/cursor/next/rules/preset-twin-sync.mdc +16 -0
  40. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +1 -0
  41. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +16 -0
  42. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +1 -0
  43. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +16 -0
  44. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +1 -0
  45. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +16 -0
  46. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +1 -0
  47. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +16 -0
  48. package/presets/mavis/README.md +60 -0
  49. package/presets/mavis/next/MAVIS.md +67 -0
  50. package/presets/mavis/next/MCP.md +36 -0
  51. package/presets/mavis/next/README.md +15 -0
  52. package/presets/mavis/next/REPO_AGENTS.md +94 -0
  53. package/presets/mavis/next/adapter-map.json +959 -0
  54. package/presets/mavis/next/agents/README.md +206 -0
  55. package/presets/mavis/next/agents/accessibility-reviewer.md +61 -0
  56. package/presets/mavis/next/agents/api-contract-reviewer.md +57 -0
  57. package/presets/mavis/next/agents/build-verifier.md +110 -0
  58. package/presets/mavis/next/agents/ci-investigator.md +63 -0
  59. package/presets/mavis/next/agents/code-reviewer.md +61 -0
  60. package/presets/mavis/next/agents/codebase-analyzer.md +21 -0
  61. package/presets/mavis/next/agents/debugger.md +80 -0
  62. package/presets/mavis/next/agents/feature-developer.md +101 -0
  63. package/presets/mavis/next/agents/migration-specialist.md +67 -0
  64. package/presets/mavis/next/agents/mockup-reviewer.md +53 -0
  65. package/presets/mavis/next/agents/openspec-author.md +157 -0
  66. package/presets/mavis/next/agents/performance-auditor.md +68 -0
  67. package/presets/mavis/next/agents/playwright-test-generator.md +28 -0
  68. package/presets/mavis/next/agents/playwright-test-healer.md +28 -0
  69. package/presets/mavis/next/agents/playwright-test-planner.md +21 -0
  70. package/presets/mavis/next/agents/qa-tester.md +52 -0
  71. package/presets/mavis/next/agents/security-reviewer.md +54 -0
  72. package/presets/mavis/next/agents/solution-architect.md +68 -0
  73. package/presets/mavis/next/agents/task-analyst.md +166 -0
  74. package/presets/mavis/next/agents/task-router.md +178 -0
  75. package/presets/mavis/next/agents/tech-writer.md +57 -0
  76. package/presets/mavis/next/agents/unit-test-generator.md +31 -0
  77. package/presets/mavis/next/agents/unit-test-healer.md +32 -0
  78. package/presets/mavis/next/agents/unit-test-planner.md +54 -0
  79. package/presets/mavis/next/commands/README.md +49 -0
  80. package/presets/mavis/next/commands/spec-start.md +24 -0
  81. package/presets/mavis/next/commands/task-continue.md +50 -0
  82. package/presets/mavis/next/commands/task.md +50 -0
  83. package/presets/mavis/next/commands/technical-retro.md +80 -0
  84. package/presets/mavis/next/hooks/README.md +22 -0
  85. package/presets/mavis/next/hooks/chain-team-phases.sh +845 -0
  86. package/presets/mavis/next/mcp.json +19 -0
  87. package/presets/mavis/next/rules/README.md +16 -0
  88. package/presets/mavis/next/rules/agent-team-intake.md +11 -0
  89. package/presets/mavis/next/rules/agent-team-orchestrator.md +210 -0
  90. package/presets/mavis/next/rules/ai-local-overlay.md +37 -0
  91. package/presets/mavis/next/rules/anti-sycophancy-discipline.md +23 -0
  92. package/presets/mavis/next/rules/api-services.md +72 -0
  93. package/presets/mavis/next/rules/architecture-boundaries-ui.md +9 -0
  94. package/presets/mavis/next/rules/architecture-boundaries.md +86 -0
  95. package/presets/mavis/next/rules/arrow-functions.md +25 -0
  96. package/presets/mavis/next/rules/code-quality-and-refactoring.md +40 -0
  97. package/presets/mavis/next/rules/code-review-mr.md +40 -0
  98. package/presets/mavis/next/rules/css-property-order-stylelint.md +5 -0
  99. package/presets/mavis/next/rules/design-guidance.md +99 -0
  100. package/presets/mavis/next/rules/feature-delivery-workflow.md +49 -0
  101. package/presets/mavis/next/rules/http-client.md +55 -0
  102. package/presets/mavis/next/rules/layer-barrel-exports.md +68 -0
  103. package/presets/mavis/next/rules/mcp-usage.md +86 -0
  104. package/presets/mavis/next/rules/mockup-review.md +107 -0
  105. package/presets/mavis/next/rules/navigation-router-stack.md +56 -0
  106. package/presets/mavis/next/rules/navigation-router-ui.md +10 -0
  107. package/presets/mavis/next/rules/next-app-core.md +29 -0
  108. package/presets/mavis/next/rules/next-app-router.md +44 -0
  109. package/presets/mavis/next/rules/no-props-spread.md +56 -0
  110. package/presets/mavis/next/rules/no-type-assertion-as-import-export.md +51 -0
  111. package/presets/mavis/next/rules/package-manager.md +11 -0
  112. package/presets/mavis/next/rules/playwright-agents.md +67 -0
  113. package/presets/mavis/next/rules/post-change-lint.md +35 -0
  114. package/presets/mavis/next/rules/preset-layering.md +27 -0
  115. package/presets/mavis/next/rules/preset-no-cross-stack-leakage.md +90 -0
  116. package/presets/mavis/next/rules/preset-pr-checklist.md +35 -0
  117. package/presets/mavis/next/rules/preset-token-budget.md +36 -0
  118. package/presets/mavis/next/rules/preset-twin-sync.md +65 -0
  119. package/presets/mavis/next/rules/product-specs-authoring.md +112 -0
  120. package/presets/mavis/next/rules/product-specs.md +56 -0
  121. package/presets/mavis/next/rules/public-imports.md +50 -0
  122. package/presets/mavis/next/rules/react-a11y-coding.md +31 -0
  123. package/presets/mavis/next/rules/react-next-anti-hallucination.md +60 -0
  124. package/presets/mavis/next/rules/react-ui.md +105 -0
  125. package/presets/mavis/next/rules/reference-features.md +45 -0
  126. package/presets/mavis/next/rules/security-next.md +45 -0
  127. package/presets/mavis/next/rules/store-rtk.md +78 -0
  128. package/presets/mavis/next/rules/technical-retro.md +11 -0
  129. package/presets/mavis/next/rules/tests-e2e-structure.md +72 -0
  130. package/presets/mavis/next/rules/tests-unit.md +72 -0
  131. package/presets/mavis/next/rules/types-jsdoc.md +43 -0
  132. package/presets/mavis/next/rules/ux-design.md +99 -0
  133. package/presets/mavis/next/skills/README.md +21 -0
  134. package/presets/mavis/next/skills/ci-investigation/SKILL.md +39 -0
  135. package/presets/mavis/next/skills/code-review/SKILL.md +39 -0
  136. package/presets/mavis/next/skills/debug-investigation/SKILL.md +26 -0
  137. package/presets/mavis/next/skills/feature-delivery/SKILL.md +34 -0
  138. package/presets/mavis/next/skills/mockup-review/SKILL.md +24 -0
  139. package/presets/mavis/next/skills/playwright-e2e/SKILL.md +28 -0
  140. package/presets/mavis/next/skills/react-performance/SKILL.md +39 -0
  141. package/presets/mavis/next/skills/spec-authoring/SKILL.md +21 -0
  142. package/presets/mavis/next/skills/spec-discovery/SKILL.md +53 -0
  143. package/presets/mavis/next/skills/technical-retro/SKILL.md +49 -0
  144. package/presets/mavis/next/skills/unit-testing/SKILL.md +29 -0
  145. package/presets/mavis/next/skills/ux-design/SKILL.md +31 -0
  146. package/presets/mavis/next/skills/write-adr/SKILL.md +36 -0
  147. package/presets/mavis/next/team/README.md +148 -0
  148. package/presets/mavis/next/team/conventions.md +21 -0
  149. package/presets/mavis/next/team/fixtures/artifact-manifest.example.json +79 -0
  150. package/presets/mavis/next/team/fixtures/bugfix-standard.json +25 -0
  151. package/presets/mavis/next/team/fixtures/feature-full.json +29 -0
  152. package/presets/mavis/next/team/fixtures/feature-light.json +27 -0
  153. package/presets/mavis/next/team/fixtures/feature-with-figma-url.json +17 -0
  154. package/presets/mavis/next/team/fixtures/feature-with-ux-no-figma.json +17 -0
  155. package/presets/mavis/next/team/fixtures/memlog.example.md +9 -0
  156. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
  157. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
  158. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
  159. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
  160. package/presets/mavis/next/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
  161. package/presets/mavis/next/team/fixtures/metrics.example.json +54 -0
  162. package/presets/mavis/next/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
  163. package/presets/mavis/next/team/fixtures/mockup-review-standalone.json +14 -0
  164. package/presets/mavis/next/team/fixtures/ux-design-standalone.json +15 -0
  165. package/presets/mavis/next/team/tasks/.gitkeep +0 -0
  166. package/presets/mavis/platform-contract.json +131 -0
  167. package/scripts/capture-cli-golden.mjs +44 -0
  168. package/scripts/check-chain-hook-coverage.sh +1 -0
  169. package/scripts/check-mavis-adapter-map.mjs +294 -0
  170. package/scripts/check-mavis-local-overlay.mjs +56 -0
  171. package/scripts/check-mavis-platform-contract.mjs +388 -0
  172. package/scripts/check-mavis-token-budget.mjs +48 -0
  173. package/scripts/check-preset-leakage.sh +35 -3
  174. package/scripts/check-preset-structure.sh +63 -0
  175. package/scripts/check-shared-core-drift.sh +18 -0
  176. package/scripts/check-task-router-intents.sh +15 -2
  177. package/scripts/fixtures/cli-golden/claude/next.json +130 -0
  178. package/scripts/fixtures/cli-golden/cursor/next.json +132 -0
  179. package/scripts/fixtures/cli-golden/mavis/next.json +125 -0
  180. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/cursor/AGENTS.md +1 -0
  181. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/cursor/rules/extra.mdc +1 -0
  182. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/cursor/rules/sample.mdc +2 -0
  183. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/mavis/MAVIS.md +1 -0
  184. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/mavis/adapter-map.json +26 -0
  185. package/scripts/fixtures/mavis-adapter-map/invalid-unmapped/mavis/rules/sample.md +2 -0
  186. package/scripts/fixtures/mavis-adapter-map/valid/cursor/AGENTS.md +1 -0
  187. package/scripts/fixtures/mavis-adapter-map/valid/cursor/rules/sample.mdc +2 -0
  188. package/scripts/fixtures/mavis-adapter-map/valid/mavis/MAVIS.md +1 -0
  189. package/scripts/fixtures/mavis-adapter-map/valid/mavis/adapter-map.json +26 -0
  190. package/scripts/fixtures/mavis-adapter-map/valid/mavis/rules/sample.md +2 -0
  191. package/scripts/fixtures/mavis-platform-contract/invalid-minimax-destination.json +131 -0
  192. package/scripts/fixtures/mavis-platform-contract/invalid-missing-capability.json +126 -0
  193. package/scripts/fixtures/mavis-platform-contract/invalid-released-unknown-stack.json +133 -0
  194. package/scripts/fixtures/mavis-platform-contract/invalid-unknown-native-path.json +131 -0
  195. package/scripts/fixtures/mavis-platform-contract/invalid-version-pin.json +132 -0
  196. package/scripts/fixtures/mavis-platform-contract/valid.json +131 -0
  197. package/scripts/fixtures/mavis-probe/AGENTS.md +6 -0
  198. package/scripts/fixtures/mavis-probe/agents/probe-agent.md +6 -0
  199. package/scripts/fixtures/mavis-probe/fake-mcode.mjs +98 -0
  200. package/scripts/fixtures/mavis-probe/output.schema.json +28 -0
  201. package/scripts/fixtures/mavis-probe/rules/probe.md +5 -0
  202. package/scripts/fixtures/mavis-probe/skills/probe/SKILL.md +11 -0
  203. package/scripts/generate-mavis-next.mjs +704 -0
  204. package/scripts/lib/cli-golden.mjs +50 -0
  205. package/scripts/lib/discover-hooks.mjs +72 -0
  206. package/scripts/probe-mavis-capabilities.mjs +480 -0
  207. package/scripts/test-agent-task-metrics-hooks.mjs +22 -16
  208. package/scripts/test-chain-team-phases-coverage.mjs +10 -7
  209. package/scripts/test-cli-init-clean.mjs +256 -0
  210. package/scripts/test-cli-mcp-merge.mjs +23 -0
  211. package/scripts/test-mavis-context-budget.mjs +55 -0
  212. package/scripts/test-mavis-orchestration.mjs +649 -0
  213. package/scripts/test-probe-mavis-capabilities.mjs +205 -0
@@ -0,0 +1,148 @@
1
+ # Agent team artifacts
2
+
3
+ Artifact directory for the Cursor “agent team” pipeline.
4
+
5
+ ## Layout
6
+
7
+ ```
8
+ .mavis/team/
9
+ active-task.json
10
+ fixtures/ # pipeline profile examples (feature-full, feature-light, bugfix-standard)
11
+ tasks/
12
+ <slug>/
13
+ pipeline.json
14
+ status.json
15
+ metrics.json # schema-v1 append-only event ledger (see Local metrics ledger)
16
+ brief.md
17
+ decomposition.md
18
+ debug-report.md # fixApplied: true/false
19
+ validation-report.md # build-verifier: PASS | FAIL
20
+ architecture.md
21
+ migration-plan.md
22
+ ci-report.md
23
+ a11y-review.md
24
+ perf-report.md
25
+ security-review.md
26
+ api-contract-review.md
27
+ unit-test-plan.md
28
+ documentation.md
29
+ review.md
30
+ .memlog.md # append-only agent notes (optional)
31
+ ```
32
+
33
+ ## pipeline.json schema
34
+
35
+ ```json
36
+ {
37
+ "slug": "order-history-date-filter",
38
+ "intent": "feature",
39
+ "specMode": "consume",
40
+ "summary": "Add date filter to Order History",
41
+ "steps": [
42
+ { "agent": "task-analyst", "label": "Clarify and decompose" },
43
+ { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
44
+ { "agent": "build-verifier", "label": "Validation gate" },
45
+ { "agent": "code-reviewer", "label": "Code review" },
46
+ { "agent": "qa-tester", "label": "E2E", "scope": "e2e-only" }
47
+ ],
48
+ "humanGates": ["after:task-analyst"],
49
+ "autoChain": true,
50
+ "skipped": []
51
+ }
52
+ ```
53
+
54
+ ### Step fields
55
+
56
+ | Field | Description |
57
+ |-------|-------------|
58
+ | `agent` | kebab-case name or array when `parallel: true` |
59
+ | `label` | Human-readable step name |
60
+ | `scope` | Passed to agents (e.g. `unit-in-dev`, `e2e-only`) |
61
+ | `skipIf` | `debugger.fixed` \| `ci-investigator.resolved` |
62
+ | `parallel` | Invoke all `agent` values in one parent turn |
63
+
64
+ Optional top-level **`specMode`:** `consume` | `generate` | `none` (router echo; `brief.md` `## Spec mode` wins).
65
+
66
+ ## status.json (pipeline mode)
67
+
68
+ ```json
69
+ {
70
+ "slug": "order-history-date-filter",
71
+ "intent": "feature",
72
+ "pipelineIndex": 0,
73
+ "currentAgent": "task-analyst",
74
+ "phase": "executing",
75
+ "state": "in_progress",
76
+ "awaitingHumanGate": false,
77
+ "retryAfterFix": null,
78
+ "activeAttempts": {},
79
+ "lastCompletedAttempt": null,
80
+ "parallelCompleted": [],
81
+ "parallelOutcomes": {},
82
+ "updatedAt": "2026-05-29T12:00:00.000Z"
83
+ }
84
+ ```
85
+
86
+ ### phase
87
+
88
+ Prefer **`executing`** for pipeline mode. Legacy: `analysis`, `development`, `review`, `testing`, `done`.
89
+
90
+ ### state
91
+
92
+ | Value | Description |
93
+ |-------|-------------|
94
+ | `in_progress` | Current step running |
95
+ | `completed` | Current step finished |
96
+ | `awaiting_approval` | Human gate; use `/task-continue` |
97
+ | `changes_requested` | Reviewer requires fixes |
98
+ | `validation_failed` | build-verifier failed |
99
+ | `approved` | Legacy continue |
100
+
101
+ ## Workflow entry
102
+
103
+ ```bash
104
+ /task <task description>
105
+ /task-continue <slug>
106
+ /technical-retro <slug>
107
+ ```
108
+
109
+ ## Creating task dirs
110
+
111
+ Bootstrap `<slug>/` by **writing** `pipeline.json` (Write tool). Runtime/hook owns `status.json` lifecycle; parent may only create a minimal bootstrap if missing. Do **not** use Shell `mkdir -p` — Cursor’s default sandbox returns `Operation not permitted` (especially for repos on macOS Desktop/Documents).
112
+
113
+ ## Git
114
+
115
+ Commit task artifacts if you want them to survive `ai-rules clean cursor`. Or copy finished tasks to `docs/agent-workflow/tasks/<slug>/`.
116
+
117
+ ## specMode, applyReadiness, memlog
118
+
119
+ - **`specMode`:** `consume` | `generate` | `none` — primary in `brief.md` `## Spec mode`; optional top-level `pipeline.json` `specMode`. `none` skips INDEX/author mode (spike/research).
120
+ - **`applyReadiness`:** YAML frontmatter on developer `implementation.md`; JSON-shaped `{ "state": "blocked"|"ready"|"all_done", "contextFiles": [] }` on the analyst receipt (analyst may emit `blocked` pre-gate). See `agent-artifact-contracts`.
121
+ - **Memlog:** `.mavis/team/tasks/<slug>/.memlog.md` (Claude: `.claude/team/tasks/<slug>/.memlog.md`) — append-only, agent-written; `/task-continue` may read. Hook does not parse it. Example: `fixtures/memlog.example.md`.
122
+
123
+ ## Artifact manifest and receipts
124
+
125
+ Each slug stores one context index at `.mavis/team/tasks/<slug>/artifact-manifest.json`. Schema v1 is defined by shared core `agent-team/agent-artifact-contracts.md`: every entry declares its producer, status, authoritative paths, acceptance-criteria IDs, decomposition task IDs, timestamps, and a terminal completion receipt.
126
+
127
+ Producer/consumer rules:
128
+
129
+ - Read the manifest first and use only the authoritative inputs needed by the current step; fall back to `brief.md`, `decomposition.md`, and `pipeline.json` when it is missing or stale, and report that gap.
130
+ - Producers upsert only their stable entry IDs, preserve foreign entries, and finish with `completed`, `blocked`, `changes_requested`, or `validation_failed` receipt evidence.
131
+ - The router owns `pipeline.json` and its routing entry; analyst, developer, verifier, and reviewer own their named outputs and receipts. Consumers do not edit another producer's receipt.
132
+ - Agents do not mutate `status.json` or `metrics.json`. The orchestration runtime/hook is their single writer. Parallel receipt merges are serialized by the parent/orchestrator.
133
+
134
+ ## Local metrics ledger
135
+
136
+ `metrics.json` is an append-only schema-v1 event ledger for one task run. It contains only allowlisted IDs, task dimensions, timestamps, outcomes, and attribution confidence—never prompts, secrets, file paths, or contents. Policy SoT: `presets/_shared/core/agent-team/agent-task-metrics.md`. The orchestration runtime writes `task_started` / `attempt_started`; the hook records host-clock completion and human-gate edges under a per-task lock with temp-and-rename.
137
+
138
+ `status.json.activeAttempts` is a transient timing bridge keyed by `attemptId`; `lastCompletedAttempt` is diagnostic; `parallelOutcomes` holds per-agent outcomes for the current parallel join until the step advances. For parallel stops, the hook must use a stable payload identity or the sole active attempt. Otherwise an explicit `.metrics-receipts.json` receipt is fallback data marked `source: agent`, `attributionConfidence: fallback`; it must never guess from `currentAgent`.
139
+
140
+ After a human gate, `/task-continue` closes wait via the installed hook (do not hand-edit `pipelineIndex` first):
141
+
142
+ ```bash
143
+ printf '%s\n' '{"status":"completed","action":"end_human_gate","activateNext":true}' | bash .mavis/hooks/chain-team-phases.sh
144
+ ```
145
+
146
+ That appends `human_gate_ended` before the next `attempt_started`. Claude twins use the same payload against `.claude/hooks/chain-team-phases.sh`. Other installable stacks ship the same ledger contract in their `team/README.md`.
147
+
148
+ Aggregate with `node packages/ai-rules/scripts/aggregate-agent-task-metrics.mjs --team-root .mavis/team`. It reports role/agent count, completed count, total/average duration, distinct completed run IDs, separate human-gate wait, and incomplete artifacts. For retros, see `/technical-retro` → **Metrics evidence**.
@@ -0,0 +1,21 @@
1
+ # Living conventions (team)
2
+
3
+ Consumer-owned store for post-init gotchas, patterns, and decisions. **Not** always-on. Fill after `ai-rules init`. Root `AGENTS.md` only points here.
4
+
5
+ ## Gotchas
6
+
7
+ <!-- e.g. fragile flows, “never do X in this repo” -->
8
+
9
+ -
10
+
11
+ ## Patterns
12
+
13
+ <!-- local patterns beyond reference-features table -->
14
+
15
+ -
16
+
17
+ ## Decisions
18
+
19
+ <!-- short pointers to ADRs / product choices that affect code -->
20
+
21
+ -
@@ -0,0 +1,79 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "slug": "order-history-date-filter",
4
+ "updatedAt": "2026-07-31T12:20:00.000Z",
5
+ "artifacts": [
6
+ {
7
+ "id": "routing",
8
+ "producer": "task-router",
9
+ "status": "completed",
10
+ "authoritativePaths": ["pipeline.json"],
11
+ "acceptanceCriteriaIds": [],
12
+ "taskIds": [],
13
+ "timestamps": {
14
+ "createdAt": "2026-07-31T12:00:00.000Z",
15
+ "updatedAt": "2026-07-31T12:00:00.000Z",
16
+ "completedAt": "2026-07-31T12:00:00.000Z"
17
+ },
18
+ "receipt": {
19
+ "outcome": "completed",
20
+ "summary": "The feature pipeline and routing evidence are authoritative.",
21
+ "evidencePaths": ["pipeline.json"]
22
+ }
23
+ },
24
+ {
25
+ "id": "analysis",
26
+ "producer": "task-analyst",
27
+ "status": "completed",
28
+ "authoritativePaths": ["brief.md", "decomposition.md", "ux-design.md"],
29
+ "acceptanceCriteriaIds": ["AC-1", "AC-2"],
30
+ "taskIds": ["T1", "T2"],
31
+ "timestamps": {
32
+ "createdAt": "2026-07-31T12:01:00.000Z",
33
+ "updatedAt": "2026-07-31T12:05:00.000Z",
34
+ "completedAt": "2026-07-31T12:05:00.000Z"
35
+ },
36
+ "receipt": {
37
+ "outcome": "completed",
38
+ "summary": "The acceptance criteria and implementation tasks are ready.",
39
+ "evidencePaths": ["brief.md", "decomposition.md", "ux-design.md"]
40
+ }
41
+ },
42
+ {
43
+ "id": "implementation",
44
+ "producer": "feature-developer",
45
+ "status": "completed",
46
+ "authoritativePaths": ["implementation.md"],
47
+ "acceptanceCriteriaIds": ["AC-1", "AC-2"],
48
+ "taskIds": ["T1", "T2"],
49
+ "timestamps": {
50
+ "createdAt": "2026-07-31T12:06:00.000Z",
51
+ "updatedAt": "2026-07-31T12:20:00.000Z",
52
+ "completedAt": "2026-07-31T12:20:00.000Z"
53
+ },
54
+ "receipt": {
55
+ "outcome": "completed",
56
+ "summary": "Implementation and focused unit coverage are complete.",
57
+ "evidencePaths": ["implementation.md"]
58
+ }
59
+ },
60
+ {
61
+ "id": "mockup-review",
62
+ "producer": "mockup-reviewer",
63
+ "status": "completed",
64
+ "authoritativePaths": ["mockup-review.md"],
65
+ "acceptanceCriteriaIds": ["AC-4", "AC-5", "AC-6", "AC-7", "AC-8"],
66
+ "taskIds": [],
67
+ "timestamps": {
68
+ "createdAt": "2026-07-31T12:05:30.000Z",
69
+ "updatedAt": "2026-07-31T12:05:45.000Z",
70
+ "completedAt": "2026-07-31T12:05:45.000Z"
71
+ },
72
+ "receipt": {
73
+ "outcome": "completed",
74
+ "summary": "Mockup review completed with verdict PASS_WITH_NOTES.",
75
+ "evidencePaths": ["mockup-review.md"]
76
+ }
77
+ }
78
+ ]
79
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "slug": "example-bugfix-standard",
3
+ "intent": "bugfix",
4
+ "profile": "standard",
5
+ "routingDecision": {
6
+ "complexity": "moderate",
7
+ "riskFlags": ["behavior-regression"],
8
+ "routingReasons": [
9
+ "The regression needs root-cause evidence before deciding whether a separate fix pass is necessary.",
10
+ "The bounded behavior change still requires validation and independent review."
11
+ ],
12
+ "estimatedWorkPackages": 1,
13
+ "openDecisionCount": 0
14
+ },
15
+ "summary": "Regression fix with review",
16
+ "steps": [
17
+ { "agent": "debugger", "label": "Root cause" },
18
+ { "agent": "feature-developer", "label": "Fix if needed", "skipIf": "debugger.fixed" },
19
+ { "agent": "build-verifier", "label": "Validation gate" },
20
+ { "agent": "code-reviewer", "label": "Code review" }
21
+ ],
22
+ "humanGates": [],
23
+ "autoChain": true,
24
+ "skipped": []
25
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "slug": "example-feature-full",
3
+ "intent": "feature",
4
+ "specMode": "consume",
5
+ "profile": "full",
6
+ "routingDecision": {
7
+ "complexity": "high",
8
+ "riskFlags": ["cross-layer", "public-contract", "broad-test-surface"],
9
+ "routingReasons": [
10
+ "The feature spans UI, state, and API boundaries, so architecture and implementation checkpoints are required.",
11
+ "The public contract and e2e acceptance surface require independent validation and review."
12
+ ],
13
+ "estimatedWorkPackages": 2,
14
+ "openDecisionCount": 1
15
+ },
16
+ "summary": "Multi-layer feature with e2e coverage",
17
+ "steps": [
18
+ { "agent": "task-analyst", "label": "Clarify and decompose" },
19
+ { "agent": "solution-architect", "label": "Design boundaries", "model": "strong" },
20
+ { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
21
+ { "agent": "build-verifier", "label": "Validation gate", "model": "cheap" },
22
+ { "agent": "security-reviewer", "label": "Security review", "model": "strong" },
23
+ { "agent": "code-reviewer", "label": "Code review", "model": "cheap" },
24
+ { "agent": "qa-tester", "label": "E2E", "scope": "e2e-only" }
25
+ ],
26
+ "humanGates": ["after:task-analyst"],
27
+ "autoChain": true,
28
+ "skipped": []
29
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "slug": "example-feature-light",
3
+ "intent": "feature",
4
+ "profile": "light",
5
+ "routingDecision": {
6
+ "complexity": "low",
7
+ "riskFlags": [],
8
+ "routingReasons": [
9
+ "The request has explicit acceptance criteria and a reversible single-file scope.",
10
+ "No public contract, cross-layer coordination, or open decision requires analysis or architecture."
11
+ ],
12
+ "estimatedWorkPackages": 1,
13
+ "openDecisionCount": 0
14
+ },
15
+ "summary": "Trivial single-file change with explicit AC",
16
+ "steps": [
17
+ { "agent": "feature-developer", "label": "Implement", "model": "cheap" },
18
+ { "agent": "build-verifier", "label": "Validation gate", "model": "cheap" }
19
+ ],
20
+ "humanGates": [],
21
+ "autoChain": true,
22
+ "skipped": [
23
+ { "agent": "task-analyst", "reason": "Explicit AC and single-file scope" },
24
+ { "agent": "code-reviewer", "reason": "Light profile — non-trivial app changes should use standard" },
25
+ { "agent": "qa-tester", "reason": "No e2e AC" }
26
+ ]
27
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "slug": "example-feature-with-figma",
3
+ "intent": "feature",
4
+ "profile": "full",
5
+ "summary": "Feature with Figma mockup URL — mockup-reviewer after analyst, before architect and developer",
6
+ "steps": [
7
+ { "agent": "task-analyst", "label": "Clarify and decompose" },
8
+ { "agent": "mockup-reviewer", "label": "Figma mockup review", "model": "strong" },
9
+ { "agent": "solution-architect", "label": "Design boundaries", "model": "strong" },
10
+ { "agent": "feature-developer", "label": "Implement" },
11
+ { "agent": "build-verifier", "label": "Validation gate", "model": "cheap" },
12
+ { "agent": "code-reviewer", "label": "Code review", "model": "cheap" }
13
+ ],
14
+ "humanGates": ["after:task-analyst"],
15
+ "autoChain": true,
16
+ "skipped": []
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "slug": "example-feature-with-ux-no-figma",
3
+ "intent": "feature",
4
+ "profile": "standard",
5
+ "summary": "Feature with required-signal UX and no Figma URL — task-analyst loads skill ux-design; no mockup-reviewer step",
6
+ "steps": [
7
+ { "agent": "task-analyst", "label": "Clarify, UX design, decompose" },
8
+ { "agent": "feature-developer", "label": "Implement" },
9
+ { "agent": "build-verifier", "label": "Validation gate", "model": "cheap" },
10
+ { "agent": "code-reviewer", "label": "Code review", "model": "cheap" }
11
+ ],
12
+ "humanGates": ["after:task-analyst"],
13
+ "autoChain": true,
14
+ "skipped": [
15
+ { "agent": "mockup-reviewer", "reason": "No figma.com URL; analyst skill ux-design covers behavioral UX" }
16
+ ]
17
+ }
@@ -0,0 +1,9 @@
1
+ # Memlog example
2
+
3
+ Append-only. Agents write; `/task-continue` may read. The hook does not parse this file.
4
+
5
+ ## 2026-08-13
6
+
7
+ - `decision`: specMode=generate; research-before-spec requested
8
+ - `claim`: empty-cart copy lives in CartEmpty.tsx (code-archaeology, inferred)
9
+ - `assumption`: no guest checkout in v1
@@ -0,0 +1,69 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "task": {
4
+ "runId": "human-gate-run",
5
+ "slug": "human-gate",
6
+ "preset": "ai-rules",
7
+ "stack": "next",
8
+ "platform": "cursor",
9
+ "intent": "feature",
10
+ "profile": "full"
11
+ },
12
+ "events": [
13
+ {
14
+ "eventId": "human-gate-run:task",
15
+ "type": "task_started",
16
+ "at": "2026-07-31T17:00:00.000Z",
17
+ "source": "router",
18
+ "attributionConfidence": "high"
19
+ },
20
+ {
21
+ "eventId": "human-gate-run:gate:1",
22
+ "type": "human_gate_started",
23
+ "at": "2026-07-31T17:01:00.000Z",
24
+ "source": "hook",
25
+ "attributionConfidence": "high"
26
+ },
27
+ {
28
+ "eventId": "human-gate-run:gate:end",
29
+ "type": "human_gate_ended",
30
+ "at": "2026-07-31T17:11:00.000Z",
31
+ "gateStartedEventId": "human-gate-run:gate:1",
32
+ "source": "command",
33
+ "attributionConfidence": "high"
34
+ },
35
+ {
36
+ "eventId": "human-gate-run:1:feature-developer:1:start",
37
+ "type": "attempt_started",
38
+ "at": "2026-07-31T17:11:00.000Z",
39
+ "attemptId": "human-gate-run:step-1:feature-developer:attempt-1",
40
+ "stepIndex": 1,
41
+ "stepLabel": null,
42
+ "agent": "feature-developer",
43
+ "role": "implementation",
44
+ "attempt": 1,
45
+ "parallelGroupId": null,
46
+ "source": "hook",
47
+ "attributionConfidence": "high"
48
+ },
49
+ {
50
+ "eventId": "human-gate-run:1:feature-developer:1:finish",
51
+ "type": "attempt_finished",
52
+ "at": "2026-07-31T17:12:00.000Z",
53
+ "attemptId": "human-gate-run:step-1:feature-developer:attempt-1",
54
+ "outcome": "completed",
55
+ "durationMs": 60000,
56
+ "retryAfterFix": null,
57
+ "source": "hook",
58
+ "attributionConfidence": "high"
59
+ },
60
+ {
61
+ "eventId": "human-gate-run:done",
62
+ "type": "task_completed",
63
+ "at": "2026-07-31T17:12:00.000Z",
64
+ "outcome": "completed",
65
+ "source": "hook",
66
+ "attributionConfidence": "high"
67
+ }
68
+ ]
69
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "slug": "missing-ledger",
3
+ "state": "completed",
4
+ "note": "Intentional fixture: metrics.json is absent."
5
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "task": {
4
+ "runId": "parallel-receipts-run",
5
+ "slug": "parallel-receipts",
6
+ "preset": "ai-rules",
7
+ "stack": "next",
8
+ "platform": "cursor",
9
+ "intent": "feature",
10
+ "profile": "full"
11
+ },
12
+ "events": [
13
+ {
14
+ "eventId": "parallel-receipts-run:task",
15
+ "type": "task_started",
16
+ "at": "2026-07-31T16:00:00.000Z",
17
+ "source": "router",
18
+ "attributionConfidence": "high"
19
+ },
20
+ {
21
+ "eventId": "parallel-receipts-run:1:code-reviewer:1:start",
22
+ "type": "attempt_started",
23
+ "at": "2026-07-31T16:00:00.000Z",
24
+ "attemptId": "parallel-receipts-run:step-1:code-reviewer:attempt-1",
25
+ "stepIndex": 1,
26
+ "stepLabel": null,
27
+ "agent": "code-reviewer",
28
+ "role": "review",
29
+ "attempt": 1,
30
+ "parallelGroupId": "parallel-receipts-run:step-1",
31
+ "source": "hook",
32
+ "attributionConfidence": "high"
33
+ },
34
+ {
35
+ "eventId": "parallel-receipts-run:1:security-reviewer:1:start",
36
+ "type": "attempt_started",
37
+ "at": "2026-07-31T16:00:00.000Z",
38
+ "attemptId": "parallel-receipts-run:step-1:security-reviewer:attempt-1",
39
+ "stepIndex": 1,
40
+ "stepLabel": null,
41
+ "agent": "security-reviewer",
42
+ "role": "review",
43
+ "attempt": 1,
44
+ "parallelGroupId": "parallel-receipts-run:step-1",
45
+ "source": "hook",
46
+ "attributionConfidence": "high"
47
+ },
48
+ {
49
+ "eventId": "parallel-receipts-run:1:security-reviewer:1:finish",
50
+ "type": "attempt_finished",
51
+ "at": "2026-07-31T16:01:00.000Z",
52
+ "attemptId": "parallel-receipts-run:step-1:security-reviewer:attempt-1",
53
+ "outcome": "completed",
54
+ "durationMs": 60000,
55
+ "retryAfterFix": null,
56
+ "source": "agent",
57
+ "attributionConfidence": "fallback"
58
+ },
59
+ {
60
+ "eventId": "parallel-receipts-run:1:code-reviewer:1:finish",
61
+ "type": "attempt_finished",
62
+ "at": "2026-07-31T16:02:00.000Z",
63
+ "attemptId": "parallel-receipts-run:step-1:code-reviewer:attempt-1",
64
+ "outcome": "completed",
65
+ "durationMs": 120000,
66
+ "retryAfterFix": null,
67
+ "source": "agent",
68
+ "attributionConfidence": "fallback"
69
+ },
70
+ {
71
+ "eventId": "parallel-receipts-run:done",
72
+ "type": "task_completed",
73
+ "at": "2026-07-31T16:02:00.000Z",
74
+ "outcome": "completed",
75
+ "source": "hook",
76
+ "attributionConfidence": "high"
77
+ }
78
+ ]
79
+ }
@@ -0,0 +1,124 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "task": {
4
+ "runId": "serial-retry-run",
5
+ "slug": "serial-retry",
6
+ "preset": "ai-rules",
7
+ "stack": "next",
8
+ "platform": "cursor",
9
+ "intent": "feature",
10
+ "profile": "full"
11
+ },
12
+ "events": [
13
+ {
14
+ "eventId": "serial-retry-run:task",
15
+ "type": "task_started",
16
+ "at": "2026-07-31T14:00:00.000Z",
17
+ "source": "router",
18
+ "attributionConfidence": "high"
19
+ },
20
+ {
21
+ "eventId": "serial-retry-run:2:code-reviewer:1:start",
22
+ "type": "attempt_started",
23
+ "at": "2026-07-31T14:00:00.000Z",
24
+ "attemptId": "serial-retry-run:step-2:code-reviewer:attempt-1",
25
+ "stepIndex": 2,
26
+ "stepLabel": null,
27
+ "agent": "code-reviewer",
28
+ "role": "review",
29
+ "attempt": 1,
30
+ "parallelGroupId": null,
31
+ "source": "hook",
32
+ "attributionConfidence": "high"
33
+ },
34
+ {
35
+ "eventId": "serial-retry-run:2:code-reviewer:1:finish",
36
+ "type": "attempt_finished",
37
+ "at": "2026-07-31T14:01:00.000Z",
38
+ "attemptId": "serial-retry-run:step-2:code-reviewer:attempt-1",
39
+ "outcome": "changes_requested",
40
+ "durationMs": 60000,
41
+ "retryAfterFix": null,
42
+ "source": "hook",
43
+ "attributionConfidence": "high"
44
+ },
45
+ {
46
+ "eventId": "serial-retry-run:retry:1",
47
+ "type": "retry_scheduled",
48
+ "at": "2026-07-31T14:01:00.000Z",
49
+ "attemptId": "serial-retry-run:step-2:code-reviewer:attempt-1",
50
+ "nextAgent": "feature-developer",
51
+ "retryAfterFix": "code-reviewer",
52
+ "source": "hook",
53
+ "attributionConfidence": "high"
54
+ },
55
+ {
56
+ "eventId": "serial-retry-run:1:feature-developer:1:start",
57
+ "type": "attempt_started",
58
+ "at": "2026-07-31T14:01:00.000Z",
59
+ "attemptId": "serial-retry-run:step-1:feature-developer:attempt-1",
60
+ "stepIndex": 1,
61
+ "stepLabel": null,
62
+ "agent": "feature-developer",
63
+ "role": "implementation",
64
+ "attempt": 1,
65
+ "parallelGroupId": null,
66
+ "source": "hook",
67
+ "attributionConfidence": "high"
68
+ },
69
+ {
70
+ "eventId": "serial-retry-run:1:feature-developer:1:finish",
71
+ "type": "attempt_finished",
72
+ "at": "2026-07-31T14:03:00.000Z",
73
+ "attemptId": "serial-retry-run:step-1:feature-developer:attempt-1",
74
+ "outcome": "completed",
75
+ "durationMs": 120000,
76
+ "retryAfterFix": null,
77
+ "source": "hook",
78
+ "attributionConfidence": "high"
79
+ },
80
+ {
81
+ "eventId": "serial-retry-run:retry:2",
82
+ "type": "retry_scheduled",
83
+ "at": "2026-07-31T14:03:00.000Z",
84
+ "attemptId": "serial-retry-run:step-1:feature-developer:attempt-1",
85
+ "nextAgent": "code-reviewer",
86
+ "retryAfterFix": null,
87
+ "source": "hook",
88
+ "attributionConfidence": "high"
89
+ },
90
+ {
91
+ "eventId": "serial-retry-run:2:code-reviewer:2:start",
92
+ "type": "attempt_started",
93
+ "at": "2026-07-31T14:03:00.000Z",
94
+ "attemptId": "serial-retry-run:step-2:code-reviewer:attempt-2",
95
+ "stepIndex": 2,
96
+ "stepLabel": null,
97
+ "agent": "code-reviewer",
98
+ "role": "review",
99
+ "attempt": 2,
100
+ "parallelGroupId": null,
101
+ "source": "hook",
102
+ "attributionConfidence": "high"
103
+ },
104
+ {
105
+ "eventId": "serial-retry-run:2:code-reviewer:2:finish",
106
+ "type": "attempt_finished",
107
+ "at": "2026-07-31T14:04:00.000Z",
108
+ "attemptId": "serial-retry-run:step-2:code-reviewer:attempt-2",
109
+ "outcome": "completed",
110
+ "durationMs": 60000,
111
+ "retryAfterFix": null,
112
+ "source": "hook",
113
+ "attributionConfidence": "high"
114
+ },
115
+ {
116
+ "eventId": "serial-retry-run:done",
117
+ "type": "task_completed",
118
+ "at": "2026-07-31T14:04:00.000Z",
119
+ "outcome": "completed",
120
+ "source": "hook",
121
+ "attributionConfidence": "high"
122
+ }
123
+ ]
124
+ }