@dombaras/agent-harness 0.1.15 → 0.1.17

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.
package/README.md CHANGED
@@ -43,7 +43,8 @@ npx @dombaras/agent-harness init --target . --dry-run
43
43
  | `.agents/features/INDEX.md` | pointer to `BACKLOG.md` (per-feature doc tree root) | **project** (create-if-missing) |
44
44
  | `opencode.json` | main/small model routing + `instructions` | harness (**merged**, see below) |
45
45
  | `scripts/qa/*` | `test:dispatch` / `test:governance` / `test:qa-plan` gates + QA-script wiring check | harness (overwrite) |
46
- | `.agents/memory/*` | project data (domain-map, stack-versions, handoff, locations, model-routing, history, flow-map, product-principles) | **project** (create-if-missing) |
46
+ | `.agents/memory/*` | project data (domain-map, stack-versions, locations, model-routing, history, flow-map, product-principles) | **project** (create-if-missing) |
47
+ | `.agents/handoffs/*` | project data (one session handoff file per session — sharded so concurrent sessions never collide) | **project** (create-if-missing) |
47
48
  | `.agents/qa-plans/*` | project data (one QA plan file per change — sharded so concurrent sessions never collide) | **project** (create-if-missing) |
48
49
  | `.harness.json` | deployed version + project profile + per-file checksums | harness |
49
50
  | `.gitignore` | harness-managed section (`.harness-backup/`) merged in, project entries preserved | harness (merged) |
@@ -121,7 +122,8 @@ warns but does not block; the guarantee only applies to registered flows.
121
122
  agents (planner, system-architect, security-engineer, diagnostics-expert,
122
123
  product-manager, qa-architect) in one step. Aliases: `deepseek`/`direct` →
123
124
  `deepseek/deepseek-v4-pro` (default, direct API key), `zen`/`opencode` →
124
- `opencode/deepseek-v4-pro` (gateway), `pickle` → `opencode/big-pickle`, or any
125
+ `opencode/deepseek-v4-pro` (gateway), `pickle` → `opencode/big-pickle`,
126
+ `nvidia`/`kimi`/`kimi-k3` → `nvidia/moonshotai/kimi-k3` (NVIDIA NIM), or any
125
127
  explicit `provider/model`. Restart opencode after switching (config reads once).
126
128
  - **`/board` command** — every deploy ships an opencode command
127
129
  (`.opencode/command/board.md`) that reads the local `BACKLOG.md` and renders a
@@ -155,7 +157,7 @@ warns but does not block; the guarantee only applies to registered flows.
155
157
  proves coverage. It also makes **"Fix One, Fix All" mechanical**: a change to one
156
158
  surface (e.g. web) cannot ship while the same flow in another codebase (e.g. `mobile/`)
157
159
  silently keeps old behavior — the plan must name each sibling as covered (`->`) or
158
- out-of-scope (`audited: reason`, e.g. `deferred — logged in handoff.md`).
160
+ out-of-scope (`audited: reason`, e.g. `deferred — logged in handoffs/`).
159
161
  - `node scripts/qa/check-qa-scripts.js` — warns (or `--strict` fails) when the
160
162
  DoD-referenced runtime QA tiers aren't wired into `package.json`.
161
163
 
@@ -170,7 +172,7 @@ scripts are **project-provided** — the rulebook references them, and
170
172
  npx @dombaras/agent-harness update --target /path/to/project
171
173
  ```
172
174
 
173
- - Overwrites harness-owned files, preserves `.agents/memory/*` and `BACKLOG.md`.
175
+ - Overwrites harness-owned files, preserves `.agents/memory/*`, `.agents/handoffs/*`, `.agents/qa-plans/*`, and `BACKLOG.md`.
174
176
  - Auto-wires the harness gate scripts (`test:dispatch`, `test:governance`,
175
177
  `test:qa-plan`, `test:backlog`, `test:product`, `test:docs`) into the target's `package.json` (merged, add-only).
176
178
  - **Auto-commits** the harness files it changed (`chore(harness): @dombaras/agent-harness
@@ -178,7 +180,7 @@ npx @dombaras/agent-harness update --target /path/to/project
178
180
  modified harness files. Your unrelated uncommitted work is never staged.
179
181
  - `--no-commit` to skip commit+push, `--no-push` to commit but not push.
180
182
  - `init` auto-commits + pushes by default too: it commits everything it scaffolds
181
- (including `.agents/memory/*`, `.agents/features/*`, and `BACKLOG.md`) so a fresh
183
+ (including `.agents/memory/*`, `.agents/features/*`, `.agents/handoffs/*`, and `BACKLOG.md`) so a fresh
182
184
  project starts fully tracked and no harness file is left untracked.
183
185
  - Harness-owned paths are **force-added**, so a project that gitignores deployment
184
186
  artifacts (an inherited `.agents/` `.opencode/` `AGENTS.md` pattern) still gets the
@@ -92,16 +92,20 @@ function relKey(rel) {
92
92
  return rel.split(path.sep).join("/");
93
93
  }
94
94
 
95
- /* `.agents/memory/*` (session memory), `.agents/features/*` (feature doc tree)
96
- * and `.agents/qa-plans/*` (one QA plan file per change) are project data —
97
- * scaffolded create-if-missing, never overwritten, and never tracked in the
98
- * manifest. qa-plans is sharded per change so concurrent sessions never collide
99
- * on a single shared file. */
95
+ /* `.agents/memory/*` (session memory), `.agents/features/*` (feature doc tree),
96
+ * `.agents/qa-plans/*` (one QA plan file per change) and `.agents/handoffs/*`
97
+ * (one session handoff file per session) are project data — scaffolded
98
+ * create-if-missing, never overwritten, and never tracked in the manifest.
99
+ * qa-plans and handoffs are sharded per change/session so concurrent sessions
100
+ * never collide on a single shared file. */
100
101
  function isProjectScaffold(rel) {
101
102
  const parts = rel.split(path.sep);
102
103
  return (
103
104
  parts.includes(".agents") &&
104
- (parts.includes("memory") || parts.includes("features") || parts.includes("qa-plans"))
105
+ (parts.includes("memory") ||
106
+ parts.includes("features") ||
107
+ parts.includes("qa-plans") ||
108
+ parts.includes("handoffs"))
105
109
  );
106
110
  }
107
111
  /* The canonical `BACKLOG.md` at the repo root is also project data (a live task
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dombaras/agent-harness",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Reusable multi-agent harness for AI-assisted development: personas, skills, operating rules, model routing, and QA gates. Deploy into any project with `npx @dombaras/agent-harness init`.",
5
5
  "bin": {
6
6
  "agent-harness": "bin/agent-harness.js"
@@ -55,17 +55,21 @@ The canonical rulebook. The always-loaded summary is `.agents/rules/00-operating
55
55
  | Data ingestion / entity resolution | `data-engineer` |
56
56
  | Deployment / cron / secrets / build+release | `devops-engineer` |
57
57
  | Session wrap-up / handoff | `handoff` |
58
- | Feature backlog + per-feature doc tree (intent/scope/plan/tests) | `features` |
58
+ | Feature backlog registration + doc-tree scaffolding (registrar only — not authoring) | `features` |
59
59
  | Human-facing docs (README / CHANGELOG / docs / ADRs) | `docs` |
60
60
  - **Feature docs, not ceremony**: capture a found item as one light row in
61
- the canonical `BACKLOG.md` (repo root). When a feature is picked up, dispatch
62
- `features` to author the doc chain `intent` (product-manager) → `scope`
63
- (system-architect, HIGH-risk only) `plan` (planner) `tests` (qa-architect)
64
- each by its author persona. Match ceremony to blast radius: trivial none,
65
- lowsingle `intent.md`, high (auth/DB/API/flow-siblings) → full chain. Write
66
- back first (update the doc before continuing when implementation invalidates it),
67
- archive on ship. Feature docs are durable and complementary to the per-session
68
- `.agents/qa-plans/<feature-id>.md`/`handoff.md`; the `tests` doc points to the
61
+ the canonical `BACKLOG.md` (repo root). `features` is a registrar only it
62
+ registers rows and scaffolds the `.agents/features/<slug>/` tree, never authors
63
+ content. When a feature is picked up, author the doc chain by dispatching each
64
+ author persona **directly** `intent` (product-manager)`scope`
65
+ (system-architect, HIGH-risk only) → `plan` (planner) → `tests` (qa-architect).
66
+ For an "investigate + plan" request (no code), dispatch `planner` and/or
67
+ `product-manager` directly never `features`. Match ceremony to blast radius:
68
+ trivial none, low → single `intent.md`, high (auth/DB/API/flow-siblings)
69
+ full chain. Write back first (update the doc before continuing when
70
+ implementation invalidates it), archive on ship. Feature docs are durable and
71
+ complementary to the per-session
72
+ `.agents/qa-plans/<feature-id>.md`/`.agents/handoffs/<feature-id>.md`; the `tests` doc points to the
69
73
  feature's QA plan, never duplicates it.
70
74
  - **Product intent is never optional (no silent skip)**: planning is
71
75
  product-first. `intent.md` must define Actor(s) → Need → Outcome → Acceptance
@@ -141,5 +145,5 @@ them. Steps 3-5 are the unconditional session close; they are NOT gated by QA.
141
145
  - **Harness-update awareness**: `npx @dombaras/agent-harness update` auto-commits the harness files it changes as `chore(harness): @dombaras/agent-harness <old> -> <new>`. If you see such a commit (or modified `.agents/**`, `scripts/qa/**`, `AGENTS.md`, `opencode.json` you didn't touch), do NOT treat it as unexplained — run `git log -1 --stat` / `git show` to see exactly which harness files changed and why, then read the rulebook. Never guess at the cause.
142
146
  - **Planned vs. Shipped**: at session end, record a "planned → shipped → deferred" delta so aspirational docs are never mistaken for reality. Always verify against live code and schema.
143
147
  - **Dispatch Log (mandatory)**: every wrap-up opens with `subagent → model → shipped/deferred`. An empty log is non-compliant.
144
- - **Persist Continuity**: use the `handoff` skill to update `.agents/memory/handoff.md`. Project history lives in `.agents/memory/history.md`; stack facts in `.agents/memory/stack-versions.md`.
148
+ - **Persist Continuity**: use the `handoff` skill to write your session's file under `.agents/handoffs/` (one per session — never edit another session's). Project history lives in `.agents/memory/history.md`; stack facts in `.agents/memory/stack-versions.md`.
145
149
  - **Pointers Map Hygiene**: record every created/discovered/changed important location (session archives, scratch scripts, logs, docs, DB targets, env files) in `.agents/memory/locations.md`.
@@ -5,4 +5,6 @@ spec docs (`.agents/features/<slug>/` intent · scope · plan · tests) still li
5
5
  this tree, owned by the `features` persona (`.agents/skills/features/SKILL.md`).
6
6
 
7
7
  This file is a pointer, not a list. Capture a found item as one row in `BACKLOG.md`;
8
- when a feature is picked up, dispatch `features` to author the per-feature doc chain.
8
+ when a feature is picked up, the orchestrator authors the per-feature doc chain by
9
+ dispatching each author persona directly (`product-manager`/`system-architect`/
10
+ `planner`/`qa-architect`) — `features` only registers the row and scaffolds this tree.
@@ -0,0 +1,40 @@
1
+ # Session handoffs — one file per session
2
+
3
+ Project-owned (like all `.agents/memory/*`). This directory holds the session
4
+ handoff, **sharded**: one file per session instead of a single shared
5
+ `handoff.md`. Each concurrent session owns its own file, so two sessions (e.g.
6
+ `F-003` and `F-035`) never rewrite each other's "where we stopped" — the failure
7
+ mode where one session's wrap-up clobbers another's and its dispatch log is
8
+ silently lost.
9
+
10
+ `npm run test:governance` reads EVERY `.md` file under this directory (plus the
11
+ legacy `.agents/memory/handoff.md` if it exists) and requires each to open with a
12
+ `## Dispatch log` section containing at least one entry — so a session's dispatch
13
+ log is enforced without a shared file.
14
+
15
+ ## Naming & ownership
16
+
17
+ - One file per session. Name it after the `BACKLOG.md` feature ID (`F-003.md`),
18
+ or a short hyphenated slug of the change (`return-no-condition.md`) when there
19
+ is no feature row.
20
+ - **Own your file; never edit another session's file.** That single rule removes
21
+ the collision. To resume a past session, READ its file; to continue the same
22
+ feature in a new session, append a new dated `##`-block — never reorder or
23
+ delete another session's entries.
24
+
25
+ ## Template
26
+
27
+ # Where we stopped (handoff) — <feature-id or slug>
28
+
29
+ Date: <YYYY-MM-DD>
30
+
31
+ ## Dispatch log
32
+ - <subagent → model → shipped/deferred> (empty log = non-compliant session)
33
+
34
+ ## Done this session (planned → shipped → deferred)
35
+ - <planned → shipped → deferred, one line each, with file + commit refs>
36
+
37
+ ## Still open / next
38
+ - <deferred items + next-session entry point>
39
+
40
+ Lines starting with `#` are ignored by the gate.
@@ -7,4 +7,4 @@ session creates, discovers, or changes an important location.
7
7
  - **Logs / telemetry**:
8
8
  - **DB / env**:
9
9
  - **Docs**:
10
- - **AI session archives**: (each agent front-end records its own paths)
10
+ - **AI session archives**: opencode: <path>; antigravity: <path>; vscode: <path> (record each front-end's session/history path the docs reconstruction bundle reads these)
@@ -27,7 +27,7 @@ frontmatter:
27
27
  - **Thinkers** (`planner`, `product-manager`) have `permission: { edit: deny, bash: deny }`.
28
28
  - **`qa-architect`** has `permission: { bash: deny }` (authors tests, never runs).
29
29
  - **`handoff`** has `permission: { bash: deny }`.
30
- - **`features`** (Feature Registrar) has `permission: { bash: deny }` — owns `BACKLOG.md` (repo root) + `.agents/features/*` (per-feature docs), routes each doc layer to its author persona.
30
+ - **`features`** (Feature Registrar) has `permission: { bash: deny }` — owns `BACKLOG.md` (repo root) + `.agents/features/*` **tree structure only** (scaffolding, never doc content). It does NOT author `intent`/`scope`/`plan`/`tests` and does NOT dispatch author personas — those are dispatched by the orchestrator directly.
31
31
  - **`docs`** (Documentation Keeper) has `permission: { bash: deny }` and `edit` allowing everything except harness/governance paths — owns `README.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, and `docs/**` (human-facing docs); never edits code or `.agents/**` memory.
32
32
  - **Code personas** (`frontend-engineer`, `mobile-engineer`, `ui-designer`,
33
33
  `data-engineer`, `devops-engineer`, `security-engineer`, `system-architect`,
@@ -34,7 +34,7 @@ covered if ANY plan file names it.
34
34
 
35
35
  ## Parallel-surface & variant audit
36
36
  - components/LendingActionDrawers.tsx -> test:quick::return (click-through: Mark as Returned, no condition selector)
37
- - mobile/features/return/ReturnStatusSheet.tsx audited: deferred — mobile still renders the selector; same simplification pending, logged in handoff.md
37
+ - mobile/features/return/ReturnStatusSheet.tsx audited: deferred — mobile still renders the selector; same simplification pending, logged in handoffs/
38
38
  - app/api/transactions/[id]/return/route.ts -> test:api::return (POST without condition payload succeeds)
39
39
  - flow: return variant: condition-selector-present audited: removed by this change — asserting absence only
40
40
  - flow: return variant: condition-selector-absent -> test:quick::return (no-selector click-through renders no condition UI)
@@ -11,11 +11,11 @@ Before reading or editing any file for a task, dispatch the relevant personas vi
11
11
  - **Accept, don't trust.** After a code persona reports done, the orchestrator re-runs the gate itself (`tsc --noEmit`, `lint:hooks`, `test:quick`) and greps the metric before integrating — a subagent's `Evidence` is a claim, not proof.
12
12
  - **QA planning is never optional.** Every change touching code paths gets a QA plan (coverage map in a per-change file under `.agents/qa-plans/`) from `qa-architect`; if it isn't dispatched, the main orchestrator plans in its place. `npm run test:qa-plan` fails on any changed code path with no covering assertion or waiver, and on any touched flow (`.agents/memory/flow-map.md`) whose sibling surfaces / declared variants the plan doesn't address.
13
13
  - Persona map, waivers, and the dispatch-failure ladder: `.agents/AGENTS.md` §5 and `.agents/memory/model-routing.md`.
14
- - **Features**: capture a found item as one light row in the canonical `BACKLOG.md` (repo root); on pickup dispatch `features` to author the per-feature doc chain (`.agents/skills/features/SKILL.md`). Right-size ceremony to risk.
14
+ - **Features**: capture a found item as one light row in the canonical `BACKLOG.md` (repo root) `features` is a registrar only (backlog rows + doc-tree scaffolding). On pickup, author the per-feature doc chain by dispatching each author persona **directly** (`product-manager`/`system-architect`/`planner`/`qa-architect`) — never via `features`. Right-size ceremony to risk.
15
15
  - **Docs**: human-facing docs (`README.md`, `CHANGELOG.md`, `docs/**`) are owned by the `docs` persona (`.agents/skills/docs/SKILL.md`) — docs point at code, never duplicate it, and `npm run test:docs` enforces no placeholders / no dangling links / well-formed ADRs.
16
16
  - **Product intent is never optional.** A feature never reaches planning/implementation without defining its user. `intent.md` must carry Actor(s) → Need → Outcome → Acceptance criteria, and `plan.md` a Value-first sequence + Product concepts applied — `npm run test:product` fails otherwise. Planning reads `.agents/memory/product-principles.md` and is value-led, not tech-led.
17
17
  - Every subagent returns the output contract (`Result` → `Evidence` → `Deferred & risks`).
18
- - Wrap up with a **dispatch log** (`subagent → model → shipped/deferred`) in `.agents/memory/handoff.md`.
18
+ - Wrap up with a **dispatch log** (`subagent → model → shipped/deferred`) in your session's `.agents/handoffs/<feature-id>.md`.
19
19
 
20
20
  ## Non-negotiable laws
21
21
 
@@ -46,6 +46,43 @@ non-redundant.
46
46
  - `docs/` topic docs — architecture, runbooks, API, data model — only what the
47
47
  project actually needs; never create empty scaffolds.
48
48
 
49
+ ## Docs reconstruction (mid-project back-fill)
50
+
51
+ When documentation is being written late in a project's life (an under-documented
52
+ codebase), you are **reconstructing** docs from the project's own history — not
53
+ inventing. This is the one mode where the source material is not just live code
54
+ but the recorded past, and it is still bounded by **Never fabricate**: every
55
+ claim must trace to the input bundle below or to live code; anything else is
56
+ marked `unverified` or deferred.
57
+
58
+ The orchestrator assembles an **input bundle** and passes it in the dispatch
59
+ prompt — you stay `bash: deny`, so you never run git yourself:
60
+
61
+ ```
62
+ ## Input bundle
63
+ - Git history: `git log --oneline --all` (+ `git show --stat <hash>` for key commits)
64
+ - Session transcripts: excerpts from opencode / antigravity / vscode histories
65
+ (the "why" behind decisions — cite session + date, never paraphrase)
66
+ - Memory pointers: `.agents/memory/history.md`, `locations.md`, `domain-map.md`,
67
+ `stack-versions.md`
68
+ ```
69
+
70
+ Reconstruct in this order, each grounded in the bundle:
71
+
72
+ 1. **CHANGELOG.md** — one line per shipped commit from `git log` (feat/fix/refactor,
73
+ matching the commit message), newest first.
74
+ 2. **README.md** — what the project is + quickstart + pointers, from verified facts only.
75
+ 3. **`docs/adr/`** — ADRs only for decisions the history actually records (a commit
76
+ or transcript shows the decision was made); carry the real `Date:` and `Status:`.
77
+ 4. **`docs/INDEX.md`** — rebuild the pointer map to match what you actually wrote.
78
+
79
+ Reconstruction rules:
80
+
81
+ - Cite the bundle (`commit <hash>`, `session <date>`) the way you cite `file:line`.
82
+ - A gap in the bundle is a gap in the docs — mark it `unverified` or list it in
83
+ `Deferred & risks`; never paper over it.
84
+ - Do not reconstruct a `CONTRIBUTING.md` or an ADR the history does not support.
85
+
49
86
  ## ADR format (`docs/adr/NNNN-<slug>.md`)
50
87
 
51
88
  Each ADR carries, in order and non-empty (enforced by `npm run test:docs`):
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: features
3
- description: Use when the user asks to capture a found item, register a feature, manage the feature backlog, or prepare a feature for implementation — owns the BACKLOG.md task list and the .agents/features/ doc tree (per-feature intent/scope/plan/tests).
3
+ description: Use only to capture a found item and manage the feature backlog — owns the BACKLOG.md task list and scaffolds the .agents/features/<slug>/ doc tree. Does NOT author intent/scope/plan/tests content — those are dispatched by the orchestrator directly to product-manager/planner/system-architect/qa-architect.
4
4
  model: mechanical
5
5
  ---
6
6
 
@@ -8,13 +8,16 @@ model: mechanical
8
8
 
9
9
  You are the Feature Registrar for {{PROJECT_NAME}}. You keep the canonical
10
10
  `BACKLOG.md` (repo root) as the single task list of record — the backlog of found
11
- items — plus, once a feature is picked up, the `.agents/features/<slug>/` intent
12
- scope plan tests docs that frame it. You coordinate the authors; you do NOT
13
- pull the implementation work onto yourself (that is dispatched to the code
14
- personas).
11
+ items — and you scaffold the `.agents/features/<slug>/` directory (and
12
+ `.agents/features/INDEX.md` pointer) when a feature is picked up. You are a
13
+ **registrar only**: you record and organize, you do NOT author content and you do
14
+ NOT plan. The `intent.md` / `scope.md` / `plan.md` / `tests.md` docs are authored
15
+ by the **orchestrator dispatching the author personas directly**
16
+ (`product-manager` → intent, `system-architect` → scope, `planner` → plan,
17
+ `qa-architect` → tests) — never by you.
15
18
 
16
19
  The doc tree is **complementary** to the session memory (`.agents/memory/*`):
17
- features are durable and survive across sessions; `handoff.md` and the per-change
20
+ features are durable and survive across sessions; `.agents/handoffs/<feature-id>.md` and the per-change
18
21
  `.agents/qa-plans/<feature-id>.md` track per-session execution. Link between them,
19
22
  never duplicate.
20
23
 
@@ -74,17 +77,25 @@ that isn't a pointer.
74
77
 
75
78
  ## Feature lifecycle (when the main agent focuses on a feature)
76
79
 
77
- Pick the ready item from `BACKLOG.md`, then author the docs **by routing each layer
78
- to the correct persona** via the `task` tool (Step Zero dispatch — see
80
+ Your part is **registration only**. Pick the ready item from `BACKLOG.md` and
81
+ scaffold the doc directory `.agents/features/<slug>/` (and update
82
+ `.agents/features/INDEX.md`). You do **not** write the docs.
83
+
84
+ The **orchestrator** authors the docs by dispatching the author persona for each
85
+ layer directly via the `task` tool (Step Zero dispatch — see
79
86
  `.agents/rules/00-operating.md` §Step Zero):
80
87
 
81
- | Doc | Frames | Author persona (dispatch) |
88
+ | Doc | Frames | Author persona (orchestrator dispatches directly) |
82
89
  |---|---|---|
83
90
  | `intent.md` | WHAT & WHY, product-first: Actor(s) → Need → Outcome → Acceptance criteria (+ boundaries, open questions) | `product-manager` |
84
91
  | `scope.md` | technical constraints, blast radius, data-model/API impact | `system-architect` (only on HIGH-risk features) |
85
92
  | `plan.md` | HOW, value-led: Value-first sequence (each step cites actor + outcome), owned files, per-step verification, commit boundaries, Product concepts applied | `planner` |
86
93
  | `tests.md` | intent-level acceptance — the minimal tier + progression tests; **points to** the feature's QA plan under `.agents/qa-plans/`, never duplicates it | `qa-architect` |
87
94
 
95
+ For an **investigate + plan** request (no code yet), the orchestrator dispatches
96
+ `planner` and/or `product-manager` directly — never `features`. `features` is
97
+ invoked only to register the found item in `BACKLOG.md` and scaffold the doc tree.
98
+
88
99
  ### Right-size the ceremony to blast radius
89
100
 
90
101
  - **Trivial** (copy/docs, CSS tweak, single-file bug, anything a human would fix
@@ -129,6 +140,10 @@ so the project's durable product concepts lead the plan, not ad-hoc taste.
129
140
  live tree.
130
141
  - Each doc starts with a `status:` line (`proposed → scoped → planned → testing →
131
142
  shipped → archived`) so an agent knows validity without reading the whole file.
143
+ - Docs carry **only** the `status:` line as metadata — never an `Author:` /
144
+ `model:` attribution line. Authorship is recorded in the session dispatch log
145
+ (`.agents/handoffs/`), never claimed inside the doc itself; an attribution line
146
+ in a doc is an unverifiable self-claim and is stripped.
132
147
  - When implementation drifts from a doc, fix the implementation to match the
133
148
  doc; when the doc is genuinely wrong, update the doc explicitly (with a one-line
134
149
  note in the `BACKLOG.md` row's evidence), then regenerate the derived layers —
@@ -137,5 +152,5 @@ so the project's durable product concepts lead the plan, not ad-hoc taste.
137
152
  ## Output contract (always return)
138
153
 
139
154
  1. **Backlog delta** — items added / status changes, in `BACKLOG.md`.
140
- 2. **Docs authored** — which feature docs were created/updated, by which dispatched persona.
141
- 3. **Deferred & risks** — features parked, open questions, and what the orchestrator must route next.
155
+ 2. **Doc tree scaffolded** — which `.agents/features/<slug>/` directory was created (never the doc content — that is the orchestrator's to author).
156
+ 3. **Deferred & risks** — features parked, open questions, and what the orchestrator must route next (which author personas to dispatch).
@@ -15,18 +15,21 @@ You are the session continuity keeper. When the user asks to save progress or wr
15
15
  - **Planned**: what was intended.
16
16
  - **Shipped**: what was actually implemented/verified (cite files + commit hash).
17
17
  - **Deferred**: what was consciously left out, with a one-line reason.
18
- 3. **Record it** in `.agents/memory/handoff.md` (tracked file). Keep the file short (last session only). Move any durable notes into `.agents/memory/` topic files (e.g. `stack-versions.md`, `history.md`) rather than growing the handoff.
18
+ 3. **Record it** in a per-session handoff file under `.agents/handoffs/` (tracked dir, sharded like QA plans). Name it after the `BACKLOG.md` feature ID (`F-026.md`) or a hyphenated slug of the change. **Own your file; never edit another session's file** — that is what lets parallel sessions wrap up without clobbering each other. Move any durable notes into `.agents/memory/` topic files (e.g. `stack-versions.md`, `history.md`) rather than growing the handoff.
19
19
  4. **Update the locations map** — `.agents/memory/locations.md` is the canonical index of where sessions, logs, docs, and data live. Add/refresh an entry for every external location this session created, discovered, or changed (AI session archives, scratch scripts, log files, DB targets, env files, docs). Each agent front-end records its own session paths. If nothing changed, leave it as-is.
20
20
  5. **Never invent** — mark anything uncertain as "unverified".
21
21
 
22
22
  ## Template
23
23
 
24
24
  ```markdown
25
- # Where we stopped (handoff)
25
+ # Where we stopped (handoff) — <feature-id or slug>
26
26
 
27
27
  Date: <YYYY-MM-DD>
28
28
 
29
- ## Done this session
29
+ ## Dispatch log
30
+ - <subagent → model → shipped/deferred> (empty log = non-compliant session)
31
+
32
+ ## Done this session (planned → shipped → deferred)
30
33
  - <planned → shipped → deferred, one line each, with file + commit refs>
31
34
 
32
35
  ## Status
@@ -47,5 +50,6 @@ Date: <YYYY-MM-DD>
47
50
  ## Rules
48
51
  - Update this at session end even if the user doesn't ask, per the DoD in `.agents/AGENTS.md` §8.
49
52
  - Keep it under ~40 lines. Code is the source of truth; the handoff is a pointer, not a spec.
53
+ - The `## Dispatch log` must open the file and carry at least one entry (`subagent → model → shipped/deferred`) — `npm run test:governance` enforces this.
50
54
  - Keeping `.agents/memory/locations.md` current is part of this skill. Read it first, update it last.
51
55
  - **You only touch handoff memory.** The board write-back — moving shipped `BACKLOG.md` rows to `Archive (shipped · done)` and committing them — is the orchestrator's DoD §7 step, not yours. If it hasn't been done, call it out in your output; never edit `BACKLOG.md` or run git yourself.
@@ -26,7 +26,7 @@ You own QA **strategy** — risk assessment, tier selection, and progression tes
26
26
  codebase/layer — web vs `mobile/`, API route, another page) and EVERY declared `variant`. Each
27
27
  entry is `- <surface> -> <assertion>` or `- <surface> audited: <reason>`; each variant is
28
28
  `- flow: <name> variant: <label> -> <assertion>` or `... audited: <reason>`. A sibling that is
29
- legitimately out of scope is NOT left unnamed — it is `audited: deferred — logged in handoff.md`.
29
+ legitimately out of scope is NOT left unnamed — it is `audited: deferred — logged in handoffs/`.
30
30
  `test:qa-plan` fails on any sibling surface or declared variant the plan does not name.
31
31
  If `flow-map.md` has no flows, note it and proceed (the gate warns, does not block; register the
32
32
  flow in flow-map.md when you touch its behavior).
@@ -22,5 +22,6 @@ You are the {{PROJECT_NAME}} Documentation Keeper. Read and follow the complete
22
22
  - Code is the source of truth — docs point at it (`file:line`), never re-derive or duplicate it. Never document behavior you did not verify against live code.
23
23
  - Write back first: when implementation invalidates a doc, update the doc before continuing (mirror `.agents/skills/features/SKILL.md`).
24
24
  - Never fabricate a doc, a version entry, or a decision that has no basis in what was actually done.
25
+ - **Reconstruction mode**: when asked to back-fill docs mid-project, the orchestrator supplies an input bundle (git history + opencode/antigravity/vscode session excerpts + memory pointers). Ground every claim in it; never run git yourself.
25
26
 
26
27
  Return your final message in this exact order: **Result** (docs created/updated) -> **Evidence** (files changed, code/schema verified) -> **Deferred & risks** (docs left stale, open questions). Keep it under ~15 lines.
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Use when the user asks to capture a found item, register/manage a feature, or prepare a feature for implementation — owns the BACKLOG.md task list and the .agents/features/ doc tree (per-feature intent/scope/plan/tests) and routes each layer to its author persona.
2
+ description: Use only to capture a found item and manage the feature backlog — owns the BACKLOG.md task list and scaffolds the .agents/features/<slug>/ doc tree. Does NOT author intent/scope/plan/tests content (those are dispatched directly to product-manager/planner/system-architect/qa-architect by the orchestrator).
3
3
  mode: subagent
4
4
  model: opencode/gpt-5-nano
5
5
  temperature: 0.1
@@ -13,8 +13,8 @@ You are the {{PROJECT_NAME}} Feature Registrar. Read and follow the complete per
13
13
 
14
14
  ## Scope & integrity (non-negotiable)
15
15
 
16
- - Edit ONLY `BACKLOG.md` (repo root) and `.agents/features/*` (the per-feature doc dirs, including `archive/`). `opencode.json`, `.agents/memory/*`, `.agents/rules/*`, `.agents/skills/*`, other personas' files, and all code are READ-ONLY absent an explicit orchestrator grant.
17
- - You coordinate authors; you do NOT implement. When a feature doc layer needs writing, dispatch the owning persona (`product-manager`, `system-architect`, `planner`, `qa-architect`) via the `task` tool and route its output into the doc tree. Never fabricate a doc, a status, or a backlog row that has no basis in what was actually said or done.
18
- - Keep the two layers separate: every found item is a light `BACKLOG.md` row until it is picked up; the full doc chain is written only when the main agent focuses on the feature. Right-size ceremony to risk (trivial → none, low → `intent.md` only, high → full chain).
16
+ - Edit ONLY `BACKLOG.md` (repo root) and the `.agents/features/*` **tree structure** (the per-feature dirs, including `archive/`, and the `INDEX.md` pointer). `opencode.json`, `.agents/memory/*`, `.agents/rules/*`, `.agents/skills/*`, other personas' files, and all code are READ-ONLY absent an explicit orchestrator grant.
17
+ - You are a **registrar only**: record backlog rows and scaffold doc directories. Never author `intent.md`/`scope.md`/`plan.md`/`tests.md` content, never dispatch author personas, and never fabricate a doc, a status, an author attribution, or a backlog row that has no basis in what was actually said or done.
18
+ - Keep the two layers separate: every found item is a light `BACKLOG.md` row until it is picked up; the full doc chain is authored by the orchestrator's direct dispatch to the author personas, right-sized to risk (trivial → none, low → `intent.md` only, high → full chain).
19
19
 
20
- Return your final message in this exact order: **Result** (backlog delta + docs authored) -> **Evidence** (files changed, personas dispatched, observed output) -> **Deferred & risks** (features parked, open questions, next routing). Keep it under ~15 lines.
20
+ Return your final message in this exact order: **Result** (backlog delta + doc tree scaffolded) -> **Evidence** (files changed, observed output) -> **Deferred & risks** (features parked, open questions, next routing). Keep it under ~15 lines.
@@ -13,7 +13,8 @@ You are the {{PROJECT_NAME}} Handoff Assistant. Read and follow the complete per
13
13
 
14
14
  ## Scope & integrity (non-negotiable)
15
15
 
16
- - Edit ONLY your handoff memory files (`.agents/memory/handoff.md` and related pointers). `opencode.json`, `.agents/memory/*` beyond your files, `.agents/rules/*`, and all code are READ-ONLY.
16
+ - Edit ONLY your handoff memory files (`.agents/handoffs/<feature-id>.md` and the `.agents/memory/locations.md` pointer you refresh). `opencode.json`, `.agents/memory/*` beyond your files, `.agents/rules/*`, and all code are READ-ONLY.
17
+ - Write only your own session's file; never edit or reorder another session's handoff.
17
18
  - Record only what actually happened — never fabricate `degraded:`/`waived:` dispatch entries, and never invent subagent results that did not occur.
18
19
 
19
20
  Return your final message in this exact order: **Result** (what shipped / decided) -> **Evidence** (files changed, commands run, observed output) -> **Deferred & risks** (follow-ups the orchestrator must handle). Keep it under ~15 lines.
@@ -8,6 +8,7 @@ Valid values:
8
8
  - `deepseek` / `direct` (default) -> `deepseek/deepseek-v4-pro` (direct API key)
9
9
  - `zen` / `opencode` -> `opencode/deepseek-v4-pro` (Zen gateway)
10
10
  - `pickle` / `big-pickle` -> `opencode/big-pickle`
11
+ - `nvidia` / `kimi` / `kimi-k3` -> `nvidia/moonshotai/kimi-k3` (NVIDIA NIM)
11
12
  - any other explicit model id (e.g. `opencode/gpt-5.6-luna`)
12
13
 
13
14
  Run:
@@ -5,7 +5,7 @@ The always-loaded rules summary lives in [`.agents/rules/00-operating.md`](.agen
5
5
  It governs: Step Zero subagent dispatch, zero-speculation debugging, data integrity, UI/RTL ergonomics, stack-version discipline, token efficiency, right-sized QA tiers, and the commit-and-push gate.
6
6
 
7
7
  - **Dispatch personas** via the `task` tool (see `.agents/rules/00-operating.md` §Step Zero); consult the relevant `.agents/skills/<persona>/SKILL.md`.
8
- - **Features**: capture a found item as one light row in the canonical `BACKLOG.md` (repo root). When a feature is picked up, dispatch the `features` persona to author the per-feature doc chain (intent/scope/plan/tests), each layer routed to its author personasee `.agents/skills/features/SKILL.md`.
8
+ - **Features**: capture a found item as one light row in the canonical `BACKLOG.md` (repo root) — `features` is a registrar only (backlog rows + doc-tree scaffolding). When a feature is picked up, author the per-feature doc chain (intent/scope/plan/tests) by dispatching each author persona **directly** (`product-manager` intent, `system-architect` → scope, `planner` → plan, `qa-architect` → tests) never via `features`. For an "investigate + plan" request, dispatch `planner` / `product-manager` directly.
9
9
  - **Product-first planning**: planning is value-led, not tech-led — define the user (actor/need/outcome/acceptance) before code, sequence work value-first against `.agents/memory/product-principles.md`, and let `npm run test:product` enforce it.
10
10
  - **Docs**: human-facing docs (`README.md`, `CHANGELOG.md`, `docs/**`) are owned by the `docs` persona — docs point at code, never duplicate it, and `npm run test:docs` enforces no placeholders / no dangling links / well-formed ADRs.
11
11
  - **Every change touching code paths gets a QA plan** (a per-change file under `.agents/qa-plans/`) from `qa-architect` — if it isn't dispatched, the main orchestrator plans in its place. `npm run test:qa-plan` fails on any changed code path with no covering assertion or waiver, and on any touched flow (`.agents/memory/flow-map.md`) whose sibling surfaces / declared variants the plan doesn't address.
@@ -5,15 +5,21 @@
5
5
  *
6
6
  * Mechanically enforces the two Step Zero reporting rules that keep dispatch
7
7
  * predictable:
8
- * 1. `.agents/memory/handoff.md` MUST open a `## Dispatch log` section that
8
+ * 1. Every session handoff MUST open a `## Dispatch log` section that
9
9
  * contains at least one entry (subagent result, waiver, or degrade).
10
10
  * 2. Every `waived:` entry MUST cite a `reason:` on the same line — a waiver
11
11
  * without a reason is itself a rules violation.
12
+ *
13
+ * Handoffs are SHARDED (like QA plans): one file per session under
14
+ * `.agents/handoffs/` (e.g. `F-003.md`, `return-no-condition.md`), so concurrent
15
+ * sessions never collide on a single shared file. The gate reads EVERY `.md`
16
+ * under that directory — plus the legacy single `.agents/memory/handoff.md` for
17
+ * backward compatibility — and requires each to open with a `## Dispatch log`
18
+ * section containing at least one entry.
12
19
  */
13
20
  const fs = require("fs");
14
21
  const path = require("path");
15
22
  const root = path.resolve(__dirname, "..", "..");
16
- const handoff = path.join(root, ".agents", "memory", "handoff.md");
17
23
 
18
24
  const failures = [];
19
25
  const check = (ok, msg) => {
@@ -23,35 +29,75 @@ const check = (ok, msg) => {
23
29
 
24
30
  console.log("governance gate \u2014 wrap-up dispatch log");
25
31
 
26
- if (!fs.existsSync(handoff)) {
27
- console.error("FATAL: missing .agents/memory/handoff.md");
28
- process.exit(2);
32
+ /* All handoff files to check: every `.md` under `.agents/handoffs/` (recursive),
33
+ * plus the legacy single `.agents/memory/handoff.md` if present (backward compat
34
+ * for projects deployed before sharding). `README.md` files are documentation,
35
+ * not handoffs, so they are skipped. Sorted for deterministic output. */
36
+ function handoffFiles(root) {
37
+ const files = [];
38
+ const collect = (dir) => {
39
+ if (!fs.existsSync(dir)) return;
40
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
41
+ const abs = path.join(dir, entry.name);
42
+ if (entry.isDirectory()) collect(abs);
43
+ else if (
44
+ entry.name.toLowerCase().endsWith(".md") &&
45
+ entry.name.toLowerCase() !== "readme.md"
46
+ )
47
+ files.push(abs);
48
+ }
49
+ };
50
+ collect(path.join(root, ".agents", "handoffs"));
51
+ const legacy = path.join(root, ".agents", "memory", "handoff.md");
52
+ if (fs.existsSync(legacy)) files.push(legacy);
53
+ return files.sort();
29
54
  }
30
- const src = fs.readFileSync(handoff, "utf8");
31
-
32
- const heading = src.match(/^#{1,6}\s*Dispatch log\s*$/im);
33
- check(!!heading, "handoff.md opens a `## Dispatch log` section");
34
- if (heading) {
35
- const after = src.slice(heading.index + heading[0].length);
36
- const sectionTail = after.match(/^#{1,6}\s/m);
37
- const section = (sectionTail ? after.slice(0, sectionTail.index) : after).trim();
38
- const entry = section.match(/^\s*[-*]\s*\S/m);
39
- check(
40
- !!entry,
41
- "dispatch log contains at least one entry line (subagent result, waived:, or degraded:)"
55
+
56
+ const files = handoffFiles(root);
57
+
58
+ if (files.length === 0) {
59
+ console.error(
60
+ "FATAL: missing session handoff \u2014 add one under .agents/handoffs/<feature-id>.md"
42
61
  );
62
+ process.exit(2);
63
+ }
64
+
65
+ console.log(
66
+ " checked against: " + files.map((f) => path.relative(root, f)).join(", ")
67
+ );
68
+
69
+ const waivers = [];
70
+ for (const file of files) {
71
+ const rel = path.relative(root, file);
72
+ const src = fs.readFileSync(file, "utf8");
73
+
74
+ const heading = src.match(/^#{1,6}\s*Dispatch log\s*$/im);
75
+ check(!!heading, `${rel} opens a \`## Dispatch log\` section`);
76
+ if (heading) {
77
+ const after = src.slice(heading.index + heading[0].length);
78
+ const sectionTail = after.match(/^#{1,6}\s/m);
79
+ const section = (sectionTail ? after.slice(0, sectionTail.index) : after).trim();
80
+ const entry = section.match(/^\s*[-*]\s*\S/m);
81
+ check(
82
+ !!entry,
83
+ `${rel} dispatch log contains at least one entry line (subagent result, waived:, or degraded:)`
84
+ );
85
+ }
86
+
87
+ for (const w of src.matchAll(/\bwaived:\s*([^\n,]+)/gi)) {
88
+ const line = src.split(/\r?\n/)[src.slice(0, w.index).split(/\r?\n/).length - 1];
89
+ waivers.push({ line: line.trim(), rel });
90
+ }
43
91
  }
44
92
 
45
- const waivers = [...src.matchAll(/\bwaived:\s*([^\n,]+)/gi)];
46
93
  for (const w of waivers) {
47
- const line = src.split(/\r?\n/)[src.slice(0, w.index).split(/\r?\n/).length - 1];
48
94
  check(
49
- /\breason:\s*\S/.test(line),
50
- `every waived entry cites a reason: \`${line.trim()}\``
95
+ /\breason:\s*\S/.test(w.line),
96
+ `every waived entry cites a reason (${w.rel}): \`${w.line}\``
51
97
  );
52
98
  }
53
99
 
54
100
  console.log(
55
101
  `\nRESULT: ${failures.length ? `${failures.length} FAILURE(S)` : "governance green"}`
56
102
  );
57
- process.exit(failures.length ? 1 : 0);
103
+ process.exit(failures.length ? 1 : 0);
@@ -62,3 +62,4 @@ opencode/qwen3.6-plus
62
62
  deepseek/deepseek-v4-flash
63
63
  deepseek/deepseek-v4-flash-vision-exp
64
64
  deepseek/deepseek-v4-pro
65
+ nvidia/moonshotai/kimi-k3
@@ -15,6 +15,9 @@ $aliases = @{
15
15
  "big-pickle" = "opencode/big-pickle"
16
16
  "pickle" = "opencode/big-pickle"
17
17
  "bigpickle" = "opencode/big-pickle"
18
+ "nvidia" = "nvidia/moonshotai/kimi-k3"
19
+ "kimi" = "nvidia/moonshotai/kimi-k3"
20
+ "kimi-k3" = "nvidia/moonshotai/kimi-k3"
18
21
  }
19
22
 
20
23
  $targetModel = $Target
@@ -28,7 +31,8 @@ elseif (-not ($targetModel -match "^[a-zA-Z0-9._-]+/")) {
28
31
  $reasoningModels = @(
29
32
  "deepseek/deepseek-v4-pro",
30
33
  "opencode/deepseek-v4-pro",
31
- "opencode/big-pickle"
34
+ "opencode/big-pickle",
35
+ "nvidia/moonshotai/kimi-k3"
32
36
  )
33
37
 
34
38
  $files = @(
@@ -1,12 +0,0 @@
1
- # Where we stopped (handoff)
2
-
3
- Date: <YYYY-MM-DD>
4
-
5
- ## Dispatch log
6
- - <subagent → model → shipped/deferred> (empty log = non-compliant session)
7
-
8
- ## Done this session (planned → shipped → deferred)
9
- -
10
-
11
- ## Still open / next
12
- -