akili-specs 2.11.0 → 2.13.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.
@@ -19,7 +19,7 @@ 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.
22
+ **Model checkpoint:** This phase runs best on **T4 Context-Ingest** for the scan and **T3 Auditor** for judging drift — recommend the deeper tier's model since the judging is where quality is decided. If the project's `## Model Routing` registry (root `AGENTS.md`/`CLAUDE.md`) maps those tiers 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 opus` (T3 judging; `sonnet` suffices for the scan); 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
23
 
24
24
  First, read the constitutional documentation baseline in the repository:
25
25
 
@@ -37,6 +37,8 @@ Perform codebase analysis (preferring CodeGraph if `.codegraph/` exists, or util
37
37
  3. **UI Components & Pages:** Actual directory structure of frontend views, components, and design tokens.
38
38
  4. **Key Modules & Dependencies:** Registered packages, external integrations, and package manifest frameworks.
39
39
 
40
+ **Delegation Thresholds (scout scan):** Apply the *Delegation Thresholds* from `.agents/leader.md` to this scan — when a single extraction above requires reading **4+ full source files**, delegate it to a scout/Explore subagent per area (API, schema, UI, modules) and judge drift from their conclusions in Step 2. CodeGraph lookups do not count toward the threshold. This keeps the T3 drift-judging context clean of raw file dumps.
41
+
40
42
  ### Step 2: Compare Documentation vs. Codebase Reality
41
43
 
42
44
  Audit for discrepancies, classifying findings under the following categories:
@@ -50,7 +52,7 @@ Audit for discrepancies, classifying findings under the following categories:
50
52
 
51
53
  ### Step 3: Write Drift Report
52
54
 
53
- Create or update:
55
+ Create or update (writing per `cognitive-doc-design`: lead with the verdict, tables over prose):
54
56
 
55
57
  ```text
56
58
  docs/specs/drift-report.md
@@ -95,6 +95,8 @@ Also inspect the codebase to understand:
95
95
 
96
96
  Do not write generic placeholder documentation when the repository already contains enough context to infer a strong baseline.
97
97
 
98
+ **Delegation Thresholds (scout research):** For legacy/existing-project analysis, apply the *Delegation Thresholds* from the packaged `leader.md` template — when inspecting the codebase requires reading **4+ full source files** for a single question (architecture survey, styling-token inventory, module-boundary mapping), spawn a scout/Explore subagent with fresh context and synthesize from its conclusions instead of reading everything inline. CodeGraph lookups (below) do not count toward the threshold.
99
+
98
100
  #### Existing Project CodeGraph Check
99
101
 
100
102
  For existing projects, prefer CodeGraph for repository analysis when available:
@@ -401,6 +403,15 @@ project guides so the project does not depend on the package's `docs/` after ins
401
403
  5. The instruction: *"To change models, edit only this registry table. Never pin a dated model name
402
404
  where a floating alias exists. Model selection is guidance only in command prompts — never add
403
405
  `model:` to command frontmatter; enforced bindings live only in the Step 8E agent wrappers."*
406
+ 6. A compact **Effort dial** subsection (mirroring the packaged `docs/model-routing.md` → *Effort
407
+ dial*): effort is the second, **per-task** routing dimension, orthogonal to the tier — the tier
408
+ picks the model, effort picks how hard it thinks on *this* task. Include: (a) the effort-by-signal
409
+ table (trivial/mechanical → `low`; standard scope → `medium`; complex — algorithm, concurrency,
410
+ security, ambiguity → `xhigh`; correctness-critical → `max`); (b) default effort by role (T1
411
+ propose/specify/Leader `high`; T2 Implementer/Tester `medium`, flex by task; T3 Reviewer `high`;
412
+ T5 archive `low`); (c) the rework rule (*bump effort one level on every retry*); and (d) the
413
+ tier↔effort rule (*never `max` a cheaper tier — escalate the tier instead*). The
414
+ `/akili-execute` and `/akili-test` Leaders read this subsection to set each worker's effort.
404
415
 
405
416
  **Mode-specific policy (mirror Step 8B):**
406
417
 
@@ -481,7 +492,9 @@ this step — the guidance-only flow keeps working.
481
492
  - **OpenCode:** create the equivalent project agent definitions (`.opencode/agent/akili-*.md` or
482
493
  the `agent` block of `opencode.json`, matching the user's OpenCode version) with `model:` set to
483
494
  the registry's OpenCode slugs (default: implementer `opencode-go/glm-5.2`, reviewer
484
- `opencode-go/deepseek-v4-pro`, leader `opencode-go/kimi-k3` (T1 — orchestration judgment)).
495
+ `opencode-go/deepseek-v4-pro`, leader `opencode-go/kimi-k3` (T1 — orchestration judgment),
496
+ tester `opencode-go/deepseek-v4-flash` — the T2 fallback rather than the T2 primary, so the
497
+ Tester lands on a **different model than the Implementer** (author ≠ tester)).
485
498
 
486
499
  - **Google Antigravity:** no per-agent model binding exists — skip wrapper generation and note in
487
500
  the summary that Antigravity stays on guidance-only routing.
@@ -489,7 +502,9 @@ this step — the guidance-only flow keeps working.
489
502
  **Rules:**
490
503
 
491
504
  1. The Reviewer wrapper's model MUST differ from the Implementer wrapper's model. If the registry
492
- collapses them, escalate the Reviewer one tier before writing the wrappers.
505
+ collapses them, escalate the Reviewer one tier before writing the wrappers. The Tester wrapper
506
+ should also **prefer** a model different from the Implementer's (author ≠ tester — a preference,
507
+ not a hard rule); if they collapse, note it in the summary rather than blocking.
493
508
  2. Wrappers reference `.agents/<role>.md`; they never duplicate persona content. Editing a persona
494
509
  requires no wrapper change; changing a model requires editing only the wrapper (or re-running
495
510
  this step).
@@ -57,6 +57,8 @@ If `.agents/` is missing, run `/akili-constitution` first to scaffold it. Do not
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
 
60
+ **Delegation Thresholds:** the Leader's inline-vs-delegate boundary is quantified in `.agents/leader.md` → *Delegation Thresholds* (inline only for 1-file checks and puntual verifications; 4+ full-file reads → scout subagent; 2+ non-trivial file writes → Implementer; CodeGraph lookups don't count toward the read threshold). Apply it to your own research inside this command — e.g. investigating a Reviewer FAIL across many files is scout work, not Leader-inline work.
61
+
60
62
  **Communication economy:** load the `caveman` skill and apply its Scope Contract to all transient output in this command — inter-agent messages (Leader ↔ Implementer/Reviewer briefs, reports, feedback relays) at `full`, user-visible progress lines at `lite`. It never applies to `execution.md` audit entries, PR descriptions, HITL summaries, Pivot blockers, or verbatim evidence (Reviewer FAIL reports pass unchanged — the Structured Feedback rule wins).
61
63
 
62
64
  ---
@@ -159,9 +161,18 @@ When the Implementer reports completion, the Leader:
159
161
  - the relevant slices of `requirements.md`, `design.md`, `trd.md`, and `docs/ux-ui/design.md`
160
162
  - the Implementer's verification evidence
161
163
 
164
+ **Review lens modes (4R):** the Reviewer audits spec conformance (the gate) plus four advisory lenses — **readability, reliability, resilience, risk** — per `.agents/reviewer.md`. The mode is selected by the task's effort dial; there is no separate configuration:
165
+
166
+ | Mode | When | Mechanics |
167
+ |------|------|-----------|
168
+ | **Lens checklist** (default) | Effort `low` / `medium` / `high` | The single Reviewer sweeps all four lenses; non-spec-violation findings return in an `ADVISORY` block. **Spec conformance remains the only PASS/FAIL gate** |
169
+ | **Parallel lens reviewers** | Effort `xhigh` / `max`, or the task touches security, migrations, or data-loss surfaces | Spawn 2–4 lens-scoped Reviewers in parallel (each gets the same diff + one named lens + baseline spec conformance). Any lens may FAIL; the Leader adjudicates whether a lens FAIL is in-scope for the task **before** consuming a rework attempt |
170
+
171
+ `ADVISORY` findings are recorded in `execution.md` with the task's entry and never trigger rework — the 3-attempt ceiling binds to spec conformance only.
172
+
162
173
  The Reviewer is read-only. It must conclude with either:
163
174
 
164
- - **`STATUS: PASS`** + a 1–2 sentence summary
175
+ - **`STATUS: PASS`** + a 1–2 sentence summary (+ optional `ADVISORY` block with 4R lens findings)
165
176
  - **`STATUS: FAIL`** + a structured list of issues, each containing:
166
177
  1. **Discovered Issue** — what is incorrect or missing
167
178
  2. **Violated Rule** — the specific spec document and section violated
@@ -171,6 +182,7 @@ The Reviewer is read-only. It must conclude with either:
171
182
  #### 2.4 — Loop Guardrails
172
183
 
173
184
  - **Maximum Retries:** A hard ceiling of **3 rework attempts** per task. This prevents infinite loops and token waste.
185
+ - **Advisory Never Gates:** `ADVISORY` (4R lens) findings are recorded in `execution.md` but never count as FAIL issues, never trigger rework, and never consume attempts. If an advisory finding is serious enough to block, the Reviewer must restate it as a spec-violation FAIL issue (or the Leader escalates it to the user as a potential spec gap via the Pivot Protocol).
174
186
  - **Fail-Fast (FATAL_FAIL):** If the Reviewer issues a `STATUS: FATAL_FAIL`, immediately HALT the loop, mark the task `[~]`, and trigger the Pivot Protocol. Do not consume remaining rework attempts.
175
187
  - **Structured Feedback:** On `FAIL`, pass the full Reviewer report unchanged to the next Implementer spawn. Do not paraphrase.
176
188
  - **Escalation on HALT:** After 3 failed attempts (or a FATAL_FAIL), mark the task `[~]`, log the full loop history in `execution.md`, and present the audit trail to the user for guidance.
@@ -228,6 +240,7 @@ Each task entry must record:
228
240
  - task ID and title
229
241
  - number of Implementer attempts run
230
242
  - for each attempt: files changed, Implementer verification command + result, Reviewer verdict + summary or full FAIL findings
243
+ - any `ADVISORY` (4R lens) findings from the final Reviewer verdict, labeled as advisory
231
244
  - requirements covered
232
245
  - decisions made
233
246
  - issues encountered
@@ -133,7 +133,7 @@ Ask focused questions only when the proposal would otherwise depend on unstable
133
133
 
134
134
  ### Step 2: Write `proposal.md`
135
135
 
136
- Create a concise proposal with this structure:
136
+ Create a concise proposal following `cognitive-doc-design` (lead with the answer, progressive disclosure, tables over prose) with this structure:
137
137
 
138
138
  1. Document Control (include `Type: Bug | Change | Trivial`)
139
139
  2. Intent
@@ -41,7 +41,7 @@ Before making any edit, confirm the change qualifies as trivial. A change is eli
41
41
  - **No behavior change:** no new or modified logic, control flow, conditionals, state, or side effects.
42
42
  - **No data / API / auth / contract change:** no schema, endpoint, request/response shape, permission, or shared-package surface change.
43
43
  - **Small and local:** roughly **≤ ~20 LOC** and confined to **one component/file** (or a couple of tightly related files).
44
- - **Design-token safe:** any color/spacing/typography change uses an existing approved token from `docs/ux-ui/design.md` — not a new hardcoded value.
44
+ - **Design-token safe:** any color/spacing/typography change uses an existing approved token from `docs/ux-ui/design.md` (legacy fallback: `docs/system-design/design.md`) — not a new hardcoded value.
45
45
 
46
46
  ### Automatic Escalation
47
47
 
@@ -66,7 +66,7 @@ Keep context small — this is a trivial change, not a full spec run.
66
66
 
67
67
  1. Read only what the change needs:
68
68
  - the target file(s) for the change
69
- - `docs/ux-ui/design.md` **only if** the change involves a color, spacing, typography, or other design token (to use the approved token)
69
+ - `docs/ux-ui/design.md` (legacy fallback: `docs/system-design/design.md`) **only if** the change involves a color, spacing, typography, or other design token (to use the approved token)
70
70
  - root `CLAUDE.md` / `AGENTS.md` only if repo conventions are unclear for the edit
71
71
  2. **CodeGraph over full reads:** if `.codegraph/` exists, use `codegraph_search` to locate the exact symbol/component instead of scanning files.
72
72
  3. Do **not** read the full constitution set, `docs/prd.md`, or `docs/trd/trd.md` for a trivial edit.
@@ -23,6 +23,8 @@ No arguments required. The command scans `docs/specs/` automatically.
23
23
 
24
24
  ### Step 0: Scan Active Specs
25
25
 
26
+ **Model checkpoint:** This phase runs best on **T5 Fast-Cheap** — file scanning and summarization; reasoning depth is not the bottleneck. 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. *"Resume is T5 — the registry recommends `/model haiku`; you are on opus"* — and offer to switch (`/model …` in Claude Code, the model selector in OpenCode). Never block on this; continuing on the current model is always allowed (and switching is rarely worth it for a single scan).
27
+
26
28
  1. List all directories under `docs/specs/` (excluding `archive/`).
27
29
  2. For each spec directory, read available files to determine current phase:
28
30
  - `proposal.md` exists → proposed
@@ -214,7 +214,7 @@ Record each failure as a finding using the skill's Issue / Impact / Evidence / F
214
214
 
215
215
  ### Phase 3: Write `seo-audit-report.md`
216
216
 
217
- Generate `docs/specs/$SPEC_PATH/seo-audit-report.md` using `docs/specs/general-setup/validation-report.md` as the format source where it fits.
217
+ Generate `docs/specs/$SPEC_PATH/seo-audit-report.md` using `docs/specs/general-setup/validation-report.md` as the format source where it fits, writing per `cognitive-doc-design` (lead with the verdict, tables over prose).
218
218
 
219
219
  Required sections:
220
220
 
@@ -82,6 +82,7 @@ When the spec is a **bug** — the proposal's Document Control says `Type: Bug`,
82
82
  - Also read `docs/specs/kaizen-log.md` if it exists — ONLY the `## Active Lessons` table (skip `## Entries`).
83
83
  5. Respect the repository's current package layout and naming conventions instead of assuming a fixed stack.
84
84
  6. **CodeGraph over full reads:** If `.codegraph/` exists, use `codegraph_search` and `codegraph_context` to inspect relevant code paths instead of reading full source files or using generic `grep`/`glob`. This drastically reduces input tokens.
85
+ 7. **Delegation Thresholds (scout research):** Beyond the constitutional docs above, apply the *Delegation Thresholds* from `.agents/leader.md` to source-code exploration in every Explore step of this command — if answering a design question requires reading **4+ full source files**, spawn a scout/Explore subagent with fresh context and consume its conclusions instead of reading the files inline. CodeGraph lookups (rule 6) do not count toward the threshold.
85
86
 
86
87
  ---
87
88
 
@@ -101,10 +101,8 @@ The Leader decides the count from the spec's depth and the independence of the s
101
101
  1. Partition the work into concrete **suites**: backend unit, frontend unit, integration, E2E — only those the spec actually needs.
102
102
  2. For each suite, assemble a **context slice**: the target requirements + scenarios, the negative/strict rules to assert, the repo test command, and the relevant skills.
103
103
  3. Apply the **Deployment Rule** to decide inline vs delegated, and parallel vs sequential.
104
- 4. Assign skills per suite as needed:
105
- - `nestjs-expert`, `systematic-debugging` — backend
106
- - `vercel-react-best-practices`, `react-doctor` — frontend
107
- - `ui-ux-pro-max` (fallback `frontend-design`) — UI-heavy E2E
104
+ 4. **Select each suite's skills as Leader — you own the decision, not a fixed list.** The spec's task skills and the project's `## Skill Map` (root `AGENTS.md`/`CLAUDE.md`) are your **defaults, not a pass-through**: judge each suite's actual nature and augment, narrow, or override them (conditional skills like `systematic-debugging` for failure-heavy suites or `ui-ux-pro-max` for UI-heavy E2E; stack skills come from the Skill Map). When you deviate from the spec's list, record a one-line reason in the test report's Summary.
105
+ 5. **Set each suite's effort** (the *Effort dial* in `## Model Routing`, orthogonal to the tier): default `medium` for a T2 Tester, `low` for a trivial single-assertion suite, `xhigh` for complex integration/concurrency suites, `max` for correctness-critical coverage. Where the tool exposes a per-spawn effort knob, set it; otherwise steer depth in the suite's context slice. Never `max` a cheaper tier escalate the tier instead.
108
106
 
109
107
  ### Phase 2: Execute Suites (Tester per suite)
110
108
 
@@ -115,7 +113,8 @@ For each suite, the assigned Tester (or the Leader inline) must:
115
113
  - Map every test back to its requirement and scenario.
116
114
  - Run the suite and apply the **bounded self-correction inner loop** (max 3 attempts):
117
115
  - fix genuine **test defects** and re-run;
118
- - keep a failing test that reveals a genuine **product defect** red, and report it as `STATUS: PRODUCT_BUG` instead of rewriting it to pass.
116
+ - keep a failing test that reveals a genuine **product defect** red, and report it as `STATUS: PRODUCT_BUG` instead of rewriting it to pass;
117
+ - on each retry, **bump the effort one level** (`medium` → `high` → `xhigh`) — a fix that failed is usually under-thinking, not missing instructions.
119
118
  - Prefer unit tests for internal logic, integration tests for cross-module/API behavior, and E2E only for critical user journeys — not every small component state.
120
119
 
121
120
  Each Tester concludes with exactly one status — `PASS`, `FAIL`, or `PRODUCT_BUG` — plus a per-scenario coverage slice, per `.agents/tester.md`.
@@ -131,7 +130,7 @@ Recommended matrix columns:
131
130
 
132
131
  ### Phase 4: Generate Test Report (Leader)
133
132
 
134
- Create `docs/specs/$ARGUMENTS/test-report.md`.
133
+ Create `docs/specs/$ARGUMENTS/test-report.md`. Write it following `cognitive-doc-design`: lead with the answer (overall status first), progressive disclosure, tables over prose.
135
134
 
136
135
  **Automated Test Parsing Option:** If the repository uses standard testing frameworks (like Jest or Vitest) and has a AKILI test parsing helper installed (e.g. `akili/scripts/parse_tests.js`), you may run the tests outputting to JSON (e.g. `jest --json --outputFile=jest-results.json` or `vitest --reporter=json --outputFile=test-results.json`) and run:
137
136
  `node <path-to-akili>/scripts/parse_tests.js jest-results.json`
@@ -108,13 +108,8 @@ For every requirement in `requirements.md`, verify:
108
108
 
109
109
  Use skills as needed:
110
110
 
111
- - `nestjs-expert`
112
- - `react-doctor`
113
- - `api-design-principles`
114
- - `tailwind-design-system`
115
- - `frontend-design`
116
- - `ui-ux-pro-max` if available for UX/UI-heavy validation
117
- - `systematic-debugging` when failures or inconsistencies appear
111
+ - **Stack skills come from the project's `## Skill Map`** (root `AGENTS.md`/`CLAUDE.md`) — load the entries matching the code under validation; do not assume a fixed list.
112
+ - Conditional skills by situation: `ui-ux-pro-max` (fallback `frontend-design`) for UX/UI-heavy validation; `systematic-debugging` when failures or inconsistencies appear.
118
113
 
119
114
  Check for:
120
115
 
@@ -127,6 +122,8 @@ Check for:
127
122
  - accessibility and responsive behavior for UI work
128
123
  - security and authorization boundaries for protected flows
129
124
 
125
+ **4R lens sweep (advisory):** Sweep the implementation through the four execution review lenses — **readability, reliability, resilience, risk** (see `.agents/reviewer.md`). Findings that are not spec violations are reported as **advisory** notes in the validation report (they inform remediation and future specs, but only spec violations drive PASS/WARN/FAIL). Also carry forward any unresolved `ADVISORY` findings recorded in `execution.md` so they surface in the report instead of dying in the audit trail.
126
+
130
127
  ### Phase 6: Design Conformance
131
128
 
132
129
  Compare the implementation against the module design and the constitutional docs where relevant.
@@ -139,7 +136,7 @@ If `proposal.md` exists, also verify that final behavior remains aligned with th
139
136
 
140
137
  ### Phase 7: Generate Validation Report
141
138
 
142
- Create `docs/specs/$ARGUMENTS/validation-report.md`.
139
+ Create `docs/specs/$ARGUMENTS/validation-report.md`. Write it following `cognitive-doc-design`: lead with the verdict, progressive disclosure, tables over prose.
143
140
 
144
141
  The report must include:
145
142
 
@@ -149,7 +146,7 @@ The report must include:
149
146
  4. File Existence
150
147
  5. Build Integrity
151
148
  6. Requirement Coverage
152
- 7. Linting & Code Quality
149
+ 7. Linting & Code Quality (including 4R advisory findings, labeled as advisory)
153
150
  8. Design Conformance
154
151
  9. Test Evidence Summary
155
152
  10. Agent Guide / Constitution Impact
@@ -5,6 +5,7 @@ version: 1.0.0
5
5
  metadata:
6
6
  author: Million.dev (millionco)
7
7
  source: https://github.com/millionco/react-doctor
8
+ license: MIT
8
9
  adapted-by: "Juan Carlos Cadavid — jcadavid.com"
9
10
  adapted-for: "AKILI-SPECS"
10
11
  binding: stack
@@ -4,7 +4,8 @@ description: Provides complete shadcn/ui component library patterns including in
4
4
  allowed-tools: Read, Write, Bash, Edit, Glob
5
5
  metadata:
6
6
  author: community (origin unverified)
7
- curated-by: "Juan Carlos Cadavid jcadavid.com"
7
+ license: "unverified no upstream source to check; treat as all-rights-reserved until origin is identified"
8
+ adapted-by: "Juan Carlos Cadavid — jcadavid.com"
8
9
  adapted-for: "AKILI-SPECS"
9
10
  binding: stack
10
11
  version: "1.0"
@@ -8,6 +8,7 @@ allowed-tools:
8
8
  metadata:
9
9
  author: Google (google-labs-code)
10
10
  source: https://github.com/google-labs-code/stitch-skills
11
+ license: Apache-2.0
11
12
  adapted-by: "Juan Carlos Cadavid — jcadavid.com"
12
13
  adapted-for: "AKILI-SPECS"
13
14
  binding: conditional
@@ -12,7 +12,8 @@ Your sole responsibility is to implement the technical scope of the active task
12
12
 
13
13
  1. **Strict Context Alignment (Prompt Caching & Skills):**
14
14
  * To maximize prompt caching, **FIRST** consult the project constitution (`CLAUDE.md`, `AGENTS.md`, `docs/trd/trd.md`, `docs/ux-ui/design.md`) in a consistent order before reading task-specific files.
15
- * **Skill Loading:** If the Leader assigns you specific skills (e.g., `shadcn-ui`, `nestjs-expert`), you MUST use the `skill` tool to load them BEFORE you write any code.
15
+ * **Skill Loading:** If the Leader assigns you specific skills (e.g., `shadcn-ui`, `nestjs-expert`), you MUST use the `skill` tool to load them BEFORE you write any code. **The Leader's skill assignment supersedes the task's recommended list** — the Leader actively selects skills per task; load what it assigns, not what the task file says.
16
+ * **Effort:** Honor the Leader's effort/depth instruction for this task (the *Effort dial* in `## Model Routing`) — think as hard as the brief asks: quick and mechanical for trivial work, deep and careful when the brief flags the task as complex or correctness-critical.
16
17
  * Strictly align with requirements defined in `docs/specs/<spec-path>/requirements.md`.
17
18
  * Follow the technical blueprint in `docs/specs/<spec-path>/design.md`.
18
19
  2. **Incremental Focus (No Scope Creep):**
@@ -49,6 +49,23 @@ Your sole responsibility is to coordinate execution of an approved spec by orche
49
49
 
50
50
  ---
51
51
 
52
+ ## 📏 Delegation Thresholds (inline vs. delegate)
53
+
54
+ This table is the methodology's single source of truth for when an orchestrating agent works inline versus spawning a subagent. It applies to you in `/akili-execute` and `/akili-test`, and to the orchestrating session in research-heavy commands (`/akili-constitution`, `/akili-specify`, `/akili-audit`). The goal: the orchestrator's context stays clean for judgment — a "mega agent" that reads everything, writes everything, and reviews itself pollutes its own context and lowers quality.
55
+
56
+ | Situation | Action |
57
+ |-----------|--------|
58
+ | 1 file, a quick check, `git status`, a puntual verification | **Inline** — do it yourself |
59
+ | Research requires reading **4+ full files** | **Spawn a scout** (Explore-type subagent) with fresh context; consume its conclusions, not the file dumps |
60
+ | Writing **2+ non-trivial files** | **Spawn an Implementer** (inside the triad this is always the rule; the threshold makes it explicit outside it) |
61
+ | Tests / builds | **Subagent** (`/akili-test` Deployment Rule governs suite-level inline exceptions) |
62
+ | Review of a diff / PR | **Fresh-context Reviewer**, diff-only input — never review your own work |
63
+ | Multiple writers at once | Only for fully independent tasks (different files/domains); use isolated worktrees where the tool supports them |
64
+
65
+ **CodeGraph exception:** in codegraph-enabled projects, `codegraph_search` / `codegraph_context` / `codegraph_callers` lookups do **not** count toward the 4-file threshold — targeted graph lookups are precisely how the orchestrator avoids bulk file reads. The threshold counts full-file reads.
66
+
67
+ ---
68
+
52
69
  ## 🔁 Orchestration Sequence (per task)
53
70
 
54
71
  1. Load spec and constitution context.
@@ -64,6 +81,20 @@ Your sole responsibility is to coordinate execution of an approved spec by orche
64
81
 
65
82
  ---
66
83
 
84
+ ## 🧪 When Orchestrating `/akili-test` (Leader → Tester harness)
85
+
86
+ The same Leader judgment applies when you orchestrate testing — only the workers change:
87
+
88
+ 1. **Partition** the spec's testing into concrete suites (backend unit, frontend unit, integration, E2E — only those the spec needs) and apply `/akili-test`'s Deployment Rule (inline vs delegated).
89
+ 2. **Select each Tester's skills and effort** exactly as you do for Implementers (Instruction #3): the spec's list and the `## Skill Map` are defaults you may override; set per-suite effort (`medium` default, flex by suite difficulty) and record deviations in the test report's Summary.
90
+ 3. **author ≠ tester:** prefer spawning each Tester on a **different model than the Implementer** that wrote the production code (reduces confirmation bias). A preference, not a hard rule — note it when they collapse.
91
+ 4. **Adjudicate results:** a `PRODUCT_BUG` from a Tester is evidence, not noise — carry it through as a failure with remediation; never let a Tester rewrite a red test to pass.
92
+ 5. You write no tests yourself except where `/akili-test`'s Deployment Rule says to run a trivial suite inline.
93
+
94
+ The full test-orchestration contract (phases, Deployment Rule, report format) lives in `/akili-test`; this section makes your authority consistent across both harnesses.
95
+
96
+ ---
97
+
67
98
  ## 📝 Reporting To The User
68
99
 
69
100
  After each task completes (whether on first pass or after self-correction), report:
@@ -4,7 +4,7 @@ You are the specialized **Specification Reviewer** agentic team member in the AK
4
4
 
5
5
  Your sole responsibility is to perform an independent, objective audit of the git diff produced by the **Implementer**. You act as a strict gatekeeper to ensure code matches specifications, conforms to design tokens, and preserves repository stability.
6
6
 
7
- > **Recommended model tier:** T3 Auditor (deep, independent review). See the `## Model Routing` registry in the project's `AGENTS.md` / `CLAUDE.md`. You **MUST** run on a **different model than the Implementer** — author ≠ auditor is a correctness constraint, not a preference. If only one model is available, escalate to the deepest-reasoning model for this audit.
7
+ > **Recommended model tier:** T3 Auditor (deep, independent review) at **default effort `high`** — auditor thoroughness is the point; do not skim (see the *Effort dial* in `## Model Routing`). See the `## Model Routing` registry in the project's `AGENTS.md` / `CLAUDE.md`. You **MUST** run on a **different model than the Implementer** — author ≠ auditor is a correctness constraint, not a preference. If only one model is available, escalate to the deepest-reasoning model for this audit.
8
8
 
9
9
  ---
10
10
 
@@ -21,6 +21,14 @@ Your sole responsibility is to perform an independent, objective audit of the gi
21
21
  3. **Structured Evaluation:**
22
22
  * Compare the implementation's code changes strictly with the active task's specification files.
23
23
  * Ensure all automated verification checks run by the Implementer are valid and passed cleanly.
24
+ 4. **4R Review Lenses (advisory layer):**
25
+ * After the spec-conformance audit, sweep the diff through four lenses:
26
+ * **Readability** — can the next maintainer follow this without reconstructing the author's head? Naming, structure, idiom match with the surrounding code.
27
+ * **Reliability** — error paths, edge cases, unhandled rejections, resource cleanup.
28
+ * **Resilience** — behavior under partial failure: timeouts, retries, bad input, concurrent access.
29
+ * **Risk** — security exposure, data loss potential, migration hazards, blast radius of a mistake.
30
+ * **Lens findings that are not spec violations are ADVISORY**: report them in the `ADVISORY` block, never as FAIL issues. They inform the Leader and land in `execution.md`; they do not gate the task and never consume a rework attempt. A lens finding that *is* a spec violation (e.g. the TRD mandates an error-handling pattern the diff ignores) belongs in the FAIL issues list as usual.
31
+ * When the Leader spawns you with a **single named lens** (parallel lens-review mode, high-effort tasks), audit only that lens plus baseline spec conformance, and say so in your summary.
24
32
 
25
33
  ---
26
34
 
@@ -33,6 +41,8 @@ If the code completely matches the spec, has zero drift, and passes all tests:
33
41
  ```text
34
42
  STATUS: PASS
35
43
  SUMMARY: (Brief 1-2 sentence description of why it passes)
44
+ ADVISORY: (Optional — 4R lens findings that are worth recording but are not spec violations.
45
+ Each line: LENS: finding + suggested improvement. Omit the block when there are none.)
36
46
  ```
37
47
 
38
48
  ### Option B: FAIL
@@ -43,6 +53,8 @@ ISSUES:
43
53
  1. **Discovered Issue:** (Clear description of what is incorrect or missing)
44
54
  * **Violated Rule:** (The specific spec document and section violated, e.g. docs/ux-ui/design.md#L45)
45
55
  * **Remediation Suggestion:** (Actionable explanation of how the Implementer must fix this)
56
+ ADVISORY: (Optional — same format as in PASS. Advisory items are NOT issues: the Implementer
57
+ is not required to address them and the Leader must not count them toward rework.)
46
58
  ```
47
59
 
48
60
  ### Option C: FATAL_FAIL (Fail-Fast)
@@ -13,7 +13,8 @@ Your sole responsibility is to author and execute the **one test suite** assigne
13
13
  1. **Strict Context Alignment (Prompt Caching & Skills):**
14
14
  * To maximize prompt caching, **FIRST** consult the project constitution (`CLAUDE.md`, `AGENTS.md`, `docs/trd/trd.md`, `docs/ux-ui/design.md`) in a consistent order before reading task-specific files.
15
15
  * Work only from the **slice** the Leader hands you: your assigned suite, its target requirements, and the Given/When/Then scenarios in scope. Do **not** pull the full spec set or unrelated source files unless strictly required to write a valid test.
16
- * **Skill Loading:** If the Leader assigns skills (e.g. `nestjs-expert`, `react-doctor`, `vercel-react-best-practices`, `systematic-debugging`, `ui-ux-pro-max`), load them with the `skill` tool **before** writing tests.
16
+ * **Skill Loading:** If the Leader assigns skills (e.g. `systematic-debugging`, `ui-ux-pro-max`, or stack skills from the project's `## Skill Map`), load them with the `skill` tool **before** writing tests. The Leader's assignment supersedes any list in the spec.
17
+ * **Effort:** Honor the Leader's effort/depth instruction for your suite (the *Effort dial* in `## Model Routing`) — quick for a trivial single-assertion suite, deep and exhaustive when the brief flags the suite as complex or correctness-critical.
17
18
  2. **Prove Behavior, Not Count (No Coverage Theater):**
18
19
  * Write focused tests that prove one behavior clearly over broad tests with unclear intent.
19
20
  * You **MUST** explicitly test the negative constraints (`BUT it must NOT`) and strict boundary validations (`AND IT MUST`) of every scenario in your slice.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,25 @@ 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.13.0] - 2026-07-24
14
+
15
+ ### Added
16
+
17
+ - **Delegation Thresholds — quantified inline-vs-delegate rules for orchestrating agents.** New *Delegation Thresholds* section in the packaged `leader.md` persona (single source of truth): inline only for 1-file checks and puntual verifications; research reading **4+ full files** → spawn a scout/Explore subagent; writing **2+ non-trivial files** → Implementer; tests/builds → subagent; diff review → fresh-context Reviewer; parallel writers only for fully independent tasks. CodeGraph lookups explicitly do **not** count toward the read threshold. Referenced from `/akili-execute` (Leader's own research), `/akili-specify` (Explore steps), `/akili-constitution` (legacy-project analysis), and `/akili-audit` (codebase scan, per-area scouts). Inspired by the convergent `gentle-ai` orchestrator→minion pattern; design recorded in `docs/plans/2026-07-24-delegation-thresholds-review-lenses.md`.
18
+ - **4R execution review lenses (readability, reliability, resilience, risk) — advisory layer on the Reviewer.** The packaged `reviewer.md` persona now sweeps the diff through four lenses after the spec-conformance audit; findings that are not spec violations return in a new `ADVISORY` block that is recorded in `execution.md` but **never gates**: spec conformance remains the only PASS/FAIL gate, and advisory findings never consume rework attempts (new *Advisory Never Gates* guardrail in `/akili-execute`). Mode is selected by the existing effort dial — single Reviewer with lens checklist by default; **parallel lens-scoped Reviewers** at `xhigh`/`max` effort or on security/migration/data-loss surfaces, with the Leader adjudicating lens FAIL scope before consuming an attempt. `/akili-validate` Phase 5 runs the same 4R sweep as advisory report content and carries forward unresolved `ADVISORY` findings from `execution.md`.
19
+
20
+ ### Fixed
21
+
22
+ - **`akili update` now works for pnpm installations.** The updater previously hardcoded npm: detection probed only `npm list`, so a `pnpm add -g akili-specs` install was misdetected as an ephemeral npx run and told to reinstall with npm (and would have created a duplicate npm-managed copy). `detectInstallType()` now probes both npm and pnpm trees (preferring the manager that invoked the process via `npm_config_user_agent`), the update runs the matching command (`pnpm add -g akili-specs@latest` / local equivalent), and the post-update changelog resolution uses the owning manager's `root`. README and `docs/cli.md` document the pnpm equivalents (`pnpm dlx`, `pnpm add -g` + one-time `pnpm setup`).
23
+ ## [2.12.0] - 2026-07-24
24
+
25
+ ### Changed
26
+
27
+ - **Methodology audit — effort dial and Leader authority propagated to their remaining surfaces.** A four-front audit (commands, personas, skills governance, docs coherence) after v2.11.0 found the new capabilities had landed in `/akili-execute` but not its siblings. Fixed: **(a)** `/akili-constitution` Step 8C now scaffolds the **Effort dial** into each project's `## Model Routing` (item 6: effort-by-signal table, per-role defaults, rework escalation, tier↔effort rule) — previously `/akili-execute` referenced a section fresh projects never had; **(b)** `/akili-test` gains per-suite **effort selection** (Phase 1), **effort escalation on the Tester inner loop**, and the same active skill-selection authority as execute; **(c)** worker personas now acknowledge the dial — `implementer.md`/`tester.md` honor the Leader's effort brief (and state the Leader's skill assignment supersedes the task list), `reviewer.md` states its default effort `high`; **(d)** `leader.md` gains a **"When Orchestrating `/akili-test`"** section (was execute-only — never mentioned Testers or author ≠ tester); **(e)** Step 8E adds the missing **OpenCode tester wrapper default** (`opencode-go/deepseek-v4-flash` — the T2 *fallback* rather than the primary, so the Tester lands on a different model than the Implementer) plus a soft author ≠ tester guard in Rule 1.
28
+ - **Command-consistency fixes from the audit.** `/akili-resume` gains the standardized model checkpoint every sibling has, and joins the phase→tier table as an explicit T5 row; `/akili-audit`'s checkpoint now surfaces `opus` for the T3 drift-judging portion (it only named the T4 scan model); `cognitive-doc-design` is now cited by all five report-producing commands that lacked it (`propose`/`audit`/`seo`/`validate`/`test`); `/akili-quick` gains the `docs/system-design/design.md` legacy fallback every other design-reader carries.
29
+ - **Skills governance: rule-vs-practice contradiction resolved with documented carve-outs.** The absolute "stack skills never hard-referenced in command text" rule contradicted four command sites. `governance.md` now distinguishes **load-directing** (violation) from three carve-outs: the constitution's candidate-pool/bootstrap lists, no-map fallback lists that defer to the Skill Map first, and Skill-Map-deferring illustrative examples. The two genuine violations were purged: `/akili-validate` and `/akili-test` now point stack-skill selection at the project `## Skill Map` instead of fixed lists. `docs/skills/README.md` aligned.
30
+ - **Skill attribution completed.** `react-doctor` (`license: MIT`) and `stitch-design` (`license: Apache-2.0`) — both verified against their upstream repositories; `shadcn-ui`'s off-schema `curated-by` normalized to `adapted-by` with an explicit unverified-license warning.
31
+ - **Stale docs corrected.** `README.md` no longer claims fast/cheap models handle the tasks split (the exact belief v2.11.0 reversed — now: deep reasoning for propose/specify incl. `tasks.md`/validate/Leader, fast/cheap only for archive+formatting, plus the Effort dial); README and `docs/cli.md` now document the v2.10.1 installer **auto-detect** behavior (bare `install`/`update`/`doctor` act on all installed targets); README's Contents lists all 22 skills (added `caveman`, `software-architect`); `docs/commands/README.md` includes Antigravity; `model-routing.md` wording fix ("the strongest open models").
13
32
  ## [2.11.0] - 2026-07-24
14
33
 
15
34
  ### Changed
package/README.md CHANGED
@@ -79,6 +79,7 @@ AKILI-SPECS is a constitution-first, spec-driven methodology for AI-assisted dev
79
79
  - `api-design-principles`
80
80
  - `aws-serverless`
81
81
  - `brainstorming`
82
+ - `caveman`
82
83
  - `cognitive-doc-design`
83
84
  - `error-handling-patterns`
84
85
  - `frontend-design`
@@ -90,6 +91,7 @@ AKILI-SPECS is a constitution-first, spec-driven methodology for AI-assisted dev
90
91
  - `react-doctor`
91
92
  - `seo-audit`
92
93
  - `shadcn-ui`
94
+ - `software-architect`
93
95
  - `stitch-design`
94
96
  - `systematic-debugging`
95
97
  - `tailwind-design-system`
@@ -136,9 +138,13 @@ Run the `init` command to launch the interactive setup wizard, which will ask yo
136
138
  npx akili-specs init
137
139
  ```
138
140
 
141
+ > **Using pnpm?** Every `npx akili-specs …` command in this guide works as `pnpm dlx akili-specs …`. The package lives on the npm registry, which pnpm consumes directly — no extra setup for one-off runs.
142
+
139
143
  **Manual Installation via Flags:**
140
144
 
141
- Install globally for Claude (default):
145
+ Install without `--tool` the installer **auto-detects targets already installed on disk**
146
+ (`~/.claude`, `~/.config/opencode`, `~/.gemini`) and acts on all of them; on a first-time run with
147
+ nothing installed it defaults to Claude:
142
148
 
143
149
  ```bash
144
150
  npx akili-specs install
@@ -242,6 +248,15 @@ akili install --tool opencode
242
248
  akili doctor --tool opencode
243
249
  ```
244
250
 
251
+ With pnpm (requires a one-time `pnpm setup` so `PNPM_HOME` is on your `PATH`):
252
+
253
+ ```bash
254
+ pnpm add -g akili-specs
255
+ akili install
256
+ ```
257
+
258
+ `akili update` detects which package manager owns the installation (npm or pnpm) and runs the matching update command.
259
+
245
260
  ### Install Paths
246
261
 
247
262
  Default targets:
@@ -810,7 +825,9 @@ selector), and `/akili-constitution` scaffolds a `## Model Routing` registry int
810
825
 
811
826
  Key principles: **ARCHITECT = BUILDER** (the model that designs also builds), **author ≠ auditor**
812
827
  (the Reviewer runs on a different model than the Implementer), reserve deep-reasoning models for
813
- `/akili-propose` and `/akili-validate`, and use fast/cheap models for the tasks split and `/akili-archive`.
828
+ `/akili-propose`, `/akili-specify` (including the `tasks.md` decomposition), `/akili-validate`, and
829
+ the `/akili-execute`/`/akili-test` Leader, and use fast/cheap models only for `/akili-archive` and
830
+ pure setup/formatting steps. An **Effort dial** adds a second, per-task dimension on top of the tier.
814
831
 
815
832
  See **[docs/model-routing.md](docs/model-routing.md)** for the tiers, the full phase→tier mapping,
816
833
  and the default registry for Claude Code (PRO) and OpenCode Go.
package/bin/akili.js CHANGED
@@ -476,26 +476,41 @@ function installTool(tool, args) {
476
476
  return { rootPath, installed, overwritten, skipped, cleaned };
477
477
  }
478
478
 
479
+ // Package managers to probe, preferring the one that invoked this process
480
+ // (npm/pnpm/yarn set npm_config_user_agent when running bins via npx / pnpm dlx / exec).
481
+ function packageManagerOrder() {
482
+ const ua = process.env.npm_config_user_agent || "";
483
+ return ua.startsWith("pnpm") ? ["pnpm", "npm"] : ["npm", "pnpm"];
484
+ }
485
+
486
+ // Detect how akili-specs is installed: { type: "global" | "local" | "npx", pm: "npm" | "pnpm" }.
487
+ // pnpm keeps its own global tree, so each manager must be probed separately.
479
488
  function detectInstallType() {
480
- try {
481
- const globalList = execSync("npm list -g akili-specs --depth=0 2>/dev/null", { encoding: "utf8" });
482
- if (globalList.includes("akili-specs")) return "global";
483
- } catch (e) {}
489
+ const managers = packageManagerOrder();
484
490
 
485
- try {
486
- const localList = execSync("npm list akili-specs --depth=0 2>/dev/null", { encoding: "utf8" });
487
- if (localList.includes("akili-specs")) return "local";
488
- } catch (e) {}
491
+ for (const pm of managers) {
492
+ try {
493
+ const globalList = execSync(`${pm} list -g akili-specs --depth=0 2>/dev/null`, { encoding: "utf8" });
494
+ if (globalList.includes("akili-specs")) return { type: "global", pm };
495
+ } catch (e) {}
496
+ }
489
497
 
490
- return "npx";
498
+ for (const pm of managers) {
499
+ try {
500
+ const localList = execSync(`${pm} list akili-specs --depth=0 2>/dev/null`, { encoding: "utf8" });
501
+ if (localList.includes("akili-specs")) return { type: "local", pm };
502
+ } catch (e) {}
503
+ }
504
+
505
+ return { type: "npx", pm: managers[0] };
491
506
  }
492
507
 
493
508
  // Resolve the installed akili-specs package directory (global or local) after an update.
494
509
  // Returns the absolute path to the package root, or null if it cannot be found.
495
- function resolveInstalledPackageDir(installType) {
510
+ function resolveInstalledPackageDir(install) {
496
511
  try {
497
512
  const root = execSync(
498
- installType === "global" ? "npm root -g 2>/dev/null" : "npm root 2>/dev/null",
513
+ install.type === "global" ? `${install.pm} root -g 2>/dev/null` : `${install.pm} root 2>/dev/null`,
499
514
  { encoding: "utf8" }
500
515
  ).trim();
501
516
  if (root) {
@@ -592,32 +607,39 @@ function printUpdateChangeSummary(packageDir, fromVersion, toVersion) {
592
607
  }
593
608
 
594
609
  function runUpdate(args) {
595
- const installType = detectInstallType();
610
+ const install = detectInstallType();
596
611
 
597
- console.log(`\n${colors.cyan}Detected installation type: ${installType}${colors.reset}`);
612
+ console.log(
613
+ `\n${colors.cyan}Detected installation type: ${install.type}${install.type === "npx" ? "" : ` (${install.pm})`}${colors.reset}`
614
+ );
598
615
 
599
- if (installType === "npx") {
600
- console.log(`\n${colors.yellow}You are running via npx. No persistent installation to update.${colors.reset}`);
601
- console.log(`To install globally: ${colors.cyan}npm install -g akili-specs${colors.reset}`);
602
- console.log(`To install locally: ${colors.cyan}npm install akili-specs${colors.reset}`);
616
+ if (install.type === "npx") {
617
+ console.log(`\n${colors.yellow}You are running via a package runner (npx / pnpm dlx). No persistent installation to update.${colors.reset}`);
618
+ console.log(`To install globally: ${colors.cyan}npm install -g akili-specs${colors.reset} or ${colors.cyan}pnpm add -g akili-specs${colors.reset}`);
619
+ console.log(`To install locally: ${colors.cyan}npm install akili-specs${colors.reset} or ${colors.cyan}pnpm add akili-specs${colors.reset}`);
603
620
  return;
604
621
  }
605
622
 
606
623
  // Capture the version before updating so we can show what changed afterward.
607
624
  const versionBefore = currentVersion;
608
625
 
609
- console.log(`\n${colors.yellow}Updating npm package...${colors.reset}`);
626
+ console.log(`\n${colors.yellow}Updating package via ${install.pm}...${colors.reset}`);
627
+
628
+ const updateCommand =
629
+ install.pm === "pnpm"
630
+ ? install.type === "global"
631
+ ? "pnpm add -g akili-specs@latest"
632
+ : "pnpm add akili-specs@latest"
633
+ : install.type === "global"
634
+ ? "npm install -g akili-specs@latest"
635
+ : "npm install akili-specs@latest";
610
636
 
611
637
  try {
612
- if (installType === "global") {
613
- execSync("npm install -g akili-specs@latest", { stdio: "inherit" });
614
- } else {
615
- execSync("npm install akili-specs@latest", { stdio: "inherit" });
616
- }
638
+ execSync(updateCommand, { stdio: "inherit" });
617
639
 
618
- console.log(`\n${colors.green}npm package updated successfully.${colors.reset}`);
640
+ console.log(`\n${colors.green}Package updated successfully via ${install.pm}.${colors.reset}`);
619
641
  } catch (e) {
620
- console.error(`\n${colors.red}Failed to update npm package.${colors.reset}`);
642
+ console.error(`\n${colors.red}Failed to update package (ran: ${updateCommand}).${colors.reset}`);
621
643
  process.exit(1);
622
644
  }
623
645
 
@@ -628,18 +650,19 @@ function runUpdate(args) {
628
650
  // After reinstalling, read the freshly installed version and show the changelog
629
651
  // between the old and new versions. The running process still has the old code
630
652
  // loaded, so we read version + CHANGELOG from the installed package on disk.
631
- const packageDir = resolveInstalledPackageDir(installType);
653
+ const packageDir = resolveInstalledPackageDir(install);
632
654
  const versionAfter = packageDir ? readInstalledVersion(packageDir) : null;
633
655
  printUpdateChangeSummary(packageDir, versionBefore, versionAfter);
634
656
 
635
657
  console.log(`\n${colors.cyan}${"─".repeat(56)}${colors.reset}`);
636
658
  console.log(`${colors.cyan}Update Summary${colors.reset}`);
659
+ const installLabel = `${install.type} install via ${install.pm}`;
637
660
  if (versionAfter && versionAfter !== versionBefore) {
638
- console.log(` Package: ${versionBefore} → ${colors.green}${versionAfter}${colors.reset} (${installType} install)`);
661
+ console.log(` Package: ${versionBefore} → ${colors.green}${versionAfter}${colors.reset} (${installLabel})`);
639
662
  } else if (versionAfter) {
640
- console.log(` Package: already up to date at ${colors.green}v${versionAfter}${colors.reset} (${installType} install)`);
663
+ console.log(` Package: already up to date at ${colors.green}v${versionAfter}${colors.reset} (${installLabel})`);
641
664
  } else {
642
- console.log(` Package: updated from v${versionBefore} (${installType} install; new version could not be read)`);
665
+ console.log(` Package: updated from v${versionBefore} (${installLabel}; new version could not be read)`);
643
666
  }
644
667
  const updatedTools = args.resolvedTools || selectedTools(args);
645
668
  console.log(` Files: reinstalled with --force for ${updatedTools.join(", ")}${args.autoDetected ? " (auto-detected)" : ""} (see Install Summary above)`);
package/docs/cli.md CHANGED
@@ -26,7 +26,10 @@ npx akili-specs install --tool both
26
26
  npx akili-specs install --tool all
27
27
  ```
28
28
 
29
- Claude is the default target:
29
+ When `--tool` is omitted, `install`, `update`, and `doctor` **auto-detect already-installed
30
+ targets** on disk (`~/.claude`, `~/.config/opencode`, `~/.gemini`) and act on all of them — so a
31
+ bare `akili update` refreshes every installed tool, not just Claude. A first-time run with nothing
32
+ installed defaults to Claude. An explicit `--tool <name>` always wins:
30
33
 
31
34
  ```bash
32
35
  npx akili-specs install
@@ -39,6 +42,8 @@ npm install -g akili-specs
39
42
  akili install --tool all
40
43
  ```
41
44
 
45
+ pnpm works everywhere npm does: `pnpm dlx akili-specs …` for one-off runs, `pnpm add -g akili-specs` for a global install (after a one-time `pnpm setup`).
46
+
42
47
  To install directly into the local project workspace instead of globally, use the `--local` flag:
43
48
 
44
49
  ```bash
@@ -51,7 +56,7 @@ akili install --tool both --local
51
56
  |---|---|
52
57
  | `akili init` | Interactive setup wizard for installation |
53
58
  | `akili install` | Install commands, skills, and helper resources |
54
- | `akili update` | Update the npm package to the latest version, reinstall files, and print a changelog summary of what changed |
59
+ | `akili update` | Update the package to the latest version (via the package manager that owns the install — npm or pnpm), reinstall files, and print a changelog summary of what changed |
55
60
  | `akili list` | List packaged commands, skills, and helper resources |
56
61
  | `akili doctor` | Check whether expected files are installed |
57
62
  | `akili help` | Show help |
@@ -67,6 +72,7 @@ Every command closes with a clear end-of-run summary:
67
72
 
68
73
  | Option | Applies To | Purpose |
69
74
  |---|---|---|
75
+ | *(no `--tool`)* | install, update, doctor | **Auto-detect installed targets** and act on all of them; default to Claude when none found |
70
76
  | `--tool claude` | install, update, doctor | Target Claude Code config |
71
77
  | `--tool opencode` | install, update, doctor | Target OpenCode config |
72
78
  | `--tool antigravity` | install, update, doctor | Target Google Antigravity config |
@@ -1,6 +1,6 @@
1
1
  # Command Reference
2
2
 
3
- AKILI commands are installed as slash-command prompts for Claude Code and OpenCode. The installable source files live in `.claude/commands/`.
3
+ AKILI commands are installed as slash-command prompts for Claude Code, OpenCode, and Google Antigravity (as workflows). The installable source files live in `.claude/commands/`.
4
4
 
5
5
  ## Command Map
6
6
 
@@ -87,6 +87,7 @@ model than the Implementer (author ≠ tester).
87
87
  | `/akili-validate` | T3 | Deep conformance audit. |
88
88
  | `/akili-audit` | T4 + T3 | Drift detection over large context, judged critically. |
89
89
  | `/akili-archive` | T5 | Cheap, fast summarization of closed work. (Kaizen Learn sub-step: T3 optional.) |
90
+ | `/akili-resume` | T5 | File scanning + dashboard summarization — reasoning depth is not the bottleneck. |
90
91
  | `/akili-seo` | T3 + T5 | Audit findings (T3) plus setup/formatting steps (T5). |
91
92
 
92
93
  **author ≠ auditor enforcement.** In the registry, T2 (Coder) and T3 (Auditor) must resolve to
@@ -130,7 +131,7 @@ unchanged (e.g. when the top family moves from one generation to the next, `opus
130
131
  Users on plans that expose a frontier model above Opus (Fable 5 / Mythos 5) can pin it for T1/T3 —
131
132
  see **Frontier escalation tier** below.
132
133
 
133
- **OpenCode Go.** The two strongest open models anchor the two highest-leverage tiers:
134
+ **OpenCode Go.** The strongest open models anchor the highest-leverage tiers:
134
135
 
135
136
  - **GLM-5.2 → T2 Coder.** A-tier open coder (753B, GPQA 91.2), successor to GLM-5.1, purpose-built
136
137
  for long autonomous coding runs — the recommended **default OpenCode workhorse**. (This row was
@@ -0,0 +1,79 @@
1
+ # Proposal: Delegation Thresholds + Execution Review Lenses
2
+
3
+ **Status:** Implemented (2026-07-24) — shipped in the release following v2.12.0; see `CHANGELOG.md` → Unreleased
4
+ **Date:** 2026-07-24
5
+ **Author:** Leader session (reviewed against `gentle-ai` orchestrator→minion pattern)
6
+
7
+ Adopt two practices observed in a convergent SDD methodology (`gentle-ai` / `sdd-orchestrator`) that AKILI-SPECS currently lacks: **quantified inline-vs-delegate thresholds** for the orchestrating agent, and **concrete review lenses (4R)** layered onto the execution Reviewer. Both are additive — no existing gate, loop guardrail, or persona contract changes.
8
+
9
+ ## Decision summary
10
+
11
+ | # | Change | Where it lands | Risk |
12
+ |---|--------|----------------|------|
13
+ | 1 | Delegation Thresholds rule block | `.claude/templates/leader.md`, `/akili-execute`, `/akili-specify`, `/akili-constitution`, `/akili-audit` | Low — codifies existing instinct as numbers |
14
+ | 2 | 4R review lenses (readability, reliability, resilience, risk) | `.claude/templates/reviewer.md`, `/akili-execute` Step 2.3, `/akili-validate` | Low–medium — widens Reviewer scope; mitigated by keeping spec-conformance as the only blocking gate by default |
15
+
16
+ ## 1. Delegation Thresholds
17
+
18
+ ### Problem
19
+
20
+ The Leader triad in `/akili-execute` always delegates, but the methodology gives no numeric guidance for the orchestrator's *own* work in research-heavy commands (`/akili-constitution`, `/akili-specify`, `/akili-audit`). Today the orchestrating agent reads everything inline, polluting its context — exactly the "mega agente leyendo todo" anti-pattern.
21
+
22
+ ### Proposed rule block
23
+
24
+ Add a shared **Delegation Thresholds** section (single source of truth in `.claude/templates/leader.md`, referenced — not copied — by the commands):
25
+
26
+ | Situation | Action |
27
+ |-----------|--------|
28
+ | 1 file, quick check, `git status`, puntual verification | Inline — do it yourself |
29
+ | Research requires reading **4+ files** | Spawn a scout/Explore subagent with fresh context; consume its conclusions, not the file dumps |
30
+ | Writing **2+ non-trivial files** | Spawn an Implementer (already the rule inside `/akili-execute`; now explicit everywhere) |
31
+ | Tests/builds | Subagent (`/akili-test` already complies) |
32
+ | Review of a diff/PR | Fresh-context Reviewer, diff-only input (already the rule; restated here for completeness) |
33
+ | Parallel writers | Only for fully independent tasks; isolated worktrees if the tool supports them (existing Step 1.4 rule, unchanged) |
34
+
35
+ ### Rationale
36
+
37
+ - Cheap, actionable heuristic: the agent doesn't have to judge "is my context getting big?" — it counts files.
38
+ - CodeGraph note: in codegraph-enabled projects, a `codegraph_context`/`codegraph_search` lookup does **not** count toward the 4-file threshold — that is precisely what the graph is for. The threshold counts full-file reads.
39
+
40
+ ## 2. Execution Review Lenses (4R)
41
+
42
+ ### Problem
43
+
44
+ The execution Reviewer audits **spec conformance** only. That is stronger than a generic reviewer on traceability, but mono-lens: a diff can pass spec conformance while being unreadable, fragile, or risky. `judgment-day` covers multi-perspective review, but only at design time (`/akili-specify`), not at execution time.
45
+
46
+ ### Proposed design
47
+
48
+ Two modes, selected by the existing **effort dial** — no new configuration surface:
49
+
50
+ | Mode | When | Mechanics |
51
+ |------|------|-----------|
52
+ | **Lens checklist** (default) | Effort `low`/`medium`/`high` | The single Reviewer's brief adds a 4R checklist — readability, reliability, resilience, risk — reported as advisory findings. **Spec conformance remains the only PASS/FAIL gate.** 4R findings that are not spec violations go to `execution.md` as `ADVISORY`, never trigger a rework attempt |
53
+ | **Parallel lens reviewers** | Effort `xhigh`/`max`, or task tagged security/migration/data-loss | Spawn 2–4 lens-scoped Reviewers in parallel (each gets the diff + one lens). Any lens may return FAIL; the Leader adjudicates whether a lens FAIL is in-scope for the task before consuming a rework attempt |
54
+
55
+ ### Guardrails (why this won't bloat the loop)
56
+
57
+ - Advisory findings never consume rework attempts — the 3-attempt ceiling still binds to spec conformance only.
58
+ - Parallel mode is opt-in via the effort dial, which the Leader already sets per task; no default token-cost increase.
59
+ - The Reviewer stays read-only and diff-only; lenses change *what it looks for*, not *what it receives*.
60
+
61
+ ## Out of scope
62
+
63
+ - No change to `judgment-day` (design-time review is already multi-perspective).
64
+ - No change to the rework loop structure, FATAL_FAIL, or Pivot Protocol.
65
+ - No new agent personas — lenses are briefs, not files.
66
+
67
+ ## Implementation checklist
68
+
69
+ - [x] Add **Delegation Thresholds** section to `.claude/templates/leader.md` (source of truth).
70
+ - [x] Reference the thresholds from `/akili-execute` (Multi-Agent Triad section), `/akili-specify`, `/akili-constitution`, `/akili-audit` (research steps).
71
+ - [x] Add 4R lens checklist + `ADVISORY` output contract to `.claude/templates/reviewer.md`.
72
+ - [x] Update `/akili-execute` Step 2.3 with the two-mode lens table and effort-dial trigger.
73
+ - [x] Update `/akili-validate` to include 4R advisory reporting in its final audit (Phase 5 sweep + report section 7).
74
+ - [x] `CHANGELOG.md` → `Unreleased` entry (methodology change → next release is **minor**).
75
+ - [ ] Smoke: run `/akili-execute` on a sample spec and confirm ADVISORY findings land in `execution.md` without consuming attempts (pending first real-project run).
76
+
77
+ ## Next step
78
+
79
+ Live-fire smoke on the next real `/akili-execute` run, then release as part of the next **minor** version.
@@ -10,7 +10,7 @@ The skill set is **curated, not accumulated**: every skill declares its original
10
10
  |---|---|
11
11
  | `core` | Hard-wired to a precise command step — the command loads it by name |
12
12
  | `conditional` | Loaded when the work touches its domain (UI, animation) |
13
- | `stack` | Selected per project via the `## Skill Map` scaffolded by `/akili-constitution`; never hardcoded in command text |
13
+ | `stack` | Selected per project via the `## Skill Map` scaffolded by `/akili-constitution`; never load-directed in command text (candidate-pool lists in the Skill Map builder and Skill-Map-deferring examples are documented carve-outs — see `governance.md`) |
14
14
 
15
15
  ## Skill Inventory
16
16
 
@@ -26,7 +26,7 @@ Rules of thumb:
26
26
 
27
27
  - A skill earns `core` only when a command step would be *wrong* without it (a retrospective without `kaizen` is not the AKILI archive).
28
28
  - `conditional` skills are stack-agnostic capabilities that many but not all specs need (UI, animation).
29
- - `stack` skills must never be hard-referenced in command text — commands stay tool- and framework-agnostic. They reach the agent through the project Skill Map and per-task skill lists.
29
+ - `stack` skills must never be **load-directed** in command text (a command step telling the agent to load a named stack skill) — commands stay tool- and framework-agnostic. They reach the agent through the project Skill Map and per-task skill lists. **Three documented carve-outs:** (1) the Skill Map *builder* in `/akili-constitution` (Step 8D, and the Step 5 TRD bootstrap that feeds it — constitution runs *before* the map exists) may enumerate the packaged stack skills as the candidate pool it selects from; (2) an explicit **no-map fallback list** that defers to the Skill Map first ("prefer the `## Skill Map` when it exists; otherwise pick from: …") is acceptable; (3) purely *illustrative* examples ("e.g. `nestjs-expert`") that explicitly defer to the task list / Skill Map are acceptable. A step that says "use these skills:" followed by stack-skill names, with **no** Skill Map deferral, is a violation.
30
30
 
31
31
  ## Frontmatter Schema
32
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akili-specs",
3
- "version": "2.11.0",
3
+ "version": "2.13.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": {