akili-specs 2.1.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 (244) hide show
  1. package/.claude/commands/akili-archive.md +145 -0
  2. package/.claude/commands/akili-audit.md +97 -0
  3. package/.claude/commands/akili-constitution.md +413 -0
  4. package/.claude/commands/akili-execute.md +240 -0
  5. package/.claude/commands/akili-propose.md +167 -0
  6. package/.claude/commands/akili-seo.md +277 -0
  7. package/.claude/commands/akili-specify.md +320 -0
  8. package/.claude/commands/akili-test.md +141 -0
  9. package/.claude/commands/akili-validate.md +176 -0
  10. package/.claude/skills/angular-developer/SKILL.md +130 -0
  11. package/.claude/skills/angular-developer/references/angular-animations.md +160 -0
  12. package/.claude/skills/angular-developer/references/angular-aria.md +410 -0
  13. package/.claude/skills/angular-developer/references/cli.md +86 -0
  14. package/.claude/skills/angular-developer/references/component-harnesses.md +59 -0
  15. package/.claude/skills/angular-developer/references/component-styling.md +91 -0
  16. package/.claude/skills/angular-developer/references/components.md +117 -0
  17. package/.claude/skills/angular-developer/references/creating-services.md +97 -0
  18. package/.claude/skills/angular-developer/references/data-resolvers.md +69 -0
  19. package/.claude/skills/angular-developer/references/define-routes.md +67 -0
  20. package/.claude/skills/angular-developer/references/defining-providers.md +72 -0
  21. package/.claude/skills/angular-developer/references/di-fundamentals.md +120 -0
  22. package/.claude/skills/angular-developer/references/e2e-testing.md +66 -0
  23. package/.claude/skills/angular-developer/references/effects.md +83 -0
  24. package/.claude/skills/angular-developer/references/hierarchical-injectors.md +43 -0
  25. package/.claude/skills/angular-developer/references/host-elements.md +80 -0
  26. package/.claude/skills/angular-developer/references/injection-context.md +63 -0
  27. package/.claude/skills/angular-developer/references/inputs.md +101 -0
  28. package/.claude/skills/angular-developer/references/linked-signal.md +59 -0
  29. package/.claude/skills/angular-developer/references/loading-strategies.md +61 -0
  30. package/.claude/skills/angular-developer/references/mcp.md +106 -0
  31. package/.claude/skills/angular-developer/references/migrations.md +30 -0
  32. package/.claude/skills/angular-developer/references/navigate-to-routes.md +69 -0
  33. package/.claude/skills/angular-developer/references/outputs.md +86 -0
  34. package/.claude/skills/angular-developer/references/reactive-forms.md +122 -0
  35. package/.claude/skills/angular-developer/references/rendering-strategies.md +44 -0
  36. package/.claude/skills/angular-developer/references/resource.md +74 -0
  37. package/.claude/skills/angular-developer/references/route-animations.md +56 -0
  38. package/.claude/skills/angular-developer/references/route-guards.md +52 -0
  39. package/.claude/skills/angular-developer/references/router-lifecycle.md +45 -0
  40. package/.claude/skills/angular-developer/references/router-testing.md +87 -0
  41. package/.claude/skills/angular-developer/references/show-routes-with-outlets.md +68 -0
  42. package/.claude/skills/angular-developer/references/signal-forms.md +897 -0
  43. package/.claude/skills/angular-developer/references/signals-overview.md +94 -0
  44. package/.claude/skills/angular-developer/references/tailwind-css.md +69 -0
  45. package/.claude/skills/angular-developer/references/template-driven-forms.md +114 -0
  46. package/.claude/skills/angular-developer/references/testing-fundamentals.md +66 -0
  47. package/.claude/skills/api-design-principles/SKILL.md +528 -0
  48. package/.claude/skills/api-design-principles/assets/api-design-checklist.md +155 -0
  49. package/.claude/skills/api-design-principles/assets/rest-api-template.py +182 -0
  50. package/.claude/skills/api-design-principles/references/graphql-schema-design.md +583 -0
  51. package/.claude/skills/api-design-principles/references/rest-best-practices.md +408 -0
  52. package/.claude/skills/aws-serverless/SKILL.md +323 -0
  53. package/.claude/skills/brainstorming/SKILL.md +96 -0
  54. package/.claude/skills/error-handling-patterns/SKILL.md +641 -0
  55. package/.claude/skills/frontend-design/LICENSE.txt +177 -0
  56. package/.claude/skills/frontend-design/SKILL.md +272 -0
  57. package/.claude/skills/gsap-core/SKILL.md +254 -0
  58. package/.claude/skills/gsap-frameworks/SKILL.md +153 -0
  59. package/.claude/skills/gsap-performance/SKILL.md +79 -0
  60. package/.claude/skills/gsap-plugins/SKILL.md +426 -0
  61. package/.claude/skills/gsap-react/SKILL.md +136 -0
  62. package/.claude/skills/gsap-scrolltrigger/SKILL.md +296 -0
  63. package/.claude/skills/gsap-timeline/SKILL.md +107 -0
  64. package/.claude/skills/gsap-utils/SKILL.md +284 -0
  65. package/.claude/skills/judgment-day/SKILL.md +52 -0
  66. package/.claude/skills/nestjs-expert/SKILL.md +552 -0
  67. package/.claude/skills/product-manager-toolkit/SKILL.md +351 -0
  68. package/.claude/skills/product-manager-toolkit/references/prd_templates.md +317 -0
  69. package/.claude/skills/product-manager-toolkit/scripts/customer_interview_analyzer.py +441 -0
  70. package/.claude/skills/product-manager-toolkit/scripts/rice_prioritizer.py +296 -0
  71. package/.claude/skills/react-doctor/AGENTS.md +15 -0
  72. package/.claude/skills/react-doctor/SKILL.md +19 -0
  73. package/.claude/skills/seo-audit/SKILL.md +497 -0
  74. package/.claude/skills/seo-audit/evals/evals.json +136 -0
  75. package/.claude/skills/seo-audit/references/ai-writing-detection.md +200 -0
  76. package/.claude/skills/seo-audit/references/international-seo.md +230 -0
  77. package/.claude/skills/shadcn-ui/SKILL.md +1677 -0
  78. package/.claude/skills/shadcn-ui/references/learn.md +145 -0
  79. package/.claude/skills/shadcn-ui/references/official-ui-reference.md +1725 -0
  80. package/.claude/skills/shadcn-ui/references/reference.md +586 -0
  81. package/.claude/skills/shadcn-ui/references/ui-reference.md +1578 -0
  82. package/.claude/skills/stitch-design/README.md +50 -0
  83. package/.claude/skills/stitch-design/SKILL.md +84 -0
  84. package/.claude/skills/stitch-design/examples/DESIGN.md +22 -0
  85. package/.claude/skills/stitch-design/examples/enhanced-prompt.md +28 -0
  86. package/.claude/skills/stitch-design/references/design-mappings.md +45 -0
  87. package/.claude/skills/stitch-design/references/prompt-keywords.md +114 -0
  88. package/.claude/skills/stitch-design/references/tool-schemas.md +76 -0
  89. package/.claude/skills/stitch-design/workflows/edit-design.md +44 -0
  90. package/.claude/skills/stitch-design/workflows/generate-design-md.md +63 -0
  91. package/.claude/skills/stitch-design/workflows/text-to-design.md +47 -0
  92. package/.claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  93. package/.claude/skills/systematic-debugging/SKILL.md +296 -0
  94. package/.claude/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  95. package/.claude/skills/systematic-debugging/condition-based-waiting.md +115 -0
  96. package/.claude/skills/systematic-debugging/defense-in-depth.md +122 -0
  97. package/.claude/skills/systematic-debugging/find-polluter.sh +63 -0
  98. package/.claude/skills/systematic-debugging/root-cause-tracing.md +169 -0
  99. package/.claude/skills/systematic-debugging/test-academic.md +14 -0
  100. package/.claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  101. package/.claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  102. package/.claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  103. package/.claude/skills/tailwind-design-system/SKILL.md +874 -0
  104. package/.claude/skills/ui-ux-pro-max/SKILL.md +377 -0
  105. package/.claude/skills/ui-ux-pro-max/data/charts.csv +26 -0
  106. package/.claude/skills/ui-ux-pro-max/data/colors.csv +97 -0
  107. package/.claude/skills/ui-ux-pro-max/data/icons.csv +101 -0
  108. package/.claude/skills/ui-ux-pro-max/data/landing.csv +31 -0
  109. package/.claude/skills/ui-ux-pro-max/data/products.csv +97 -0
  110. package/.claude/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  111. package/.claude/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  112. package/.claude/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  113. package/.claude/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  114. package/.claude/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  115. package/.claude/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  116. package/.claude/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  117. package/.claude/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  118. package/.claude/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  119. package/.claude/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  120. package/.claude/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  121. package/.claude/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  122. package/.claude/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  123. package/.claude/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  124. package/.claude/skills/ui-ux-pro-max/data/styles.csv +68 -0
  125. package/.claude/skills/ui-ux-pro-max/data/typography.csv +58 -0
  126. package/.claude/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  127. package/.claude/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  128. package/.claude/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  129. package/.claude/skills/ui-ux-pro-max/scripts/core.py +253 -0
  130. package/.claude/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  131. package/.claude/skills/ui-ux-pro-max/scripts/search.py +114 -0
  132. package/.claude/skills/vercel-react-best-practices/AGENTS.md +2934 -0
  133. package/.claude/skills/vercel-react-best-practices/SKILL.md +136 -0
  134. package/.claude/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  135. package/.claude/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
  136. package/.claude/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
  137. package/.claude/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
  138. package/.claude/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
  139. package/.claude/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
  140. package/.claude/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
  141. package/.claude/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
  142. package/.claude/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
  143. package/.claude/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
  144. package/.claude/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
  145. package/.claude/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  146. package/.claude/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
  147. package/.claude/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
  148. package/.claude/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
  149. package/.claude/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
  150. package/.claude/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
  151. package/.claude/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
  152. package/.claude/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
  153. package/.claude/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
  154. package/.claude/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
  155. package/.claude/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
  156. package/.claude/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
  157. package/.claude/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
  158. package/.claude/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
  159. package/.claude/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
  160. package/.claude/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
  161. package/.claude/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
  162. package/.claude/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
  163. package/.claude/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
  164. package/.claude/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  165. package/.claude/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
  166. package/.claude/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
  167. package/.claude/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  168. package/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  169. package/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
  170. package/.claude/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
  171. package/.claude/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  172. package/.claude/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
  173. package/.claude/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
  174. package/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  175. package/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
  176. package/.claude/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
  177. package/.claude/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  178. package/.claude/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
  179. package/.claude/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
  180. package/.claude/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  181. package/.claude/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  182. package/.claude/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
  183. package/.claude/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  184. package/.claude/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
  185. package/.claude/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
  186. package/.claude/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
  187. package/.claude/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
  188. package/.claude/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
  189. package/.claude/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
  190. package/.claude/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
  191. package/.claude/templates/implementer.md +36 -0
  192. package/.claude/templates/leader.md +77 -0
  193. package/.claude/templates/reviewer.md +53 -0
  194. package/.mcp.json.example +12 -0
  195. package/CHANGELOG.md +243 -0
  196. package/LICENSE +21 -0
  197. package/README.md +795 -0
  198. package/assets/jc-fox-mark.svg +10 -0
  199. package/assets/jc-methodology-badge.png +0 -0
  200. package/bin/akili.js +574 -0
  201. package/docs/README.md +48 -0
  202. package/docs/cli.md +187 -0
  203. package/docs/commands/README.md +43 -0
  204. package/docs/commands/akili-archive.md +65 -0
  205. package/docs/commands/akili-constitution.md +91 -0
  206. package/docs/commands/akili-execute.md +93 -0
  207. package/docs/commands/akili-propose.md +65 -0
  208. package/docs/commands/akili-seo.md +75 -0
  209. package/docs/commands/akili-specify.md +69 -0
  210. package/docs/commands/akili-test.md +65 -0
  211. package/docs/commands/akili-validate.md +64 -0
  212. package/docs/flow.md +255 -0
  213. package/docs/model-routing.md +133 -0
  214. package/docs/openspec-comparison.md +42 -0
  215. package/docs/plans/2026-05-26-multi-agent-sdd-orchestration-design.md +105 -0
  216. package/docs/release-checklist.md +91 -0
  217. package/docs/skills/README.md +42 -0
  218. package/docs/skills/angular-developer.md +23 -0
  219. package/docs/skills/api-design-principles.md +22 -0
  220. package/docs/skills/aws-serverless.md +22 -0
  221. package/docs/skills/brainstorming.md +21 -0
  222. package/docs/skills/error-handling-patterns.md +22 -0
  223. package/docs/skills/frontend-design.md +23 -0
  224. package/docs/skills/gsap-core.md +21 -0
  225. package/docs/skills/gsap-frameworks.md +20 -0
  226. package/docs/skills/gsap-performance.md +21 -0
  227. package/docs/skills/gsap-plugins.md +20 -0
  228. package/docs/skills/gsap-react.md +22 -0
  229. package/docs/skills/gsap-scrolltrigger.md +21 -0
  230. package/docs/skills/gsap-timeline.md +20 -0
  231. package/docs/skills/gsap-utils.md +21 -0
  232. package/docs/skills/nestjs-expert.md +23 -0
  233. package/docs/skills/product-manager-toolkit.md +22 -0
  234. package/docs/skills/react-doctor.md +27 -0
  235. package/docs/skills/seo-audit.md +27 -0
  236. package/docs/skills/shadcn-ui.md +22 -0
  237. package/docs/skills/stitch-design.md +21 -0
  238. package/docs/skills/systematic-debugging.md +27 -0
  239. package/docs/skills/tailwind-design-system.md +23 -0
  240. package/docs/skills/ui-ux-pro-max.md +25 -0
  241. package/docs/skills/vercel-react-best-practices.md +22 -0
  242. package/package.json +50 -0
  243. package/scripts/gsc_verify.py +162 -0
  244. package/scripts/parse_tests.js +112 -0
@@ -0,0 +1,145 @@
1
+ ---
2
+ description: Archive a completed spec task, sync agent guides and CodeGraph, and keep the TRD current.
3
+ ---
4
+
5
+ # Archive AKILI-SPECS Spec
6
+
7
+ Archive a completed AKILI-SPECS spec path after implementation, testing, and validation are done.
8
+
9
+ Archiving preserves the full decision trail. It keeps active `docs/specs/` easier to scan while retaining proposal, requirements, design, tasks, execution notes, test evidence, and validation evidence for future review.
10
+
11
+ > **Recommended model tier:** T5 Fast-Cheap. This is a format-following and file-moving job; a deep reasoning model is not required.
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ /akili-archive <spec-path>
17
+ ```
18
+
19
+ **Examples:**
20
+
21
+ - `/akili-archive changes/add-remember-me`
22
+ - `/akili-archive bugfix/login-redirect`
23
+ - `/akili-archive enhancements/renewals`
24
+
25
+ ## Arguments
26
+
27
+ - `$ARGUMENTS` - Relative path under `docs/specs/` that should be archived.
28
+
29
+ ## Output
30
+
31
+ Move the completed spec folder from:
32
+
33
+ ```text
34
+ docs/specs/$ARGUMENTS/
35
+ ```
36
+
37
+ to:
38
+
39
+ ```text
40
+ docs/specs/archive/YYYY-MM-DD-$SAFE_NAME/
41
+ ```
42
+
43
+ Where `$SAFE_NAME` is `$ARGUMENTS` converted to a filesystem-safe flat name by replacing `/` with `--`.
44
+
45
+ Example:
46
+
47
+ ```text
48
+ docs/specs/bugfix/login-redirect/
49
+ docs/specs/archive/2026-05-16-bugfix--login-redirect/
50
+ ```
51
+
52
+ ## Behavior
53
+
54
+ ### Step 0: Load Context
55
+
56
+ **Token Optimization (Prompt Caching):** To maximize prompt caching, always read the constitutional baseline documents FIRST and in the exact same order across all sessions before reading task-specific files.
57
+
58
+ 1. Confirm `docs/specs/$ARGUMENTS/` exists.
59
+ 2. Read project-level context ONLY if needed to interpret archive readiness (IN THIS ORDER):
60
+ - root `CLAUDE.md`
61
+ - `AGENTS.md`
62
+ - `docs/prd.md`
63
+ - `docs/ux-ui/design.md` (legacy fallback: `docs/system-design/design.md`)
64
+ - `docs/trd/trd.md` (legacy fallback: `docs/detailed-design/detailed-design.md`)
65
+ - `docs/specs/general-setup/`
66
+ 3. Read all available files in the spec folder, especially:
67
+ - `proposal.md` if present
68
+ - `requirements.md`
69
+ - `design.md`
70
+ - `tasks.md`
71
+ - `execution.md` if present
72
+ - `test-report.md` if present
73
+ - `validation-report.md` if present
74
+
75
+ ### Step 1: Check Archive Readiness
76
+
77
+ Verify the spec is ready to archive:
78
+
79
+ - `requirements.md`, `design.md`, and `tasks.md` exist
80
+ - all required tasks are marked `[x]`, or incomplete tasks are explicitly accepted as follow-up work
81
+ - `test-report.md` exists, or the absence is explicitly accepted
82
+ - `validation-report.md` exists, or the absence is explicitly accepted
83
+ - no unresolved FAIL findings remain in `validation-report.md`
84
+ - WARN findings are either accepted or assigned to follow-up tasks
85
+ - implementation drift is reflected in the AKILI-SPECS docs or execution notes
86
+
87
+ If readiness is unclear, stop and ask the user whether to proceed, validate first, or keep the spec active.
88
+
89
+ ### Step 2: Create Archive Summary
90
+
91
+ Before moving the folder, create or update:
92
+
93
+ ```text
94
+ docs/specs/$ARGUMENTS/archive-summary.md
95
+ ```
96
+
97
+ The summary must include:
98
+
99
+ 1. Document Control
100
+ 2. Original Spec Path
101
+ 3. Archive Date
102
+ 4. Final Status
103
+ 5. Requirements Delivered
104
+ 6. Files Changed Summary, based on `execution.md` when available
105
+ 7. Test Evidence Summary
106
+ 8. Validation Summary
107
+ 9. Accepted Warnings Or Follow-Ups
108
+ 10. Historical Notes
109
+
110
+ ### Step 3: Constitution & Graph Sync
111
+
112
+ Before moving the folder, sync the project constitution with what the spec actually changed:
113
+
114
+ 1. **Read impact notes:** Collect every `## Constitution Impact` block from `execution.md` and the files-changed summary. If none exist but the diff clearly introduced a new module/package, treat that as an implicit impact note.
115
+ 2. **Agent guide sync:** For each impacted module:
116
+ - Create or update the child `CLAUDE.md`/`AGENTS.md` when the module's conventions diverge from the root (thin, module-specific, never duplicating root rules).
117
+ - Add or refresh the child's entry in the parent guides' `## Module Guides` index.
118
+ - Update any root-guide statements the change made stale (structure descriptions, module lists, key commands).
119
+ - Follow the inheritance convention from `/akili-constitution` Step 7 — if the project has no `## Module Guides` index yet, add it rather than inventing a parallel structure.
120
+ 3. **CodeGraph Refresh Hook:** Check if `.codegraph/` exists in the repository root. If it does, recommend that the user or environment runs a fresh CodeGraph indexing/update (e.g. running `codegraph index` or equivalent) so the graph reflects the new or reshaped modules.
121
+
122
+ ### Step 4: Move Folder
123
+
124
+ 1. Ensure `docs/specs/archive/` exists.
125
+ 2. Move `docs/specs/$ARGUMENTS/` to `docs/specs/archive/YYYY-MM-DD-$SAFE_NAME/`.
126
+ 3. If the target archive folder already exists, do not overwrite it. Add a numeric suffix such as `-2` and report the final path.
127
+
128
+ ### Step 5: Report To User
129
+
130
+ Present:
131
+
132
+ 1. archived source path
133
+ 2. final archive path
134
+ 3. final validation status
135
+ 4. unresolved follow-ups, if any
136
+ 5. whether the active spec directory is now clean
137
+ 6. constitution sync summary: guides created or updated, parent index entries touched, and whether a CodeGraph re-index is recommended
138
+
139
+ ## Error Handling
140
+
141
+ - If the spec path does not exist, report the missing path and stop.
142
+ - If required docs are missing, ask whether to archive anyway or run the missing command first.
143
+ - If validation has unresolved FAIL findings, recommend fixing or explicitly accepting risk before archive.
144
+ - If moving the folder fails, leave the original folder in place and report the reason.
145
+ - Do not delete spec folders as part of archiving; only move them into `docs/specs/archive/`.
@@ -0,0 +1,97 @@
1
+ ---
2
+ description: Run spec-to-code drift auditing to detect differences between active codebase reality and the active UX/UI design and TRD.
3
+ ---
4
+
5
+ # Audit AKILI Specifications for Drift
6
+
7
+ Detect and report drift between the project's specifications (PRD, UX/UI Design, and TRD) and the actual implementation in the codebase.
8
+
9
+ ## Usage
10
+
11
+ ```
12
+ /akili-audit
13
+ ```
14
+
15
+ ## Behavior
16
+
17
+ ### Step 0: Read Project Specifications
18
+
19
+ First, read the constitutional documentation baseline in the repository:
20
+
21
+ 1. `docs/prd.md`
22
+ 2. `docs/ux-ui/design.md` (legacy fallback: `docs/system-design/design.md`)
23
+ 3. `docs/trd/trd.md` (legacy fallback: `docs/detailed-design/detailed-design.md`)
24
+ 4. Any active specs in `docs/specs/` that are not yet archived.
25
+
26
+ ### Step 1: Scan Active Codebase
27
+
28
+ Perform codebase analysis (preferring CodeGraph if `.codegraph/` exists, or utilizing Grep, Glob, and file structures) to extract:
29
+
30
+ 1. **API Surfaces & Services:** Active REST/GraphQL endpoints, controllers, and domain services.
31
+ 2. **Database Schemas & Models:** Active database tables, ORM entities, and schema migrations.
32
+ 3. **UI Components & Pages:** Actual directory structure of frontend views, components, and design tokens.
33
+ 4. **Key Modules & Dependencies:** Registered packages, external integrations, and package manifest frameworks.
34
+
35
+ ### Step 2: Compare Documentation vs. Codebase Reality
36
+
37
+ Audit for discrepancies, classifying findings under the following categories:
38
+
39
+ * **Stale Specification (Documentation > Codebase):** Features, API endpoints, views, or database fields documented in the specs/TRD but completely missing or commented out in the codebase.
40
+ * **Undocumented Feature (Codebase > Documentation):** Modules, API endpoints, major components, or integrations added to the codebase but completely missing from the PRD, UX/UI Design, or TRD.
41
+ * **Visual/Design Token Mismatch:** Colors, typography, spacing, or component structures used in the codebase that violate the styling tokens and design principles declared in `docs/ux-ui/design.md`.
42
+ * **Technical Constraints Violation:** Architectural layout in the codebase that conflicts with patterns (e.g. testing requirements, security rules, file structuring) documented in `docs/trd/trd.md`.
43
+ * **Agent Guide Drift:** Modules whose conventions clearly diverge from the root but lack a child `CLAUDE.md`/`AGENTS.md`, child guides missing from the parent's `## Module Guides` index, guide entries pointing at modules that no longer exist, or root-guide structure descriptions that no longer match the codebase.
44
+
45
+ ### Step 3: Write Drift Report
46
+
47
+ Create or update:
48
+
49
+ ```text
50
+ docs/specs/drift-report.md
51
+ ```
52
+
53
+ The Drift Report must follow this format:
54
+
55
+ ```markdown
56
+ # AKILI Drift Audit Report
57
+
58
+ - **Date of Audit:** YYYY-MM-DD
59
+ - **Code Graph Used:** Yes/No
60
+ - **Overall Conformance Score:** X% (An evaluation of how closely the docs match the code)
61
+
62
+ ## Executive Summary
63
+ A brief overview of the codebase alignment state and major areas of specification drift.
64
+
65
+ ## Identified Discrepancies
66
+
67
+ ### 🔴 High Priority (Breaking/Critical)
68
+ - **[Discrepancy Name]:** Description of what is documented vs. what is coded.
69
+ - **Affected Spec File:** [link text](file:///absolute/path/to/spec)
70
+ - **Affected Code File:** [link text](file:///absolute/path/to/code)
71
+ - **Remediation:** Action needed (either update code or update docs).
72
+
73
+ ### 🟡 Medium Priority (Inconsistencies/Gaps)
74
+ - ...
75
+
76
+ ### 🟢 Low Priority (Style/Cleanups)
77
+ - ...
78
+
79
+ ## Conformance Matrix
80
+
81
+ | Spec Section | Code Reality Status | Alignment Status | Notes |
82
+ | :--- | :--- | :--- | :--- |
83
+ | Product Requirements (PRD) | [Details] | [Aligned / Drifted] | |
84
+ | UX/UI Design / Screen Inventory | [Details] | [Aligned / Drifted] | |
85
+ | TRD (APIs/DB) | [Details] | [Aligned / Drifted] | |
86
+ | Agent Guides (root + `## Module Guides` index) | [Details] | [Aligned / Drifted] | |
87
+
88
+ ## Recommended Next Steps
89
+ Specific actions to resolve the discrepancies (e.g., "Run `/akili-constitution` to enhance baseline", "Update `trd.md` with active REST APIs", or "Schedule a task to implement missing validation tests").
90
+ ```
91
+
92
+ ### Step 4: Report to User
93
+
94
+ Summarize the conformance score, key discrepancies found, and recommended remediation paths. Ask the user whether they would like to:
95
+ 1. Fix documented specs (update baseline docs in place).
96
+ 2. Schedule task specs to implement missing functionality in the code.
97
+ 3. Keep the report for review.
@@ -0,0 +1,413 @@
1
+ ---
2
+ description: Establish or strengthen the project-wide AKILI-SPECS foundation and baseline docs (PRD, UX/UI Design, TRD).
3
+ ---
4
+
5
+ # Establish AKILI-SPECS Constitution
6
+
7
+ Establish or strengthen the project-wide AKILI-SPECS foundation. This command creates the documentation baseline that all later module-level AKILI-SPECS work depends on.
8
+
9
+ ## Usage
10
+
11
+ ```
12
+ /akili-constitution
13
+ ```
14
+
15
+ ## Behavior
16
+
17
+ ### Step 0: Determine Project Mode and Foundation Setup
18
+
19
+ Before classifying the repository, use the `brainstorming` skill to ask the user if this is a new project/MVP starting from 0, or if it is an existing project with an established structure.
20
+
21
+ Based on the response, classify the repository into one of three modes. The classification is non-destructive — it controls how aggressively the constitution drafts, scans, or preserves existing material.
22
+
23
+ - **Brand-new project (Seed Setup):** The user is starting from scratch. Prepare the project from 0. There is little or no application code, no stable project documentation, and no prior AKILI-SPECS artifacts.
24
+ - **Legacy codebase (Discovery Setup):** The user indicates an existing project structure. Analyze the existing project and explicitly prompt to install CodeGraph (`codegraph init -i`) before proceeding. Meaningful application code, package manifests, infrastructure, tests, routes, components, or prior non-AKILI-SPECS docs exist, but the AKILI-SPECS baseline (`docs/prd.md`, `docs/ux-ui/design.md`, `docs/trd/trd.md`, `docs/specs/general-setup/`) is missing or skeletal.
25
+ - **Active AKILI-SPECS project (Safe Update):** the AKILI-SPECS baseline already exists, prior specs live under `docs/specs/`, and an `.agents/` directory may already contain customized personas. The constitution must upgrade weak sections without overwriting customizations.
26
+
27
+ For all three modes:
28
+
29
+ 1. Ensure `docs/` exists.
30
+ 2. Ensure `docs/specs/` exists.
31
+ 3. Ensure `docs/specs/general-setup/` exists.
32
+ 4. Ensure root `CLAUDE.md` exists or is enhanced.
33
+ 5. Ensure root `AGENTS.md` exists or is enhanced.
34
+ 6. Ensure project-level `.agents/` exists with `leader.md`, `implementer.md`, and `reviewer.md` (see Step 7B).
35
+ 7. Default behavior is to enhance existing project docs in place instead of creating parallel copies.
36
+
37
+ The constitutional baseline must cover these files:
38
+
39
+ - `docs/prd.md`
40
+ - `docs/ux-ui/design.md`
41
+ - `docs/trd/trd.md`
42
+ - `docs/infrastructure.md`
43
+ - `docs/specs/general-setup/requirements.md`
44
+ - `docs/specs/general-setup/design.md`
45
+ - `docs/specs/general-setup/task.md`
46
+ - `CLAUDE.md`
47
+ - `AGENTS.md`
48
+ - `.agents/leader.md`
49
+ - `.agents/implementer.md`
50
+ - `.agents/reviewer.md`
51
+
52
+ **Mode-specific drafting policy:**
53
+
54
+ - **Brand-new:** prompt the user for a seed intent (product idea, target users, stack preference), then draft baselines and `.agents/` from the default templates plus that intent.
55
+ - **Legacy:** do not draft the baseline until repository reality has been inspected and summarized. Use CodeGraph or `Grep` to extract components, API surfaces, styling tokens, and module boundaries; synthesize the baseline from that evidence; tailor `.agents/` personas to the detected stack (frameworks, test runner, design tokens).
56
+ - **Active AKILI-SPECS:** read existing files and any custom subagent rules. **Do not overwrite them.** Upgrade only weak sections, fill in missing files, and extend `.agents/` to support the multi-agent loop while preserving custom instructions.
57
+
58
+ **Legacy path migration (pre-TRD naming):**
59
+
60
+ Older AKILI-SPECS baselines used `docs/system-design/design.md` for the UX/UI blueprint and `docs/detailed-design/detailed-design.md` for the technical blueprint. When those legacy paths exist:
61
+
62
+ 1. Treat them as the existing UX/UI Design document and TRD — never draft duplicates alongside them.
63
+ 2. In Active AKILI-SPECS mode, propose migrating them with `git mv` to `docs/ux-ui/design.md` and `docs/trd/trd.md`, then update every reference in `CLAUDE.md`, `AGENTS.md`, `.agents/*.md`, and `docs/specs/` to the new paths.
64
+ 3. If the user declines migration, keep the legacy paths and note the mapping in `CLAUDE.md` so later AKILI-SPECS commands resolve them correctly.
65
+
66
+ ---
67
+
68
+ ### Step 1: Read Project Context First
69
+
70
+ Before writing anything, read the repository context carefully:
71
+
72
+ 1. Root `CLAUDE.md` if it exists
73
+ 2. Root `AGENTS.md` if it exists
74
+ 3. Package-level `CLAUDE.md` and `AGENTS.md` files if they exist
75
+ 4. Existing `docs/prd.md`
76
+ 5. Existing `docs/ux-ui/design.md`
77
+ 6. Existing `docs/trd/trd.md`
78
+ 7. Existing `docs/specs/` folders to extract terminology, taxonomy, and prior feature history
79
+ 8. Any architecture, infrastructure, setup, or product docs already present under `docs/`
80
+
81
+ Also inspect the codebase to understand:
82
+
83
+ - Product domain and business model
84
+ - Main user roles and workflows
85
+ - Current frontend/backend/shared architecture
86
+ - Existing visual patterns and design system signals
87
+ - Technical constraints already enforced by the repo
88
+ - Existing spec taxonomy under `docs/specs/` such as domain, enhancement, bugfix, or epic folders
89
+
90
+ Do not write generic placeholder documentation when the repository already contains enough context to infer a strong baseline.
91
+
92
+ #### Existing Project CodeGraph Check
93
+
94
+ For existing projects, prefer CodeGraph for repository analysis when available:
95
+
96
+ 1. If `.codegraph/` exists, use CodeGraph for symbol lookup, architecture context, callers/callees, and impact analysis before broad file scanning.
97
+ 2. If `.codegraph/` does not exist and the `codegraph` CLI is available, ask the user whether to run `codegraph init -i` before continuing.
98
+ 3. If CodeGraph is unavailable or the user declines initialization, continue with normal `Glob`, `Grep`, and file reads.
99
+ 4. Never block the constitution on CodeGraph. Treat it as an optional context accelerator.
100
+ 5. Do not commit generated CodeGraph databases. Only durable configuration such as `.codegraph/config.json` may be committed when useful.
101
+
102
+ When CodeGraph is used, summarize the evidence it revealed in the constitution output: dominant languages/frameworks, important modules, entry points, routes/API surfaces, test layout, and high-impact dependencies.
103
+
104
+ ---
105
+
106
+ ### Step 2: Clarify Missing Business Context
107
+
108
+ If essential product context is missing or ambiguous, ask focused user questions before drafting the documents.
109
+
110
+ Focus especially on:
111
+
112
+ - The core problem the product solves
113
+ - Primary personas and user roles
114
+ - Business goals and expected outcomes
115
+ - Success metrics or KPIs
116
+ - Scope boundaries and non-goals
117
+ - Known constraints, dependencies, and risks
118
+ - Infrastructure expectations (e.g., AWS, deployment platforms, architectural rules, specific cloud components required)
119
+ - Preferred `docs/specs/` taxonomy when the repo does not already imply one
120
+
121
+ Ask only what is needed to avoid unstable assumptions.
122
+
123
+ ---
124
+
125
+ ### Step 3: Create or Enhance the General PRD
126
+
127
+ Create or enhance `docs/prd.md` as a concise living document.
128
+
129
+ **Primary skill:** `product-manager-toolkit`
130
+
131
+ **PRD rules:**
132
+
133
+ - Lead with the why: problem statement, business context, user need
134
+ - Keep it concise and maintainable
135
+ - Define measurable success metrics before implementation begins
136
+ - Define explicit out-of-scope items
137
+ - Use user-centric requirements and user stories
138
+ - Use testable acceptance criteria
139
+ - Collaborate through assumptions and open questions rather than pretending certainty
140
+ - Keep it AI-ready with clean headings and concise bullets
141
+
142
+ **Pitfalls to avoid:**
143
+
144
+ - Do not mix goals with requirements
145
+ - Do not use vague language like "fast" or "intuitive" without measurable meaning
146
+ - Do not treat the PRD as static
147
+ - Do not force a predetermined technical solution into the PRD
148
+
149
+ **Required PRD structure:**
150
+
151
+ 1. Overview & Purpose
152
+ 2. Problem Statement
153
+ 3. Target Personas
154
+ 4. Goals & Success Metrics
155
+ 5. Scope (In / Out)
156
+ 6. User Stories
157
+ 7. Acceptance Criteria
158
+ 8. Assumptions, Dependencies, & Constraints
159
+ 9. Open Questions
160
+
161
+ When `docs/prd.md` already exists, preserve useful content and upgrade weak sections to follow the rules above.
162
+
163
+ ---
164
+
165
+ ### Step 4: Create or Enhance the UX/UI Design Document
166
+
167
+ Create or enhance `docs/ux-ui/design.md` as the UI/UX system blueprint.
168
+
169
+ **Preferred skill chain:**
170
+
171
+ - `ui-ux-pro-max` if available
172
+ - otherwise `frontend-design` + `stitch-design`
173
+
174
+ This document represents the visual and interaction system, not the low-level technical implementation.
175
+
176
+ **Required structure:**
177
+
178
+ 1. Product Experience Principles
179
+ 2. Information Architecture
180
+ 3. Primary User Flows
181
+ 4. Screen Inventory
182
+ 5. Navigation Model
183
+ 6. Layout Patterns
184
+ 7. Design Tokens
185
+ 8. Component Inventory
186
+ 9. Responsive Behavior
187
+ 10. Accessibility Expectations
188
+ 11. Dark Mode Behavior
189
+ 12. Design Decisions
190
+ 13. Open Gaps / Open Questions
191
+
192
+ **Document intent:**
193
+
194
+ - Define a reusable, consistent UI/UX system
195
+ - Capture visual consistency, accessibility, and interaction rules
196
+ - Reference existing brand, color, typography, and component patterns from the repository when available
197
+ - Prefer clarity over decorative language
198
+
199
+ When the file already exists, refine it in place instead of replacing established valid patterns.
200
+
201
+ ---
202
+
203
+ ### Step 5: Create or Enhance the TRD (Technical Requirements Document)
204
+
205
+ Create or enhance `docs/trd/trd.md` as the technical implementation blueprint.
206
+
207
+ **Use skills when relevant:**
208
+
209
+ - `nestjs-expert`
210
+ - `api-design-principles`
211
+ - `error-handling-patterns`
212
+ - `aws-serverless`
213
+ - `shadcn-ui`
214
+ - `tailwind-design-system`
215
+ - `vercel-react-best-practices`
216
+
217
+ **Required structure:**
218
+
219
+ 1. System Overview
220
+ 2. Domain Modules & Responsibilities
221
+ 3. Data Model & Entities
222
+ 4. API Surface & Contracts
223
+ 5. Backend Workflows & Business Rules
224
+ 6. Frontend Architecture & State Boundaries
225
+ 7. Integration Points
226
+ 8. Security & Authorization Model
227
+ 9. Error Handling & Observability
228
+ 10. Testing Strategy
229
+ 11. Technical Constraints & Assumptions
230
+
231
+ ---
232
+
233
+ ### Step 6: Create or Enhance the Infrastructure Document
234
+
235
+ Create or enhance `docs/infrastructure.md` as the deployment and hosting blueprint.
236
+
237
+ **Required structure:**
238
+
239
+ 1. Target Environment (e.g., AWS, GCP, Vercel, On-prem)
240
+ 2. Core Cloud Components (e.g., Lambda, S3, RDS, ECS)
241
+ 3. Deployment Strategy (e.g., CI/CD, Terraform, CDK)
242
+ 4. Network & Security Architecture
243
+ 5. Infrastructure Rules & Constraints
244
+
245
+ If this information is missing during the initial setup or discovery phase, explicitly ask the user for the intended infrastructure specifications before drafting this document.
246
+
247
+ ---
248
+
249
+ ### Step 7: Create or Enhance General Setup Templates
250
+
251
+ Create or enhance the canonical templates under `docs/specs/general-setup/`.
252
+
253
+ These files define the format that `/akili-specify` must follow later:
254
+
255
+ 1. `requirements.md` — requirement numbering, structure, and writing standards
256
+ 2. `design.md` — architecture, data model, API, frontend, and decision-record structure
257
+ 3. `task.md` — task format, dependency graph format, testing expectations, and execution conventions
258
+
259
+ These are methodology templates for future specs, not a feature spec themselves.
260
+
261
+ They must reflect:
262
+
263
+ - The repo's current architecture and package layout
264
+ - The chosen `docs/specs/` taxonomy
265
+ - The approved PRD, UX/UI design, and TRD conventions
266
+
267
+ ---
268
+
269
+ ### Step 8: Update Root Agent Guides
270
+
271
+ Update root `CLAUDE.md` and `AGENTS.md` so they reference:
272
+
273
+ - `docs/prd.md`
274
+ - `docs/ux-ui/design.md`
275
+ - `docs/trd/trd.md`
276
+ - `docs/infrastructure.md`
277
+ - `docs/specs/general-setup/`
278
+
279
+ The update should explain briefly:
280
+
281
+ - What each document is for
282
+ - When Claude should consult each one
283
+ - That these documents form the constitutional baseline for future AKILI-SPECS work
284
+ - How module specs should be organized under `docs/specs/`
285
+ - Which skills should be used for common work in the project
286
+ - Whether CodeGraph is initialized and how agents should use it for existing-project analysis
287
+ - Which model to switch to per AKILI-SPECS phase (the `## Model Routing` registry added in Step 7C)
288
+
289
+ Preserve the repository's existing `CLAUDE.md` and `AGENTS.md` conventions and extend them.
290
+
291
+ **Nested agent guide inheritance:**
292
+
293
+ Root guides are the parent; major modules or packages may carry child guides. Establish this convention explicitly:
294
+
295
+ 1. A module/package gets a child `CLAUDE.md` and/or `AGENTS.md` **only when its conventions genuinely diverge from the root** (different stack, test runner, boundaries, or domain rules). Do not scaffold empty child guides for every folder.
296
+ 2. Child guides stay thin and module-specific. They must never duplicate root rules — inheritance means the root guide always applies and children only add or narrow.
297
+ 3. The root guides must carry a `## Module Guides` index: one line per child guide (`- <path> — <one-line scope>`). A child guide that is not referenced from the parent index is considered drift.
298
+ 4. **Legacy mode:** create child guides only where the codebase scan shows divergent conventions, and build the parent index from what exists. **Active AKILI-SPECS mode:** preserve existing child guides, add missing parent index entries, and never overwrite customized children.
299
+
300
+ This index is what keeps agent context inheritance working: agents load the root guide plus the child guide of the module they are touching.
301
+
302
+ ---
303
+
304
+ ### Step 8B: Scaffold the `.agents/` Triad
305
+
306
+ Establish or upgrade the project-level `.agents/` directory that powers the AKILI multi-agent execution loop (Leader → Implementer → Reviewer used by `/akili-execute`).
307
+
308
+ Target layout:
309
+
310
+ ```text
311
+ <project-root>/
312
+ ├── .agents/
313
+ │ ├── leader.md # Orchestration playbook, task tracking, .agents references
314
+ │ ├── implementer.md # Coding guidelines, testing standards, design-token discipline
315
+ │ └── reviewer.md # Spec conformance audit, design-token compliance, structured FAIL output
316
+ ```
317
+
318
+ **Source of truth for templates:**
319
+
320
+ The packaged methodology ships default personas under `akili/templates/` inside the active tool's config directory:
321
+
322
+ - Claude Code: `~/.claude/akili/templates/{leader,implementer,reviewer}.md`
323
+ - OpenCode: `~/.config/opencode/akili/templates/{leader,implementer,reviewer}.md`
324
+ - Antigravity: `~/.gemini/config/akili/templates/{leader,implementer,reviewer}.md`
325
+
326
+ If the packaged templates are available, prefer copying them as the seed; otherwise draft equivalent personas inline using the structure documented in this command and the `/akili-execute` command.
327
+
328
+ **Mode-specific scaffolding policy:**
329
+
330
+ - **Brand-new (Seed Setup):** copy the three default templates verbatim into `.agents/`. Tailor only the project name and detected stack if known.
331
+ - **Legacy (Discovery Setup):** copy the three default templates, then customize them based on the codebase scan — inject detected design-token paths, the test command, the lint command, framework conventions, and any directory boundaries discovered. The Reviewer persona in particular should know which `design.md` and `trd.md` paths to cite.
332
+ - **Active AKILI-SPECS (Safe Update):** **do not overwrite** existing `.agents/*.md` files. For each missing file, install the default template (customized to the detected stack). For each existing file, read it, identify gaps versus the current packaged template (e.g. missing rework-loop instructions, missing PASS/FAIL output contract, missing AKILI commit standard), and append a minimal upgrade block that preserves all existing custom instructions.
333
+
334
+ **Required content per persona:**
335
+
336
+ - **`leader.md`** — orchestration sequence, rework loop with 3-attempt ceiling, structured FAIL handoff to the next Implementer spawn, `execution.md` audit-trail format, `tasks.md` status transitions, AKILI commit standard, Pivot Protocol escalation.
337
+ - **`implementer.md`** — strict context alignment to constitution + spec, incremental focus (no scope creep), aesthetics and design-token compliance from `docs/ux-ui/design.md`, verification rigor (must run the task's verification command before reporting), structured completion report.
338
+ - **`reviewer.md`** — read-only role, audit checklist (requirement conformance, design-token compliance, technical compliance, stability), structured PASS/FAIL output where every FAIL item lists *Discovered Issue*, *Violated Rule*, and *Remediation Suggestion*.
339
+
340
+ **Cross-tool compatibility:**
341
+
342
+ The `.agents/` directory must be tool-agnostic:
343
+
344
+ - Pure Markdown + YAML frontmatter, natively compatible with Antigravity, Claude Code, and OpenCode.
345
+ - All AKILI commands resolve the `.agents/` path relative to the active terminal's current working directory, binding it strictly to the current workspace (no global agents directory).
346
+ - Antigravity invokes `invoke_subagent` using prompts read from `.agents/`; Claude Code and OpenCode delegate via sub-prompt contexts seeded with the persona content.
347
+
348
+ ---
349
+
350
+ ### Step 8C: Scaffold Model Routing
351
+
352
+ Add or upgrade a `## Model Routing` section in the project's root `AGENTS.md` **and** `CLAUDE.md`
353
+ so each project carries its own editable, per-tool model-selection registry. This is **guidance
354
+ only** — it tells humans and agents which model to switch to per phase. Do not add `model:`
355
+ frontmatter to any command and do not change the installer.
356
+
357
+ The canonical reference is the packaged `docs/model-routing.md` (criteria-first philosophy, the six
358
+ capability tiers, the phase→tier mapping, and the model registry). Mirror its content into the
359
+ project guides so the project does not depend on the package's `docs/` after install.
360
+
361
+ **The scaffolded `## Model Routing` section must contain:**
362
+
363
+ 1. A one-line statement of the criteria-first philosophy and the guiding principles
364
+ (match the dominant demand; ARCHITECT = BUILDER; **author ≠ auditor**; reserve deep-reasoning for
365
+ propose/verify; fast & cheap for tasks/archive).
366
+ 2. The six capability tiers (T1 Architect, T2 Coder, T3 Auditor, T4 Context-Ingest, T5 Fast-Cheap,
367
+ T6 Multimodal) with one-line definitions.
368
+ 3. The phase→tier mapping for the real AKILI phases, with the `/akili-execute` triad split into
369
+ Leader (T5), Implementer (T2), and Reviewer (T3), and an explicit note that the Reviewer model
370
+ must differ from the Implementer model.
371
+ 4. The editable model registry table with columns `Tier | Claude Code | OpenCode | Fallback`.
372
+ Fill the Claude Code column for the user's plan (e.g. PRO: Opus reserved for T1/T3, Sonnet as the
373
+ T2/T4/T6 workhorse, Haiku for T5). Fill the OpenCode column from the user's confirmed roster; if
374
+ it is unknown, leave clearly-marked `<CONFIRM SLUG>` placeholders rather than guessing.
375
+ 5. The instruction: *"To change models, edit only this registry table. Model selection is guidance
376
+ only — never add `model:` to command frontmatter."*
377
+
378
+ **Mode-specific policy (mirror Step 7B):**
379
+
380
+ - **Brand-new (Seed Setup):** insert the full `## Model Routing` section using the packaged defaults.
381
+ - **Legacy (Discovery Setup):** insert the section and, where detected, annotate the registry with
382
+ the project's actual tooling (e.g. note if the team already standardizes on a specific model).
383
+ - **Active AKILI-SPECS (Safe Update):** **do not overwrite** an existing customized registry. If the section
384
+ is missing, add it; if it exists, only fill gaps (missing tiers, missing author ≠ auditor note)
385
+ without changing the user's pinned models.
386
+
387
+ Confirm the user's available models before writing concrete identifiers: which tier they run in
388
+ Claude Code (and their plan's rate limits) and which models their OpenCode roster exposes.
389
+
390
+ ---
391
+
392
+ ### Step 9: Present and Confirm
393
+
394
+ After drafting or enhancing the documents, generate a short, easy-to-understand summary (summary facil de entender de lo que se hizo) covering:
395
+
396
+ - What was created vs enhanced
397
+ - Which of the three modes was applied (Brand-new / Legacy / Active AKILI-SPECS) and why
398
+ - Whether CodeGraph was used, initialized, declined, or unavailable
399
+ - The chosen spec taxonomy under `docs/specs/`
400
+ - The main problem statement and personas captured in the PRD
401
+ - The main UX/system decisions captured in the UX/UI design document
402
+ - The main technical decisions captured in the TRD
403
+ - The core infrastructure decisions captured in the Infrastructure document
404
+ - The state of `.agents/` (created from defaults, customized to detected stack, or preserved with upgrades) and any customizations applied
405
+ - Any assumptions and open questions that still need validation
406
+
407
+ Ask the user whether to approve or request changes. If changes are requested, revise the affected documents and re-present.
408
+
409
+ ---
410
+
411
+ ## Outcome
412
+
413
+ At the end of `/akili-constitution`, the repository should have a project-level baseline that future `/akili-specify`, `/akili-execute`, `/akili-validate`, and `/akili-test` work can rely on without guessing the structure or conventions. The `.agents/` triad must be in place so that `/akili-execute` can run the Leader → Implementer → Reviewer rework loop without falling back to inline personas. The root guides must also carry a `## Model Routing` registry (Step 8C) so each phase runs on a model matched to its demand, with the Reviewer on a different model than the Implementer.