Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Build a scratch prototype to empirically validate the `R-NN` risks surfaced by spec-review — write throwaway code under `units/<area>/u<NN>/prototype/`, run it, capture concrete evidence (output, dumps, timings, errors), and emit a verdict (`go`, `go-with-caveats`, or `abort`) that drives orchestrator branching back to SPEC regeneration. Use when asked to create a prototype, prototype an integration, empirically validate spec assumptions, test library behavior before implementation, prototype th
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 3243% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 3721% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 685% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 2373% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 430% | 0% |
Produce a PROTOTYPE.md that resolves every R-NN risk surfaced by G2 SPEC_REVIEW.md before the SPEC regenerates. Each risk is settled by writing scratch code in units/<area>/u<NN>/prototype/, running it, capturing concrete evidence, and translating the empirical findings into a constraint or caveat the SPEC must encode. The skill emits a machine-readable verdict (go, go-with-caveats, or abort) that the orchestrator branches on: go regenerates the SPEC unchanged in approach, go-with-caveats regenerates with the surfaced caveats encoded, abort regenerates with a fresh approach (or escalates to human if the prototype budget is exhausted). An agent reading PROTOTYPE.md alone — without re-reading the SPEC, the SPEC_REVIEW, or the prototype scratch code — can tell exactly what was empirically validated, what caveats apply, what new risks surfaced, and what specific edits the SPEC must apply on regeneration.
PROTOTYPE.md exists because real-world testing of the ADD pipeline showed SPECs frequently encoding silent assumptions about library behavior, runtime semantics, and integration friction — assumptions the SPEC author drew from documentation but never verified by running code. Implementations would discover the assumptions wrong only after a complete G5 implementation cycle, forcing expensive re-work. The defining discipline — and the commonest violation — is evidence over reasoning: every finding cites concrete output (a token-tree dump, a timing measurement, an error verbatim, a screenshot, a test runner pass/fail), not the agent's reasoning about what should happen. The commonest failure is declaring a risk "resolved" with no captured evidence — typically because the experiment was inconclusive but the agent moved on. If a finding cannot cite evidence, the experiment was not conclusive and must be iterated.
R-NN entries) and § 8 Prototype Brief (the consolidated question-driven brief) end-to-end. These are the questions to answer; every R-NN becomes a § 2 entry in the output. Path: units/<area>/u<NN>/SPEC_REVIEW.md.units/<area>/u<NN>/SPEC.md.R-NN entries (required, scoped per risk — typically 1–2) — usually a subset of INTERFACES.md (for wire-format risks), BEHAVIOR.md (for state/saga risks), DATA.md (for schema risks), or one of the surface IAs (for UI risks). Read only the artifacts named by the R-NN entries' reference materials; do not pre-load the full design suite.Read-set size: 1 SPEC_REVIEW + 1 SPEC + 1–2 design artifacts + tool reads (codebase, web). Within ADD's 10-artifact budget.
The skill is a focused, sequential, exploratory task — single-agent, no subagents. Five phases.
Read SPEC_REVIEW.md § 5 Risk Surface and § 8 Prototype Brief end-to-end. Read SPEC.md end-to-end for context. Read the 1–2 design artifacts cited by R-NN reference materials.
For each R-NN, build an in-agent working list:
If any required input is missing — units/<area>/u<NN>/SPEC_REVIEW.md does not exist, has empty Risk Surface, or has no Prototype Brief — stop and emit a PROTOTYPE.md with status: blocked describing exactly which input is missing or empty. Do not invent risks to prototype. PROTOTYPE only runs when SPEC_REVIEW emitted verdict: prototype-needed.
Group R-NN risks by the kind of experiment they require:
Sketch a per-risk plan. For each risk:
Do not plan polished test suites. Plan throwaway experiments.
Create the scratch directory at units/<area>/u<NN>/prototype/. Initialize a project appropriate to the technology under test:
| Technology | Initialization | Toolchain | |------------|----------------|-----------| | TypeScript / Node | npm init -y && npm install -D tsx vitest @types/node | npx tsx <file>.ts or npx vitest | | Rust | cargo init (in subdir) | cargo run or cargo test | | Python | uv init && uv add <deps> | uv run <file>.py or uv run pytest | | Browser-touching | npm init -y && npm install -D vitest jsdom @testing-library/dom | npx vitest --environment jsdom | | Multi-library integration | one of the above, plus the libraries under test pinned at the SPEC's intended versions | matching runner |
Install only the dependencies the experiments need. Pin versions explicitly when the SPEC names a target version — divergent versions invalidate the prototype.
Critical: do not initialize anything outside units/<area>/u<NN>/prototype/. Do not modify production code, sibling units' prototype directories, or repository-root configuration files.
For each R-NN:
console.log(JSON.stringify(...)) (or equivalent) to dump intermediate state.units/<area>/u<NN>/prototype/evidence/ for visual rendering risks. Save raw runner output for test-based risks.| Per-R-NN verdict | Meaning | |--------------------|---------| | resolved | The experiment produced conclusive evidence; the SPEC's assumption holds as-stated. | | resolved-with-caveats | The assumption holds only under specific conditions (a config value, a version pin, an order constraint). The SPEC must encode the caveat. | | unresolved | The experiment was inconclusive after iteration, OR the experiment ran but the result is ambiguous and a deeper investigation is needed. | | new-risk-discovered | A different empirical question surfaced during the experiment that fundamentally challenges the SPEC's approach. |
When the answer is conclusive, move on to the next risk. Do not pad the prototype with experiments not driven by an R-NN.
The skill emphasizes speed of discovery over code quality (Rules § 2). The prototype is throwaway. A 30-line script that answers the question in 5 minutes is worth more than a polished test suite that takes an hour.
Compute the verdict mechanically (see Rules § 8):
all R-NN verdicts in {resolved} → verdict: go
at least one resolved-with-caveats; none unresolved or new-risk → verdict: go-with-caveats
at least one unresolved (material) OR
at least one new-risk-discovered (material) → verdict: abortA risk's implication is material if its consequence affects the SPEC's stated approach — wire shape, behavioral path, library choice, performance budget, error code. An unresolved risk on a non-load-bearing detail (a logging field name, a cosmetic edge case) is non-material and may be surfaced as a § 6 New Risk for spec-review to triage.
Write PROTOTYPE.md to units/<area>/u<NN>/PROTOTYPE.md. Frontmatter counts must match the body exactly. Self-check: every R-NN from SPEC_REVIEW § 5 appears in § 2 with a per-risk verdict and cited evidence.
The scratch directory at units/<area>/u<NN>/prototype/ persists after PROTOTYPE.md is written. It is part of the artifact for reproducibility. Do not delete or prune.
These rules govern the prototype and the output document. Violations are detected by the Quality Checklist.
The scratch directory units/<area>/u<NN>/prototype/ is the prototype's sandbox. The agent has full freedom there:
npm init, cargo init, uv init, vite scaffold, pnpm create, etc.)..ts, .tsx, .rs, .py, .js, .html, .test.*, .json, scratch shell scripts, fixtures).vitest, cargo test, pytest, tsx, node, or any runner.evidence/ for screenshots).The agent has no freedom outside the scratch directory. Production code is read-only. Other units' prototype directories are off-limits. Repository-root configuration files (package.json, Cargo.toml, pyproject.toml, tsconfig.json at the repository root) are read-only.
The scratch directory persists after PROTOTYPE.md is written — it is part of the artifact for reproducibility. Do not delete it. Do not prune intermediate experiments.
> The prototype is throwaway. Code quality is irrelevant. Speed of discovery matters. Optimise for getting answers, not for clean code. A 30-line script that answers the question in 5 minutes is worth more than a polished test suite that takes an hour.
This is an explicit principle, not a fallback. Do not apologise for messy prototype code. Do not add abstractions, helper functions, type definitions, or test scaffolds beyond what the experiment requires. Do not rewrite working scratch code to be cleaner. The metric is prototype_runtime_min — wall-clock minutes between the start of Phase 4 (first experiment run) and the end of Phase 4 (last experiment run). Record the start timestamp before running the first experiment and the end timestamp after the last; the difference, rounded up to the nearest integer minute, is the value. Excludes Phase 1–3 (reading inputs, planning, scratch-dir setup) and Phase 5 (writing PROTOTYPE.md). The goal is to keep this number low while still capturing conclusive evidence.
Every finding in PROTOTYPE.md § 2 must cite concrete evidence — actual output, not the agent's reasoning about what should happen. Acceptable evidence patterns:
console.log(JSON.stringify(...)) or equivalent.console.time, performance.now(), criterion, pytest-benchmark.units/<area>/u<NN>/prototype/evidence/ for visual rendering risks.node_modules/marked/src/Tokenizer.ts:142–156).If a finding cannot cite evidence, the experiment was not conclusive — iterate until it is, or mark the per-risk verdict unresolved. Do not paper over inconclusive evidence with reasoning.
When the running code diverges from what the library documentation claims, the library source is the ground truth. Read it directly. Source path conventions:
| Ecosystem | Source location | |-----------|-----------------| | npm / pnpm / yarn | node_modules/<package>/dist/... (compiled) or node_modules/<package>/src/... (when src/ is published) | | cargo | ~/.cargo/registry/src/index.crates.io-*/<crate>-<version>/src/... — find with cargo metadata --format-version 1 \| jq -r '.packages[] \| select(.name=="<crate>") \| .manifest_path' | | Python (uv / pip) | <project>/.venv/lib/python<X.Y>/site-packages/<package>/... | | Go modules | ~/go/pkg/mod/<module>@<version>/... |
Cite the exact file and line range when a finding is grounded in source code. Add the citation to the corresponding § 2 entry. The library source is the authority that overrides documentation when they disagree.
If a risk is resolved-with-caveats, the constraint must appear in § 5 Caveats and Constraints with the exact wording the SPEC must encode. Categories of caveats:
library.configure({ strict: true }) before first use).library@1.4.x; 1.5.0 changed the default of option X).TypeError rather than the documented ValidationError when input is undefined).Caveats not surfaced in § 5 are caveats the SPEC author will not encode, which means caveats the implementation will violate.
The prototype must not touch production code. If understanding production behavior requires running production code:
units/<area>/u<NN>/prototype/ as a copy and modify the copy.Direct modification of production code violates the prototype's read-only contract and corrupts the SPEC's regeneration baseline. Verifiable: every file edit during this skill happens inside units/<area>/u<NN>/prototype/.
If a new empirical question emerges during prototyping that was not on the original R-NN list, surface it in § 6 New Risks Discovered with the same shape as a SPEC_REVIEW R-NN (assumption, why-not-readable, suggested prototype, materiality). Do not silently expand prototype scope to chase the new question; the new risk becomes input to the next SPEC_REVIEW round (or escalates to human if the prototype budget is exhausted).
The verdict is computed from per-R-NN verdicts mechanically:
all in {resolved} → go
at least one resolved-with-caveats; none unresolved or new-risk → go-with-caveats
at least one unresolved (material) OR
at least one new-risk-discovered (material) → abortMateriality test: a per-risk verdict is material if its consequence affects the SPEC's stated approach (wire shape, behavioral path, library choice, performance budget, error code). Non-material unresolved or new-risk-discovered items are surfaced in § 6 and the overall verdict may still be go-with-caveats.
The verdict drives orchestrator behavior:
go → SPEC regenerates with PROTOTYPE.md added to its inputs; the approach stands.go-with-caveats → SPEC regenerates with PROTOTYPE.md as input; § 5 Caveats are encoded into the SPEC.abort → SPEC must regenerate with a fresh approach (the current approach cannot work as-described). If the prototype round count has reached 2 (per ADD convergence cap), the orchestrator escalates to human instead.There is no subjective override. A reviewer who believes a risk is acceptable downgrades it to resolved-with-caveats with an explicit caveat — not by overriding the verdict.
The prototype tests only what the R-NN entries demand. Do not pad with generic edge-case tests, bench suites, or coverage exploration. Specifically:
R-NN, not a generic checklist.R-NN has a performance dimension; otherwise it carries the omission stub.Exactly one YAML frontmatter block at the top of PROTOTYPE.md, containing the universal fields (skill, date, status) plus the prototype-specific fields. Never two blocks. Counts match the body exactly.
No "appropriate", "relevant", "as needed", "etc.", "various", "reasonable", "best practice", "industry-standard". Use exact library names with versions, exact file paths, exact line numbers, exact field names, exact configuration values. Unresolvable ambiguity surfaces in § 9 Open Questions with options, tradeoffs, and a recommendation.
The template below is wrapped in a 4-backtick fence so that the inner 3-backtick blocks (the Reproduce shell block under § 1 and the evidence code blocks under § 2) render correctly. PROTOTYPE.md itself uses standard 3-backtick fences for those inner blocks.
`markdown--- skill: PROTOTYPE.md date: {YYYY-MM-DD} status: {complete | has_open_questions | blocked} unit: {U-NN} verdict: {go | go-with-caveats | abort} risks_addressed: {N} risks_resolved: {N} risks_unresolved: {N} caveats_surfaced: {N} new_risks_discovered: {N} prototype_runtime_min: {N} open_questions: {N} --- # PROTOTYPE: {U-NN} — {Unit Name} > Empirical validation of the `R-NN` risks surfaced by `add/{U-NN}/SPEC_REVIEW.md`. > Scratch code retained at `add/{U-NN}/prototype/`. Verdict (`go`, `go-with-caveats`, > `abort`) drives orchestrator branching back to `/SPEC.md` regeneration. ## § 1. Setup - **Scratch directory:** `add/{U-NN}/prototype/` - **Toolchain:** - `{tool 1 name and version — e.g., "Node.js v22.9.0"}` - `{tool 2 name and version — e.g., "tsx 4.19.0"}` - `{...}` - **Dependencies installed:** | Package | Version (pinned) | Purpose | |---------|------------------|---------| | `{name}` | `{semver}` | `{which R-NN this supports}` | (Repeat per dependency.) - **Reproduce:**
cd add/{U-NN}/prototype/ {install command — e.g., "npm install"} {run command 1 — e.g., "npx tsx experiment-r01.ts"} {run command 2 — ...}
---
## § 2. Risks Addressed
For each `R-NN` from SPEC_REVIEW.md § 5:
### R-{NN}: {short title — copy from SPEC_REVIEW.md § 5}
- **Question (verbatim from SPEC_REVIEW § 8):** `{exact question}`
- **Approach:** `{one paragraph — what files in prototype/ contain the experiment, what they test, what assertions they make}`
- **Findings:** `{concrete factual answer — data, output, error messages, raw token-tree dumps, timing measurements. Use code blocks for evidence.}`
```
{captured terminal output, JSON dump, error trace, timing measurement, etc.}
```
- **Implication for SPEC:** `{specific claim or constraint the SPEC must now reflect, with proposed wording for the SPEC section — e.g., "Replace § 6 'shiki returns serializable token trees' with 'shiki returns token trees containing function references for theme application; serialization requires a custom toJSON conversion (see units/<area>/u03/prototype/serializer.ts)'."}`
- **Code link:** `prototype/{filename}` (relative to the scratch dir)
- `prototype/{filename-1}` — `{what it tests}`
- `prototype/{filename-2}` — `{what it tests}` (if multi-file)
- **Library source consulted (if any):** `{e.g., "node_modules/marked/src/Tokenizer.ts:142–156"}`
- **Verdict:** `{resolved | resolved-with-caveats | unresolved | new-risk-discovered}`
(Repeat for each `R-NN`. Every `R-NN` from SPEC_REVIEW.md § 5 must appear here. If SPEC_REVIEW had no risk surface, do not run this skill.)
---
## § 3. Edge Cases Tested
Risk-driven only — only edge cases the prototype actually exercised in service of an `R-NN`. Do not include a generic checklist.
| Case | Expected | Actual | Verdict | Driving R-NN |
|------|----------|--------|---------|--------------|
| `{specific input or scenario}` | `{expected output}` | `{actual output}` | `{pass \| fail \| quirk}` | `R-{NN}` |
(Repeat per case. If none: "No edge cases tested beyond the primary R-NN experiments.")
---
## § 4. Performance Findings
(Include this section only if at least one `R-NN` has a performance dimension. Otherwise: "No performance dimension in any R-NN; section omitted.")
- **Baseline (current SPEC approach):** `{timing — e.g., "1240ms per 100-token tree, n=10"}`
- **Alternative tested (if any):** `{timing}`
- **Bottleneck identified (if any):** `{specific operation and its share of total time}`
- **Implication for SPEC:** `{specific budget or strategy the SPEC must encode}`
---
## § 5. Caveats and Constraints
Every constraint the SPEC must encode for the implementation to succeed. Each entry is paired with the `R-NN` that surfaced it.
#### {Caveat title}
- **Driving R-NN:** `R-{NN}`
- **Type:** `{configuration | version pin | error-path | order-of-operations | limitation}`
- **Constraint (exact wording for the SPEC):** `{e.g., "shiki must be initialized with codeToTokens (not codeToHtml) when rendering inside react-diff-view; see prototype/serializer.ts"}`
- **What breaks if missing:** `{specific implementation failure — e.g., "react-diff-view re-tokenises and discards shiki's theme metadata; the production code will render unstyled tokens."}`
(Repeat per caveat. If none: "No caveats — every R-NN resolved without constraints.")
---
## § 6. New Risks Discovered
Empirical questions that surfaced during prototyping but were not on the original `R-NN` list. These become input to the next SPEC_REVIEW round (or escalate if material and the prototype budget is exhausted).
#### {Short title}
- **Surfaced by:** `R-{NN} experiment in prototype/{filename}`
- **Assumption (newly identified):** `{exact statement of what was implicitly assumed}`
- **Why it cannot be answered by reading:** `{specific reason — same shape as SPEC_REVIEW R-NN justification}`
- **Suggested prototype:** `{one-line scope of what to test}`
- **Materiality:** `{material | non-material — and why}`
(Repeat per new risk. If none: "No new risks discovered.")
---
## § 7. Verdict
**verdict: `{go | go-with-caveats | abort}`**
{One paragraph. Begin with what was empirically validated (name the strongest finding — e.g., "shiki's token trees survive round-trip through react-diff-view's diff hunks when codeToTokens is used"). Then summarise: what caveats apply (point at § 5), what new risks surfaced (point at § 6), what the SPEC author must update before the unit can proceed. If `abort`, name the unresolved risk and the reason the current approach cannot work as-described. If `go`, conclude that the SPEC may regenerate with PROTOTYPE.md as input and proceed to /PLAN.md.}
---
## § 8. Recommendations for Production Implementation
Concrete, evidence-grounded advice for the SPEC author. Each recommendation cites the `R-NN` (and § 2 finding) that supports it.
#### {Recommendation title}
- **Driving R-NN(s):** `R-{NN}`
- **Recommendation:** `{exact API shape, exact strategy, exact infrastructure addition — e.g., "Use shiki.codeToTokens() and feed tokens to a self-recursive renderToken function that walks react-diff-view hunks; do not pass through codeToHtml() because react-diff-view re-tokenises HTML."}`
- **Final API/struct shape (if applicable):**
```
{exact type signature or struct definition}
```
- **Quirks the production code must handle:** `{specific quirk and how — e.g., "Empty hunks with line:0 do not produce output; guard with `if (hunk.lines.length === 0) return null;`."}`
- **Graceful degradation needed (if any):** `{when and how — e.g., "Inputs > 1MB exceed react-diff-view's default chunking; fall back to plain <pre> rendering."}`
(Repeat per recommendation. If none: "No production recommendations beyond § 5 caveats.")
---
## § 9. Open Questions
Genuinely unresolved review-level questions where empirical evidence was contradictory, insufficient, or would require infrastructure beyond the scratch directory.
- [ ] `{Question — e.g., "Behavior under sustained load (10⁴ token trees / sec) was not measurable in a single-process prototype; do we need a load-test rig before SPEC?"}`
- **Option A:** `{interpretation}` — `{tradeoff}`
- **Option B:** `{interpretation}` — `{tradeoff}`
- **Recommendation:** `{suggested resolution or "escalate to human"}`
(If none: "All questions resolved.")R-NN reference materialsunits/<area>/u<NN>/prototype/ with appropriate toolchainR-NN findings, caveats, recommendations, and a mechanically-computed verdict/SPEC.md (G1) on regeneration. PROTOTYPE proposes constraints and recommendations; the SPEC skill encodes them./SPEC_REVIEW.md (G2)./IMPLEMENTATION.md (G5) after the SPEC is final.R-NN demands, or refactoring scratch experiments — the prototype is throwaway./decide skill before SPEC_REVIEW runs.Before considering PROTOTYPE.md complete, verify:
skill, date, status, unit, verdict, risks_addressed, risks_resolved, risks_unresolved, caveats_surfaced, new_risks_discovered, prototype_runtime_min, open_questions)R-NN from SPEC_REVIEW.md § 5 appears in § 2 with a per-risk verdict (resolved, resolved-with-caveats, unresolved, or new-risk-discovered)units/<area>/u<NN>/prototype/ and is not empty — every § 2 finding's Code link resolves to a file inside itR-NN that surfaced it and states exactly what breaks if missingR-NN verdicts: go iff every per-risk verdict is resolved; go-with-caveats iff at least one is resolved-with-caveats and none are materially unresolved or new-risk-discovered; abort iff at least one is materially unresolved or new-risk-discoveredR-NN entries — assumption, why-not-readable, suggested prototype, materiality)units/<area>/u<NN>/prototype/R-NN had a performance dimension; otherwise it carries the omission stubrisks_addressed equals the count of § 2 entries; risks_resolved equals the count of per-risk verdicts in {resolved, resolved-with-caveats}; risks_unresolved equals the count of per-risk verdicts in {unresolved, new-risk-discovered}; caveats_surfaced equals the § 5 entry count; new_risks_discovered equals the § 6 entry count; open_questions equals the unresolved checkbox count in § 9status is complete if § 9 reads "All questions resolved.", has_open_questions if any unresolved checkbox remains, blocked only when a missing input prevented prototyping (Phase 1 abort)Other measured skills in the registry, with their headline benchmark lift.