Skip to content

Commit 98b94e9

Browse files
maxgfrclaude
andcommitted
docs: refresh README and DOCUMENTATION for analyze, min-grounding and verify
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent acfc292 commit 98b94e9

2 files changed

Lines changed: 54 additions & 16 deletions

File tree

DOCUMENTATION.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ CI verifies the committed bundle is reproducible (`pnpm run check:build`).
1515
## Pipeline
1616

1717
```
18-
init → (interview, agent-driven) → research → render → check
19-
brief.json evidence/ SRD tree + SRD.json report
18+
init → (interview, agent-driven) → research → analyze → render → check → verify
19+
brief.json evidence/ gap report SRD tree + SRD.json report build referee
20+
+ BUILD-PLAN.json
2021
```
2122

2223
### `init`
@@ -41,13 +42,24 @@ subprocesses through `util.ts::sh` — the two mock seams that make the rest
4142
offline-testable. Every angle degrades honestly to an empty result with a note
4243
rather than aborting the run.
4344

44-
### `render` (`src/render.ts`, `src/srd.ts`, `src/templates.ts`)
45+
### `analyze` (`src/analyze.ts`)
46+
The post-research gap signal. Pure read of `brief.json` + the dossier that
47+
reuses the render's own `matchEvidence`, so every reported gap is a claim that
48+
WILL render ungrounded: features with no matchable evidence, competitors the
49+
market angle never surfaced, candidate tech without docs/SO grounding, unmined
50+
OSS seeds — each with the drill command that fixes it. Informational; exit 0.
51+
52+
### `render` (`src/render.ts`, `src/srd.ts`, `src/templates.ts`, `src/plan.ts`)
4553
`buildSRD(brief, evidence, {level})` assembles a pure, deterministic SRD model
4654
(`src/srd.ts`): one FR per feature with templated Given/When/Then, the required
47-
NFRs for the level, ADRs from the candidate stack, a competitive table, a build
48-
plan and a traceability matrix. Evidence `[E#]` hooks are auto-attached by
49-
keyword overlap (`matchEvidence`). `templates.ts` turns each model slice into
50-
Markdown (pure, golden-testable); `render.ts` writes the tree + `SRD.json`.
55+
NFRs for the level, an *inferred* data model and interface set (recurring nouns
56+
+ boundary detection, FR references closed symmetrically), ADRs from the
57+
candidate stack, a competitive table, a build plan and a traceability matrix.
58+
Evidence `[E#]` hooks are auto-attached by keyword overlap (`matchEvidence`).
59+
`templates.ts` turns each model slice into Markdown (pure, golden-testable);
60+
`render.ts` writes the tree + `SRD.json` + `BUILD-PLAN.json` (`src/plan.ts`:
61+
`derivePlan` builds the task DAG from the SRD; `mergePlan` preserves the
62+
building agent's progress across re-renders, keyed by feature title).
5163

5264
Conventions: `> 🧠 **Decide:**` for open decisions; `[E#]` for grounded claims.
5365

@@ -57,7 +69,18 @@ Two independent passes:
5769
acceptance criteria and resolving entity/interface/NFR references; required
5870
NFR categories present for the level; ADRs well-formed; required files present.
5971
- **Grounding coverage (advisory):** per-section grounded fraction, dangling
60-
`[E#]`, uncited evidence. Never changes the exit code.
72+
`[E#]`, uncited evidence, renderer-templated criteria nudges. Never changes
73+
the exit code — unless the caller opts into `--min-grounding <0-100>`, which
74+
adds a third gate failing below the threshold.
75+
76+
### `verify` (`src/verify.ts`)
77+
The build referee. Static by default: `BUILD-PLAN.json` well-formed and
78+
acyclic, every `frIds`/`acceptance` ref resolves into `SRD.json`, done tasks'
79+
declared artifacts/tests exist under the app dir, and every FR is referenced by
80+
a test (greps `conventions.frTagPattern` over test files via `walk.ts`; stale
81+
tags after an id shift are flagged). `--run-tests` opts into executing
82+
`conventions.testCommand` + per-task `verify.commands` (via `util.ts::sh`);
83+
`--strict` fails a built must-have FR with no referencing test.
6184

6285
## The three axes
6386

@@ -72,6 +95,10 @@ Two independent passes:
7295
openQuestions.
7396
- `evidence/evidence.json``EvidenceItem[]` with stable `E#` ids.
7497
- `SRD.json` — the full `SRD` manifest the `check` reads.
98+
- `BUILD-PLAN.json``BuildPlanDoc`: engine-derived task structure (ids,
99+
milestones, `acceptance` pointers into `SRD.json`, dependency edges) +
100+
agent-owned progress (`status`, `artifacts`, `tests`, `verify.commands`,
101+
`conventions.testCommand`/`appDir`) that survives re-renders.
75102

76103
## Release
77104

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ by Conventional Commits.
1919
- **oss** — comparable open-source projects + their issues/PRs (GitHub/GitLab),
2020
- **tech** — candidate-technology docs + StackOverflow pitfalls,
2121
- **semantic** *(optional)* — a local-embedding relevance pass (Qdrant + Ollama).
22-
3. **Render** a complete SRD tree (vision, scope, numbered functional requirements
23-
with Given/When/Then, non-functional requirements, system context, data model,
24-
interfaces, ADRs, competitive landscape, build plan, traceability) + `SRD.json`.
25-
4. **Check** it: a **hard** structural-completeness gate plus an **advisory**
26-
grounding-coverage report.
22+
3. **Analyze** the dossier: name every feature/competitor/tech/seed that would
23+
render ungrounded, with the drill command that fixes each gap.
24+
4. **Render** a complete SRD tree (vision, scope, numbered functional requirements
25+
with Given/When/Then, non-functional requirements, system context, an
26+
*inferred* data model and interfaces, ADRs, competitive landscape, build plan,
27+
traceability) + `SRD.json` + a machine-readable `BUILD-PLAN.json` task DAG.
28+
5. **Check** it: a **hard** structural-completeness gate plus an **advisory**
29+
grounding-coverage report (opt-in `--min-grounding` threshold).
30+
6. **Verify** the build *(optional)*: the agent implements the app task-by-task
31+
from `BUILD-PLAN.json`; `construct verify` referees it against the SRD —
32+
declared files exist, every requirement is referenced by a test, and (with
33+
`--run-tests`) the declared test commands pass.
2734

2835
No API keys. No `npm install` at skill-use time.
2936

@@ -39,8 +46,10 @@ npx skills add maxgfr/construct
3946
node scripts/construct.mjs init --idea "a self-hosted read-it-later app" --out ./readpile
4047
# …fill ./readpile/brief.json via the interview…
4148
node scripts/construct.mjs research --out ./readpile --angles market,oss,tech
49+
node scripts/construct.mjs analyze --out ./readpile # what's thin? drill it
4250
node scripts/construct.mjs render --out ./readpile --level complex
43-
node scripts/construct.mjs check --out ./readpile
51+
node scripts/construct.mjs check --out ./readpile # add --min-grounding 70 to enforce
52+
node scripts/construct.mjs verify --out ./readpile --app ./readpile-app --run-tests --strict
4453
```
4554

4655
Add `--merge` to also emit a single-file `SRD.md`. Run `--help` for the full
@@ -54,7 +63,7 @@ surface, or see [`SKILL.md`](SKILL.md) for the agent playbook and
5463
requirements/ FUNCTIONAL.md · NON-FUNCTIONAL.md
5564
architecture/ SYSTEM-CONTEXT.md · DATA-MODEL.md · INTERFACES.md · decisions/NNNN-*.md
5665
competitive/ LANDSCAPE.md
57-
BUILD-PLAN.md · TRACEABILITY.md
66+
BUILD-PLAN.md · BUILD-PLAN.json (task DAG for the build phase) · TRACEABILITY.md
5867
evidence/ EVIDENCE.md · evidence.json · meta.json · brief.json · SRD.json
5968
```
6069

@@ -64,7 +73,9 @@ evidence/ EVIDENCE.md · evidence.json · meta.json · brief.json · SR
6473
on an incomplete SRD (unresolved `🧠` decisions, an FR with no acceptance
6574
criteria, a dangling reference, a missing required NFR category, a malformed
6675
ADR). The **grounding coverage** is a report — it tells you how well-cited the
67-
SRD is so you can invest research where it matters, but it never fails the build.
76+
SRD is so you can invest research where it matters, but it never fails the build
77+
by default. When you *do* want it enforced, `--min-grounding <0-100>` opts into
78+
a second gate that fails below the threshold.
6879

6980
## Optional local stack
7081

0 commit comments

Comments
 (0)