akili-specs 2.8.0 → 2.9.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.
@@ -56,6 +56,8 @@ docs/specs/archive/2026-05-16-bugfix--login-redirect/
56
56
 
57
57
  ### Step 0: Load Context
58
58
 
59
+ **Model checkpoint:** This phase runs best on **T5 Fast-Cheap** (summarization and bookkeeping). If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"This phase is T5 — the registry recommends `/model haiku`; you are on opus"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
60
+
59
61
  **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.
60
62
 
61
63
  1. Confirm `docs/specs/$ARGUMENTS/` exists.
@@ -19,6 +19,8 @@ Detect and report drift between the project's specifications (PRD, UX/UI Design,
19
19
 
20
20
  ### Step 0: Read Project Specifications
21
21
 
22
+ **Model checkpoint:** This phase runs best on **T4 Context-Ingest** for the scan and **T3 Auditor** for judging drift. If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"This phase is T4+T3 — the registry recommends `/model sonnet`; you are on haiku"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
23
+
22
24
  First, read the constitutional documentation baseline in the repository:
23
25
 
24
26
  1. `docs/prd.md`
@@ -44,6 +46,7 @@ Audit for discrepancies, classifying findings under the following categories:
44
46
  * **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`.
45
47
  * **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`.
46
48
  * **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.
49
+ * **Model Registry Drift:** The project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) names models the host tool no longer offers, uses dated model pins where a floating alias exists (violating the alias-first rule) without a recorded reason, is missing tiers or the author ≠ auditor note versus the packaged default in `docs/model-routing.md`, or the Step 8E agent wrappers (`.claude/agents/akili-*.md` / OpenCode agent config) declare models that contradict the registry. Report only — never edit the registry or wrappers during the audit.
47
50
 
48
51
  ### Step 3: Write Drift Report
49
52
 
@@ -87,6 +90,7 @@ A brief overview of the codebase alignment state and major areas of specificatio
87
90
  | UX/UI Design / Screen Inventory | [Details] | [Aligned / Drifted] | |
88
91
  | TRD (APIs/DB) | [Details] | [Aligned / Drifted] | |
89
92
  | Agent Guides (root + `## Module Guides` index) | [Details] | [Aligned / Drifted] | |
93
+ | Model Routing (registry + Step 8E wrappers) | [Details] | [Aligned / Drifted] | |
90
94
 
91
95
  ## Recommended Next Steps
92
96
  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").
@@ -19,6 +19,8 @@ Establish or strengthen the project-wide AKILI-SPECS foundation. This command cr
19
19
 
20
20
  ### Step 0: Determine Project Mode and Foundation Setup
21
21
 
22
+ **Model checkpoint:** This phase runs best on **T4 Context-Ingest** for repository ingestion and **T1 Architect** for baseline synthesis (if no project registry exists yet, use the packaged default in `docs/model-routing.md`). If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"Baseline synthesis is T1 — the default registry recommends `/model opus`; you are on haiku"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
23
+
22
24
  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.
23
25
 
24
26
  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.
@@ -34,7 +36,7 @@ For all three modes:
34
36
  3. Ensure `docs/specs/general-setup/` exists.
35
37
  4. Ensure root `CLAUDE.md` exists or is enhanced.
36
38
  5. Ensure root `AGENTS.md` exists or is enhanced.
37
- 6. Ensure project-level `.agents/` exists with `leader.md`, `implementer.md`, `reviewer.md`, and `tester.md` (see Step 7B).
39
+ 6. Ensure project-level `.agents/` exists with `leader.md`, `implementer.md`, `reviewer.md`, and `tester.md` (see Step 8B).
38
40
  7. Default behavior is to enhance existing project docs in place instead of creating parallel copies.
39
41
 
40
42
  The constitutional baseline must cover these files:
@@ -291,7 +293,7 @@ The update should explain briefly:
291
293
  - How module specs should be organized under `docs/specs/`
292
294
  - Which skills should be used for common work in the project (the `## Skill Map` added in Step 8D)
293
295
  - Whether CodeGraph is initialized and how agents should use it for existing-project analysis
294
- - Which model to switch to per AKILI-SPECS phase (the `## Model Routing` registry added in Step 7C)
296
+ - Which model to switch to per AKILI-SPECS phase (the `## Model Routing` registry added in Step 8C)
295
297
 
296
298
  Preserve the repository's existing `CLAUDE.md` and `AGENTS.md` conventions and extend them.
297
299
 
@@ -379,21 +381,28 @@ project guides so the project does not depend on the package's `docs/` after ins
379
381
  must differ from the Implementer model. `/akili-test` is likewise split into its Leader (T5,
380
382
  orchestration) and Tester(s) (T2, test authoring), with a note to prefer a Tester model different
381
383
  from the Implementer (author ≠ tester).
382
- 4. The editable model registry table with columns `Tier | Claude Code | OpenCode | Fallback`.
383
- Fill the Claude Code column for the user's plan (e.g. PRO: Opus reserved for T1/T3, Sonnet as the
384
- T2/T4/T6 workhorse, Haiku for T5). Fill the OpenCode column from the user's confirmed roster; if
385
- it is unknown, leave clearly-marked `<CONFIRM SLUG>` placeholders rather than guessing.
386
- 5. The instruction: *"To change models, edit only this registry table. Model selection is guidance
387
- onlynever add `model:` to command frontmatter."*
384
+ 4. The editable model registry table with columns `Tier | Claude Code | OpenCode | Fallback`, plus
385
+ an `Updated: <YYYY-MM>` stamp. **Alias-first rule:** the Claude Code column uses floating aliases
386
+ (`opus`, `sonnet`, `haiku`) they always resolve to the latest generation, so the registry
387
+ survives model churn with zero edits; pin a dated model ID only when the user deliberately wants
388
+ to freeze a version, and record why. Fill the OpenCode column from the user's confirmed roster
389
+ (slugs are concrete no alias mechanism); if it is unknown, leave clearly-marked
390
+ `<CONFIRM SLUG>` placeholders rather than guessing.
391
+ 5. The instruction: *"To change models, edit only this registry table. Never pin a dated model name
392
+ where a floating alias exists. Model selection is guidance only in command prompts — never add
393
+ `model:` to command frontmatter; enforced bindings live only in the Step 8E agent wrappers."*
388
394
 
389
- **Mode-specific policy (mirror Step 7B):**
395
+ **Mode-specific policy (mirror Step 8B):**
390
396
 
391
397
  - **Brand-new (Seed Setup):** insert the full `## Model Routing` section using the packaged defaults.
392
398
  - **Legacy (Discovery Setup):** insert the section and, where detected, annotate the registry with
393
399
  the project's actual tooling (e.g. note if the team already standardizes on a specific model).
394
400
  - **Active AKILI-SPECS (Safe Update):** **do not overwrite** an existing customized registry. If the section
395
401
  is missing, add it; if it exists, only fill gaps (missing tiers, missing author ≠ auditor note)
396
- without changing the user's pinned models.
402
+ without changing the user's pinned models. Additionally, **flag stale entries**: compare the
403
+ project registry against the packaged default in `docs/model-routing.md` and list (do not edit)
404
+ entries that name models the tool no longer offers or dated pins that an alias would now cover —
405
+ the user decides whether to refresh them.
397
406
 
398
407
  Confirm the user's available models before writing concrete identifiers: which tier they run in
399
408
  Claude Code (and their plan's rate limits) and which models their OpenCode roster exposes.
@@ -428,6 +437,58 @@ is how they reach the agents.
428
437
 
429
438
  ---
430
439
 
440
+ ### Step 8E: Bind Personas to Models (Tool-Native Agent Wrappers)
441
+
442
+ Offer to generate **tool-native agent definitions** that bind the `.agents/` personas to the models
443
+ in the `## Model Routing` registry (Step 8C). This turns model routing from guidance into
444
+ enforcement for the multi-agent fan-out — where most tokens are spent — and makes
445
+ **author ≠ auditor structural**: the Reviewer wrapper is pinned to a different model than the
446
+ Implementer wrapper in configuration, not by human discipline.
447
+
448
+ Ask the user first (one question): *"Bind the AKILI personas to models with native agent wrappers,
449
+ so the Implementer/Reviewer/Tester automatically run on their tier's model?"* If declined, skip
450
+ this step — the guidance-only flow keeps working.
451
+
452
+ **Per tool:**
453
+
454
+ - **Claude Code:** create project-level `.claude/agents/akili-leader.md`, `akili-implementer.md`,
455
+ `akili-reviewer.md`, and `akili-tester.md`. Each wrapper is thin:
456
+
457
+ ```markdown
458
+ ---
459
+ name: akili-implementer
460
+ description: AKILI Implementer — executes one spec task with strict scope and verification.
461
+ model: sonnet
462
+ ---
463
+ Read `.agents/implementer.md` in the project root and adopt it fully as your persona and
464
+ operating contract before doing anything else.
465
+ ```
466
+
467
+ Models come from the registry's Claude Code column as **aliases** (default: leader `haiku`,
468
+ implementer `sonnet`, reviewer `opus`, tester `sonnet`). Never copy the persona body into the
469
+ wrapper — `.agents/` stays the single source of truth.
470
+
471
+ - **OpenCode:** create the equivalent project agent definitions (`.opencode/agent/akili-*.md` or
472
+ the `agent` block of `opencode.json`, matching the user's OpenCode version) with `model:` set to
473
+ the registry's OpenCode slugs (default: implementer `opencode-go/glm-5.1`, reviewer
474
+ `opencode-go/deepseek-v4-pro`, leader `opencode-go/deepseek-v4-flash`).
475
+
476
+ - **Google Antigravity:** no per-agent model binding exists — skip wrapper generation and note in
477
+ the summary that Antigravity stays on guidance-only routing.
478
+
479
+ **Rules:**
480
+
481
+ 1. The Reviewer wrapper's model MUST differ from the Implementer wrapper's model. If the registry
482
+ collapses them, escalate the Reviewer one tier before writing the wrappers.
483
+ 2. Wrappers reference `.agents/<role>.md`; they never duplicate persona content. Editing a persona
484
+ requires no wrapper change; changing a model requires editing only the wrapper (or re-running
485
+ this step).
486
+ 3. **Mode policy:** Brand-new/Legacy — create the wrappers when accepted. Active AKILI-SPECS —
487
+ never overwrite existing wrapper files; create only missing ones and flag model drift between
488
+ existing wrappers and the current registry.
489
+
490
+ ---
491
+
431
492
  ### Step 9: Present and Confirm
432
493
 
433
494
  After drafting or enhancing the documents, generate a short, easy-to-understand summary (summary facil de entender de lo que se hizo) covering:
@@ -52,8 +52,8 @@ If `.agents/` is missing, run `/akili-constitution` first to scaffold it. Do not
52
52
 
53
53
  **Delegation mechanism by tool:**
54
54
 
55
- - **Claude Code / OpenCode:** spawn a focused subagent (or sub-prompt context) seeded with the persona file plus the task/diff context.
56
- - **Google Antigravity:** invoke `invoke_subagent` (or the equivalent workflow primitive) using prompts read from `.agents/`.
55
+ - **Claude Code / OpenCode:** if the project has tool-native AKILI agent wrappers (scaffolded by `/akili-constitution` Step 8E — e.g. `.claude/agents/akili-implementer.md` / `akili-reviewer.md` with `model:` bindings from the `## Model Routing` registry), **spawn those named agents** so each role runs on its tier's model and author ≠ auditor is enforced by configuration. Otherwise, spawn a focused subagent (or sub-prompt context) seeded with the persona file plus the task/diff context.
56
+ - **Google Antigravity:** invoke `invoke_subagent` (or the equivalent workflow primitive) using prompts read from `.agents/` (no per-agent model binding — guidance-only routing).
57
57
 
58
58
  The Leader does not write production code itself unless the rework loop is exhausted and the user has explicitly approved a fallback.
59
59
 
@@ -63,6 +63,8 @@ The Leader does not write production code itself unless the rework loop is exhau
63
63
 
64
64
  ### Step 0: Load Context
65
65
 
66
+ **Model checkpoint:** This phase runs best on **T5 Fast-Cheap** for you as Leader — the Implementer/Reviewer route through the Step 8E agent wrappers (their own tier models) when present. If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"The Leader loop is T5 — the registry recommends `/model haiku`; you are on opus"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
67
+
66
68
  **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.
67
69
 
68
70
  1. Read the project constitutional docs (IN THIS ORDER):
@@ -55,6 +55,8 @@ Do not create `requirements.md`, `design.md`, or `tasks.md` in this command unle
55
55
 
56
56
  ### Step 0: Resolve Path And Load Context
57
57
 
58
+ **Model checkpoint:** This phase runs best on **T1 Architect** (deep reasoning). If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"This phase is T1 — the registry recommends `/model opus`; you are on sonnet"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
59
+
58
60
  **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.
59
61
 
60
62
  1. Resolve `$SPEC_PATH` using the path rules above.
@@ -60,6 +60,8 @@ State clearly which criterion failed and which command to run instead. Never sil
60
60
 
61
61
  ### Step 0: Load Minimal Context
62
62
 
63
+ **Model checkpoint:** This phase runs best on **T2 Coder** (small direct edit, light verification). If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"This phase is T2 — the registry recommends `/model sonnet`; you are on opus"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
64
+
63
65
  Keep context small — this is a trivial change, not a full spec run.
64
66
 
65
67
  1. Read only what the change needs:
@@ -74,6 +74,8 @@ If any prerequisite is missing, stop and report exactly what is missing and how
74
74
 
75
75
  ### Phase 0: Setup
76
76
 
77
+ **Model checkpoint:** This phase runs best on **T3 Auditor** for audit findings and **T5 Fast-Cheap** for setup/formatting. If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"The audit phase is T3 — the registry recommends `/model opus`; you are on haiku"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
78
+
77
79
  1. Resolve the spec path. If `$ARGUMENTS` is a bare domain, set `SPEC_PATH = seo/<domain>`. Otherwise treat `$ARGUMENTS` as the literal spec path.
78
80
  2. Create directory `docs/specs/$SPEC_PATH/` if it does not exist.
79
81
  3. Read the constitutional templates and project context as defined in `akili-specify`:
@@ -61,6 +61,8 @@ When the spec is a **bug** — the proposal's Document Control says `Type: Bug`,
61
61
 
62
62
  ### Step 0: Setup
63
63
 
64
+ **Model checkpoint:** This phase runs best on **T1 Architect** for requirements/design (re-check at Phase 3: **T5 Fast-Cheap** for the tasks split, **T6 Multimodal** when visual design is in scope). If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"Phases 1–2 are T1 — the registry recommends `/model opus`; you are on haiku"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
65
+
64
66
  **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.
65
67
 
66
68
  1. Create directory `docs/specs/$ARGUMENTS/` if it does not exist.
@@ -50,8 +50,8 @@ If `.agents/tester.md` is missing, run `/akili-constitution` first to scaffold i
50
50
 
51
51
  **Delegation mechanism by tool:**
52
52
 
53
- - **Claude Code / OpenCode:** spawn a focused subagent (or sub-prompt context) seeded with `tester.md` plus the suite's context slice.
54
- - **Google Antigravity:** invoke `invoke_subagent` (or the equivalent) using the prompt read from `.agents/tester.md`.
53
+ - **Claude Code / OpenCode:** if the project has a tool-native `akili-tester` agent wrapper (scaffolded by `/akili-constitution` Step 8E with a `model:` binding from the `## Model Routing` registry), **spawn that named agent** so each Tester runs on its tier's model — preferring a model different from the Implementer's (author ≠ tester). Otherwise, spawn a focused subagent (or sub-prompt context) seeded with `tester.md` plus the suite's context slice.
54
+ - **Google Antigravity:** invoke `invoke_subagent` (or the equivalent) using the prompt read from `.agents/tester.md` (no per-agent model binding — guidance-only routing).
55
55
 
56
56
  **Token discipline — thin context per Tester (this is the core saving):**
57
57
 
@@ -76,6 +76,8 @@ The Leader decides the count from the spec's depth and the independence of the s
76
76
 
77
77
  ### Phase 0: Load Context (Leader)
78
78
 
79
+ **Model checkpoint:** This phase runs best on **T5 Fast-Cheap** for you as Leader — Testers route through the `akili-tester` wrapper (T2) when present. If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"The Leader loop is T5 — the registry recommends `/model haiku`; you are on opus"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
80
+
79
81
  **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.
80
82
 
81
83
  1. Read project-level context (IN THIS ORDER):
@@ -49,6 +49,8 @@ Use these result levels consistently:
49
49
 
50
50
  ### Phase 0: Load Context
51
51
 
52
+ **Model checkpoint:** This phase runs best on **T3 Auditor** — and it MUST resolve to a different model than the one that implemented the work (author ≠ auditor). If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps that tier to a model different from the current session model, tell the user in one line — e.g. *"This phase is T3 — the registry recommends `/model opus`; you are on sonnet, which also implemented the spec"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode) at the first approval pause. Never block on this; continuing on the current model is always allowed.
53
+
52
54
  **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.
53
55
 
54
56
  1. Read constitutional context (IN THIS ORDER):
package/CHANGELOG.md CHANGED
@@ -10,6 +10,18 @@ The format is inspired by Keep a Changelog and the repository follows semantic v
10
10
 
11
11
  - No unreleased changes yet.
12
12
 
13
+ ## [2.9.0] - 2026-07-20
14
+
15
+ ### Added
16
+
17
+ - **Model Routing 2.0 — enforced for subagents, guided for the main loop:**
18
+ - **Tool-native agent wrappers (`/akili-constitution` Step 8E):** with user approval, the constitution now binds the `.agents/` personas to the Model Routing registry via native agent definitions — `.claude/agents/akili-{leader,implementer,reviewer,tester}.md` in Claude Code (alias-based `model:`) and agent config in OpenCode (provider slugs). `/akili-execute` and `/akili-test` prefer these named agents, so the multi-agent fan-out (where most tokens are spent) routes automatically and **author ≠ auditor becomes structural** — the Reviewer wrapper pins a different model than the Implementer wrapper. Wrappers are thin references to `.agents/`; personas remain the single source of truth. Antigravity stays guidance-only (no per-agent model binding).
19
+ - **Model checkpoints in every command:** all 10 commands (`propose`, `specify`, `execute`, `test`, `validate`, `archive`, `audit`, `quick`, `seo`, `constitution`) perform a one-line, never-blocking check during setup — if the phase's tier maps to a different model than the current session, the user is told (e.g. "This phase is T1 — the registry recommends `/model opus`") and offered the switch at the first approval pause.
20
+ - **Model Registry Drift check in `/akili-audit`:** new drift category and Conformance Matrix row — registry entries naming models the tool no longer offers, dated pins where a floating alias exists, missing tiers/author ≠ auditor notes versus the packaged default, and Step 8E wrappers contradicting the registry. Report-only.
21
+
22
+ ### Changed
23
+
24
+ - **Alias-first model registry (survives model churn):** `docs/model-routing.md` and the Step 8C scaffold now mandate floating aliases (`opus`/`sonnet`/`haiku` in Claude Code — they always resolve to the latest generation, so new model families require zero registry edits); dated model pins require a recorded reason. The default registry was rewritten alias-first with an `Updated:` stamp; OpenCode slugs (no alias mechanism) keep the Fallback column and are covered by the drift check. Safe Update mode now also flags stale registry entries against the packaged default without touching user pins.
13
25
  ## [2.8.0] - 2026-07-20
14
26
 
15
27
  ### Added
@@ -63,7 +63,11 @@ The `.agents/` directory is tool-agnostic: pure Markdown + YAML frontmatter, res
63
63
 
64
64
  ## Model Routing Scaffolding
65
65
 
66
- Step 7C adds or upgrades a `## Model Routing` section in the project's root `AGENTS.md` and `CLAUDE.md`: a capability-tier registry that maps each AKILI-SPECS phase to a model **per tool** (Claude Code and OpenCode). It is guidance only no `model:` frontmatter is added and the installer is unchanged. The registry enforces **author ≠ auditor** (the Reviewer runs on a different model than the Implementer) and, in Active-AKILI-SPECS mode, is non-destructive: an existing customized registry is preserved and only gaps are filled. See [Model Routing](../model-routing.md) for the tiers and the default registry.
66
+ Step 8C adds or upgrades a `## Model Routing` section in the project's root `AGENTS.md` and `CLAUDE.md`: a capability-tier registry that maps each AKILI-SPECS phase to a model **per tool** (Claude Code and OpenCode), following the **alias-first rule** (floating aliases like `opus`/`sonnet`/`haiku` wherever they exist, so the registry survives model generations without edits). No `model:` frontmatter is added to commands and the installer is unchanged. The registry enforces **author ≠ auditor** (the Reviewer runs on a different model than the Implementer) and, in Active-AKILI-SPECS mode, is non-destructive: an existing customized registry is preserved, gaps are filled, and stale entries are flagged against the packaged default without touching user pins. See [Model Routing](../model-routing.md) for the tiers and the default registry.
67
+
68
+ ## Model Binding Scaffolding (Tool-Native Agent Wrappers)
69
+
70
+ Step 8E (with the user's approval) binds the `.agents/` personas to the registry's models via **tool-native agent definitions**: `.claude/agents/akili-{leader,implementer,reviewer,tester}.md` in Claude Code (alias-based `model:` frontmatter) and the equivalent agent config in OpenCode (provider slugs). The wrappers are thin — they reference the `.agents/` persona instead of duplicating it — and make model routing **enforced** for the `/akili-execute` and `/akili-test` fan-out, including a structural author ≠ auditor guarantee (the Reviewer wrapper pins a different model than the Implementer wrapper). Antigravity has no per-agent model binding and stays guidance-only. In Active-AKILI-SPECS mode existing wrappers are never overwritten.
67
71
 
68
72
  ## Skill Map Scaffolding
69
73
 
package/docs/flow.md CHANGED
@@ -303,11 +303,25 @@ T4 Context-Ingest, T5 Fast-Cheap, T6 Multimodal** — map to the phases:
303
303
  | `/akili-audit` | T4 + T3 |
304
304
  | `/akili-archive` | T5 |
305
305
 
306
- A single editable registry binds each tier to a concrete model **per tool** (Claude Code and
307
- OpenCode). `/akili-constitution` (Step 7C) scaffolds a `## Model Routing` copy of that registry into
308
- the project's `AGENTS.md` / `CLAUDE.md`. It is **guidance only** no `model:` frontmatter, no
309
- installer changes and it enforces **author ≠ auditor** (Reviewer model ≠ Implementer model). See
310
- [model-routing.md](model-routing.md) for the tiers, principles, and the default registry.
306
+ A single editable registry binds each tier to a model **per tool** (Claude Code and OpenCode),
307
+ using **floating aliases** (`opus`/`sonnet`/`haiku`) wherever they exist so the registry survives
308
+ model generations without edits. `/akili-constitution` (Step 8C) scaffolds a `## Model Routing`
309
+ copy into the project's `AGENTS.md` / `CLAUDE.md`.
310
+
311
+ Routing operates at two levels:
312
+
313
+ * **Enforced (subagents):** `/akili-constitution` Step 8E can generate tool-native agent wrappers
314
+ (`.claude/agents/akili-{leader,implementer,reviewer,tester}.md` in Claude Code, agent config in
315
+ OpenCode) that pin each persona to its tier's model. `/akili-execute` and `/akili-test` prefer
316
+ those named agents — so **author ≠ auditor** (Reviewer model ≠ Implementer model) holds by
317
+ configuration on the fan-out where most tokens are spent.
318
+ * **Guided (main loop):** every command emits a one-line, never-blocking **model checkpoint** in
319
+ its setup step when the phase's tier maps to a different model than the current session.
320
+
321
+ No `model:` frontmatter on commands and no installer changes. `/akili-audit` reports **Model
322
+ Registry Drift** (stale model names, dated pins where an alias exists, wrappers contradicting the
323
+ registry). See [model-routing.md](model-routing.md) for the tiers, principles, and the default
324
+ registry.
311
325
 
312
326
  ### 8. The Kaizen Loop
313
327
 
@@ -4,8 +4,17 @@ AKILI is model-agnostic: no command, skill, or persona hardcodes a model. This d
4
4
  **human-facing guidance** for choosing which model runs which AKILI-SPECS phase, so each phase runs on a
5
5
  model matched to its dominant computational demand rather than one model doing everything.
6
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
7
+ Routing operates at two levels:
8
+
9
+ - **Enforced (subagents):** `/akili-constitution` Step 8E can bind the Implementer / Reviewer /
10
+ Tester / Leader personas to models via **tool-native agent definitions** (see
11
+ [Enforced routing](#enforced-routing-tool-native-agent-bindings)). This is where most tokens are
12
+ spent and where author ≠ auditor becomes structural instead of aspirational.
13
+ - **Guided (main loop):** the session model can only be switched by you (Claude Code `/model`,
14
+ OpenCode model selector). Commands emit a one-line **model checkpoint** when the phase's tier
15
+ points to a different model than the current session, so the switch happens at the right moment.
16
+
17
+ Nothing here is injected into command frontmatter or the installer — see
9
18
  [Cross-Tool Safety](#cross-tool-safety).
10
19
 
11
20
  ## Philosophy: criteria first, model second
@@ -75,25 +84,35 @@ tier (to the deeper reasoner) to preserve independence.
75
84
  ## Model registry
76
85
 
77
86
  This is the single editable source of truth. Phases reference **tiers**; only this table names
78
- concrete models. When models change, edit only this table.
87
+ models. When models change, edit only this table. *Registry updated: 2026-07.*
79
88
 
80
- | Tier | Claude Code (PRO) | OpenCode Go | Fallback |
89
+ **Alias-first rule: never pin a dated model name where a floating alias exists.** Claude Code's
90
+ `opus` / `sonnet` / `haiku` aliases always resolve to the latest version of each family — when
91
+ Anthropic ships a new generation, an alias-based registry needs **zero edits**. Pin a dated ID only
92
+ when you deliberately need to freeze a version, and record why next to the pin. OpenCode slugs are
93
+ concrete (no alias mechanism), which is why they carry the Fallback column and the drift check
94
+ below.
95
+
96
+ | Tier | Claude Code | OpenCode Go | Fallback |
81
97
  |---|---|---|---|
82
- | **T1 Architect** | Opus 4.8 | `opencode-go/kimi-k2.6` | `opencode-go/deepseek-v4-pro` / Sonnet 4.6 |
83
- | **T2 Coder** | Sonnet 4.6 | `opencode-go/glm-5.1` | Haiku 4.5 / `opencode-go/qwen3.7-max` |
84
- | **T3 Auditor** | Opus 4.8 *(must differ from T2)* | `opencode-go/deepseek-v4-pro` | Sonnet 4.6 / `opencode-go/kimi-k2.6` |
85
- | **T4 Context-Ingest** | Sonnet 4.6 (1M context) | `opencode-go/deepseek-v4-flash` | Opus 4.8 / `opencode-go/deepseek-v4-pro` |
86
- | **T5 Fast-Cheap** | Haiku 4.5 | `opencode-go/deepseek-v4-flash` | Sonnet 4.6 / `opencode-go/mimo-v2.5` |
87
- | **T6 Multimodal** | Sonnet 4.6 (vision) | `opencode-go/qwen3.7-max` *(weak — prefer Claude/Gemini)* | Opus 4.8 |
98
+ | **T1 Architect** | `opus` *(alias — always latest)* | `opencode-go/kimi-k2.6` | `opencode-go/deepseek-v4-pro` / `sonnet` |
99
+ | **T2 Coder** | `sonnet` | `opencode-go/glm-5.1` | `haiku` / `opencode-go/qwen3.7-max` |
100
+ | **T3 Auditor** | `opus` *(must differ from T2)* | `opencode-go/deepseek-v4-pro` | `sonnet` / `opencode-go/kimi-k2.6` |
101
+ | **T4 Context-Ingest** | `sonnet` (long context) | `opencode-go/deepseek-v4-flash` | `opus` / `opencode-go/deepseek-v4-pro` |
102
+ | **T5 Fast-Cheap** | `haiku` | `opencode-go/deepseek-v4-flash` | `sonnet` / `opencode-go/mimo-v2.5` |
103
+ | **T6 Multimodal** | `sonnet` (vision) | `opencode-go/qwen3.7-max` *(weak — prefer Claude/Gemini)* | `opus` |
88
104
 
89
105
  ### Why these models
90
106
 
91
- **Claude Code (PRO).** Opus 4.8 carries the tightest PRO rate limits, so it is **reserved for
92
- T1 (propose, specify reasoning) and T3 (validate, review)** — the two phases that most reward deep
93
- reasoning. **Sonnet 4.6 is the workhorse** for coding (T2), large-context ingestion via its 1M
94
- window (T4), and vision (T6). **Haiku 4.5** handles fast/cheap formatting, orchestration, and
95
- summarization (T5). This concentrates scarce Opus budget on architecture and audit and avoids
96
- exhausting it during execution-heavy work.
107
+ **Claude Code.** The top-family alias (`opus`) carries the tightest plan rate limits, so it is
108
+ **reserved for T1 (propose, specify reasoning) and T3 (validate, review)** — the two phases that
109
+ most reward deep reasoning. **`sonnet` is the workhorse** for coding (T2), large-context ingestion
110
+ (T4), and vision (T6). **`haiku`** handles fast/cheap formatting, orchestration, and summarization
111
+ (T5). This concentrates the scarce top-tier budget on architecture and audit and avoids exhausting
112
+ it during execution-heavy work. Because these are aliases, the mapping survives model generations
113
+ unchanged (e.g. when the top family moves from one generation to the next, `opus` follows it).
114
+ Users on plans that expose additional tiers (e.g. a Mythos-class model above Opus) can pin it for
115
+ T1/T3 in their project registry.
97
116
 
98
117
  **OpenCode Go.** The two strongest open models anchor the two highest-leverage tiers:
99
118
 
@@ -115,20 +134,69 @@ exhausting it during execution-heavy work.
115
134
  All OpenCode Go slugs are taken from the [OpenCode Go model list](https://opencode.ai/docs/go).
116
135
  Confirm them against your own OpenCode configuration and adjust if your roster differs.
117
136
 
137
+ ## Enforced routing (tool-native agent bindings)
138
+
139
+ The `/akili-execute` and `/akili-test` fan-out (Implementer, Reviewer, Testers) is where most
140
+ tokens are spent — and a generic subagent **inherits the session model**, which silently breaks
141
+ author ≠ auditor when the whole session runs on one model. Both tools support a `model` field on
142
+ **agent definitions** (never on commands), so `/akili-constitution` Step 8E binds the personas
143
+ there:
144
+
145
+ | Tool | Native agent location | Model value |
146
+ |---|---|---|
147
+ | Claude Code | `.claude/agents/akili-{leader,implementer,reviewer,tester}.md` (project-level) | Alias from the registry (`model: sonnet`, `model: opus`, `model: haiku`) |
148
+ | OpenCode | Project agent config (`.opencode/agent/*.md` or the `agent` block of `opencode.json`, per your OpenCode version) | Provider slug from the registry (`model: opencode-go/glm-5.1`) |
149
+ | Antigravity | Not supported — `invoke_subagent` has no per-agent model binding | Guidance-only fallback |
150
+
151
+ Each wrapper is thin: frontmatter (`name`, `description`, `model`) plus a body that instructs the
152
+ agent to read and fully adopt the corresponding `.agents/<role>.md` persona. The persona files in
153
+ `.agents/` remain the tool-agnostic source of truth; the wrappers only add the model binding.
154
+ `/akili-execute` and `/akili-test` prefer these named agents when they exist and fall back to
155
+ generic subagents seeded with the persona content when they don't.
156
+
157
+ **author ≠ auditor becomes structural:** `akili-reviewer` is pinned to a different model than
158
+ `akili-implementer` in the wrapper files themselves — no human discipline required.
159
+
160
+ ## Model checkpoints (main loop)
161
+
162
+ The session model cannot be switched programmatically, but the agent knows which model it is
163
+ running on. Every AKILI command performs a one-line **model checkpoint** during setup: read the
164
+ project's `## Model Routing` registry, compare the phase's tier to the current session model, and
165
+ if they differ, tell the user in one line (e.g. *"This phase is T1 — the registry recommends
166
+ `/model opus`; you are on haiku"*) and offer the switch in the phase's first HITL pause. The user
167
+ can always continue on the current model; the checkpoint never blocks.
168
+
169
+ ## Surviving model churn
170
+
171
+ Models change constantly; the design absorbs that at three layers:
172
+
173
+ 1. **Tiers are the stable layer.** Phases map to T1–T6 and never change when models do.
174
+ 2. **Aliases are the default.** The Claude column uses floating aliases that track the latest
175
+ generation automatically (see the alias-first rule above).
176
+ 3. **Drift is detected, not discovered.** `/akili-audit` includes a **Model Registry Drift** check
177
+ (registry entries naming models the tool no longer offers, or a project registry older than the
178
+ packaged default), and `/akili-constitution` in Safe Update mode flags stale entries against the
179
+ packaged default without overwriting user pins. Each AKILI release refreshes this document's
180
+ default registry.
181
+
118
182
  ## How to apply per tool
119
183
 
120
- - **Claude Code (PRO):** switch with `/model` before running a phase — e.g. `/model opus` for
184
+ - **Claude Code:** switch with `/model` before running a phase — e.g. `/model opus` for
121
185
  `/akili-propose` and `/akili-validate`, `/model sonnet` for `/akili-execute` and `/akili-test`,
122
- `/model haiku` for the tasks split and `/akili-archive`. For the `/akili-execute` triad, run the
123
- Implementer on Sonnet and the Reviewer on Opus so author auditor holds.
124
- - **OpenCode:** select the `opencode-go/...` model for each phase per the registry. Keep the
125
- Reviewer/validator on a different model (`deepseek-v4-pro`) than the Implementer (`glm-5.1`).
186
+ `/model haiku` for the tasks split and `/akili-archive` or simply respond to each command's
187
+ model checkpoint. With Step 8E bindings in place, the execute/test triad routes itself
188
+ (Implementer on `sonnet`, Reviewer on `opus`).
189
+ - **OpenCode:** select the `opencode-go/...` model for each phase per the registry, or use the
190
+ Step 8E agent bindings. Keep the Reviewer/validator on a different model (`deepseek-v4-pro`)
191
+ than the Implementer (`glm-5.1`).
126
192
 
127
193
  ## Cross-tool safety
128
194
 
129
- - **No `model:` frontmatter.** Command prompts stay `description:`-only. A single frontmatter value
130
- cannot serve both tools anyway (Claude Code expects `opus`/`sonnet`/`haiku`; OpenCode expects
131
- `provider/model`), so model choice stays out of the prompts.
195
+ - **No `model:` frontmatter on commands.** Command prompts stay `description:`-only. A single
196
+ frontmatter value cannot serve both tools anyway (Claude Code expects `opus`/`sonnet`/`haiku`;
197
+ OpenCode expects `provider/model`), so model choice stays out of the prompts. Model bindings live
198
+ exclusively in **agent definitions**, which are per-tool, per-project files generated with the
199
+ user's approval in Step 8E.
132
200
  - **No installer changes.** Nothing here is force-injected. `/akili-constitution` scaffolds a project
133
201
  copy of this registry into `AGENTS.md` / `CLAUDE.md` as plain Markdown — identical handling across
134
202
  Claude Code, OpenCode, and Google Antigravity.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akili-specs",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "Portable AKILI-SPECS methodology commands and skills for AI-assisted development.",
5
5
  "homepage": "https://github.com/JuankCadavid/akili-specs#readme",
6
6
  "repository": {