@deepseek-insight/dsi 0.5.18 → 0.5.20
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/.agents/skills/dsi-adr/SKILL.md +121 -0
- package/.agents/skills/dsi-i18n-migrate/SKILL.md +87 -0
- package/.agents/skills/dsi-ov-setup/SKILL.md +114 -0
- package/.agents/skills/dsi-release/SKILL.md +175 -0
- package/.agents/skills/dsi-spcheck/SKILL.md +188 -0
- package/.agents/skills/dsi-spec/SKILL.md +310 -0
- package/.agents/skills/dsi-spec/references/mermaid-pattern.md +160 -0
- package/.agents/skills/dsi-spec/references/tasks-json-template.md +125 -0
- package/.agents/skills/dsi-task/SKILL.md +287 -0
- package/README.md +5 -23
- package/bin/dsi.mjs +129 -17
- package/bin/lib/mirror-skills.mjs +56 -0
- package/build/client/_app/immutable/assets/0.C4pk9RsQ.css +2 -0
- package/build/client/_app/immutable/assets/{2.GTtLKMiQ.css → 2.Dk-hwaP_.css} +1 -1
- package/build/client/_app/immutable/chunks/CodI3RGj.js +1 -0
- package/build/client/_app/immutable/chunks/{CLNDb8QN.js → CxmtCU9s.js} +1 -1
- package/build/client/_app/immutable/chunks/{Bx7fD5zN.js → DKDzTags.js} +2 -2
- package/build/client/_app/immutable/chunks/{DWBqt9Io.js → azDKH4zi.js} +1 -1
- package/build/client/_app/immutable/chunks/qIBjcgkE.js +1 -0
- package/build/client/_app/immutable/entry/{app.CnWnvioB.js → app.CqYGeqRv.js} +2 -2
- package/build/client/_app/immutable/entry/start.CIXiL_7f.js +1 -0
- package/build/client/_app/immutable/nodes/{0.B3qXb7lb.js → 0.u99aBgpL.js} +1 -1
- package/build/client/_app/immutable/nodes/{1.DdjrT3tT.js → 1.qcRcZCY6.js} +1 -1
- package/build/client/_app/immutable/nodes/2.GgqfB5rv.js +171 -0
- package/build/client/_app/version.json +1 -1
- package/build/handler.js +4 -4
- package/build/index.js +4 -4
- package/build/server/chunks/chunks/{app-config.svelte.js-rN4N5yAI.js → app-config.svelte.js-CFb4kaFl.js} +7 -3
- package/build/server/chunks/chunks/{db.js-DbbYS9o8.js → db.js-9wP1ySFv.js} +2 -2
- package/build/server/chunks/chunks/{db2.js-BQWa7bEG.js → db2.js-B_Un4Zvq.js} +7 -5
- package/build/server/chunks/chunks/{dsh-connection.js-CpcCtA42.js → dsh-connection.js-CwL9I98w.js} +4 -3
- package/build/server/chunks/chunks/{git-probe.js-CvkToKO4.js → git-probe.js-C7z6xDzg.js} +3 -3
- package/build/server/chunks/chunks/{insight-config.js-Dw_Qi0fO.js → insight-config.js-COS9LOWZ.js} +13 -4
- package/build/server/chunks/chunks/{internal.js-DKO0SoY7.js → internal.js-Bf2uRIVS.js} +2 -2
- package/build/server/chunks/chunks/{permission-state.js-yvwUSnug.js → permission-state.js-BoJAoWqi.js} +18 -15
- package/build/server/chunks/chunks/settings-home.js-CqnqJVOu.js +9 -0
- package/build/server/chunks/chunks/settings-home2.js-f75-B6RI.js +102 -0
- package/build/server/chunks/chunks/{state.js-C7gJT4Un.js → state.js-OWX1K3Yj.js} +2 -2
- package/build/server/chunks/chunks/{watcher.js-C97Xyorx.js → watcher.js-Dc9hzRLI.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/a2a/_id_/{_server.ts.js-Cqh1iqgu.js → _server.ts.js-0rfV7w20.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/a2a/{_server.ts.js-DNKD4rZu.js → _server.ts.js-DX0DUIja.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/a2a/register/{_server.ts.js-CJ-FwkrZ.js → _server.ts.js-zB-V9Naa.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/config/{_server.ts.js-CMM4kYVx.js → _server.ts.js-Bo4VgIna.js} +5 -3
- package/build/server/chunks/entries/endpoints/api/dsh/directory/{_server.ts.js-epVplzwB.js → _server.ts.js-_Wc4NU0Q.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/pick-directory/{_server.ts.js-bXHb97gT.js → _server.ts.js-CvoINUYy.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/presets/{_server.ts.js-BNOHhtzy.js → _server.ts.js-B4UwZ8nd.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/attachment/{_server.ts.js-BBi6jeVj.js → _server.ts.js-Hml2J0Bq.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/cancel/{_server.ts.js-N0nKPuqL.js → _server.ts.js-CsZ2u8cs.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/catalog/{_server.ts.js-VGFCPAbs.js → _server.ts.js-BhF1Nzig.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/command/{_server.ts.js-na_sUb0Z.js → _server.ts.js-BGXjV_Ak.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/events/{_server.ts.js-CeNf028P.js → _server.ts.js-BF4vBIja.js} +5 -4
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/fork/{_server.ts.js-DfqO-GO4.js → _server.ts.js-B2OwrEQD.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/goal/{_server.ts.js-Dj9GYNl7.js → _server.ts.js-DboY_7cp.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/history/{_server.ts.js-DqShsRl9.js → _server.ts.js-BpioYdnc.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/models/{_server.ts.js-BQSBUf70.js → _server.ts.js-CLrgUoq0.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/path/{_server.ts.js-CeCKDyKB.js → _server.ts.js-BlZr_mA6.js} +3 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/permission/{_server.ts.js-CadTCNUJ.js → _server.ts.js-BiU_IgYD.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/prompt/{_server.ts.js-BXzgi8xX.js → _server.ts.js-FV-4ougZ.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/rename/{_server.ts.js-BfD5FXiL.js → _server.ts.js-ChxB0XU5.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/respond/{_server.ts.js-CiDPC9TY.js → _server.ts.js-DkSydg_X.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/select-model/{_server.ts.js-DGcZgN96.js → _server.ts.js-Wbuf-vse.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/sessions/{_server.ts.js-DnU1CCOw.js → _server.ts.js-B-BfCKKL.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/{_server.ts.js-BZ0UV1n2.js → _server.ts.js-fKfv5g19.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file-bytes/{_server.ts.js-lxLpuPFL.js → _server.ts.js-DZpRzvas.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-tree/{_server.ts.js-Cw3vl704.js → _server.ts.js-Hn5-fnsU.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/{_server.ts.js-KKnR2UO4.js → _server.ts.js-CtPDRjV7.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/delete/{_server.ts.js-I1eSZn60.js → _server.ts.js-DOp3nIcK.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/rename/{_server.ts.js-B0zqAKnV.js → _server.ts.js-DiwcZfK9.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/prompts/_id_/{_server.ts.js-C-QN0enK.js → _server.ts.js-SoNSMvWj.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/prompts/{_server.ts.js-CwTGUPIp.js → _server.ts.js-DIZiiHk-.js} +12 -4
- package/build/server/chunks/entries/endpoints/api/prompts/use/{_server.ts.js-Bvotxm37.js → _server.ts.js-CbsUk0fk.js} +4 -3
- package/build/server/chunks/entries/endpoints/api/settings/{_server.ts.js-CRRLXk0y.js → _server.ts.js-DCeIpzKT.js} +3 -2
- package/build/server/chunks/entries/endpoints/api/settings-home/file/_server.ts.js-C1gSFX1P.js +68 -0
- package/build/server/chunks/entries/endpoints/api/settings-home/file-write/_server.ts.js-Dx0glK_q.js +68 -0
- package/build/server/chunks/entries/endpoints/api/settings-home/tree/_server.ts.js-CAmn2SKB.js +61 -0
- package/build/server/chunks/entries/endpoints/api/workspace/file-write/{_server.ts.js-DY_NDlYl.js → _server.ts.js-Blw1UFX2.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/workspace/git-events/{_server.ts.js-DHEaymrG.js → _server.ts.js-yflU8VH2.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/workspace/git-file-head/{_server.ts.js-AQgNkfCV.js → _server.ts.js-q9jXuJ1p.js} +10 -18
- package/build/server/chunks/entries/endpoints/api/workspace/git-map/{_server.ts.js-C9vxPbB3.js → _server.ts.js-YjwnbPfG.js} +12 -20
- package/build/server/chunks/entries/endpoints/api/workspace/git-status/{_server.ts.js-BlMRR11v.js → _server.ts.js-DRQay15h.js} +12 -20
- package/build/server/chunks/entries/endpoints/api/workspace/write-gate/_server.ts.js-BiCzLyNH.js +54 -0
- package/build/server/chunks/entries/pages/{_error.svelte.js-C73uxSol.js → _error.svelte.js-DkmmDHjP.js} +3 -3
- package/build/server/chunks/entries/pages/{_page.server.ts.js-ze2dUhXW.js → _page.server.ts.js-BHW1mzYQ.js} +3 -3
- package/build/server/chunks/entries/pages/{_page.svelte.js-C1cGitkt.js → _page.svelte.js-BSt3-Adz.js} +993 -532
- package/build/server/chunks/{handler-CTOEBU52.js → handler-CEAxnB4f.js} +3 -3
- package/build/server/chunks/{index.js-Bifh9-nS.js → index.js-B-3rUYGC.js} +2 -2
- package/build/server/chunks/{manifest.js-Da5_i6lM.js → manifest.js--ZDTDlzU.js} +71 -43
- package/build/server/chunks/nodes/{0.js-DIgCB7dX.js → 0.js-BQXxAZac.js} +3 -3
- package/build/server/chunks/nodes/1.js-DMcugevB.js +9 -0
- package/build/server/chunks/nodes/{2.js-DXw1-iEf.js → 2.js-BrT7uCAN.js} +9 -8
- package/package.json +3 -2
- package/template/.dsi/config.json +2 -2
- package/template/.dsi/prompts.sqlite-shm +0 -0
- package/template/.dsi/prompts.sqlite-wal +0 -0
- package/template/.dsi/settings.yaml +2 -1
- package/build/client/_app/immutable/assets/0.BQjO3ESU.css +0 -2
- package/build/client/_app/immutable/chunks/CAZxZSEb.js +0 -1
- package/build/client/_app/immutable/chunks/DvLq-YzL.js +0 -1
- package/build/client/_app/immutable/entry/start.DrunaWOx.js +0 -1
- package/build/client/_app/immutable/nodes/2.o9KKAujP.js +0 -170
- package/build/server/chunks/nodes/1.js-DPBXm0Gt.js +0 -9
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "dsi-spcheck"
|
|
3
|
+
description: "Verify feature-spec docs coherence: trace facts across Karpathy→PRD→Tasks, catch missing branches and field mismatches before execution. Reserved keywords:"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Spec Coherence Check
|
|
7
|
+
|
|
8
|
+
Verify that feature-spec deliverables are internally coherent and execution-ready.
|
|
9
|
+
Runs after `/feature-spec` produces docs, before `/execute-tasks` consumes them.
|
|
10
|
+
|
|
11
|
+
Reserved keywords: `/spec-check`, `/coherence-check`
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- After `/feature-spec` has produced all 3 deliverables (karpathy-context.md, PRD.md, Tasks.md)
|
|
16
|
+
- Before handing off to `/execute-tasks`
|
|
17
|
+
- When reviewing a spec folder you didn't author
|
|
18
|
+
- When a spec "looks fine" but execution keeps hitting gaps
|
|
19
|
+
|
|
20
|
+
## Inputs
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
/spec-check {path-to-spec-folder}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If no path given, ask. The folder must contain all 3 files:
|
|
27
|
+
- `karpathy-context.md` (base layer — source of truth)
|
|
28
|
+
- `PRD.md` (supporting layer — derives from Karpathy)
|
|
29
|
+
- `Tasks.md` (execution layer — derives from both)
|
|
30
|
+
|
|
31
|
+
## Procedure
|
|
32
|
+
|
|
33
|
+
### Step 0: Load all 3 documents
|
|
34
|
+
|
|
35
|
+
Read all files. Store in context. Do not skip any.
|
|
36
|
+
|
|
37
|
+
### Step 1: Cross-Document Fact Trace
|
|
38
|
+
|
|
39
|
+
For each critical fact, verify it appears and is consistent across all docs that need it.
|
|
40
|
+
|
|
41
|
+
**Facts to trace (Karpathy → PRD → Tasks):**
|
|
42
|
+
|
|
43
|
+
1. **Module Map entries** — every module in Karpathy Layer 3 Q3 appears in PRD Module Map. Every file touched in Tasks references a module from the map.
|
|
44
|
+
2. **Shared Utilities** — every utility in Karpathy Shared Layer appears in PRD Shared Utilities Inventory. Every import in Tasks code snippets references a function that exists in the Shared Layer.
|
|
45
|
+
3. **Edge cases** — every edge case in Karpathy Layer 2 Q4 appears (or is explicitly deferred) in PRD Edge Cases and Tasks Risk Register.
|
|
46
|
+
4. **Off-limits files** — every file in Karpathy Q6 "off-limits" is NOT modified in any Tasks task. Grep Tasks for file paths and cross-reference.
|
|
47
|
+
5. **Module boundaries** — Karpathy boundary rules are respected by Tasks code snippets. No Tasks snippet imports from a forbidden path.
|
|
48
|
+
6. **Design decisions** — each Karpathy decision has a corresponding mention in PRD. If PRD adds decisions not in Karpathy, flag for back-propagation.
|
|
49
|
+
7. **Enumerated status/state vocabulary** — grep every status/state/type/kind string literal in Tasks code snippets and SQL queries. Read the schema `CREATE TABLE` status comment and the state-machine line in the source/architecture doc. Any value not in the declared set is a silent bug: non-enforced TEXT columns accept any string, so a sibling component's query (`WHERE status = 'running'`) silently misses rows stored under a different literal (`in_progress`). Trace each literal across every doc that touches it — including the architecture/source doc itself, which is often internally inconsistent (schema says one value, prose examples another).
|
|
50
|
+
8. **Cross-feature dependencies** — when a feature references modules defined in another feature's spec (look for cross-refs like "(F1)", "Feature N", or import paths into sibling spec folders), open the referenced feature's spec and verify each claim against its own Module Map and Tasks:
|
|
51
|
+
- **Export location** — the consuming feature's import points to the file the defining feature actually names as the export site (e.g., F4 PRD says `describeInputError()` lives in `discovery.ts`; F1 spec places it in `permission.ts` — wrong path breaks every import).
|
|
52
|
+
- **Import style** — if the consuming feature imports from a barrel (`./audio/index.js`), confirm the defining feature specifies a barrel `index.ts` and the codebase actually uses barrels (count `index.ts` under the target dir). Zero barrels + barrel import = compile failure or empty module.
|
|
53
|
+
- **Signature contract** — the consuming feature calls the function with the arg count and return type the defining feature declares.
|
|
54
|
+
**Per-entity vocabularies:** a codebase may define different status sets per entity type (e.g. tasks: `running`; features/waves: `in_progress`). When a literal is valid for one entity but wrong for another, trace per-entity with context-scoped grep — never globally find-replace a bare literal or you corrupt the valid entity's references. To verify each remaining occurrence, read its surrounding sentence/row for the entity name before deciding to change it.
|
|
55
|
+
|
|
56
|
+
**Evidence requirement — avoid false-positive gaps.** Every Step 1 gap must cite verifiable evidence from the actual file: the quoted heading text or a `grep` count. Two recurring false positives:
|
|
57
|
+
- **"Section X is missing"** when it exists under another heading or section number. Read the full file and `grep` for the heading words before asserting absence.
|
|
58
|
+
- **"Doc references function Y"** that the doc never mentions. `grep` the doc for the symbol before claiming a reference.
|
|
59
|
+
|
|
60
|
+
A gap with no quoted source evidence is a false positive — do not report it.
|
|
61
|
+
|
|
62
|
+
### Step 2: Source-Code Reality Check
|
|
63
|
+
|
|
64
|
+
For each file the Tasks document instructs the executor to create or modify:
|
|
65
|
+
|
|
66
|
+
1. **Read the actual file** from disk.
|
|
67
|
+
2. **Verify field names** — Tasks code snippets use the same field names as the source. Flag mismatches.
|
|
68
|
+
3. **Verify render/processing chains** — if Tasks shows a BEFORE/AFTER diff, does the BEFORE match the actual current source? Missing branches = silent deletion risk.
|
|
69
|
+
4. **Verify function signatures** — Tasks snippets call functions with correct signature as the source.
|
|
70
|
+
5. **Check for undocumented branches** — if source has conditional branches that Tasks BEFORE/AFTER doesn't show, flag them. Executor might delete them.
|
|
71
|
+
6. **Verify target directories exist** — for each *new* file path in Tasks, `ls` its parent directory. If absent, the spec must instruct `mkdir -p` before file creation; otherwise every import of that path fails at compile time. Grep all import paths against the real tree before trusting them.
|
|
72
|
+
7. **Verify styling tokens match the project token system** — read `app.css` (or design-token source) for the actual CSS custom properties and utility classes the project uses. Flag generic framework defaults (e.g. `bg-green-500`, `text-red-500`) that don't map to project tokens (`text-status-pass`, `text-accent-blue`): same color name ≠ same hex value, so they silently break visual consistency.
|
|
73
|
+
8. **Verify code-structure pattern matches codebase convention** — when spec code snippets introduce a new module that has a structural analog in the existing codebase (another polling service, another reactive store, another API reader), read that analog and confirm the new code follows the same structural pattern (factory function vs class, lifecycle hook shape, module export style). A class where the codebase uses factory functions compiles fine but diverges from convention and creates maintenance friction. Fix in lockstep across all docs that show the snippet.
|
|
74
|
+
|
|
75
|
+
9. **Trace consumed fields through the whole chain** — for each field a Tasks/PRD UI snippet consumes, verify the full chain exists in source: DB column → query/SELECT → view-model interface → mapper function → prop reference. View-model mappers routinely drop columns, so a missing link compiles clean and the affordance silently never renders. Report a consumed field with no full chain as a MEDIUM gap; the fix is a task extending the chain (interface + mapper + one reader test) plus the map rows. **Done when** every field a snippet consumes traces column → SELECT → view-model → prop.
|
|
76
|
+
|
|
77
|
+
10. **Recompute exact computed literals asserted by Tasks** — when a Tasks unit assertion pins an exact string produced by arithmetic or framework interpolation (e.g. `width: {100 / zoom}%` → `105.26315789473685%`), never trust the digits in the doc: recompute with `node -e`. Floating-point last-digit drift (`…684` vs `…685`) is invisible to reading and fails the test on first run, tempting the executor to loosen the assertion. If serialization format matters (property order, spacing, decimals), confirm with a live mount probe per Step 3.4 — heavy children stubbed via `vi.mock('$lib/components/.../Heavy.svelte', async () => ({ default: (await import('./Stub.svelte')).default }))`; a plain-object mock throws `TypeError: default is not a function`. Run, capture the literal, delete the probe. A single recomputed literal fix qualifies for the CRITICAL auto-patch exception — grep all docs for the literal and patch every occurrence in lockstep. **Done when** every exact literal asserted in Tasks matches recomputed or probe output.
|
|
78
|
+
|
|
79
|
+
11. **Verify the test runner collects, env-maps, and gates every new test file** — for each test path Tasks creates:
|
|
80
|
+
- **Net-new claim:** repo-wide search by basename AND by imported symbol before trusting "no tests exist"/"net-new" in any doc. A probe of one directory (`tests/unit/`) hides an existing suite elsewhere (`tests/lib/server/…`) whose assertions may pin the behavior being changed.
|
|
81
|
+
- **Collection + environment:** read the runner config (vitest `include` + `environmentMatchGlobs`, Playwright `testDir`/`testIgnore`/`grep`) and confirm the path is both collected and mapped to the environment its imports need — a `node:sqlite` import in a path not mapped to node env crashes at import under the default DOM env. Silent in review, CRITICAL on first run.
|
|
82
|
+
- **Gate coverage:** confirm the DoD gate command executes the file. A Playwright `grep` like `/^(?!.*@orchestration).*$/i` drops tagged specs from the default run — "all green" passes while the new e2e never ran; the DoD must name the extra `--grep @tag` invocation. Naming the invocation is not enough: Playwright ANDs config `grep` with CLI `--grep`, so when the config excludes the tag, `--grep @tag` selects ZERO tests and still exits 0 — a named-but-silent no-op gate. Execute each prescribed gate command once during the check and read the reporter's collected/passed count; zero collected = gap (record the working invocation — e.g. a sibling config that clears only `grep`, run via `--config` — in the DoD). Do not prescribe `--pass-with-no-tests` on a gate.
|
|
83
|
+
Flag every mismatch with the config line that proves it. **Done when** every new test file traces path → collected → correct environment → a gate command that demonstrably collects a non-empty set.
|
|
84
|
+
|
|
85
|
+
12. **Verify guard-insertion anchors against surrounding side effects** — when a task says "insert guard before `<call>`", read the whole block from the anchor to the branch end: a counter or flag the anchor skips (`unreported++`) often feeds a later conditional write (`updateWaveStatus(wave.id, 'failed')`), so skipping only the named call still fires the downstream write and the guarded incident recurs one level up. Trace every statement the guard skips to its consumer; when one reaches a write, flag the anchor as load-bearing, require the task to name the exact line (counter included), and add a test case pinning the downstream write untouched while deferred (2026-08-20 latch-unlock spec: "before `resetTaskForRedispatch`" left the wave marked failed while its worker streamed). **Done when** every prescribed guard sits before every side effect it must suppress.
|
|
86
|
+
|
|
87
|
+
### Step 3: Bug and Quirk Discovery
|
|
88
|
+
|
|
89
|
+
Compare duplicate or parallel logic across components for undocumented bugs:
|
|
90
|
+
|
|
91
|
+
1. If two components implement the same logic (e.g., duplicate `isMarkdown()` vs `hasMarkdownSyntax()`), diff them. Any differences (even character-level like `\\x08` vs `\\b`) must be documented.
|
|
92
|
+
2. Check for caps, limits, or truncation logic in existing functions that new patterns might trigger (e.g., 3-tool cap in `enrichToolName()`).
|
|
93
|
+
3. Any discovered bug that the refactoring silently fixes must be called out in both Karpathy edge cases and Tasks risk register.
|
|
94
|
+
4. **Execute claimed behavioral bugs** — when a spec asserts a runtime bug, reproduce it before judging severity: write a temporary probe test in the project's own runner that imports the real module (aliases resolve; never hand-strip TypeScript for `node -e`), run it, delete the file. Probe the happy path too, not only the documented variant — severity is often understated.
|
|
95
|
+
5. **Find tests that pin the pre-fix behavior** — when a wave changes behavior, grep test files for expected values equal to the current buggy output; comments like "WIP bug" or "documents current behavior" mark them. Flag each pinned assertion with exact file and line in the gap list so the executor flips them alongside the fix instead of reverting the fix to satisfy them.
|
|
96
|
+
|
|
97
|
+
6. **Execute prescribed design mechanics, not just claimed bugs** — when Tasks prescribes a new integration pattern or branch (snippet prop through a container, sentinel early-return, drag math), validate it by running it: back up the target file (`cp` to /tmp), apply the spec's exact snippet to the real component, mount in the project's own runner with heavy children stubbed, run, then restore from the backup and confirm `git diff` shows the file clean. Dispatch the real trigger events (e.g. `mousedown` → `mousemove`) and assert the post-interaction value; a probe that asserts the initial state without firing the event passes vacuously and proves nothing. If a `vi.mock` fails on a missing export (icon library pulled in by the import chain), mock the heavy child component one level down instead of the library. A failing design probe is a CRITICAL gap — the spec's core mechanism does not work as written. **Done when** every prescribed pattern that can run headless has an executed probe, and the working tree is verified clean afterward.
|
|
98
|
+
|
|
99
|
+
### Step 4: Question-Count Verification
|
|
100
|
+
|
|
101
|
+
Verify Karpathy Layer 3 has exactly 8 questions per the feature-spec skill:
|
|
102
|
+
- Q1: persistent context
|
|
103
|
+
- Q2: non-negotiable conventions
|
|
104
|
+
- Q3: workspace structure + Module Map
|
|
105
|
+
- Q4: Module Communication Map
|
|
106
|
+
- Q5: Shared Layer
|
|
107
|
+
- Q6: files off-limits + module boundary rules (SINGLE question)
|
|
108
|
+
- Q7: verification automation
|
|
109
|
+
- Q8: build and test
|
|
110
|
+
|
|
111
|
+
If split or renumbered, flag.
|
|
112
|
+
|
|
113
|
+
### Step 5: Output and Save Coherence Report
|
|
114
|
+
|
|
115
|
+
Save the full report as `spec-check.md` in the **same spec folder** as the input docs.
|
|
116
|
+
This ensures findings persist alongside the deliverables for human review without scrolling chat history.
|
|
117
|
+
|
|
118
|
+
Then present a summary in chat:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
📋 Spec Coherence Check: {feature name}
|
|
122
|
+
Source: {path}
|
|
123
|
+
Report saved: {path}/spec-check.md
|
|
124
|
+
|
|
125
|
+
[✅/❌] 1. Cross-document fact trace
|
|
126
|
+
[✅/❌] 2. Source-code reality check
|
|
127
|
+
[✅/❌] 3. Bug and quirk discovery
|
|
128
|
+
[✅/❌] 4. Question-count verification
|
|
129
|
+
|
|
130
|
+
Gaps found: {count}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
For each gap in the saved report:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
⚠️ GAP-{N} ({severity: CRITICAL/MEDIUM/LOW})
|
|
137
|
+
Layer: {which doc(s)}
|
|
138
|
+
Issue: {one line}
|
|
139
|
+
Impact: {what breaks during execution}
|
|
140
|
+
Fix: {concrete patch instruction}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Default: report gaps only, do not auto-patch — most coherence fixes involve design judgment.
|
|
144
|
+
|
|
145
|
+
**Exception — auto-patch CRITICAL gaps with verifiable source-grounded fixes.**
|
|
146
|
+
Apply a fix directly when ALL of:
|
|
147
|
+
- Severity is CRITICAL (would break execution: compile error, runtime failure, malformed request)
|
|
148
|
+
- The correct value is grounded in existing source on disk (read the actual file, confirm the export/import/API param)
|
|
149
|
+
- The fix changes one fact in lockstep across every doc that contains it (PRD AND Tasks — never patch one layer and leave the contradiction in the other)
|
|
150
|
+
|
|
151
|
+
Then in the summary, mark each applied fix with ✅ APPLIED and the source file that grounded it.
|
|
152
|
+
MEDIUM/LOW gaps and any fix requiring a design decision stay report-only.
|
|
153
|
+
|
|
154
|
+
## Remediation Pass — when the user says "fix the gaps"
|
|
155
|
+
|
|
156
|
+
Runs only on explicit user request after a check; never remediate unprompted.
|
|
157
|
+
|
|
158
|
+
1. Classify each gap: doc-only fact rewrite, full-chain code fix, or design decision. Resolve design-decision gaps in this pass — the explicit request authorizes the decision: pick the option with codebase precedent, write the chosen option and rationale into the task body (both twins), and append the resolved decisions to karpathy-context.md so the base layer keeps up. When the chosen option anchors on parity with shipped behavior, verify that behavior in shipped code first — read the full handler chain (a child handler that `preventDefault`s and `return`s never reaches the parent; one handler read proves nothing); if code disproves the gap's own premise, the real contradiction is doc-vs-doc — fix the contradicting doc and amend the gap's issue text in spec-check.md with a strike-through correction so the audit trail stays honest. Done when every design-decision gap names its chosen option in Tasks.md, Tasks.json, and karpathy-context.md. Design decisions stay report-only during the check phase, before any remediation request.
|
|
159
|
+
2. Fix full-chain gaps link by link — type → mapper → shared util → component — adding one test per link. When a component would duplicate an existing helper, promote the helper to the shared layer instead of adding another copy.
|
|
160
|
+
3. Update every doc carrying the fact in lockstep: karpathy-context.md, PRD.md, Tasks.md, AND the Tasks.json twin — plus any ADR or architecture doc the fact appears in (grep the whole docs tree for the superseded phrasing: the contradicting row often lives in an ADR outside the spec folder). Task status, filesInvolved, and checklists must agree across both twins. Compose the Tasks.json edit from a fresh read of the exact block — grep-reconstructed JSON drifts on quotes and whitespace and fails the exact-match edit. Verify twin agreement programmatically after the edits (taskNumbers, titles, files, deps): strip inline backticks before matching MD headings to JSON titles — MD styles code spans (`` `/api/sessions` ``) where JSON holds plain text, so naive string matching flags pre-existing styling as drift. Confirm each residual flag against the pre-edit git commit before treating it as remediation drift.
|
|
161
|
+
4. Parse-verify the Tasks.json twin through the project's real reader (e.g. `readTasksJson`); eyeball parity is not verification. Read the reader's return interface before probing: readers transform fields — `readTasksJson` joins `filesInvolved` into a comma-joined string (DB-column format) though the raw JSON holds arrays — so probe with `filesInvolved.includes('path')`; array methods (`.some`, indexing) throw or return string garbage. Run the reader through a temporary vitest test in the project's own runner (TS and `$lib` aliases resolve there; a plain node script cannot import the module), assert the remediated facts appear in the parsed task descriptions — parse success alone proves nothing — then delete the probe and confirm a clean `git status`.
|
|
162
|
+
5. Run full gates and compare counts to baseline (unit tests = baseline + N new; type-check = baseline). Unexpected drift blocks completion.
|
|
163
|
+
6. Execute the task's manual verification live (headed browser, DOM query) and archive dated evidence under `test-results/`; mark the task done with timestamp + evidence path.
|
|
164
|
+
7. Sweep the spec folder for stale terms before reporting done: grep every value the edits superseded (old paths, old counts, old phrasing like "both surfaces"). Lockstep edits leave stragglers — one twin updated while its sibling keeps the old value. Fix each hit and re-sweep until the grep exits empty.
|
|
165
|
+
8. Append a remediation section to `spec-check.md`: gap → resolution → files touched, plus gate counts.
|
|
166
|
+
|
|
167
|
+
Done when every reported gap maps to a resolution row or an explicit user deferral.
|
|
168
|
+
|
|
169
|
+
## What This Skill Does NOT Do
|
|
170
|
+
|
|
171
|
+
- Does not check mermaid syntax (feature-spec Step 4.2 handles that)
|
|
172
|
+
- Does not check layman paragraphs (feature-spec Step 4.7 handles that)
|
|
173
|
+
- Does not re-run the feature-spec pipeline
|
|
174
|
+
- Does not auto-patch documents
|
|
175
|
+
|
|
176
|
+
## Evidence
|
|
177
|
+
|
|
178
|
+
Discovered during 2026-08-05 audit of `2026-08-04 - Exec-Tool-Enrichment-and-Markdown-Rendering` spec:
|
|
179
|
+
- Task 2.1 BEFORE/AFTER omitted ChipDetail's MemoryBlock/WebFetchBlock branches
|
|
180
|
+
- Task 2.2 said "same as ChipDetail" but components have different render chains
|
|
181
|
+
- `\\x08` bug in StandaloneToolCall's duplicate `isMarkdown()` undocumented across all 3 docs
|
|
182
|
+
- 3-tool cap in `enrichToolName()` undocumented
|
|
183
|
+
- Edge cases diverged (Karpathy: 6, PRD: 8, Tasks risk: 4, only 3 overlapped)
|
|
184
|
+
- Layer 3 had 9 questions instead of 8 (Q6 split into Q6+Q7)
|
|
185
|
+
|
|
186
|
+
Root cause: LLM attention degradation during long document generation. "Every X" rules degrade to "most X" by the third document.
|
|
187
|
+
|
|
188
|
+
Reference: `AI Research/YT-Research/2026-06-22 - Why Long Instructions Make AI Dumber - Attention Degradation Science.md`
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "dsi-spec"
|
|
3
|
+
description: "Analyze a feature request, self-interrogate via Karpathy method, and generate PRD + tasks document. One trigger produces the full spec pipeline. Reserved keywor"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature Spec
|
|
7
|
+
|
|
8
|
+
One trigger → full spec pipeline. Analyze codebase, brainstorm internally via Karpathy 3-layer method, produce PRD + tasks document with execution checklists.
|
|
9
|
+
|
|
10
|
+
## SYSTEM PROTOCOL: ARCHITECTURAL DECOMPOSITION ENGINE
|
|
11
|
+
|
|
12
|
+
When translating raw requirements into technical specifications, you must enforce a decoupled, event-driven architecture. Never define monolithic implementations. Every feature spec must be structured around three pillars:
|
|
13
|
+
|
|
14
|
+
### 1. MODULE ISOLATION (Where it lives)
|
|
15
|
+
- Identify the primary execution boundary for the feature.
|
|
16
|
+
- Assign the logic to a single, dedicated functional module directory.
|
|
17
|
+
- Enforce a strict "one responsibility per module" rule.
|
|
18
|
+
|
|
19
|
+
### 2. MODULE COMMUNICATION (How they interact)
|
|
20
|
+
- Map module interactions using a decoupled pattern appropriate to the project (event bus, pub/sub, message passing, dependency injection, middleware chain, hook registration, shared state, API contracts, etc.).
|
|
21
|
+
- Specify which modules emit events, which modules listen, and what data flows between them.
|
|
22
|
+
- Prohibit modules from directly calling each other's internal functions; cross-cutting concerns must route through a defined communication layer.
|
|
23
|
+
- If the project has a central orchestrator (main entry point, router, event bus host), document where module registration or wiring happens.
|
|
24
|
+
|
|
25
|
+
### 3. CROSS-CUTTING COMPONENT UTILITIES (How it shares)
|
|
26
|
+
- Identify shared utility patterns (such as global state verification, global logging, or shared validation).
|
|
27
|
+
- Isolate these into a centralized "Shared Layer" to be imported by modules, maintaining strict DRY (Don't Repeat Yourself) compliance.
|
|
28
|
+
|
|
29
|
+
### Enforcement Rules
|
|
30
|
+
- Every PRD section "Proposed Architecture" MUST include:
|
|
31
|
+
- A **Module Map** table: module name → directory → responsibility
|
|
32
|
+
- A **Module Communication Map** table: module → communication pattern → what it emits/listens to
|
|
33
|
+
- A **Shared Utilities Inventory**: utilities available to all modules
|
|
34
|
+
- Every Tasks.md wave MUST verify the module decomposition is physically correct (directory structure matches the logical design)
|
|
35
|
+
- Sequence diagrams in the PRD MUST show data/event flow between modules, not direct function calls
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## When to Use
|
|
40
|
+
|
|
41
|
+
- User says `/feature-spec {feature description}` with a project path
|
|
42
|
+
- User says "spec out the WebSocket feature" or "I need a PRD for X"
|
|
43
|
+
- User provides a project path and asks to plan a feature
|
|
44
|
+
|
|
45
|
+
### Step 0: No Params — Usage Guide
|
|
46
|
+
|
|
47
|
+
When the user sends `/feature-spec` with no arguments:
|
|
48
|
+
|
|
49
|
+
1. Ask for the two required inputs:
|
|
50
|
+
- **Feature description** — what to build (one sentence is enough)
|
|
51
|
+
- **Project path** — the codebase root to analyze
|
|
52
|
+
2. Reply with a usage guide — NOT execution
|
|
53
|
+
|
|
54
|
+
**Response format:**
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
📋 **Feature Spec** — No inputs specified. I need two things:
|
|
58
|
+
|
|
59
|
+
1. **Feature description** — what you want to build
|
|
60
|
+
Example: "Add real-time WebSocket updates to openclaw-insight"
|
|
61
|
+
|
|
62
|
+
2. **Project path** — the codebase root to analyze
|
|
63
|
+
Example: `~/openclaw-insight`
|
|
64
|
+
|
|
65
|
+
Usage: `/feature-spec {feature description} {project-path}`
|
|
66
|
+
|
|
67
|
+
Or just describe the feature and I'll ask which project if unclear.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Rules:**
|
|
71
|
+
- If only the feature is provided but no project path, check workspace context for the likely project — if unclear, ask
|
|
72
|
+
- If only the project path is provided, ask what feature to spec — don't guess
|
|
73
|
+
- Do NOT proceed to Step 1 (Codebase Analysis) until both inputs are confirmed
|
|
74
|
+
|
|
75
|
+
## How It Works
|
|
76
|
+
|
|
77
|
+
This skill orchestrates three sub-steps internally. The user sees ONE checklist for the whole pipeline, not three separate checklists. This prevents attention degradation — the model carries one pipeline context, not three.
|
|
78
|
+
|
|
79
|
+
```mermaid
|
|
80
|
+
flowchart LR
|
|
81
|
+
A["/feature-spec<br/>user request"] --> B["Phase 1:<br/>Codebase Analysis"]
|
|
82
|
+
B --> C["Phase 2:<br/>Karpathy Self-Interrogation<br/>3 layers, internal"]
|
|
83
|
+
C --> D["Phase 3:<br/>Generate Documents<br/>PRD + Tasks"]
|
|
84
|
+
D --> E["User reviews<br/>deliverables"]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Step 0.5: Date Resolution ⛔ MANDATORY
|
|
90
|
+
|
|
91
|
+
Before constructing any date-prefixed filenames, resolve today's date via `date +%Y-%m-%d`. Store as `TODAY`. Never infer from context.
|
|
92
|
+
<!-- RCA: AI-Research/Troubleshoot/2026-06-18 - Wrong Date Prefix in yt-research Filename - RCA.md -->
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Step 1: Codebase Analysis
|
|
97
|
+
|
|
98
|
+
Understand the existing code before speculating about changes.
|
|
99
|
+
|
|
100
|
+
**What to do:**
|
|
101
|
+
1. Read the project structure (package.json, src layout)
|
|
102
|
+
2. Read the files the feature will touch or depend on
|
|
103
|
+
3. Read existing tests (Playwright + unit)
|
|
104
|
+
4. Identify the gap: what exists vs. what's needed
|
|
105
|
+
5. Read any existing `dev/specs/` pages for prior context
|
|
106
|
+
6. Verify each suspected behavioral gap with an executable probe before claiming it: write a throwaway test that imports the real module and asserts the promised behavior, run it, and cite the pass/fail output as gap evidence — then delete the probe file
|
|
107
|
+
- Place probes inside the project's vitest `include` glob (e.g. `tests/unit/_probe.test.ts`); paths outside it return "No test files found"
|
|
108
|
+
- Read DOM interaction state (highlight, aria-selected, caret, value) in ONE `evaluate()` pass; locator lists captured across re-renders go stale and report false regressions
|
|
109
|
+
- When a probe contradicts the source reading (the binding or logic visibly exists), re-probe with a cleaner instrument before recording the gap; if an already-recorded claim is falsified, correct the upstream doc with a retraction note and keep the clean probe only as a promoted regression spec
|
|
110
|
+
- When the request leaves a product decision the codebase cannot answer (which entity an action targets, what a named control actually does), ask the user with 2-3 concrete options via ask_user before writing any document; record the chosen option with its date in the Karpathy Layer 2 assumptions. Codebase facts go to probes; product semantics go to the user
|
|
111
|
+
- Done when every behavioral gap cites file/line evidence or probe output, no probe files remain in the tree, and every product ambiguity cites a recorded user decision
|
|
112
|
+
|
|
113
|
+
**Output to user:** Brief analysis summary (3-5 bullet points). NOT a document. Just enough to confirm the model understood the codebase correctly.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Step 2: Karpathy Self-Interrogation (Internal)
|
|
118
|
+
|
|
119
|
+
Run the 3-layer Karpathy method **internally** — brainstorming with yourself, not interrogating the user. The user already gave the feature request; you fill in the gaps by reading the codebase.
|
|
120
|
+
|
|
121
|
+
### Layer 1: Spec
|
|
122
|
+
|
|
123
|
+
Answer these questions from codebase evidence (not guessing):
|
|
124
|
+
|
|
125
|
+
1. What is the real goal? (Surface task vs. deeper outcome)
|
|
126
|
+
2. What decision does this feature drive?
|
|
127
|
+
3. What is the success threshold? (Measurable, specific)
|
|
128
|
+
4. What are the failure conditions?
|
|
129
|
+
5. What existing alternatives exist? Why build this?
|
|
130
|
+
6. What is IN scope and OUT of scope?
|
|
131
|
+
7. Who is the user?
|
|
132
|
+
8. What is the technical constraints?
|
|
133
|
+
|
|
134
|
+
### Layer 2: Verifier
|
|
135
|
+
|
|
136
|
+
1. What are the acceptance criteria per feature?
|
|
137
|
+
2. What is the user acceptance test? (First thing they'd try)
|
|
138
|
+
3. What existing feature is most likely to break? (Regression target)
|
|
139
|
+
4. What are the edge cases?
|
|
140
|
+
5. What assumptions are we making? Which are critical?
|
|
141
|
+
6. What is the weakest point? (A senior engineer would question this)
|
|
142
|
+
|
|
143
|
+
### Layer 3: Environment
|
|
144
|
+
|
|
145
|
+
1. What persistent context does the AI need every session?
|
|
146
|
+
2. What are the non-negotiable conventions?
|
|
147
|
+
3. What is the workspace structure — including the **Module Map** (module → directory → responsibility)?
|
|
148
|
+
4. What are the **Module Communication Map** entries (module → communication pattern → what it emits/listens to)?
|
|
149
|
+
5. What lives in the **Shared Layer** (shared utilities, types, validators)?
|
|
150
|
+
6. What files are off-limits to modify? What are the module boundary rules (no cross-module imports)?
|
|
151
|
+
7. What verification automation exists?
|
|
152
|
+
8. How does the project build and test?
|
|
153
|
+
|
|
154
|
+
**Output to user:** Nothing. This is internal brainstorming. The results go into the Karpathy context file and inform the documents.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Step 3: Generate Documents
|
|
159
|
+
|
|
160
|
+
### Document 1: PRD
|
|
161
|
+
|
|
162
|
+
Save to: `{project-path}/dev/specs/{TODAY} - {Feature Name}/PRD.md`
|
|
163
|
+
|
|
164
|
+
**Contents:**
|
|
165
|
+
1. Current architecture — how it works today (with mermaid flowchart + sequence diagram)
|
|
166
|
+
2. Gap analysis — why current approach falls short
|
|
167
|
+
3. Proposed architecture — how it should work (with mermaid flowchart + sequence diagram)
|
|
168
|
+
|
|
169
|
+
**⚠️ Mermaid Syntax & Accessibility Rules — see `references/mermaid-pattern.md` for full details. Key rules:**
|
|
170
|
+
- **No `style` directives inside `sequenceDiagram` blocks** — causes parse error in Obsidian
|
|
171
|
+
- **No `#`, raw `>`, or colons inside mermaid message/label text** — causes parse error
|
|
172
|
+
- **No `&` multi-target syntax in flowchart arrows** — use separate arrow lines
|
|
173
|
+
- **No special chars (→, -, :, &, ", parens) in mindmap node text**
|
|
174
|
+
- **All flowchart `style` directives must use WCAG AA colors with `color:#fff`** — approved palette in reference file
|
|
175
|
+
- **Sequence diagrams are CONDITIONAL** — only when actors with message flows exist. Do NOT force for purely conceptual content.
|
|
176
|
+
- **Pre-save mermaid checklist (12 items)** in `references/mermaid-pattern.md` — verify before saving
|
|
177
|
+
4. Feature analysis — how each existing feature connects to the new module
|
|
178
|
+
5. Data flow diagrams — how data moves through the system
|
|
179
|
+
6. Playwright test infrastructure — existing tests, what they cover, why they matter
|
|
180
|
+
<!-- RCA: AI-Research/Troubleshoot/2026-06-13 - Playwright omitted from PRD despite 6 existing test files -->
|
|
181
|
+
|
|
182
|
+
**Writing rule:** Every section must have a layman paragraph ("In plain terms: ...") before technical content.
|
|
183
|
+
|
|
184
|
+
### Document 2: Tasks
|
|
185
|
+
|
|
186
|
+
Save to: `{project-path}/dev/specs/{TODAY} - {Feature Name}/Tasks.md`
|
|
187
|
+
|
|
188
|
+
**Contents:**
|
|
189
|
+
1. Execution checklist — `⛔ Behavioral Commitments` as PUBLIC checklists (not private anti-patterns)
|
|
190
|
+
2. Task summary — mermaid dependency graph
|
|
191
|
+
3. Tasks by wave — dependency-ordered, each wave ships standalone value
|
|
192
|
+
4. Per-wave execution checklist — template with behavioral commitments, sub-agent safety, completion gate
|
|
193
|
+
5. **Unit test tasks — every code-writing task MUST have a paired test task** (e.g., if Task 1.1 adds a function, Task 1.1-T adds unit tests for it). Test tasks live in the same wave as the code they test.
|
|
194
|
+
6. Playwright regression tasks — after each code-modifying wave
|
|
195
|
+
7. Feature compatibility matrix — proving existing features survive each wave
|
|
196
|
+
8. Risk register — known risks with mitigation
|
|
197
|
+
9. Definition of Done — public checklist
|
|
198
|
+
|
|
199
|
+
**Twin rule:** Tasks.md is the *human* view. Every Tasks.md ships with a machine-readable twin `Tasks.json` (Document 4) rendered from the same internal model — never one without the other. The orchestration DB ingests the JSON directly; humans and AI executors read the Markdown.
|
|
200
|
+
|
|
201
|
+
### Document 3: Karpathy Context
|
|
202
|
+
|
|
203
|
+
Save to: `{project-path}/dev/specs/{TODAY} - {Feature Name}/karpathy-context.md`
|
|
204
|
+
|
|
205
|
+
**Contents:** All 3 layers as structured markdown. This is the internal context file the task-executor loads when executing.
|
|
206
|
+
|
|
207
|
+
### Document 4: Tasks Machine Twin (Tasks.json)
|
|
208
|
+
|
|
209
|
+
Save to: `{project-path}/dev/specs/{TODAY} - {Feature Name}/Tasks.json`
|
|
210
|
+
|
|
211
|
+
The binding machine contract — the orchestration register flow maps these keys one-to-one into SQLite. **Rules:**
|
|
212
|
+
|
|
213
|
+
- Rendered from the SAME internal model that renders Tasks.md — waves, task numbers, titles, and dependencies identical by construction
|
|
214
|
+
- Must pass every validation rule in `references/tasks-json-template.md` before saving
|
|
215
|
+
- `featureSlug` MUST equal the consumer's `deriveFeatureSlug(folderName)` — grep it from `src/lib/server/orchestration/tasks-json.ts` in openclaw-insight and replicate exactly in a one-off script before saving; never approximate with a hand-rolled regex. Algorithm: strip date prefix `^\d{4}-\d{2}-\d{2}[- ]*`, lowercase, collapse spaces/hyphens to one `-`, drop other non-alphanumerics, trim edge hyphens — internal hyphens survive ("2026-08-21 - DSI Honest Inspector POC-2" → `dsi-honest-inspector-poc-2`, not `...poc2`). Assert `featureSlug === derived` in the save verification and reuse the slug verbatim in Tasks.md board-post IDs
|
|
216
|
+
- Never hand-edit one twin without regenerating the other
|
|
217
|
+
|
|
218
|
+
**Full template, validation rules, and the JSON to SQLite field map:** `references/tasks-json-template.md`
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Step 4: Post-Save Verification ⛔ MANDATORY
|
|
223
|
+
|
|
224
|
+
Before declaring the pipeline complete, output the checklist to the user, then verify each item. Do NOT check silently.
|
|
225
|
+
<!-- RCA: AI-Research/Troubleshoot/2026-06-11 - ADDITIONAL_PAGES Three Generations Same Bug - RCA.md -->
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Pipeline Checklist — MANDATORY
|
|
230
|
+
|
|
231
|
+
This is the ONLY checklist output to the user. Declared at the start. Verified at the end.
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
📋 feature-spec: {feature name} — {project name}
|
|
235
|
+
|
|
236
|
+
[ ] 0.5 ⛔ Resolve today's date via `date +%Y-%m-%d` (store as TODAY)
|
|
237
|
+
|
|
238
|
+
Step 1: Codebase Analysis
|
|
239
|
+
[ ] 1.1 Project structure read (package.json, src/)
|
|
240
|
+
[ ] 1.2 Relevant source files analyzed
|
|
241
|
+
[ ] 1.3 Existing tests identified (Playwright + unit)
|
|
242
|
+
[ ] 1.4 Gap analysis confirmed with user (3-5 bullets)
|
|
243
|
+
|
|
244
|
+
Step 2: Karpathy Self-Interrogation (internal)
|
|
245
|
+
[ ] 2.1 Layer 1: Spec — answered from codebase evidence
|
|
246
|
+
[ ] 2.2 Layer 2: Verifier — acceptance criteria + edge cases
|
|
247
|
+
[ ] 2.3 Layer 3: Environment — conventions + guardrails
|
|
248
|
+
[ ] 2.4 Karpathy context saved to project docs
|
|
249
|
+
|
|
250
|
+
Step 3: Generate Documents
|
|
251
|
+
[ ] 3.1 PRD saved to project docs (mermaid diagrams included)
|
|
252
|
+
[ ] 3.2 Tasks saved to project docs (execution checklists included)
|
|
253
|
+
[ ] 3.3 Karpathy context saved to project docs
|
|
254
|
+
[ ] 3.4 Every code-writing task in Tasks.md has a paired unit test task
|
|
255
|
+
[ ] 3.5 Tasks.json saved beside Tasks.md — template-valid per references/tasks-json-template.md
|
|
256
|
+
|
|
257
|
+
Step 4: Post-Save Verification
|
|
258
|
+
[ ] 4.1 All 3 deliverable files exist on disk (verified via find)
|
|
259
|
+
[ ] 4.2 PRD contains ≥2 mermaid diagrams (flowchart + sequence)
|
|
260
|
+
[ ] 4.3 PRD contains Module Map, Module Communication Map, Shared Utilities Inventory
|
|
261
|
+
[ ] 4.4 Tasks contains directory structure verification per wave
|
|
262
|
+
[ ] 4.5 Tasks contains public behavioral commitments (not private anti-patterns)
|
|
263
|
+
[ ] 4.6 Tasks contains unit test tasks for every code-writing task
|
|
264
|
+
[ ] 4.7 All 3 deliverable files semantic coherence: re-read each document fully and grep for stale design terms — does the document contradict itself
|
|
265
|
+
[ ] 4.8 Tasks.json exists, parses via JSON.parse, and its wave and task counts match Tasks.md exactly
|
|
266
|
+
|
|
267
|
+
⛔ Behavioral Commitments:
|
|
268
|
+
[ ] I will NOT skip mermaid diagrams in the PRD
|
|
269
|
+
[ ] I will NOT write internal anti-patterns — all rules are public checklists
|
|
270
|
+
[ ] I will NOT guess codebase details — I will read the actual files
|
|
271
|
+
[ ] I will NOT self-certify document quality — I will verify on disk
|
|
272
|
+
[ ] I will NOT produce monolithic specs — every PRD enforces module decomposition
|
|
273
|
+
[ ] I will generate a unit test task for every code-writing task in Tasks.md
|
|
274
|
+
[ ] I will NOT let Tasks.md and Tasks.json drift — both render from one internal model, saved together
|
|
275
|
+
[ ] I will verify all 3 deliverable files exist on disk before declaring done
|
|
276
|
+
[ ] I will verify all 3 deliverable files exist on disk before declaring done
|
|
277
|
+
[ ] I will re-output this checklist at each phase transition (Step 1→2, 2→3)
|
|
278
|
+
[ ] I will NOT go silent for 60+ seconds without a progress update
|
|
279
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Check-Off Rules
|
|
283
|
+
|
|
284
|
+
- **After each phase transition** (Step 1→2, Step 2→3, Step 3→4), re-output the checklist with `[✅]` for done, `[🔄]` for current, `[ ]` remaining
|
|
285
|
+
- **Before posting any checklist re-render, count its structure**: 5 step headers (0.5, 1, 2, 3, 4) and 22 numbered items (0.5 · 1.1–1.4 · 2.1–2.4 · 3.1–3.5 · 4.1–4.8), each exactly once, line numbers intact — hand-copied renders drop blocks and truncate numbers. Render again when the count is off; declare an already-posted blemish in that message and fix it on the next re-render
|
|
286
|
+
- **At pipeline completion**, output the final checklist: ALL `[✅]`, any `[❌]` for failures
|
|
287
|
+
- **Do NOT deliver without showing the final checklist**
|
|
288
|
+
<!-- RCA: AI-Research/LLMs Skip Mandatory Steps/001. LLMs Skip Mandatory Steps/002.The Visible checklist Pattern/2026-06-11 - The Visible Checklist Pattern - AI Research v1 - report.md -->
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## How This Skill Connects to task-executor
|
|
293
|
+
|
|
294
|
+
After `/feature-spec` produces the deliverables, the user can run `/execute-tasks` to begin implementation. The task-executor skill loads the Karpathy context and tasks document produced by this skill.
|
|
295
|
+
|
|
296
|
+
```mermaid
|
|
297
|
+
flowchart LR
|
|
298
|
+
A["/feature-spec"] --> B["PRD + Tasks.md + Tasks.json<br/>+ Karpathy context"]
|
|
299
|
+
B --> C["{project-path}/dev/specs/"]
|
|
300
|
+
C --> D["User reviews"]
|
|
301
|
+
D --> E["/execute-tasks {project-path}"]
|
|
302
|
+
E --> F["task-executor loads<br/>context + tasks from dev/"]
|
|
303
|
+
F --> G["Wave-by-wave<br/>implementation"]
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Attention-Degradation Protection
|
|
307
|
+
|
|
308
|
+
This skill stays SHORT. Phase 2 details reference the karpathy-method skill rather than copying its full content. Phase 3 references the task-executor skill rather than duplicating its checklists. Each skill carries its own context; this skill only orchestrates.
|
|
309
|
+
|
|
310
|
+
Reference: `AI Research/YT-Research/2026-06-22 - Why Long Instructions Make AI Dumber - Attention Degradation Science.md`
|