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,65 @@
1
+ # `/akili-test`
2
+
3
+ Run or create tests for a spec path and produce requirement-level evidence.
4
+
5
+ ## Usage
6
+
7
+ ```text
8
+ /akili-test <spec-path>
9
+ ```
10
+
11
+ ## Use When
12
+
13
+ - Implementation tasks are complete or ready for verification.
14
+ - You need a requirement-to-test matrix.
15
+ - Manual gaps must be documented explicitly.
16
+
17
+ ## Inputs
18
+
19
+ Reads:
20
+
21
+ - `docs/specs/<spec-path>/requirements.md`
22
+ - `docs/specs/<spec-path>/design.md`
23
+ - `docs/specs/<spec-path>/tasks.md`
24
+ - project-level constitution docs and agent guidance
25
+
26
+ ## Outputs
27
+
28
+ Creates or updates:
29
+
30
+ ```text
31
+ docs/specs/<spec-path>/test-report.md
32
+ ```
33
+
34
+ The report includes:
35
+
36
+ - commands run and results
37
+ - backend unit test evidence
38
+ - frontend unit test evidence
39
+ - integration test evidence
40
+ - E2E test evidence
41
+ - requirement-to-test matrix
42
+ - scenario coverage status
43
+ - failures and remediation
44
+ - accepted gaps with reasons
45
+
46
+ ## Skills Commonly Used
47
+
48
+ - `nestjs-expert`
49
+ - `systematic-debugging`
50
+ - `vercel-react-best-practices`
51
+ - `react-doctor`
52
+ - `ui-ux-pro-max`
53
+ - `frontend-design`
54
+
55
+ ## Key Rule
56
+
57
+ Testing must prove the behavior promised in `requirements.md`, not only increase test count.
58
+
59
+ ## Next Step
60
+
61
+ After test evidence is recorded:
62
+
63
+ ```text
64
+ /akili-validate <spec-path>
65
+ ```
@@ -0,0 +1,64 @@
1
+ # `/akili-validate`
2
+
3
+ Audit whether implementation matches the approved spec and constitutional baseline.
4
+
5
+ ## Usage
6
+
7
+ ```text
8
+ /akili-validate <spec-path>
9
+ ```
10
+
11
+ ## Use When
12
+
13
+ - Implementation and test evidence are ready for final conformance review.
14
+ - You need a clear PASS/WARN/FAIL/BLOCKED report.
15
+ - You want to know whether a spec is archive-ready.
16
+
17
+ ## Inputs
18
+
19
+ Reads:
20
+
21
+ - `proposal.md` when present
22
+ - `requirements.md`
23
+ - `design.md`
24
+ - `tasks.md`
25
+ - `execution.md` when present
26
+ - `test-report.md` when present
27
+ - constitution docs and agent guidance
28
+
29
+ ## Outputs
30
+
31
+ Creates or updates:
32
+
33
+ ```text
34
+ docs/specs/<spec-path>/validation-report.md
35
+ ```
36
+
37
+ ## Result Levels
38
+
39
+ | Result | Meaning |
40
+ |---|---|
41
+ | PASS | Requirement, task, or check is satisfied with evidence |
42
+ | WARN | Acceptable but risky, missing evidence, or minor drift |
43
+ | FAIL | Does not satisfy the requirement, task, or check |
44
+ | BLOCKED | Validation could not complete because context, tooling, or access is missing |
45
+
46
+ ## Checks
47
+
48
+ - task completion and execution notes
49
+ - expected file existence
50
+ - build, lint, and type-check integrity
51
+ - requirement coverage
52
+ - test evidence summary
53
+ - architecture and design conformance
54
+ - UI/UX, API, security, accessibility, error handling, and observability as relevant
55
+
56
+ ## Next Step
57
+
58
+ If archive-ready:
59
+
60
+ ```text
61
+ /akili-archive <spec-path>
62
+ ```
63
+
64
+ If not archive-ready, fix the critical findings or update the spec with accepted drift before archiving.
package/docs/flow.md ADDED
@@ -0,0 +1,255 @@
1
+ # AKILI Flow
2
+
3
+ AKILI keeps durable product, design, implementation, test, and validation context in repository files so agents do not have to infer the same project reality every session.
4
+
5
+ The workflow is inspired by OpenSpec's artifact-guided pattern, but AKILI adds a project constitution step, Claude/OpenCode skills, and explicit validation evidence before archive.
6
+
7
+ ## Philosophy
8
+
9
+ ```text
10
+ → constitution before feature work
11
+ → reviewable intent before implementation
12
+ → behavior requirements before code
13
+ → small verified tasks over broad rewrites
14
+ → evidence before archive
15
+ ```
16
+
17
+ ## Primary Lifecycle
18
+
19
+ ```text
20
+ You: /akili-constitution
21
+ AI: Creates or strengthens the project baseline:
22
+ ✓ docs/prd.md
23
+ ✓ docs/ux-ui/design.md
24
+ ✓ docs/trd/trd.md
25
+ ✓ docs/specs/general-setup/
26
+ ✓ CLAUDE.md and AGENTS.md
27
+
28
+ You: /akili-propose add-remember-me
29
+ AI: Creates docs/specs/changes/add-remember-me/proposal.md
30
+ ✓ problem, scope, non-goals
31
+ ✓ affected systems
32
+ ✓ requirement delta preview
33
+ ✓ approach options and recommendation
34
+
35
+ You: /akili-specify changes/add-remember-me
36
+ AI: Creates or updates:
37
+ ✓ requirements.md
38
+ ✓ design.md
39
+ ✓ tasks.md
40
+
41
+ You: /akili-execute changes/add-remember-me
42
+ AI: Runs the Leader → Implementer → Reviewer harness on the next approved task
43
+ ✓ Implementer writes code and runs verification
44
+ ✓ Reviewer audits the diff and emits STATUS: PASS or STATUS: FAIL
45
+ ✓ Up to 3 rework attempts on FAIL, then HALT for human guidance
46
+ ✓ updates tasks.md
47
+ ✓ appends execution.md with full PASS/FAIL audit trail
48
+ ✓ commits with [SPEC:<spec-path>] and records verification evidence
49
+
50
+ You: /akili-test changes/add-remember-me
51
+ AI: Creates test-report.md with requirement-to-test traceability (supports automated parsing via `scripts/parse_tests.js`)
52
+
53
+ You: /akili-validate changes/add-remember-me
54
+ AI: Creates validation-report.md with PASS/WARN/FAIL/BLOCKED findings
55
+
56
+ You: /akili-archive changes/add-remember-me
57
+ AI: Moves completed work into docs/specs/archive/ and refreshes CodeGraph
58
+
59
+ Independent Auditing:
60
+ You: /akili-audit
61
+ AI: Scans codebase and detects drift against baselines, generating docs/specs/drift-report.md
62
+ ```
63
+
64
+ ## Project Modes
65
+
66
+ `/akili-constitution` begins by classifying the repository into one of three modes. Each mode adjusts how aggressively the constitution drafts, scans, or preserves existing material — and how the project `.agents/` harness is scaffolded.
67
+
68
+ | Mode | Meaning | Constitution Behavior | `.agents/` Behavior |
69
+ |---|---|---|---|
70
+ | Brand-new (Seed Setup) | Little or no application code, no AKILI-SPECS docs, starting from scratch | Draft baseline from user intent, chosen stack, assumptions, and open questions | Copy default Leader / Implementer / Reviewer personas verbatim |
71
+ | Legacy (Discovery Setup) | Real code, package manifests, routes, tests exist; AKILI-SPECS baseline missing or skeletal | Inspect repository reality (CodeGraph preferred) before drafting; synthesize baseline from evidence | Copy defaults then customize with detected stack, design tokens, lint and test commands |
72
+ | Active AKILI-SPECS (Safe Update) | AKILI-SPECS baseline and possibly customized `.agents/` already in place | Upgrade weak sections, fill missing files, preserve custom rules | Never overwrite existing personas — append only the minimal upgrade blocks needed |
73
+
74
+ For Legacy and Active-AKILI-SPECS modes, CodeGraph is preferred when `.codegraph/` exists. If CodeGraph is missing but the CLI is available, the agent should ask before running `codegraph init -i`. If CodeGraph is unavailable or declined, normal file and content searches are used.
75
+
76
+ ## Artifacts
77
+
78
+ | Artifact | Created By | Purpose |
79
+ |---|---|---|
80
+ | `docs/prd.md` | `/akili-constitution` | Product purpose, personas, goals, scope, success metrics |
81
+ | `docs/ux-ui/design.md` | `/akili-constitution` | UX system, flows, screen inventory, tokens, accessibility expectations |
82
+ | `docs/trd/trd.md` | `/akili-constitution` | Technical architecture, modules, data, APIs, integrations, testing strategy |
83
+ | `docs/specs/general-setup/` | `/akili-constitution` | Project-specific templates for future specs |
84
+ | `docs/specs/<spec-path>/proposal.md` | `/akili-propose` | Reviewable intent, scope, options, and risks |
85
+ | `docs/specs/<spec-path>/requirements.md` | `/akili-specify` | Behavior contracts and scenarios |
86
+ | `docs/specs/<spec-path>/design.md` | `/akili-specify` | Implementation approach and trade-offs |
87
+ | `docs/specs/<spec-path>/tasks.md` | `/akili-specify` | Small executable tasks with verification |
88
+ | `docs/specs/<spec-path>/execution.md` | `/akili-execute` | Task execution history and evidence |
89
+ | `docs/specs/<spec-path>/test-report.md` | `/akili-test` | Requirement-to-test matrix and coverage gaps |
90
+ | `docs/specs/<spec-path>/validation-report.md` | `/akili-validate` | Final conformance audit |
91
+ | `docs/specs/drift-report.md` | `/akili-audit` | Conformance auditing of documentation vs. codebase reality |
92
+ | `docs/specs/archive/.../archive-summary.md` | `/akili-archive` | Historical closure record |
93
+
94
+ ## Review Gates
95
+
96
+ AKILI keeps humans in control at each important transition.
97
+
98
+ | Gate | Before Moving On, Confirm |
99
+ |---|---|
100
+ | Constitution | Baseline docs reflect the actual product and architecture |
101
+ | Proposal | Problem, scope, non-goals, and recommended approach are approved |
102
+ | Requirements | Observable behavior and scenarios are testable |
103
+ | Design | Technical approach fits the current repository |
104
+ | Tasks | Work is small enough to execute and verify incrementally |
105
+ | Execution | Each completed task has verification evidence |
106
+ | Testing | Key requirements have automated or accepted manual evidence |
107
+ | Validation | No unresolved FAIL findings remain |
108
+ | Archive | Warnings and follow-ups are accepted |
109
+
110
+ ## Documentation Depth
111
+
112
+ Use the lightest documentation that still makes the work clear and verifiable.
113
+
114
+ | Depth | Use For | Capture |
115
+ |---|---|---|
116
+ | Lite | Small bugfixes, copy updates, narrow UI tweaks | Problem, scenario, focused task, verification command |
117
+ | Standard | Normal features and enhancements | Requirements, scenarios, design decisions, tasks, tests |
118
+ | Full | Risky, cross-cutting, API, data, auth, migration, or SEO work | Alternatives, rollout, risks, observability, rollback, explicit traceability |
119
+
120
+ Lite mode does not skip rigor. Requirements still need scenarios, tasks still need done criteria, and validation still needs evidence.
121
+
122
+ ## Spec Folder Shape
123
+
124
+ ```text
125
+ docs/specs/<spec-path>/
126
+ ├── proposal.md
127
+ ├── requirements.md
128
+ ├── design.md
129
+ ├── tasks.md
130
+ ├── execution.md
131
+ ├── test-report.md
132
+ ├── validation-report.md
133
+ └── archive-summary.md
134
+ ```
135
+
136
+ Common spec paths:
137
+
138
+ ```text
139
+ docs/specs/changes/add-remember-me/
140
+ docs/specs/enhancements/renewals/
141
+ docs/specs/admin/user-management/
142
+ docs/specs/bugfix/login-redirect/
143
+ docs/specs/seo/example.com/
144
+ ```
145
+
146
+ ## Shortcut Paths
147
+
148
+ For a small, obvious change in a repository with a strong baseline, you may start at `/akili-specify <spec-path>`.
149
+
150
+ For unclear, risky, cross-functional, or stakeholder-sensitive work, start at `/akili-propose <change-name-or-spec-path>`.
151
+
152
+ For a new repository, stale documentation, or a major product pivot, start at `/akili-constitution`.
153
+
154
+ ---
155
+
156
+ ## Advanced Engineering Capabilities
157
+
158
+ To support robust, long-term development cycles, AKILI includes the following specialized workflows:
159
+
160
+ ### 1. Spec-to-Code Traceability (Git & Comments)
161
+ To establish high-traceability between spec files and source code:
162
+ * **Commit Messages:** Every commit made during `/akili-execute` must be prefixed with `[SPEC:<spec-path>]` (e.g. `git commit -m "[SPEC:changes/add-remember-me] implement secure cookie storage"`).
163
+ * **Comment Tracing:** For complex algorithms, API entry points, or core models, developers/agents should place a reference comment: `// @akili-spec <spec-path>`.
164
+
165
+ ### 2. Specification Drift Auditing (`/akili-audit`)
166
+ Run `/akili-audit` independently to verify that the active codebase reflects active documentation. The command produces `docs/specs/drift-report.md` detailing:
167
+ * **Stale Specifications:** Documented endpoints/modules missing from code.
168
+ * **Undocumented Code:** Active code additions completely missing from the PRD, UX/UI design, or TRD docs.
169
+ * **Styling/Architecture Violations:** Active code violating styling tokens or engineering guidelines.
170
+ * **Agent Guide Drift:** Modules lacking a needed child `CLAUDE.md`/`AGENTS.md`, child guides missing from the parent's `## Module Guides` index, or root-guide structure descriptions that no longer match the codebase.
171
+
172
+ ### 3. The Pivot Protocol
173
+ If discovery during `/akili-execute` invalidates requirements or design rules:
174
+ 1. Mark the current task in `tasks.md` as `[~]` (blocked).
175
+ 2. Append a `## Pivot Record: <Task ID>` under `execution.md` explaining the conflict, technical constraints, and proposed options.
176
+ 3. Update `requirements.md`, `design.md`, and/or `tasks.md` in the spec folder.
177
+ 4. Obtain user sign-off on the pivot before resuming execution.
178
+
179
+ ### 4. CodeGraph Refresh Trigger
180
+ When compiling the `archive-summary.md` and moving folders to the archive via `/akili-archive`:
181
+ * The agent detects if `.codegraph/` configuration folders are present.
182
+ * The agent reminds or executes the re-indexing command (e.g., `codegraph index`) to guarantee semantic search utilities remain highly functional for subsequent sessions.
183
+
184
+ ### 5. Automated Test Reporting (`scripts/parse_tests.js`)
185
+ Rather than manually compiling assertion results during `/akili-test`:
186
+ 1. Execute tests outputting to JSON (e.g. `jest --json --outputFile=jest-results.json` or `vitest --reporter=json`).
187
+ 2. Run `node <path-to-akili>/scripts/parse_tests.js jest-results.json` to generate the AKILI matrix table automatically for inclusion inside `test-report.md`.
188
+
189
+ ### 6. Multi-Agent Harness (`/akili-execute` Triad)
190
+
191
+ `/akili-execute` is implemented as a multi-agent orchestration rather than a single-agent script. The Leader role does not write production code; it delegates implementation and audit to two subordinate roles, then enforces a strict PASS/FAIL gate before the task advances.
192
+
193
+ **Roles** — all three live in the project's `.agents/` directory, scaffolded by `/akili-constitution`:
194
+
195
+ | Role | File | Responsibilities |
196
+ |---|---|---|
197
+ | Leader | `.agents/leader.md` | Picks the next eligible task, delegates work, enforces the rework loop, updates `tasks.md` and `execution.md`, commits with `[SPEC:<spec-path>]` |
198
+ | Implementer | `.agents/implementer.md` | Writes code strictly within task scope, applies design tokens from `docs/ux-ui/design.md`, runs the verification command before reporting |
199
+ | Reviewer | `.agents/reviewer.md` | Read-only diff audit against requirements, design tokens, and the TRD; outputs a structured PASS or FAIL with *Discovered Issue*, *Violated Rule*, and *Remediation Suggestion* |
200
+
201
+ **Loop:**
202
+
203
+ ```text
204
+ Leader picks the next task → spawns Implementer with task + persona
205
+ Implementer writes code, runs verification → reports back
206
+ Leader extracts git diff → spawns Reviewer with diff + persona
207
+ Reviewer returns STATUS: PASS, STATUS: FAIL, or STATUS: FATAL_FAIL
208
+
209
+ if PASS → update tasks.md, append execution.md, commit, advance
210
+ if FAIL and attempts < 3 → respawn Implementer with the Reviewer's structured findings
211
+ if FATAL_FAIL → abort loop immediately, mark task [~], trigger Pivot Protocol
212
+ if 3 consecutive FAILs → HALT, mark task [~], present audit trail
213
+ ```
214
+
215
+ **Why this exists:**
216
+
217
+ - **Eliminates confirmation bias.** The same agent that writes code does not also approve it.
218
+ - **Keeps each context tight.** Each role sees only the slice of spec it needs.
219
+ - **Hard PASS/FAIL gate.** Design tokens, requirements conformance, and stability are enforced before the task is marked `[x]`.
220
+
221
+ **Guardrails & Token Optimization:**
222
+
223
+ - **Maximum retries.** A hard ceiling of 3 rework attempts per task.
224
+ - **Fail-Fast (FATAL_FAIL).** Reviewer aborts the loop on critical architectural violations to save tokens.
225
+ - **Diff-Only Review.** The Reviewer reads only the git diff to drastically reduce context window size.
226
+ - **Structured feedback.** The Reviewer's FAIL report is forwarded unchanged to the next Implementer spawn.
227
+ - **Pivot Protocol takes precedence.** If discovery proves the spec itself is wrong, the loop stops immediately; rework retries are not consumed on a broken spec.
228
+
229
+ **Cross-tool compatibility:**
230
+
231
+ The `.agents/` directory is pure Markdown + YAML frontmatter and is resolved relative to the active workspace, so the harness runs under Claude Code, OpenCode, and Google Antigravity. Antigravity invokes `invoke_subagent` with prompts read from `.agents/`; Claude Code and OpenCode delegate via sub-prompt contexts seeded with the persona files.
232
+
233
+ ### 7. Capability-Tier Model Routing
234
+
235
+ Each AKILI-SPECS phase has a different dominant demand, so AKILI routes phases to models by **capability
236
+ tier** rather than using one model everywhere. Six tiers — **T1 Architect, T2 Coder, T3 Auditor,
237
+ T4 Context-Ingest, T5 Fast-Cheap, T6 Multimodal** — map to the phases:
238
+
239
+ | Phase / Role | Tier |
240
+ |---|---|
241
+ | `/akili-constitution` | T4 + T1 |
242
+ | `/akili-propose`, `/akili-specify` (requirements/design) | T1 |
243
+ | `/akili-specify` (tasks) | T5 |
244
+ | `/akili-specify` (UX/UI design) | T6 |
245
+ | `/akili-execute` Leader / Implementer / Reviewer | T5 / T2 / T3 |
246
+ | `/akili-test` | T2 |
247
+ | `/akili-validate` | T3 |
248
+ | `/akili-audit` | T4 + T3 |
249
+ | `/akili-archive` | T5 |
250
+
251
+ A single editable registry binds each tier to a concrete model **per tool** (Claude Code and
252
+ OpenCode). `/akili-constitution` (Step 7C) scaffolds a `## Model Routing` copy of that registry into
253
+ the project's `AGENTS.md` / `CLAUDE.md`. It is **guidance only** — no `model:` frontmatter, no
254
+ installer changes — and it enforces **author ≠ auditor** (Reviewer model ≠ Implementer model). See
255
+ [model-routing.md](model-routing.md) for the tiers, principles, and the default registry.
@@ -0,0 +1,133 @@
1
+ # Capability-Tier Model Routing
2
+
3
+ AKILI is model-agnostic: no command, skill, or persona hardcodes a model. This document is the
4
+ **human-facing guidance** for choosing which model runs which AKILI-SPECS phase, so each phase runs on a
5
+ model matched to its dominant computational demand rather than one model doing everything.
6
+
7
+ It is **guidance-first**: you switch models yourself per tool (Claude Code `/model`, OpenCode
8
+ model selector). Nothing here is injected into command frontmatter or the installer — see
9
+ [Cross-Tool Safety](#cross-tool-safety).
10
+
11
+ ## Philosophy: criteria first, model second
12
+
13
+ Each AKILI-SPECS phase declares **what it needs** (deep reasoning, coding throughput, independent
14
+ judgment, large context, speed/cost, or vision) before anyone picks a model. The model is derived
15
+ from the need, not the reverse. The registry lists a principal model plus a fallback per tier.
16
+
17
+ ### Guiding principles
18
+
19
+ - **Match the dominant demand.** Route by the single most important demand of the phase, not by
20
+ "use the smartest model everywhere."
21
+ - **ARCHITECT = BUILDER.** The model family that reasons about the design should also implement it
22
+ (`/akili-propose` and the `/akili-execute` Implementer share the workhorse family). Less information
23
+ is lost between design and code.
24
+ - **author ≠ auditor.** The Reviewer / validator MUST run on a **different model** than the
25
+ Implementer. An independent auditor catches what the author rationalized away.
26
+ - **Reserve deep-reasoning for propose & verify.** The most expensive reasoning models earn their
27
+ cost on architecture (`/akili-propose`) and final audit (`/akili-validate`, Reviewer), not on
28
+ bookkeeping.
29
+ - **Fast & cheap for tasks & archive.** Partitioning a spec into tickets and summarizing closed
30
+ work are format-following jobs — speed and cost dominate; raw intelligence adds little.
31
+
32
+ ## Capability tiers
33
+
34
+ Six tiers cover the genuinely distinct demands across the AKILI-SPECS pipeline without proliferating one
35
+ tier per phase (which would defeat the abstraction and churn on every model release).
36
+
37
+ | Tier | Definition |
38
+ |---|---|
39
+ | **T1 Architect** | Deep reasoning for architecture, trade-offs, and intent — "think hard before code." |
40
+ | **T2 Coder** | Maximum coding throughput and instruction-following for writing and editing code and tests. |
41
+ | **T3 Auditor** | Independent critical review — conformance, bug-finding, drift; must differ from the author model. |
42
+ | **T4 Context-Ingest** | Large-context absorption of legacy codebases and baseline docs — window size over depth. |
43
+ | **T5 Fast-Cheap** | Cheap, fast structured formatting and summarization where reasoning depth is not the bottleneck. |
44
+ | **T6 Multimodal** | Visual / UI-UX design reasoning over images, screenshots, and design references. |
45
+
46
+ ## Phase → tier mapping
47
+
48
+ The `/akili-execute` triad is split because each role has a different demand — and because
49
+ author ≠ auditor makes the Implementer/Reviewer split a **correctness constraint**, not a
50
+ preference.
51
+
52
+ | Phase / Role | Tier(s) | Why |
53
+ |---|---|---|
54
+ | `/akili-constitution` | T4 + T1 | Ingest legacy code (long context), then reason to synthesize the baseline. |
55
+ | `/akili-propose` | T1 | Architecture and trade-offs — reserve the deep reasoner. |
56
+ | `/akili-specify` → requirements.md / design.md | T1 | Heavy reasoning + technical writing. |
57
+ | `/akili-specify` → tasks.md | T5 | Fast structured partitioning into tickets. |
58
+ | `/akili-specify` → UX/UI design | T6 | Only when visual design is in scope. |
59
+ | `/akili-execute` → **Leader** | T5 | Orchestration / instruction-following — writes no code. |
60
+ | `/akili-execute` → **Implementer** | T2 | Maximum coding. Shares the workhorse family with propose (ARCHITECT = BUILDER). |
61
+ | `/akili-execute` → **Reviewer** | T3 | Independent audit. **MUST resolve to a different model than the Implementer.** |
62
+ | `/akili-test` | T2 | Test authoring + verification. |
63
+ | `/akili-validate` | T3 | Deep conformance audit. |
64
+ | `/akili-audit` | T4 + T3 | Drift detection over large context, judged critically. |
65
+ | `/akili-archive` | T5 | Cheap, fast summarization of closed work. |
66
+ | `/akili-seo` | T3 + T5 | Audit findings (T3) plus setup/formatting steps (T5). |
67
+
68
+ **author ≠ auditor enforcement.** In the registry, T2 (Coder) and T3 (Auditor) must resolve to
69
+ **different concrete models**. If they ever collapse to the same model, escalate the Reviewer one
70
+ tier (to the deeper reasoner) to preserve independence.
71
+
72
+ ## Model registry
73
+
74
+ This is the single editable source of truth. Phases reference **tiers**; only this table names
75
+ concrete models. When models change, edit only this table.
76
+
77
+ | Tier | Claude Code (PRO) | OpenCode Go | Fallback |
78
+ |---|---|---|---|
79
+ | **T1 Architect** | Opus 4.8 | `opencode-go/kimi-k2.6` | `opencode-go/deepseek-v4-pro` / Sonnet 4.6 |
80
+ | **T2 Coder** | Sonnet 4.6 | `opencode-go/glm-5.1` | Haiku 4.5 / `opencode-go/qwen3.7-max` |
81
+ | **T3 Auditor** | Opus 4.8 *(must differ from T2)* | `opencode-go/deepseek-v4-pro` | Sonnet 4.6 / `opencode-go/kimi-k2.6` |
82
+ | **T4 Context-Ingest** | Sonnet 4.6 (1M context) | `opencode-go/deepseek-v4-flash` | Opus 4.8 / `opencode-go/deepseek-v4-pro` |
83
+ | **T5 Fast-Cheap** | Haiku 4.5 | `opencode-go/deepseek-v4-flash` | Sonnet 4.6 / `opencode-go/mimo-v2.5` |
84
+ | **T6 Multimodal** | Sonnet 4.6 (vision) | `opencode-go/qwen3.7-max` *(weak — prefer Claude/Gemini)* | Opus 4.8 |
85
+
86
+ ### Why these models
87
+
88
+ **Claude Code (PRO).** Opus 4.8 carries the tightest PRO rate limits, so it is **reserved for
89
+ T1 (propose, specify reasoning) and T3 (validate, review)** — the two phases that most reward deep
90
+ reasoning. **Sonnet 4.6 is the workhorse** for coding (T2), large-context ingestion via its 1M
91
+ window (T4), and vision (T6). **Haiku 4.5** handles fast/cheap formatting, orchestration, and
92
+ summarization (T5). This concentrates scarce Opus budget on architecture and audit and avoids
93
+ exhausting it during execution-heavy work.
94
+
95
+ **OpenCode Go.** The two strongest open models anchor the two highest-leverage tiers:
96
+
97
+ - **GLM-5.1 → T2 Coder.** The highest-rated open-source model overall (58.4% SWE-Pro, ahead of
98
+ GPT-5.4 and Claude Opus 4.6) and purpose-built for long autonomous coding runs. It is the
99
+ recommended **default OpenCode workhorse** and universal fallback when no specialized model is
100
+ preferred.
101
+ - **Kimi K2.6 → T1 Architect.** One of the best open models (58.6% SWE-Pro, tied with GPT-5.5); its
102
+ Agent Swarm is built for multi-step decomposition — ideal for architectural trade-off reasoning
103
+ and `/akili-explore`-style impact analysis.
104
+ - **DeepSeek V4 Pro → T3 Auditor.** 1M context + a "Think Max" reasoning mode, and crucially a
105
+ *different* model than the GLM-5.1 coder — satisfying author ≠ auditor for `/akili-validate` and the
106
+ Reviewer.
107
+ - **DeepSeek V4 Flash → T4 / T5.** 1M context, fastest and cheapest, highest rate limit — right for
108
+ bulk ingestion and high-frequency formatting.
109
+ - **Qwen3.7 Max → T6.** Best-effort only. Open-source multimodal is weak; for real UI/UX design work
110
+ prefer Claude Sonnet (vision) or an external Gemini model.
111
+
112
+ All OpenCode Go slugs are taken from the [OpenCode Go model list](https://opencode.ai/docs/go).
113
+ Confirm them against your own OpenCode configuration and adjust if your roster differs.
114
+
115
+ ## How to apply per tool
116
+
117
+ - **Claude Code (PRO):** switch with `/model` before running a phase — e.g. `/model opus` for
118
+ `/akili-propose` and `/akili-validate`, `/model sonnet` for `/akili-execute` and `/akili-test`,
119
+ `/model haiku` for the tasks split and `/akili-archive`. For the `/akili-execute` triad, run the
120
+ Implementer on Sonnet and the Reviewer on Opus so author ≠ auditor holds.
121
+ - **OpenCode:** select the `opencode-go/...` model for each phase per the registry. Keep the
122
+ Reviewer/validator on a different model (`deepseek-v4-pro`) than the Implementer (`glm-5.1`).
123
+
124
+ ## Cross-tool safety
125
+
126
+ - **No `model:` frontmatter.** Command prompts stay `description:`-only. A single frontmatter value
127
+ cannot serve both tools anyway (Claude Code expects `opus`/`sonnet`/`haiku`; OpenCode expects
128
+ `provider/model`), so model choice stays out of the prompts.
129
+ - **No installer changes.** Nothing here is force-injected. `/akili-constitution` scaffolds a project
130
+ copy of this registry into `AGENTS.md` / `CLAUDE.md` as plain Markdown — identical handling across
131
+ Claude Code, OpenCode, and Google Antigravity.
132
+ - **Per-project override.** Edit the registry inside your project's `AGENTS.md` / `CLAUDE.md` to
133
+ pin different models; this package's copy is only the default.
@@ -0,0 +1,42 @@
1
+ # OpenSpec Comparison
2
+
3
+ OpenSpec is a broader spec-driven development framework with a mature npm CLI, docs site, workflow profiles, and support for many AI tools. AKILI is a smaller methodology package focused on Claude Code and OpenCode with packaged commands, skills, and repository-local documentation conventions.
4
+
5
+ This repository borrows useful documentation and workflow ideas from OpenSpec while keeping AKILI intentionally scoped to its own command set.
6
+
7
+ ## What We Borrow From OpenSpec
8
+
9
+ | OpenSpec Pattern | AKILI Equivalent |
10
+ |---|---|
11
+ | README hero and quick docs index | AKILI README hero plus links to `docs/` |
12
+ | Artifact-guided workflow | Constitution, proposal, requirements, design, tasks, execution, test, validation, archive |
13
+ | Slash-command lifecycle | `/akili-*` command set |
14
+ | CLI reference | `docs/cli.md` |
15
+ | Commands reference | `docs/commands/` |
16
+ | Workflows documentation | `docs/flow.md` |
17
+ | Lightweight comparison section | This document |
18
+
19
+ ## Key Differences
20
+
21
+ | Area | OpenSpec | AKILI |
22
+ |---|---|---|
23
+ | Scope | General-purpose SDD framework across many tools | Methodology package for Claude Code and OpenCode |
24
+ | Initialization | CLI initializes OpenSpec workspace files | `/akili-constitution` creates or strengthens project baseline docs |
25
+ | Baseline | Change/spec artifacts are central | Constitution is central before feature specs |
26
+ | Skills | Uses slash commands and agent instructions | Ships Claude/OpenCode skills alongside commands |
27
+ | Existing projects | Brownfield-friendly workflow | Explicit existing-project constitution mode with optional CodeGraph analysis |
28
+ | Validation | Workflow validation through commands | Dedicated `/akili-test` and `/akili-validate` reports before archive |
29
+ | SEO | Not a core workflow in OpenSpec | `/akili-seo` handles Google Search Console setup and audits |
30
+ | Package target | `@fission-ai/openspec` | `akili-specs` |
31
+
32
+ ## Practical Takeaway
33
+
34
+ Use OpenSpec if you want a mature, general SDD framework that targets a wide range of tools and workflow profiles.
35
+
36
+ Use AKILI if you want this opinionated Claude/OpenCode workflow:
37
+
38
+ ```text
39
+ constitution → proposal → spec → execute → test → validate → archive
40
+ ```
41
+
42
+ Use the comparison as design guidance only. The AKILI command prompts in `.claude/commands/` are the implementation source of truth for this package.
@@ -0,0 +1,105 @@
1
+ # Design Document: AKILI Multi-Agent AKILI-SPECS Orchestration
2
+ **Date:** 2026-05-26
3
+ **Topic:** Multi-Agent AKILI-SPECS Orchestration (Leader-Implementer-Reviewer Triad)
4
+ **Status:** Approved
5
+
6
+ ---
7
+
8
+ ## 1. Executive Summary
9
+
10
+ This document specifies the integration of a specialized **Leader-Implementer-Reviewer** agentic team into the AKILI Spec-Driven Development (AKILI-SPECS) methodology.
11
+
12
+ By shifting from a single-agent execution model to a collaborative, multi-agent triad, AKILI eliminates confirmation bias during code reviews, improves context window efficiency, and guarantees high-fidelity compliance with system design tokens and the project's constitution (`CLAUDE.md`/`AGENTS.md`).
13
+
14
+ ---
15
+
16
+ ## 2. Agent Roles & Folder Structure
17
+
18
+ We define a hidden directory `.agents/` in the project root to serve as the unified source of truth for the local developer team:
19
+
20
+ ```text
21
+ your-workspace/
22
+ ├── .agents/
23
+ │ ├── leader.md # Orchestration logic, task tracking, and links to CLAUDE.md/AGENTS.md
24
+ │ ├── implementer.md # Focused coding guidelines, testing standards, design token extraction
25
+ │ └── reviewer.md # Spec conformance audits, lint/type checks, and design token compliance
26
+ ```
27
+
28
+ ### Agent Personas
29
+ 1. **Leader Agent (Orchestrator):** Coordinates the execution, parses `tasks.md`, spawns subagents, monitors retries, and records execution history inside `execution.md`.
30
+ 2. **Implementer Agent (Coder):** Natively equipped with write tools to create and edit files, compile code, and run tests. Focuses strictly on the active task.
31
+ 3. **Reviewer Agent (Auditor):** Natively equipped with read/diff tools. Does **not** modify code. Evaluates the Implementer's diff against requirements, detailed designs, and global style guides.
32
+
33
+ ---
34
+
35
+ ## 3. The Smart Constitution Phase (`/akili-constitution`)
36
+
37
+ During the constitution phase, the Leader dynamically classifies the repository and sets up the agentic environment without destroying existing configurations:
38
+
39
+ 1. **Brand New Project (Seed Setup):** Prompts the user for a seed intent, initializes directories, drafts initial baselines (`prd.md`, `design.md`, `detailed-design.md`), and scaffolds the default `.agents/` templates.
40
+ 2. **Legacy Codebase (Discovery Setup):** Deep scans the codebase using CodeGraph or grep to extract components, API contracts, and styling tokens. Synthesizes baselines from this codebase reality and customizes the `.agents/` guidelines matching this tech stack.
41
+ 3. **Active AKILI-SPECS Project (Safe Update):** Reads existing files and custom subagent rules. **It does not overwrite them.** It only upgrades weak sections and updates `.agents/` to support the new multi-agent loop while preserving custom instructions.
42
+
43
+ ---
44
+
45
+ ## 4. Automated Rework Loop (`/akili-execute`)
46
+
47
+ When `/akili-execute` is triggered, the Leader automatically coordinates the subagent loop in the background:
48
+
49
+ ```mermaid
50
+ sequenceDiagram
51
+ autonumber
52
+ actor User as You
53
+ participant L as Leader Agent
54
+ participant I as Implementer Subagent
55
+ participant R as Reviewer Subagent
56
+
57
+ User->>L: /akili-execute changes/add-remember-me
58
+ L->>L: Reads next task & .agents/implementer.md
59
+ L->>I: Spawns Implementer with task context
60
+ Note over I: Writes code & runs local verifications
61
+ I-->>L: Reports Task Done & provides verification evidence
62
+ L->>L: Reads .agents/reviewer.md & extracts git diff
63
+ L->>R: Spawns Reviewer to audit diff
64
+ Note over R: Audits diff against specs & constitution
65
+
66
+ alt Review Passes (PASS)
67
+ R-->>L: PASS: Review Approved
68
+ L->>L: Updates tasks.md & execution.md
69
+ L-->>User: Task completed successfully!
70
+ else Review Fails (FAIL)
71
+ R-->>L: FAIL: Detailed issues report
72
+ loop Max 3 Rework Attempts
73
+ L->>L: Logs fail state in execution.md
74
+ L->>I: Spawns Implementer with Reviewer's feedback
75
+ Note over I: Adjusts code & re-verifies
76
+ I-->>L: Reports Rework Done
77
+ L->>R: Spawns Reviewer to audit new diff
78
+ R-->>L: Re-evaluates diff
79
+ alt Review Passes
80
+ R-->>L: PASS: Review Approved
81
+ L->>L: Updates tasks.md
82
+ L-->>User: Task completed after automated self-correction!
83
+ end
84
+ end
85
+ Note over L: If still failing after 3 attempts:
86
+ L-->>User: HALT: Rework limit reached. Presents logs for human guidance.
87
+ end
88
+ ```
89
+
90
+ ### Rework Loop Guardrails
91
+ * **Maximum Retries:** A hard ceiling of **3 rework attempts** is enforced to prevent infinite loops and token waste.
92
+ * **Structured Feedback:** The Reviewer outputs a structured three-part report: *Discovered Issue*, *Violated Rule*, and *Remediation Suggestion* to guide the Implementer directly.
93
+ * **Escalation:** If the loop fails all 3 retries, the Leader halts and presents the audit trails for human intervention.
94
+
95
+ ---
96
+
97
+ ## 5. Unified Cross-Tool Compatibility Specs
98
+
99
+ The `.agents/` directory is standardized to be completely tool-agnostic:
100
+
101
+ * **Markdown Frontmatter:** Uses pure Markdown + YAML frontmatter, natively compatible with Antigravity, Claude Code, and OpenCode.
102
+ * **Standard Path Resolution:** All AKILI commands resolve the `.agents/` path relative to the active terminal's **Current Working Directory (Cwd)**, binding it strictly to the current workspace.
103
+ * **Subagent Adaptations:**
104
+ * *Antigravity:* Calls `invoke_subagent` using prompts read from `.agents/`.
105
+ * *Claude Code / OpenCode:* Delegates tasks by triggering sub-prompt contexts seeded with the extracted implementer/reviewer instructions.