akili-specs 2.4.2 → 2.5.1

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.
@@ -1,6 +1,6 @@
1
1
  # `/akili-test`
2
2
 
3
- Run or create tests for a spec path and produce requirement-level evidence.
3
+ Run or create tests for a spec path and produce requirement-level evidence, using the AKILI **Leader → Tester(s)** multi-agent harness.
4
4
 
5
5
  ## Usage
6
6
 
@@ -14,6 +14,17 @@ Run or create tests for a spec path and produce requirement-level evidence.
14
14
  - You need a requirement-to-test matrix.
15
15
  - Manual gaps must be documented explicitly.
16
16
 
17
+ ## Multi-Agent Harness
18
+
19
+ The main session acts as the **Leader** (orchestrator). It partitions testing into suites (backend unit, frontend unit, integration, E2E) and delegates each to a focused **Tester** subagent defined in `.agents/tester.md`, then aggregates the structured reports.
20
+
21
+ - **Deployment Rule (token-aware):** Lite depth or a single trivial suite runs **inline** (no spawn); Standard/Full or multiple independent suites get **one Tester per suite**, spawned **in parallel** when they touch different files. Suites that share files run sequentially. The Leader picks the fewest spawns that keep each context small.
22
+ - **Thin context per Tester:** each Tester gets only its suite's requirements, scenarios, and test command — never the full spec set — and its context is discarded on completion, so per-suite contexts never accumulate.
23
+ - **Author ≠ tester:** Testers prefer a different model than the Implementer that wrote the code, reducing confirmation bias.
24
+ - Each Tester reports one status — `PASS`, `FAIL`, or `PRODUCT_BUG` — plus a per-scenario coverage slice. A `PRODUCT_BUG` keeps a correct test red instead of rewriting it to pass.
25
+
26
+ If `.agents/tester.md` is missing, run `/akili-constitution` first to scaffold it.
27
+
17
28
  ## Inputs
18
29
 
19
30
  Reads:
@@ -21,6 +32,7 @@ Reads:
21
32
  - `docs/specs/<spec-path>/requirements.md`
22
33
  - `docs/specs/<spec-path>/design.md`
23
34
  - `docs/specs/<spec-path>/tasks.md`
35
+ - `.agents/tester.md`
24
36
  - project-level constitution docs and agent guidance
25
37
 
26
38
  ## Outputs
@@ -48,9 +48,10 @@ docs/specs/<spec-path>/validation-report.md
48
48
  - task completion and execution notes
49
49
  - expected file existence
50
50
  - build, lint, and type-check integrity
51
- - requirement coverage
51
+ - requirement coverage — **reuses `test-report.md`** as the primary evidence (its requirement-to-test matrix and `PASS`/`FAIL`/`PRODUCT_BUG` verdicts) instead of re-deriving coverage; an unresolved `PRODUCT_BUG` forces a FAIL
52
52
  - test evidence summary
53
- - architecture and design conformance
53
+ - architecture and design conformance, including UI consistency with the proposal's **Visual Reference** (Figma or a generated mockup) when the spec was designed against one
54
+ - a lightweight **Agent Guide / Constitution Impact** check: if `execution.md` records module-boundary changes, confirm the child guides and the parent `## Module Guides` index are not stale (flagged WARN and left for `/akili-archive`)
54
55
  - UI/UX, API, security, accessibility, error handling, and observability as relevant
55
56
 
56
57
  ## Next Step
package/docs/flow.md CHANGED
@@ -61,6 +61,45 @@ You: /akili-audit
61
61
  AI: Scans codebase and detects drift against baselines, generating docs/specs/drift-report.md
62
62
  ```
63
63
 
64
+ ## Fast-Track for Trivial Changes
65
+
66
+ Not every change needs the full lifecycle. For a genuinely trivial, low-risk change — a button color, a title's text, a small paragraph — use `/akili-quick`:
67
+
68
+ ```text
69
+ You: /akili-quick login-button-color use the brand accent token on the primary login button
70
+ AI: ✓ checks the triviality gate (cosmetic/copy-only, no behavior/data/API/auth change,
71
+ ≤ ~20 LOC in one component, design-token safe)
72
+ ✓ makes the edit directly
73
+ ✓ runs a light verification (lint / type-check / existing test / manual note)
74
+ ✓ appends a one-line entry to docs/specs/quick/quick-log.md
75
+ ✓ commits with [SPEC:quick/login-button-color]
76
+ ```
77
+
78
+ If the change fails the gate (it has logic, touches data/API/auth, needs a new design token, or is bigger than a tweak), `/akili-quick` stops and escalates to `/akili-specify` (Lite) or `/akili-propose`. This keeps spec-to-code traceability intact while sparing small changes the full flow.
79
+
80
+ ## Handling Bugs
81
+
82
+ Bugs are **not** treated exactly like normal changes — a bug starts from a *symptom*, not an *intent*, so the root cause must be understood before a fix is proposed. AKILI does this without a separate command: `/akili-propose` classifies the request and, when it detects a bug, follows the **Bug Track**.
83
+
84
+ ```text
85
+ You: /akili-propose checkout-total-wrong the cart total is off by one item after removing a product
86
+ AI: ✓ classifies this as a Bug (records Type: Bug)
87
+ ✓ loads systematic-debugging
88
+ ✓ captures: observed symptom, reproduction steps, CONFIRMED root cause, impact/scope
89
+ ✓ recommends a fix strategy and the route
90
+
91
+ You: /akili-specify bugfix/checkout-total-wrong
92
+ AI: runs in Bug Mode — frames requirements around the corrected behavior and REQUIRES a
93
+ regression test (red before the fix, green after) as a mandatory task
94
+ ```
95
+
96
+ Routing by size:
97
+
98
+ - **Cosmetic bug** (e.g. a visible typo, wrong static label) → `/akili-quick`.
99
+ - **Bug with logic/behavior** → `/akili-propose` (diagnose) → `/akili-specify` Bug Mode (fix + regression test) → `/akili-execute` → `/akili-test` → `/akili-validate`.
100
+
101
+ The regression test is the non-negotiable evidence that the bug is actually fixed and stays fixed. `/akili-validate` then carries any unresolved `PRODUCT_BUG` from the test evidence through as a FAIL.
102
+
64
103
  ## Project Modes
65
104
 
66
105
  `/akili-constitution` begins by classifying the repository into one of three modes. Each mode adjusts how aggressively the constitution drafts, scans, or preserves existing material — and how the project `.agents/` harness is scaffolded.
@@ -113,11 +152,12 @@ Use the lightest documentation that still makes the work clear and verifiable.
113
152
 
114
153
  | Depth | Use For | Capture |
115
154
  |---|---|---|
155
+ | Quick (`/akili-quick`) | Genuinely trivial cosmetic/copy changes (button color, title text, small paragraph) | No spec docs — a one-line `quick-log.md` entry + `[SPEC:quick/<name>]` commit; escalates if not trivial |
116
156
  | Lite | Small bugfixes, copy updates, narrow UI tweaks | Problem, scenario, focused task, verification command |
117
157
  | Standard | Normal features and enhancements | Requirements, scenarios, design decisions, tasks, tests |
118
158
  | Full | Risky, cross-cutting, API, data, auth, migration, or SEO work | Alternatives, rollout, risks, observability, rollback, explicit traceability |
119
159
 
120
- Lite mode does not skip rigor. Requirements still need scenarios, tasks still need done criteria, and validation still needs evidence.
160
+ Lite mode does not skip rigor. Requirements still need scenarios, tasks still need done criteria, and validation still needs evidence. `/akili-quick` is the only path that skips the spec documents — gated to genuinely trivial changes, and it auto-escalates anything larger to `/akili-specify` (Lite) or `/akili-propose`.
121
161
 
122
162
  ## Spec Folder Shape
123
163
 
@@ -186,7 +226,7 @@ Rather than manually compiling assertion results during `/akili-test`:
186
226
  1. Execute tests outputting to JSON (e.g. `jest --json --outputFile=jest-results.json` or `vitest --reporter=json`).
187
227
  2. Run `node <path-to-akili>/scripts/parse_tests.js jest-results.json` to generate the AKILI matrix table automatically for inclusion inside `test-report.md`.
188
228
 
189
- ### 6. Multi-Agent Harness (`/akili-execute` Triad)
229
+ ### 6. Multi-Agent Harness (`/akili-execute` Triad and `/akili-test` Testers)
190
230
 
191
231
  `/akili-execute` is implemented as a multi-agent orchestration rather than a single-agent script. The Leader role does not write production code; it delegates implementation and audit to two subordinate roles, then enforces a strict PASS/FAIL gate before the task advances.
192
232
 
@@ -230,6 +270,19 @@ if 3 consecutive FAILs → HALT, mark task [~], present audit trail
230
270
 
231
271
  The `.agents/` directory is pure Markdown + YAML frontmatter and is resolved relative to the active workspace, so the harness runs under Claude Code, OpenCode, and Google Antigravity. Antigravity invokes `invoke_subagent` with prompts read from `.agents/`; Claude Code and OpenCode delegate via sub-prompt contexts seeded with the persona files.
232
272
 
273
+ **`/akili-test` — Leader → Tester(s):**
274
+
275
+ `/akili-test` uses the same Leader pattern with a fourth persona, `.agents/tester.md`, and a token-aware **Deployment Rule**. The Leader partitions testing into suites (backend unit, frontend unit, integration, E2E) and decides how many Testers to spawn:
276
+
277
+ | Situation | Action |
278
+ |---|---|
279
+ | Lite depth or a single trivial suite | Run **inline** — no spawn (cheaper than delegating) |
280
+ | Standard/Full with one substantial suite | One Tester |
281
+ | Multiple **independent** suites | One Tester per suite, **in parallel** |
282
+ | Suites sharing files/fixtures | Testers run sequentially |
283
+
284
+ Each Tester gets only its suite's requirements, scenarios, and test command (never the full spec set), runs a bounded 3-attempt self-correction inner loop, and returns `STATUS: PASS`, `STATUS: FAIL`, or `STATUS: PRODUCT_BUG` — keeping a correct test red on a genuine product defect instead of rewriting it to pass. The Leader aggregates the per-suite coverage slices into the `test-report.md` requirement-to-test matrix. Ideally a Tester runs on a different model than the Implementer that wrote the code (author ≠ tester).
285
+
233
286
  ### 7. Capability-Tier Model Routing
234
287
 
235
288
  Each AKILI-SPECS phase has a different dominant demand, so AKILI routes phases to models by **capability
@@ -240,10 +293,11 @@ T4 Context-Ingest, T5 Fast-Cheap, T6 Multimodal** — map to the phases:
240
293
  |---|---|
241
294
  | `/akili-constitution` | T4 + T1 |
242
295
  | `/akili-propose`, `/akili-specify` (requirements/design) | T1 |
296
+ | `/akili-quick` | T2 |
243
297
  | `/akili-specify` (tasks) | T5 |
244
298
  | `/akili-specify` (UX/UI design) | T6 |
245
299
  | `/akili-execute` Leader / Implementer / Reviewer | T5 / T2 / T3 |
246
- | `/akili-test` | T2 |
300
+ | `/akili-test` Leader / Tester(s) | T5 / T2 |
247
301
  | `/akili-validate` | T3 |
248
302
  | `/akili-audit` | T4 + T3 |
249
303
  | `/akili-archive` | T5 |
@@ -47,19 +47,22 @@ tier per phase (which would defeat the abstraction and churn on every model rele
47
47
 
48
48
  The `/akili-execute` triad is split because each role has a different demand — and because
49
49
  author ≠ auditor makes the Implementer/Reviewer split a **correctness constraint**, not a
50
- preference.
50
+ preference. `/akili-test` is split the same way: a cheap Leader orchestrates while T2 Testers author
51
+ the suites, and a Tester ideally runs on a different model than the Implementer (author ≠ tester).
51
52
 
52
53
  | Phase / Role | Tier(s) | Why |
53
54
  |---|---|---|
54
55
  | `/akili-constitution` | T4 + T1 | Ingest legacy code (long context), then reason to synthesize the baseline. |
55
56
  | `/akili-propose` | T1 | Architecture and trade-offs — reserve the deep reasoner. |
57
+ | `/akili-quick` | T2 | A small, direct edit + light verification — no deep reasoning needed. |
56
58
  | `/akili-specify` → requirements.md / design.md | T1 | Heavy reasoning + technical writing. |
57
59
  | `/akili-specify` → tasks.md | T5 | Fast structured partitioning into tickets. |
58
60
  | `/akili-specify` → UX/UI design | T6 | Only when visual design is in scope. |
59
61
  | `/akili-execute` → **Leader** | T5 | Orchestration / instruction-following — writes no code. |
60
62
  | `/akili-execute` → **Implementer** | T2 | Maximum coding. Shares the workhorse family with propose (ARCHITECT = BUILDER). |
61
63
  | `/akili-execute` → **Reviewer** | T3 | Independent audit. **MUST resolve to a different model than the Implementer.** |
62
- | `/akili-test` | T2 | Test authoring + verification. |
64
+ | `/akili-test` → **Leader** | T5 | Orchestration partitions suites and delegates; writes no tests. |
65
+ | `/akili-test` → **Tester(s)** | T2 | Test authoring + verification per suite. Prefer a different model than the Implementer (author ≠ tester). |
63
66
  | `/akili-validate` | T3 | Deep conformance audit. |
64
67
  | `/akili-audit` | T4 + T3 | Drift detection over large context, judged critically. |
65
68
  | `/akili-archive` | T5 | Cheap, fast summarization of closed work. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akili-specs",
3
- "version": "2.4.2",
3
+ "version": "2.5.1",
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": {