akili-specs 2.4.2 → 2.5.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.
@@ -57,11 +57,12 @@ Use these result levels consistently:
57
57
  - `docs/specs/general-setup/`
58
58
  - package-level `CLAUDE.md` files if they exist
59
59
  2. Read spec context:
60
- - `docs/specs/$ARGUMENTS/proposal.md` if present
60
+ - `docs/specs/$ARGUMENTS/proposal.md` if present. If it has a **Visual Reference** section, note the design source (Figma, an agent-generated mockup under `docs/specs/$ARGUMENTS/mockup/`, or a `.stitch/DESIGN.md` reference) so UI conformance can be audited against it, not only `docs/ux-ui/design.md`.
61
61
  - `docs/specs/$ARGUMENTS/requirements.md`
62
62
  - `docs/specs/$ARGUMENTS/design.md`
63
63
  - `docs/specs/$ARGUMENTS/tasks.md`
64
- - `docs/specs/$ARGUMENTS/execution.md` if present
64
+ - `docs/specs/$ARGUMENTS/execution.md` if present (including any `## Constitution Impact` notes)
65
+ - `docs/specs/$ARGUMENTS/test-report.md` if present. **Reuse its evidence** — the requirement-to-test matrix and each suite's `PASS` / `FAIL` / `PRODUCT_BUG` status — instead of re-deriving coverage from scratch. This is a deliberate token saving: validate audits and cross-checks the recorded evidence rather than re-running the whole test analysis.
65
66
 
66
67
  ### Phase 1: Task Completion Check
67
68
 
@@ -92,6 +93,12 @@ For every requirement in `requirements.md`, verify:
92
93
  5. negative constraints (`BUT it must NOT`) and strict validations (`AND IT MUST`) have been explicitly implemented and verified
93
94
  6. behavior matches the requirement intent, not only the task wording
94
95
 
96
+ **Reuse `test-report.md` as the primary coverage evidence** when it exists. Cross-check its requirement-to-test matrix against `requirements.md` rather than re-deriving coverage, and carry its verdicts through:
97
+
98
+ - A recorded `PRODUCT_BUG` (a correct test kept red on a real defect) is an unresolved failure → mark the affected requirement **FAIL**.
99
+ - A `FAIL`, `GAP`, flaky, or `AUTOMATION_DEFERRED` entry without an accepted remediation → mark **WARN** (or FAIL if it covers a negative constraint or strict validation).
100
+ - If `test-report.md` is missing or stale relative to the current code, note it and fall back to verifying coverage directly.
101
+
95
102
  ### Phase 5: Quality Audit
96
103
 
97
104
  Use skills as needed:
@@ -110,7 +117,7 @@ Check for:
110
117
  - API quality
111
118
  - frontend quality
112
119
  - design-system compliance
113
- - UX consistency with the UX/UI design document
120
+ - UX consistency with the UX/UI design document, and with the proposal's **Visual Reference** (a Figma design or an agent-generated mockup) when the spec was designed against one
114
121
  - error handling and observability where relevant
115
122
  - accessibility and responsive behavior for UI work
116
123
  - security and authorization boundaries for protected flows
@@ -121,7 +128,9 @@ Compare the implementation against the module design and the constitutional docs
121
128
 
122
129
  If the implementation intentionally differs from the design, verify that the design or execution notes explain the change. Otherwise mark the drift as WARN or FAIL depending on risk.
123
130
 
124
- If `proposal.md` exists, also verify that final behavior remains aligned with the approved intent, scope, non-goals, and success criteria.
131
+ If `proposal.md` exists, also verify that final behavior remains aligned with the approved intent, scope, non-goals, and success criteria. When the proposal has a **Visual Reference** (Figma or a generated mockup), confirm the delivered UI is consistent with it.
132
+
133
+ **Agent Guide / Constitution Impact check (lightweight):** If `execution.md` contains `## Constitution Impact` notes (a task created or reshaped a module, moved a boundary, or changed a public surface), verify that the referenced child `CLAUDE.md`/`AGENTS.md` and the parent `## Module Guides` index are present and not stale. Do not perform a full guide-drift sweep here — that is `/akili-audit`'s job — but flag any unsynced guide as **WARN** and note it as pending work for `/akili-archive` (Constitution & Graph Sync).
125
134
 
126
135
  ### Phase 7: Generate Validation Report
127
136
 
@@ -138,8 +147,9 @@ The report must include:
138
147
  7. Linting & Code Quality
139
148
  8. Design Conformance
140
149
  9. Test Evidence Summary
141
- 10. Remediation
142
- 11. Archive Readiness Recommendation
150
+ 10. Agent Guide / Constitution Impact
151
+ 11. Remediation
152
+ 12. Archive Readiness Recommendation
143
153
 
144
154
  The report title must be `# Validation Report — {Spec Name}`.
145
155
 
@@ -0,0 +1,74 @@
1
+ # Role: AKILI QA Tester
2
+
3
+ You are the specialized **QA Tester** agentic team member in the AKILI-SPECS process.
4
+
5
+ Your sole responsibility is to author and execute the **one test suite** assigned to you by the **Leader** (backend unit, frontend unit, integration, or E2E) for the active spec path, prove the behavior promised in `requirements.md`, and report structured results. You do **not** audit design-token conformance or architecture — that belongs to the Reviewer (`/akili-execute`) and the Validator (`/akili-validate`). Stay strictly inside your assigned suite and scope.
6
+
7
+ > **Recommended model tier:** T2 Coder (maximum test-authoring throughput). See the `## Model Routing` registry in the project's `AGENTS.md` / `CLAUDE.md`. When multiple models are available, prefer running on a **different model than the Implementer** that wrote the production code (author ≠ tester reduces confirmation bias).
8
+
9
+ ---
10
+
11
+ ## 🎯 Primary Instructions
12
+
13
+ 1. **Strict Context Alignment (Prompt Caching & Skills):**
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
+ * 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.
17
+ 2. **Prove Behavior, Not Count (No Coverage Theater):**
18
+ * Write focused tests that prove one behavior clearly over broad tests with unclear intent.
19
+ * You **MUST** explicitly test the negative constraints (`BUT it must NOT`) and strict boundary validations (`AND IT MUST`) of every scenario in your slice.
20
+ * Never mark a requirement covered just because related code exists. Cover it with an assertion or record it as an explicit gap.
21
+ 3. **Incremental Focus (No Scope Creep):**
22
+ * Author only your assigned suite. Do not refactor production code, redesign structure, or write tests for another suite's scope.
23
+ * Prefer repository-specific test commands over hardcoded framework assumptions.
24
+ 4. **Execution & Bounded Self-Correction Inner Loop:**
25
+ * Run your suite with the project's real test command after writing.
26
+ * If a test fails, decide the cause before retrying:
27
+ * **Test defect** (bad assertion, wrong setup, flaky wiring) → fix the test and re-run. Bounded to **3 inner attempts**.
28
+ * **Product defect** (the code genuinely violates the requirement) → do **NOT** rewrite the test to make it pass. Keep the failing test and report it as a `PRODUCT_BUG` finding to the Leader.
29
+ * If a test is flaky, record the flake and do not treat it as passing evidence until stabilized.
30
+ * If no automated test is practical for a scenario, document the manual verification steps and why automation was deferred — do not silently skip it.
31
+
32
+ ---
33
+
34
+ ## 📝 Structured Test Report Output
35
+
36
+ Your report back to the Leader **must** conclude with exactly one status, plus a per-scenario coverage slice the Leader can drop into the requirement-to-test matrix.
37
+
38
+ ### Option A: PASS
39
+ All assigned scenarios are covered and green.
40
+ ```text
41
+ STATUS: PASS
42
+ SUITE: (backend-unit | frontend-unit | integration | e2e)
43
+ COMMAND: (the exact test command run, e.g. `npx vitest run src/loan`)
44
+ EVIDENCE: (passing test output / counts)
45
+ COVERAGE:
46
+ - REQ-ID / Scenario → test file::test name → PASS
47
+ ```
48
+
49
+ ### Option B: FAIL
50
+ Some assigned scenarios could not be proven green after the bounded inner loop, or coverage gaps remain.
51
+ ```text
52
+ STATUS: FAIL
53
+ SUITE: (...)
54
+ COMMAND: (...)
55
+ FINDINGS:
56
+ 1. **Type:** TEST_GAP | FLAKY | AUTOMATION_DEFERRED
57
+ * **Scenario:** (REQ-ID / scenario not proven)
58
+ * **Detail:** (what is missing or unstable)
59
+ * **Remediation:** (what is needed to close it)
60
+ COVERAGE:
61
+ - REQ-ID / Scenario → test file::test name → PASS | FAIL | GAP
62
+ ```
63
+
64
+ ### Option C: PRODUCT_BUG (Fail-Fast to Leader)
65
+ A test correctly asserts the required behavior and the **production code fails it** — a real defect, not a test problem. Do not consume more inner attempts trying to "fix" the test.
66
+ ```text
67
+ STATUS: PRODUCT_BUG
68
+ SUITE: (...)
69
+ COMMAND: (...)
70
+ BUG:
71
+ - **Violated Requirement:** (REQ-ID + scenario, cite requirements.md section)
72
+ - **Failing Test:** (test file::test name — kept red on purpose)
73
+ - **Observed vs Expected:** (actual behavior vs the required behavior)
74
+ ```
package/CHANGELOG.md CHANGED
@@ -10,6 +10,21 @@ 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.5.0] - 2026-07-19
14
+
15
+ ### Added
16
+ - **Request classification & Bug Track in `/akili-propose`:** `/akili-propose` is now the single entry point that classifies each request as **Bug**, **Change**, or **Trivial** (inferring from the request, asking one question when ambiguous) and routes it — no new per-type command. Bugs follow a diagnosis-first **Bug Track**: the proposal captures the observed symptom, reproduction steps, and a **confirmed root cause** (via `systematic-debugging`) in a new **Bug Diagnosis** section instead of the Requirement Delta Preview, and records `Type:` in Document Control.
17
+ - **`/akili-specify` Bug Mode:** when a spec is a bug, specify frames requirements around the corrected behavior and **requires a regression test** as a mandatory task — red before the fix, green after — so a bug is provably fixed and stays fixed.
18
+ - **`/akili-quick` trivial fast-track command:** A new single-step command for genuinely trivial, low-risk changes (button color, title text, small paragraph). It makes the edit directly, runs a light verification, records a one-line entry in `docs/specs/quick/quick-log.md`, and commits with a `[SPEC:quick/<name>]` prefix — skipping the full `requirements` → `design` → `tasks` → `execution` → `test-report` → `validation-report` set while preserving spec-to-code traceability. A strict triviality gate (cosmetic/copy-only, no behavior/data/API/auth/contract change, ≤ ~20 LOC in one component, design-token safe) **auto-escalates** anything larger to `/akili-specify` (Lite) or `/akili-propose`.
19
+ - **`/akili-test` Leader → Tester(s) multi-agent harness:** `/akili-test` is no longer a single-agent script. The main session acts as a Leader that partitions testing into suites (backend unit, frontend unit, integration, E2E) and delegates each to a focused **Tester** subagent. A new `.agents/tester.md` persona (packaged under `.claude/templates/tester.md` and deployed by `/akili-constitution`) authors one suite from a thin per-suite context, explicitly covers negative constraints (`BUT it must NOT`) and strict validations (`AND IT MUST`), runs a bounded 3-attempt self-correction inner loop, and emits a `PASS` / `FAIL` / `PRODUCT_BUG` contract — keeping a correct test red on a genuine product defect instead of rewriting it to pass.
20
+ - **Token-aware Deployment Rule:** the Leader spawns the fewest Testers needed — inline (no spawn) for Lite/trivial single-suite work, one Tester per **independent** suite (in parallel when they touch different files), and sequential Testers when suites share files. Each Tester's context is discarded on completion so per-suite contexts never accumulate.
21
+ - **Mockup fallback in `/akili-propose`:** When a UI change arrives with no Figma link, image, or existing design, the proposal step now offers an opt-in, recommended path to generate a mockup directly in the agent via the `stitch-design` skill. Accepted mockups are saved under `docs/specs/<spec-path>/mockup/` (or `.stitch/designs` / `.stitch/DESIGN.md`) and recorded in a new **Visual Reference** proposal section.
22
+
23
+ ### Changed
24
+ - **`/akili-specify` consumes generated mockups:** The specify step now reads the proposal's **Visual Reference** and treats an agent-generated mockup (or `.stitch/DESIGN.md`) as approved visual design context — the same as a Figma link — driving the `Design Impact` guidance across requirements, design, and tasks.
25
+ - **`/akili-validate` reuses test evidence and new context:** Validation now reads `test-report.md` and **reuses its requirement-to-test matrix and `PASS`/`FAIL`/`PRODUCT_BUG` verdicts** as primary coverage evidence instead of re-deriving it (a token saving that closes the test→validate loop); an unresolved `PRODUCT_BUG` forces a FAIL. Validation also audits UI against the proposal's **Visual Reference** (Figma or generated mockup) and adds a lightweight **Agent Guide / Constitution Impact** check that flags stale child guides / `## Module Guides` index as WARN for `/akili-archive`.
26
+ - **Model routing for `/akili-test` split into Leader (T5) and Tester(s) (T2)**, with a note to prefer a Tester model different from the Implementer (author ≠ tester). Updated `docs/model-routing.md`, `/akili-constitution` scaffolding, and the docs hub accordingly.
27
+ - **`/akili-constitution` now scaffolds four `.agents/` personas** (`leader`, `implementer`, `reviewer`, `tester`) and the installer deploys `tester.md` alongside the existing templates.
13
28
  ## [2.4.2] - 2026-07-19
14
29
 
15
30
  ### Changed
package/README.md CHANGED
@@ -55,7 +55,7 @@ AKILI-SPECS is a constitution-first, spec-driven methodology for AI-assisted dev
55
55
 
56
56
  - `.claude/commands/` — custom AKILI-SPECS command prompts
57
57
  - `.claude/skills/` — required and preferred skills used by the methodology
58
- - `.claude/templates/` — default Leader, Implementer, and Reviewer personas used by the multi-agent harness (deployed into project `.agents/`)
58
+ - `.claude/templates/` — default Leader, Implementer, Reviewer, and Tester personas used by the multi-agent harness (deployed into project `.agents/`)
59
59
  - `docs/` — human-facing documentation for the flow, CLI, commands, skills, and release process
60
60
  - `scripts/` — helper scripts referenced by commands (e.g. `gsc_verify.py`)
61
61
  - `.mcp.json.example` — reference MCP server configuration (e.g. `gsc`)
@@ -104,6 +104,7 @@ AKILI-SPECS is a constitution-first, spec-driven methodology for AI-assisted dev
104
104
  - `leader.md`
105
105
  - `implementer.md`
106
106
  - `reviewer.md`
107
+ - `tester.md`
107
108
  - `docs/`
108
109
  - `flow.md`
109
110
  - `cli.md`
@@ -261,7 +262,7 @@ For Claude, the installer writes:
261
262
  ~/.claude/commands/
262
263
  ~/.claude/skills/
263
264
  ~/.claude/akili/scripts/
264
- ~/.claude/akili/templates/ (leader, implementer, reviewer personas used by /akili-constitution)
265
+ ~/.claude/akili/templates/ (leader, implementer, reviewer, tester personas used by /akili-constitution)
265
266
  ~/.claude/akili/.mcp.json.example
266
267
  ```
267
268
 
@@ -501,6 +502,7 @@ See the full [Command Reference](docs/commands/README.md) for detailed pages per
501
502
  |---|---|---|
502
503
  | `/akili-constitution` | Starting a repo or repairing weak project context | `docs/prd.md`, UX/UI design, TRD, `docs/infrastructure.md`, general spec templates, `CLAUDE.md`, `AGENTS.md` guidance |
503
504
  | `/akili-propose <change-name-or-spec-path>` | Aligning on intent before full specification (supports Figma/Jira MCP context) | `proposal.md` under `docs/specs/<spec-path>/` |
505
+ | `/akili-quick <change-name>` | Making a genuinely trivial, low-risk change (button color, title text, small paragraph) fast | The edit + a one-line entry in `docs/specs/quick/quick-log.md` and a `[SPEC:quick/<name>]` commit |
504
506
  | `/akili-specify <spec-path>` | Planning one bounded change before code | `requirements.md`, `design.md`, `tasks.md` under `docs/specs/<spec-path>/` (includes Design Impact injection, LOC estimation and HITL menus) |
505
507
  | `/akili-execute <spec-path>` | Implementing approved tasks via the Leader → Implementer → Reviewer harness | Code changes, updated `tasks.md`, `execution.md` with full PASS/FAIL audit trail |
506
508
  | `/akili-test <spec-path>` | Adding or running test evidence | `test-report.md` with requirement-to-test traceability |
@@ -516,12 +518,13 @@ Use the lightest documentation that still makes the work clear and verifiable.
516
518
 
517
519
  | Work Type | Recommended Depth | What To Capture |
518
520
  |---|---|---|
521
+ | Trivial cosmetic / copy tweak (button color, title text, small paragraph) | `/akili-quick` (no spec docs) | One-line log entry + `[SPEC:quick/<name>]` commit; auto-escalates if not actually trivial |
519
522
  | Small bugfix or UI tweak | Lite | Problem, affected requirement, scenario, focused task, verification command |
520
523
  | Normal feature | Standard | Requirements, scenarios, design decisions, task breakdown, tests |
521
524
  | High-risk change | Full | Business context, alternatives, data/API contracts, rollout, risks, observability, rollback |
522
525
  | Cross-cutting architecture | Full plus constitution review | Updates to project baseline docs and affected specs |
523
526
 
524
- Lite mode does not skip rigor. It keeps the documents short, but every requirement still needs a testable scenario and every task still needs a done criterion.
527
+ Lite mode does not skip rigor. It keeps the documents short, but every requirement still needs a testable scenario and every task still needs a done criterion. `/akili-quick` is the one path that skips the spec documents entirely — reserved for genuinely trivial changes, with a strict gate that escalates anything bigger.
525
528
 
526
529
  ## Core Concepts
527
530
 
@@ -720,18 +723,18 @@ Fallback rule:
720
723
  ## Methodology Contract
721
724
 
722
725
  - **User-Facing Summaries:** All major commands (`/akili-propose`, `/akili-specify`, `/akili-execute`, `/akili-validate`, `/akili-test`, `/akili-constitution`) generate a short, digestible summary on the screen before proceeding to the next step, ensuring developers always understand what the agent just did.
723
- - `/akili-constitution` establishes the project baseline docs (`docs/prd.md`, `docs/ux-ui/design.md`, `docs/trd/trd.md`, `docs/infrastructure.md`) and `docs/specs/general-setup/` templates, and scaffolds the project `.agents/` harness (Leader, Implementer, Reviewer).
726
+ - `/akili-constitution` establishes the project baseline docs (`docs/prd.md`, `docs/ux-ui/design.md`, `docs/trd/trd.md`, `docs/infrastructure.md`) and `docs/specs/general-setup/` templates, and scaffolds the project `.agents/` harness (Leader, Implementer, Reviewer, Tester).
724
727
  - `/akili-propose` creates a lightweight proposal before full specification. Evaluates massive instructions for **Scope Chunking** to split work into manageable modules. Integrates with **Figma MCP** and **Jira MCP** to extract visual context, requirements, and user stories.
725
728
  - `/akili-specify` must follow those templates when generating module specs. Enforces **Human-in-the-loop (HITL)** approval pauses after Requirements, Design, and Tasks. Promotes rigorous BDD scenarios (`BUT it must NOT`, `AND IT MUST`), allows blind adversarial design reviews via the `judgment-day` skill, outputs a final **Lines of Code (LOC) estimate** to recommend a safe Pull Request strategy, and explicitly injects **Design Impact** rules (from Figma contexts) into UI tasks and components.
726
729
  - `/akili-execute` orchestrates a Leader → Implementer → Reviewer rework loop (max 3 retries) to implement tasks from an approved spec path.
727
- - `/akili-test` validates requirement-to-test traceability, explicitly checking for negative constraints and strict boundaries.
730
+ - `/akili-test` runs a Leader → Tester(s) harness: the Leader partitions testing into suites and delegates each to a Tester subagent (inline for trivial/Lite work; one Tester per independent suite, in parallel, otherwise). It validates requirement-to-test traceability, explicitly checking for negative constraints and strict boundaries.
728
731
  - `/akili-validate` audits implementation conformance against the spec (including rigorous boundary validations) and constitutional baseline.
729
732
  - `/akili-archive` preserves completed specs under `docs/specs/archive/` after validation, syncs agent guides (child `CLAUDE.md`/`AGENTS.md` + the parent `## Module Guides` index) from the spec's `## Constitution Impact` notes, and recommends a CodeGraph re-index.
730
733
  - `/akili-seo` operates outside the main spec lifecycle: it provisions Google Search Console ownership for a domain and produces a standalone SEO audit under `docs/specs/seo/<domain>/`. Run it any time after deployment; rerun after major content or schema changes.
731
734
 
732
735
  ## Multi-Agent Harness Engineering
733
736
 
734
- `/akili-execute` is not a single-agent script. It is a coordinated triad of specialized roles that share the same spec, the same constitution, and the same audit trail. The harness exists to remove confirmation bias from review (an independent auditor instead of the same agent that wrote the code), to keep each role's context window small and focused, and to enforce design-token and constitutional discipline through a hard PASS/FAIL gate.
737
+ `/akili-execute` and `/akili-test` are not single-agent scripts. Each is a coordinated set of specialized roles that share the same spec, the same constitution, and the same audit trail. The harness exists to remove confirmation bias from review and testing (an independent auditor/tester instead of the same agent that wrote the code), to keep each role's context window small and focused, and to enforce design-token and constitutional discipline through a hard PASS/FAIL gate.
735
738
 
736
739
  Roles live in the project's `.agents/` directory (scaffolded by `/akili-constitution`):
737
740
 
@@ -740,6 +743,7 @@ Roles live in the project's `.agents/` directory (scaffolded by `/akili-constitu
740
743
  | Leader | `.agents/leader.md` | Orchestration. Picks the next eligible task, delegates, enforces the rework loop, updates `tasks.md` and `execution.md`, commits with `[SPEC:<spec-path>]`. |
741
744
  | Implementer | `.agents/implementer.md` | Writes and tests the code. Strictly task-scoped, must follow design tokens from `docs/ux-ui/design.md`, must run the verification command before reporting. |
742
745
  | Reviewer | `.agents/reviewer.md` | Read-only spec audit. Compares the diff against requirements, design tokens, the TRD, and stability. Outputs a structured PASS or FAIL with *Discovered Issue*, *Violated Rule*, and *Remediation Suggestion* for each finding. |
746
+ | Tester | `.agents/tester.md` | Authors and runs **one** test suite (backend unit, frontend unit, integration, or E2E) from a thin per-suite context. Explicitly covers negative constraints and strict validations, runs a bounded 3-attempt self-correction inner loop, and emits `PASS`/`FAIL`/`PRODUCT_BUG` — keeping a correct test red on a real product defect instead of rewriting it. |
743
747
 
744
748
  The Leader runs each task through this loop:
745
749
 
@@ -761,11 +765,13 @@ if 3 consecutive FAILs → HALT, mark task [~], present full audit trail for hum
761
765
  - **Pivot protocol.** If discovery proves the spec itself is wrong (not the implementation), the loop stops immediately and a `## Pivot Record` is opened in `execution.md` for user sign-off — rework retries are not consumed on a broken spec.
762
766
  - **Cross-tool.** `.agents/` is pure Markdown + YAML frontmatter and is resolved relative to the active workspace, so the same harness runs under Claude Code, OpenCode, and Google Antigravity (the latter invokes `invoke_subagent` using the same persona files).
763
767
 
768
+ **`/akili-test` — Leader → Tester(s):** The same Leader pattern drives testing, but delegation is token-aware. The Leader partitions the work into suites and applies a **Deployment Rule**: Lite depth or a single trivial suite runs **inline** (no subagent spawn — spawning would cost more tokens than it saves); Standard/Full depth or multiple **independent** suites get **one Tester per suite**, spawned **in parallel** when they touch different files, and sequentially when they share files/fixtures. Each Tester receives 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. A Tester runs a bounded 3-attempt inner loop and distinguishes a **test defect** (fix the test) from a **product defect** (keep the test red, report `PRODUCT_BUG`). Ideally a Tester runs on a different model than the Implementer that wrote the code (author ≠ tester).
769
+
764
770
  `/akili-constitution` classifies the repository into one of three modes and seeds `.agents/` accordingly:
765
771
 
766
772
  | Mode | When | `.agents/` Behavior |
767
773
  |---|---|---|
768
- | Brand-new | No code, no docs | Copies the default Leader/Implementer/Reviewer templates verbatim |
774
+ | Brand-new | No code, no docs | Copies the default Leader/Implementer/Reviewer/Tester templates verbatim |
769
775
  | Legacy | Real code, no AKILI-SPECS baseline | Copies defaults and customizes them with detected stack, design tokens, lint and test commands |
770
776
  | Active AKILI-SPECS | Baseline already exists | Preserves customized `.agents/` files in place and only upgrades or fills gaps non-destructively |
771
777
 
package/bin/akili.js CHANGED
@@ -12,7 +12,7 @@ const SOURCE_CLAUDE = path.join(PACKAGE_ROOT, ".claude");
12
12
  const SOURCE_COMMANDS = path.join(SOURCE_CLAUDE, "commands");
13
13
  const SOURCE_SKILLS = path.join(SOURCE_CLAUDE, "skills");
14
14
  const SOURCE_TEMPLATES = path.join(SOURCE_CLAUDE, "templates");
15
- const AGENT_TEMPLATES = ["leader.md", "implementer.md", "reviewer.md"];
15
+ const AGENT_TEMPLATES = ["leader.md", "implementer.md", "reviewer.md", "tester.md"];
16
16
  const RESOURCE_SCRIPTS = ["gsc_verify.py", "parse_tests.js"];
17
17
  const SOURCE_SCRIPTS = path.join(PACKAGE_ROOT, "scripts");
18
18
  const SOURCE_MCP_EXAMPLE = path.join(PACKAGE_ROOT, ".mcp.json.example");
package/docs/README.md CHANGED
@@ -47,6 +47,6 @@ Use `/akili-seo <site-domain>` independently when you need Google Search Console
47
47
 
48
48
  - Command implementation prompts: `.claude/commands/*.md`
49
49
  - Skill implementation prompts: `.claude/skills/*/SKILL.md`
50
- - Multi-agent harness templates: `.claude/templates/{leader,implementer,reviewer}.md` (deployed into each project's `.agents/` by `/akili-constitution`)
50
+ - Multi-agent harness templates: `.claude/templates/{leader,implementer,reviewer,tester}.md` (deployed into each project's `.agents/` by `/akili-constitution`)
51
51
  - CLI implementation: `bin/akili.js`
52
52
  - Release automation: `scripts/release.js` and `scripts/release-status.js`
package/docs/cli.md CHANGED
@@ -94,7 +94,7 @@ Claude install layout:
94
94
  ~/.claude/commands/
95
95
  ~/.claude/skills/
96
96
  ~/.claude/akili/scripts/
97
- ~/.claude/akili/templates/ (leader.md, implementer.md, reviewer.md — used by /akili-constitution to scaffold project .agents/)
97
+ ~/.claude/akili/templates/ (leader.md, implementer.md, reviewer.md, tester.md — used by /akili-constitution to scaffold project .agents/)
98
98
  ~/.claude/akili/.mcp.json.example
99
99
  ```
100
100
 
@@ -114,7 +114,7 @@ Antigravity install layout:
114
114
  ~/.gemini/antigravity/global_workflows/ (custom commands mapped as global workflows)
115
115
  ~/.gemini/config/skills/ (skills mapped as global skills)
116
116
  ~/.gemini/config/akili/scripts/ (scripts mapped as config resources)
117
- ~/.gemini/config/akili/templates/ (multi-agent harness templates: leader, implementer, reviewer)
117
+ ~/.gemini/config/akili/templates/ (multi-agent harness templates: leader, implementer, reviewer, tester)
118
118
  ~/.gemini/config/akili/.mcp.json.example
119
119
  ```
120
120
 
@@ -170,6 +170,7 @@ The CLI installs helper resources under the target `akili/` directory:
170
170
  | `templates/leader.md` | Default Leader (Orchestrator) persona for the multi-agent harness — copied into project `.agents/` by `/akili-constitution` |
171
171
  | `templates/implementer.md` | Default Implementer persona for the multi-agent harness |
172
172
  | `templates/reviewer.md` | Default Reviewer persona for the multi-agent harness |
173
+ | `templates/tester.md` | Default Tester persona for the `/akili-test` Leader → Tester(s) harness — copied into project `.agents/` by `/akili-constitution` |
173
174
  | `.mcp.json.example` | Example MCP config for the Google Search Console MCP server |
174
175
 
175
176
  ## Troubleshooting
@@ -8,9 +8,10 @@ AKILI commands are installed as slash-command prompts for Claude Code and OpenCo
8
8
  |---|---|---|
9
9
  | [`/akili-constitution`](akili-constitution.md) | Starting a repo or repairing weak project context | Project baseline docs, `CLAUDE.md`, `AGENTS.md`, general spec templates, and the `.agents/` multi-agent harness |
10
10
  | [`/akili-propose <change-name-or-spec-path>`](akili-propose.md) | Aligning on intent before full specification | `proposal.md` under `docs/specs/<spec-path>/` |
11
+ | [`/akili-quick <change-name>`](akili-quick.md) | Making a genuinely trivial, low-risk change (copy edit, color/text tweak) fast | The edit + a one-line entry in `docs/specs/quick/quick-log.md` and a `[SPEC:quick/<name>]` commit |
11
12
  | [`/akili-specify <spec-path>`](akili-specify.md) | Planning one bounded change before code | `requirements.md`, `design.md`, `tasks.md` |
12
13
  | [`/akili-execute <spec-path>`](akili-execute.md) | Implementing approved tasks via the Leader → Implementer → Reviewer harness | Code/docs changes, updated `tasks.md`, `execution.md` with full PASS/FAIL audit trail |
13
- | [`/akili-test <spec-path>`](akili-test.md) | Proving behavior with test evidence | `test-report.md` |
14
+ | [`/akili-test <spec-path>`](akili-test.md) | Proving behavior with test evidence via the Leader → Tester(s) harness | `test-report.md` |
14
15
  | [`/akili-validate <spec-path>`](akili-validate.md) | Auditing conformance before completion | `validation-report.md` |
15
16
  | [`/akili-archive <spec-path>`](akili-archive.md) | Closing completed work after validation | Archived spec folder with `archive-summary.md` |
16
17
  | [`/akili-audit`](akili-audit.md) | Detecting drift between specs and codebase reality | `docs/specs/drift-report.md` with conformance score and discrepancy matrix |
@@ -29,7 +30,7 @@ AKILI commands are installed as slash-command prompts for Claude Code and OpenCo
29
30
  /akili-archive <spec-path>
30
31
  ```
31
32
 
32
- You can skip `/akili-propose` for very small, obvious work. You should not skip validation before archiving unless the user explicitly accepts the risk.
33
+ You can skip `/akili-propose` for very small, obvious work. For a genuinely trivial, low-risk change (a button color, a title's text, a small paragraph) use `/akili-quick <change-name>`, which makes the edit in one step with minimal traceability and auto-escalates to `/akili-specify` (Lite) or `/akili-propose` if the change turns out to be bigger than trivial. You should not skip validation before archiving unless the user explicitly accepts the risk.
33
34
 
34
35
  Run `/akili-audit` independently to detect drift between specs and codebase reality at any time.
35
36
 
@@ -39,6 +40,7 @@ Run `/akili-audit` independently to detect drift between specs and codebase real
39
40
  |---|---|
40
41
  | `/akili-constitution` | `.claude/commands/akili-constitution.md` |
41
42
  | `/akili-propose` | `.claude/commands/akili-propose.md` |
43
+ | `/akili-quick` | `.claude/commands/akili-quick.md` |
42
44
  | `/akili-specify` | `.claude/commands/akili-specify.md` |
43
45
  | `/akili-execute` | `.claude/commands/akili-execute.md` |
44
46
  | `/akili-test` | `.claude/commands/akili-test.md` |
@@ -43,6 +43,7 @@ Creates or enhances:
43
43
  - `.agents/leader.md`
44
44
  - `.agents/implementer.md`
45
45
  - `.agents/reviewer.md`
46
+ - `.agents/tester.md`
46
47
 
47
48
  Projects created before the TRD naming may still have `docs/system-design/design.md` (UX/UI blueprint) and `docs/detailed-design/detailed-design.md` (technical blueprint). The constitution treats those as the existing UX/UI Design document and TRD, and in Active-AKILI-SPECS mode offers to migrate them to `docs/ux-ui/design.md` and `docs/trd/trd.md`.
48
49
 
@@ -50,11 +51,11 @@ The root guides also carry a `## Module Guides` index: modules whose conventions
50
51
 
51
52
  ## Multi-Agent Harness Scaffolding
52
53
 
53
- `.agents/` is the source of truth for the multi-agent loop that `/akili-execute` runs (Leader → Implementer → Reviewer). The constitution seeds it from the packaged defaults shipped by the installer:
54
+ `.agents/` is the source of truth for the multi-agent harness: the loop that `/akili-execute` runs (Leader → Implementer → Reviewer) and the Leader → Tester(s) harness that `/akili-test` runs. The constitution seeds it from the packaged defaults shipped by the installer:
54
55
 
55
- - Claude Code: `~/.claude/akili/templates/{leader,implementer,reviewer}.md`
56
- - OpenCode: `~/.config/opencode/akili/templates/{leader,implementer,reviewer}.md`
57
- - Antigravity: `~/.gemini/config/akili/templates/{leader,implementer,reviewer}.md`
56
+ - Claude Code: `~/.claude/akili/templates/{leader,implementer,reviewer,tester}.md`
57
+ - OpenCode: `~/.config/opencode/akili/templates/{leader,implementer,reviewer,tester}.md`
58
+ - Antigravity: `~/.gemini/config/akili/templates/{leader,implementer,reviewer,tester}.md`
58
59
 
59
60
  If packaged templates are not available, the constitution drafts equivalent personas inline using the structure documented in `/akili-execute` (rework loop, PASS/FAIL output contract, AKILI commit standard, Pivot Protocol).
60
61
 
@@ -31,6 +31,19 @@ Bare names default to `changes/<name>`. Paths containing `/` are used as provide
31
31
  - Scope, non-goals, risks, or affected systems are uncertain.
32
32
  - Multiple implementation approaches are possible.
33
33
  - Existing behavior may need added, modified, or removed requirements.
34
+ - A **bug** needs its root cause diagnosed before a fix is planned.
35
+
36
+ ## Request Classification & Routing
37
+
38
+ `/akili-propose` is the single entry point that classifies the request and routes it — so the methodology does not need a separate command per work type. It infers the type from the request (and asks one short question if ambiguous):
39
+
40
+ | Type | Route |
41
+ |---|---|
42
+ | **Trivial** (cosmetic/copy tweak) | Recommends `/akili-quick <name>` instead of a full proposal |
43
+ | **Feature / Change** | Standard proposal → `/akili-specify` |
44
+ | **Bug** | **Bug Track**: diagnose first (reproduction + confirmed root cause via `systematic-debugging`) in the proposal, then `/akili-specify` in **Bug Mode** with a mandatory regression test |
45
+
46
+ The detected type is recorded as `Type: Bug | Change | Trivial` in the proposal's Document Control so `/akili-specify` inherits it.
34
47
 
35
48
  ## Output
36
49
 
@@ -42,20 +55,31 @@ docs/specs/<spec-path>/proposal.md
42
55
 
43
56
  ## Proposal Sections
44
57
 
45
- - Document Control
58
+ - Document Control (records `Type: Bug | Change | Trivial`)
46
59
  - Intent
47
60
  - Problem / Current Behavior
48
61
  - Proposed Outcome
49
62
  - Scope
50
63
  - Non-Goals
51
64
  - Affected Users, Systems, And Specs
52
- - Requirement Delta Preview
65
+ - Visual Reference
66
+ - Bug Diagnosis (Bug track) *or* Requirement Delta Preview (Change track)
53
67
  - Approach Options
54
68
  - Recommended Approach
55
69
  - Risks, Dependencies, And Open Questions
56
70
  - Success Criteria
57
71
  - Next Step
58
72
 
73
+ ## Bug Track
74
+
75
+ For a bug, the proposal replaces the Requirement Delta Preview with a **Bug Diagnosis** produced with the `systematic-debugging` skill: observed symptom, reproduction steps, **confirmed** root cause (not a guess), impact/scope, and a fix strategy. No fix is proposed until the root cause is confirmed. The fix then routes by size — a purely cosmetic one-liner to `/akili-quick`, anything with logic to `/akili-specify` (Lite) in Bug Mode, which requires a regression test (red before the fix, green after).
76
+
77
+ ## Visual Input & Mockup Fallback
78
+
79
+ During intent clarification the command asks for the requirement source (e.g. Jira MCP) and any visual design (Figma MCP).
80
+
81
+ When the change has a UI surface and **no** Figma link, image, or existing design is provided, the command offers an **opt-in, recommended** fallback: generate a mockup directly in the agent using the `stitch-design` skill (Stitch MCP). Accepted mockups are saved under `docs/specs/<spec-path>/mockup/` (or the `.stitch/designs` / `.stitch/DESIGN.md` location) and recorded in the proposal's **Visual Reference** section. This mockup then counts as approved visual design context for `/akili-specify`, exactly like a Figma link. The user can always decline and continue without a visual.
82
+
59
83
  ## Next Step
60
84
 
61
85
  After approval:
@@ -0,0 +1,54 @@
1
+ # `/akili-quick`
2
+
3
+ Fast-track a genuinely trivial, low-risk change in one step, with minimal traceability and automatic escalation when the change is not actually trivial.
4
+
5
+ ## Usage
6
+
7
+ ```text
8
+ /akili-quick <short-change-name> [free-text description]
9
+ ```
10
+
11
+ Examples:
12
+
13
+ ```text
14
+ /akili-quick login-button-color make the primary login button use the brand accent token
15
+ /akili-quick hero-title fix the typo in the homepage hero title
16
+ /akili-quick pricing-paragraph add a short paragraph under the pricing table
17
+ ```
18
+
19
+ ## Use When
20
+
21
+ - The change is cosmetic or copy-only: text/label edits, color/spacing/style-token tweaks, small static markup additions.
22
+ - It changes no behavior, data, API, auth, or shared contract.
23
+ - It is small and local (~≤ 20 LOC, one component/file).
24
+ - Any visual change uses an existing approved token from `docs/ux-ui/design.md`.
25
+
26
+ Do **not** use it for real features, logic changes, bugfixes with behavior impact, or anything that introduces a new design token or pattern.
27
+
28
+ ## Triviality Gate & Escalation
29
+
30
+ Before editing, the command checks all gate criteria. If any fails, it **stops and escalates**:
31
+
32
+ - Small but with logic, or a real bugfix → `/akili-specify <spec-path>` (Lite).
33
+ - A **bug** whose fix touches logic/behavior → `/akili-propose <name>` (Bug Track: diagnose the root cause first), then `/akili-specify` (Lite) in Bug Mode with a mandatory regression test. A purely cosmetic bug (e.g. a visible typo) may stay in `/akili-quick`.
34
+ - Non-trivial, risky, cross-cutting, or uncertain → `/akili-propose <change-name>`.
35
+ - Needs a new design token/pattern → `/akili-propose` or `/akili-specify` so the token is designed, not improvised.
36
+
37
+ ## Output
38
+
39
+ - The edit applied to the target file(s).
40
+ - A one-line entry appended to `docs/specs/quick/quick-log.md` (date, change, files, verification, commit).
41
+ - A commit prefixed `[SPEC:quick/<change-name>]`.
42
+
43
+ It does **not** create `requirements.md`, `design.md`, `tasks.md`, `execution.md`, `test-report.md`, or `validation-report.md`.
44
+
45
+ ## Key Rules
46
+
47
+ - Traceability is not optional: every quick change gets a `[SPEC:quick/<name>]` commit and a log line.
48
+ - Respect design tokens — never hardcode a new value to "just make it match"; use the token or escalate.
49
+ - One change per invocation.
50
+ - When in doubt about triviality, escalate.
51
+
52
+ ## Next Step
53
+
54
+ None required — the change is committed. If follow-up work grows beyond a trivial tweak, move it to `/akili-propose` or `/akili-specify`.
@@ -58,6 +58,8 @@ docs/specs/<spec-path>/tasks.md
58
58
  - Key requirements include Given/When/Then scenarios.
59
59
  - Design extends the current architecture instead of replacing it.
60
60
  - Tasks reference requirements, design sections, dependencies, done criteria, verification, and relevant skills.
61
+ - Any visual design context in the proposal — a Figma link, an agent-generated mockup under `docs/specs/<spec-path>/mockup/`, or a `.stitch/DESIGN.md` reference — is treated as approved input and drives the `Design Impact` guidance across requirements, design, and tasks.
62
+ - **Bug Mode:** when the spec is a bug (`Type: Bug`, a `bugfix/*` path, or framed as a defect), specify frames requirements around the corrected behavior from the confirmed root cause and **requires a regression test** — at least one task adds a test that is red before the fix and green after. The root cause is confirmed with `systematic-debugging` if no proposal diagnosis exists.
61
63
  - The user approves requirements, design, and tasks before implementation begins.
62
64
 
63
65
  ## Next Step
@@ -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