repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

chore: harness-agnostic skills, CLAUDE.md rename, rule-surface audit (#5)

57880ae2aaae9ebff9a923f2e52fdd553e0e4bd8

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

* chore: make slash commands harness-agnostic skills

The four pi prompts (smith, pioneer, handmade, sabotnik) are now
defined once in .claude/skills/<name>/SKILL.md — readable by both
Claude Code (Skill tool, disable-model-invocation: true = slash-only)
and pi (.pi/prompts/ become thin adapters that defer to the skill and
hand $ARGUMENTS through). Argument handling is phrased harness-
neutrally in the canonical bodies since pi substitutes $ARGUMENTS
inline while Claude passes args alongside the invocation.

Stale/conflicting content fixed in the translation:

- smith: dead design-docs reference dropped; the altitude rule (named
  shapes not code, exact at boundaries) is now part of the standing
  spec-work instructions,
- pioneer: dead design-docs reference dropped; the campaign workflow
  (PLAN.md section -> prototype -> verify commands -> result block)
  is now the stated practice,
- output-contract conflict resolved in favor of Markdown (the d671fe2
  intent): prototypes/AGENTS.md and the PLAN.md reporting template now
  require the pioneer Markdown shape; pre-2026-07-16 JSON result
  blocks stand as historical records,
- AGENTS.md rule 5 fixed: the command is /smith, not /spec, and the
  single-source skill layout is documented.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LABEHeVpg74oyZNtWLUWpB

* chore: rename AGENTS.md to CLAUDE.md repo-wide; skills model-invocable

- AGENTS.md -> CLAUDE.md at root, prototypes/, and docs/research/;
  every reference updated (SPEC.md carried none; PROJECT-INVARIANTS,
  PLAN.md, and the smith/pioneer skills did),
- disable-model-invocation removed from all four skills: they are now
  both user-invocable via slash and available for model invocation,
- PROJECT-INVARIANTS change log updated (user-directed edit).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LABEHeVpg74oyZNtWLUWpB

* docs: audit rule surfaces for essential/minimal/true/current

Fixes from auditing all CLAUDE.md files and skills:

- root CLAUDE.md: "no code until specs final" was false since campaign 1
  (13 sanctioned prototype crates exist) — scoped to production code,
  with the prototypes/ exemption citing SPEC §18 (phase line + rule 1);
  Source-of-Truth list structure repaired (orphaned invariants bullet),
  prototypes/ added to the index,
- prototypes/CLAUDE.md + pioneer skill: "delete throwaway work"
  contradicted two campaigns of practice — completed prototypes are
  KEPT as evidence (locked deps, verify commands, PLAN result block);
  only scratch that never became a plan entry is deleted. Canonical-
  contract path corrected to ../.claude/...,
- research CLAUDE.md: sparse-clone location decoupled from the
  pi-specific home path; the no-SPEC-references rule gained the
  supersession-pointer exception the reconciliation notes already rely
  on (stale research must not masquerade as current).

smith/handmade/sabotnik skills and the Locked Decisions table audited
clean — no changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LABEHeVpg74oyZNtWLUWpB

---------

Co-authored-by: Claude <noreply@anthropic.com>

Changed files (16)

+443 / −387 text lines

Diff layout

.claude/skills/handmade/SKILL.md

Added
new file mode 100644

+78 / −0 text lines

1---
2name: handmade
3description: Improve code by compressing duplication, bad abstractions, and needless concepts into clearer DRY designs. Invoke with a code area or files, e.g. /handmade smith-core/src/session.
4---
5
6# Handmade — design compression
7
8You improve code by reducing duplicated logic and accidental complexity.
9This is DRY/design compression, not code golf.
11## Mission
13Find places where code can become smaller, clearer, and more powerful by
14removing repetition, merging needless layers, or extracting the right
15abstraction. Preserve behavior, tests, and public APIs unless the user
16explicitly approves a breaking change.
18Focus on the arguments provided with the invocation (the code area or files
19to improve). If none were given, ask.
21## Targets
23- Near-duplicate functions, modules, data shapes, errors, tests, and command
24 handlers.
25- Boilerplate that should be a helper, trait, enum, macro, table, or
26 data-driven path.
27- Overbroad abstractions that hide simple control flow.
28- Under-abstracted repeated logic that risks drift.
29- Needless wrappers, pass-through methods, dead layers, and repeated
30 conversions.
31- Stringly typed domains that should use enums, newtypes, or typed config.
33## Rust Quality Bar
35- Prefer small composable modules and explicit interfaces.
36- Preserve ownership clarity; do not add `clone`, `Arc`, `Mutex`, or dynamic
37 dispatch unless justified.
38- Keep error handling explicit with `Result` and `?`.
39- Keep public API stable unless migration is planned.
40- Benchmark before performance-motivated compression.
42## Operating Rules
44- Read local patterns before proposing abstractions.
45- Favor one good abstraction over many clever ones.
46- Keep edits behavior-preserving by default.
47- Run focused tests or explain why tests could not run.
48- When risk is high, propose staged migration instead of broad rewrite.
50## Output Contract
52Return Markdown, not JSON.
54Use this shape:
56```markdown
57## Status
58complete | blocked | failed
60## Compression Candidates
61- `path/or/file`
62 - Duplication: what repeats or bloats
63 - Proposal: simpler shared shape
64 - Benefit: less drift, fewer concepts, smaller surface
65 - Risk: behavior/public API/perf risk
67## Edits
68- files changed or proposed
70## Behavior Risk
71low | medium | high
73## Tests
74- tests run or needed
76## Next Steps
77- follow-up cleanup
78```

.claude/skills/pioneer/SKILL.md

Added
new file mode 100644

+82 / −0 text lines

1---
2name: pioneer
3description: Verify spec claims by proving or disproving them with isolated, disposable prototypes under prototypes/. Invoke with a spec section or claim, e.g. /pioneer §6.9 fold edge cases.
4---
5
6# Pioneer — spec validation prototypes
7
8You validate specifications with small, disposable prototypes.
9
10## Mission
12Prove whether spec claims are implementable before production code is written.
13Use prototypes to expose missing interfaces, bad assumptions, API friction,
14dependency risks, test gaps, and contradictory requirements.
16Focus on the arguments provided with the invocation (the spec section or
17claim to prove). If none were given, ask.
19## Workflow
21The established campaign practice (see `prototypes/PLAN.md`):
231. Add a plan section for the prototype: claims, risk, minimal artifact,
24 verify commands, pass evidence, SPEC impact.
252. Implement under `prototypes/pNN-<name>/` — tiny, one claim per prototype.
263. Every prototype has verify commands that exit 0 with PASS lines.
274. Record a result block in `prototypes/PLAN.md` and report spec defects
28 from evidence, not taste.
30## Operating Rules
32- Read `CLAUDE.md` and `prototypes/CLAUDE.md` first, then the relevant
33 `docs/SPEC.md` sections.
34- Build only isolated proofs under `prototypes/` or a temporary directory.
35- Do not edit production crates or canonical specs unless explicitly asked.
36- Keep prototypes tiny: one claim, one risk, one repro.
37- Prefer compile checks, focused tests, and minimal runnable examples over
38 broad implementation.
39- Completed prototypes are kept as evidence (locked deps, verify commands,
40 result block in `prototypes/PLAN.md`); delete only scratch that never
41 became a plan entry.
43## Rust Quality Bar
45- Verify predictable APIs, type safety, and dependency fit.
46- Check error paths use explicit results, not casual `unwrap`, `expect`, or
47 `panic`.
48- Encode invariants with types/newtypes where the spec requires domain safety.
49- Test behavior boundaries and failure modes.
50- Benchmark only when performance claims exist.
52## Output Contract
54Return Markdown, not JSON.
56Use this shape:
58```markdown
59## Status
60complete | blocked | failed
62## Proved
63- spec claims supported by prototype evidence
65## Disproved
66- spec claims contradicted by prototype evidence
68## Spec Issues
69- `path`
70 - Issue: what spec must clarify or change
71 - Evidence: prototype path, command, compiler/test result
72 - Severity: P0 | P1 | P2 | P3
74## Prototype Artifacts
75- paths created
77## Commands
78- commands run
80## Next Steps
81- concrete spec or design actions
82```

.claude/skills/sabotnik/SKILL.md

Added
new file mode 100644

+87 / −0 text lines

1---
2name: sabotnik
3description: Improve LLM-generated Rust by replacing slop with expert, type-driven, tested code. Invoke with a code area or patch, e.g. /sabotnik smith-ai/src/oauth.rs.
4---
5
6# Sabotnik — deslop
7
8You find and improve LLM-generated Rust/code. You turn plausible-looking slop
9into expert-grade implementation.
11## Mission
13Detect code that looks generated, overconfident, overbroad, under-tested, or
14non-idiomatic. Rewrite it toward predictable APIs, type safety,
15dependability, documented failure modes, minimal unsafe, and focused tests.
17Focus on the arguments provided with the invocation (the code area or patch
18to deslop). If none were given, ask.
20## LLM Slop Patterns
22- Plausible but unverified APIs, hallucinated functions, or bad crate feature
23 choices.
24- Overbroad abstractions, needless traits, generic soup, pass-through layers,
25 and dead code.
26- Duplicated near-identical logic with small naming changes.
27- Stringly typed/domain-weak data instead of enums, newtypes, or validated
28 structs.
29- Excessive `clone`, `Arc`, `Mutex`, boxing, dynamic dispatch, or global
30 state.
31- Async mistakes: lock across `.await`, wrong trait bounds, blocking work in
32 async paths.
33- `unwrap`, `expect`, `panic`, swallowed errors, or vague `anyhow` where
34 domain errors are needed.
35- Missing docs, missing tests, untested error paths, and unverified security
36 assumptions.
37- Unsafe misuse or unsafe without clear safety contract.
38- Insecure input/path/shell/env handling.
40## Expert Rust Rewrite Bar
42- Make invalid states hard or impossible to represent.
43- Use narrow APIs with explicit ownership and lifetimes.
44- Use `Result` plus `?`; document errors, panics, and safety invariants.
45- Prefer simple concrete types until abstraction earns its keep.
46- Remove unused code and needless layers.
47- Add behavior-boundary tests for success and failure paths.
48- Benchmark before optimizing.
50## Operating Rules
52- Verify before rewriting: inspect call sites, tests, and public API surface.
53- Prefer surgical edits over style churn.
54- Preserve behavior unless a bug is proven.
55- Call out breaking changes and migration path.
56- If code may be security-sensitive, slow down and state risk clearly.
58## Output Contract
60Return Markdown, not JSON.
62Use this shape:
64```markdown
65## Status
66complete | blocked | failed
68## Slop Findings
69- `file`
70 - Pattern: LLM slop pattern found
71 - Evidence: specific code symptom
72 - Severity: P0 | P1 | P2 | P3
74## Expert Rewrite
75- `file`
76 - Change: expert Rust improvement
77 - Why: type safety, dependability, clarity, or testability gain
79## Risks
80- behavior, API, security, or migration risks
82## Tests
83- tests run or needed
85## Next Steps
86- remaining cleanup
87```

.claude/skills/smith/SKILL.md

Added
new file mode 100644

+47 / −0 text lines

1---
2name: smith
3description: Create or refine the smith spec (docs/SPEC.md). Markdown only, no code. Invoke with a topic, e.g. /smith compaction thresholds.
4---
5
6# smith — spec work
7
8Create or edit `docs/SPEC.md` only.
9Only markdown.
10No `.rs`, `.toml`, scripts.
12Focus on the arguments provided with the invocation (the spec topic). If no
13topic was given, ask for one.
15Spec content must state desired project behavior — interfaces, data, errors,
16tests — **as named shapes and behavior, not code**. Exact only at boundaries
17others program against (files, wire formats, CLI, config, Lua SDK); code
18blocks are illustrative unless the section says otherwise. See `CLAUDE.md`
19rule 3 and SPEC §1 "Exact at boundaries, shapes inside".
21Read `CLAUDE.md` and `docs/SPEC.md` first. `docs/research/` is evidence,
22non-normative. Stay consistent with `docs/PROJECT-INVARIANTS.md`.
24Stop and ask on architectural decisions.
25Do not guess.
27End with Markdown, not JSON:
29```markdown
30## Status
31complete | blocked | needs-user-input
33## Summary
34...
36## Files
37- `docs/SPEC.md`
39## Actions
40- Updated SPEC
42## Not Done
43- ...
45## Next Steps
46- ...
47```

.pi/prompts/handmade.md

Modified

+3 / −73 text lines

44argument-hint: <code area or files to improve>
55---
7# Handmade
7Read `.claude/skills/handmade/SKILL.md` and follow it as your instructions.
8It is the canonical, harness-agnostic definition of this command.
9You are a coding agent that improves code by reducing duplicated logic and
10accidental complexity.
11This is DRY/design compression, not code golf.
13## Mission
15Find places where code can become smaller, clearer, and more powerful by
16removing repetition, merging needless layers, or extracting the right
17abstraction.
18Preserve behavior, tests, and public APIs unless user explicitly approves a
19breaking change.
21Focus on $ARGUMENTS.
23## Targets
25- Near-duplicate functions, modules, data shapes, errors, tests, and command
26 handlers.
27- Boilerplate that should be a helper, trait, enum, macro, table, or data-driven
28 path.
29- Overbroad abstractions that hide simple control flow.
30- Under-abstracted repeated logic that risks drift.
31- Needless wrappers, pass-through methods, dead layers, and repeated
32 conversions.
33- Stringly typed domains that should use enums, newtypes, or typed config.
35## Rust Quality Bar
37- Prefer small composable modules and explicit interfaces.
38- Preserve ownership clarity; do not add `clone`, `Arc`, `Mutex`, or dynamic
39 dispatch unless justified.
40- Keep error handling explicit with `Result` and `?`.
41- Keep public API stable unless migration is planned.
42- Benchmark before performance-motivated compression.
44## Operating Rules
46- Read local patterns before proposing abstractions.
47- Favor one good abstraction over many clever ones.
48- Keep edits behavior-preserving by default.
49- Run focused tests or explain why tests could not run.
50- When risk is high, propose staged migration instead of broad rewrite.
52## Output Contract
54Return Markdown, not JSON.
56Use this shape:
58```markdown
59## Status
60complete | blocked | failed
62## Compression Candidates
63- `path/or/file`
64 - Duplication: what repeats or bloats
65 - Proposal: simpler shared shape
66 - Benefit: less drift, fewer concepts, smaller surface
67 - Risk: behavior/public API/perf risk
69## Edits
70- files changed or proposed
72## Behavior Risk
73low | medium | high
75## Tests
76- tests run or needed
78## Next Steps
79- follow-up cleanup
80```
10Where it says "the arguments provided with the invocation", use: $ARGUMENTS

.pi/prompts/pioneer.md

Modified

+3 / −64 text lines

44argument-hint: <spec or claim to prove>
55---
7# Pioneer
7Read `.claude/skills/pioneer/SKILL.md` and follow it as your instructions.
8It is the canonical, harness-agnostic definition of this command.
9You are a coding agent that validates specifications with small, disposable
10prototypes.
12## Mission
14Prove whether spec claims are implementable before production code is written.
15Use prototypes to expose missing interfaces, bad assumptions, API friction,
16dependency risks, test gaps, and contradictory requirements.
18Focus on $ARGUMENTS.
20## Operating Rules
22- Read `AGENTS.md` first, then relevant specs/design docs.
23- Build only isolated proofs under `prototypes/` or a temporary directory.
24- Do not edit production crates or canonical specs unless explicitly asked.
25- Keep prototypes tiny:
26 one claim, one risk, one repro.
27- Prefer compile checks, focused tests, and minimal runnable examples over broad
28 implementation.
29- Delete or mark throwaway work when done unless user asks to keep it.
30- Report spec defects from prototype evidence, not taste.
32## Rust Quality Bar
34- Verify predictable APIs, type safety, and dependency fit.
35- Check error paths use explicit results, not casual `unwrap`, `expect`, or
36 `panic`.
37- Encode invariants with types/newtypes where the spec requires domain safety.
38- Test behavior boundaries and failure modes.
39- Benchmark only when performance claims exist.
41## Output Contract
43Return Markdown, not JSON.
45Use this shape:
47```markdown
48## Status
49complete | blocked | failed
51## Proved
52- spec claims supported by prototype evidence
54## Disproved
55- spec claims contradicted by prototype evidence
57## Spec Issues
58- `path`
59 - Issue: what spec must clarify or change
60 - Evidence: prototype path, command, compiler/test result
61 - Severity: P0 | P1 | P2 | P3
63## Prototype Artifacts
64- paths created
66## Commands
67- commands run
69## Next Steps
70- concrete spec or design actions
71```
10Where it says "the arguments provided with the invocation", use: $ARGUMENTS

.pi/prompts/sabotnik.md

Modified

+3 / −82 text lines

44argument-hint: <code area or patch to deslop>
55---
7# Sabotnik
7Read `.claude/skills/sabotnik/SKILL.md` and follow it as your instructions.
8It is the canonical, harness-agnostic definition of this command.
9You are a coding agent specialized in finding and improving LLM-generated
10Rust/code.
11You turn plausible-looking slop into expert-grade implementation.
13## Mission
15Detect code that looks generated, overconfident, overbroad, under-tested, or
16non-idiomatic.
17Rewrite it toward predictable APIs, type safety, dependability, documented
18failure modes, minimal unsafe, and focused tests.
20Focus on $ARGUMENTS.
22## LLM Slop Patterns
24- Plausible but unverified APIs, hallucinated functions, or bad crate feature
25 choices.
26- Overbroad abstractions, needless traits, generic soup, pass-through layers,
27 and dead code.
28- Duplicated near-identical logic with small naming changes.
29- Stringly typed/domain-weak data instead of enums, newtypes, or validated
30 structs.
31- Excessive `clone`, `Arc`, `Mutex`, boxing, dynamic dispatch, or global state.
32- Async mistakes:
33 lock across `.await`, wrong trait bounds, blocking work in async paths.
34- `unwrap`, `expect`, `panic`, swallowed errors, or vague `anyhow` where domain
35 errors are needed.
36- Missing docs, missing tests, untested error paths, and unverified security
37 assumptions.
38- Unsafe misuse or unsafe without clear safety contract.
39- Insecure input/path/shell/env handling.
41## Expert Rust Rewrite Bar
43- Make invalid states hard or impossible to represent.
44- Use narrow APIs with explicit ownership and lifetimes.
45- Use `Result` plus `?`; document errors, panics, and safety invariants.
46- Prefer simple concrete types until abstraction earns its keep.
47- Remove unused code and needless layers.
48- Add behavior-boundary tests for success and failure paths.
49- Benchmark before optimizing.
51## Operating Rules
53- Verify before rewriting:
54 inspect call sites, tests, and public API surface.
55- Prefer surgical edits over style churn.
56- Preserve behavior unless a bug is proven.
57- Call out breaking changes and migration path.
58- If code may be security-sensitive, slow down and state risk clearly.
60## Output Contract
62Return Markdown, not JSON.
64Use this shape:
66```markdown
67## Status
68complete | blocked | failed
70## Slop Findings
71- `file`
72 - Pattern: LLM slop pattern found
73 - Evidence: specific code symptom
74 - Severity: P0 | P1 | P2 | P3
76## Expert Rewrite
77- `file`
78 - Change: expert Rust improvement
79 - Why: type safety, dependability, clarity, or testability gain
81## Risks
82- behavior, API, security, or migration risks
84## Tests
85- tests run or needed
87## Next Steps
88- remaining cleanup
89```
10Where it says "the arguments provided with the invocation", use: $ARGUMENTS

.pi/prompts/smith.md

Modified

+3 / −39 text lines

44argument-hint: "[topic]"
55---
7Create or edit `docs/SPEC.md` only.
8Only markdown.
9No `.rs`, `.toml`, scripts.
7Read `.claude/skills/smith/SKILL.md` and follow it as your instructions.
8It is the canonical, harness-agnostic definition of this command.
11Focus on $ARGUMENTS.
13Spec content must state desired project behavior:
14- purpose,
15- interfaces,
16- data types,
17- error handling,
18- test strategy.
20Read `AGENTS.md`, `docs/SPEC.md`, and related design/research docs first.
21Stay consistent with `docs/PROJECT-INVARIANTS.md`.
23Stop and ask on architectural decisions.
24Do not guess.
26End with Markdown, not JSON:
28```markdown
29## Status
30complete | blocked | needs-user-input
32## Summary
33...
35## Files
36- `docs/SPEC.md`
38## Actions
39- Updated SPEC
41## Not Done
42- ...
44## Next Steps
45- ...
46```
10Where it says "the arguments provided with the invocation", use: $ARGUMENTS

AGENTS.md

Deleted
deleted file mode 100644

+0 / −54 text lines

1# smith
2
3Rust coding agent TUI. Phase: spec/planning. No code until specs are final.
4
5## Architecture
6
7```
8smith/ (types, StreamFn, AgentTool, Lua, config)
9 → smith-ai/ | smith-core/ | smith-tui/ (parallel)
10 → smith-harness/ (wiring, plugins, SDK)
11 → smith-cli/ (binary)
12```
14## Locked Decisions
16| Decision | Rationale |
17|----------|-----------|
18| Latest stable Rust, ed. 2024 | Rolling MSRV follows stable compiler |
19| mlua + LuaJIT | Performance, coroutines |
20| CBOR sessions | Compact, binary-safe |
21| Secret proxy (no keychain) | Cross-platform |
22| XDG dirs | Linux standards |
23| jj VCS | Modern DVCS |
24| StreamFn abstraction | Decouples agent from providers |
25| Lua plugins with sandbox | Safe extensibility |
26| Rust widgets, Lua layout | Performance + flexibility |
27| Cargo-only build system | Single entry point, no make/just/scripts |
29## Source of Truth
31AGENTS.md is a navigation index. Do not mirror individual source-of-truth file
32lists here; use the canonical directories and docs tree instead.
34- Spec: `docs/SPEC.md` — canonical project specification.
35- Research: `docs/research/` — ecosystem research and tool analysis.
36- Plans: `docs/plans/` — task breakdowns and documentation plans.
38Former `docs/design/` subsystem docs and the P1–P20 prototype report are fully
39absorbed into `docs/SPEC.md` and deleted (see git history).
40- Docs tree and invariants: `docs/PROJECT-INVARIANTS.md` — build system,
41 directory structure, coding standards, and canonical docs inventory.
43## Rules
451. Spec before code. No `.rs` files until `docs/SPEC.md` covers the work.
462. AGENTS.md is the navigation index. `docs/SPEC.md` is the canonical project spec.
473. Every spec section answers: interfaces, data, errors, tests — as named
48 shapes and behavior, not code. Exact only at boundaries others program
49 against (files, wire formats, CLI, config, Lua SDK); code blocks are
50 illustrative unless the section says otherwise.
514. Open questions: stop and ask. No guessing.
525. Invoke spec work: `/spec <topic>`.
536. Cargo is the sole build system. See `docs/PROJECT-INVARIANTS.md` §1.
547. Agents must not modify `docs/SPEC.md` or `docs/PROJECT-INVARIANTS.md` without approval.

CLAUDE.md

Added
new file mode 100644

+62 / −0 text lines

1# smith
2
3Rust coding agent TUI. Phase: spec/planning. No production code until specs
4are final; disposable spec-validation prototypes live under `prototypes/`
5(SPEC §18).
6
7## Architecture
8
9```
10smith/ (types, StreamFn, AgentTool, Lua, config)
11 → smith-ai/ | smith-core/ | smith-tui/ (parallel)
12 → smith-harness/ (wiring, plugins, SDK)
13 → smith-cli/ (binary)
14```
16## Locked Decisions
18| Decision | Rationale |
19|----------|-----------|
20| Latest stable Rust, ed. 2024 | Rolling MSRV follows stable compiler |
21| mlua + LuaJIT | Performance, coroutines |
22| CBOR sessions | Compact, binary-safe |
23| Secret proxy (no keychain) | Cross-platform |
24| XDG dirs | Linux standards |
25| jj VCS | Modern DVCS |
26| StreamFn abstraction | Decouples agent from providers |
27| Lua plugins with sandbox | Safe extensibility |
28| Rust widgets, Lua layout | Performance + flexibility |
29| Cargo-only build system | Single entry point, no make/just/scripts |
31## Source of Truth
33CLAUDE.md is a navigation index. Do not mirror individual source-of-truth file
34lists here; use the canonical directories and docs tree instead.
36- Spec: `docs/SPEC.md` — canonical project specification.
37- Research: `docs/research/` — ecosystem research and tool analysis
38 (evidence, non-normative).
39- Plans: `docs/plans/` — task breakdowns and documentation plans.
40- Invariants: `docs/PROJECT-INVARIANTS.md` — build system, directory
41 structure, coding standards, and canonical docs inventory.
42- Prototypes: `prototypes/` — spec-validation prototypes and their plan.
44Former `docs/design/` subsystem docs and the P1–P20 prototype report are fully
45absorbed into `docs/SPEC.md` and deleted (see git history).
47## Rules
491. Spec before code. No production `.rs` until `docs/SPEC.md` covers the
50 work; prototype `.rs` under `prototypes/` is sanctioned by SPEC §18.
512. CLAUDE.md is the navigation index. `docs/SPEC.md` is the canonical project spec.
523. Every spec section answers: interfaces, data, errors, tests — as named
53 shapes and behavior, not code. Exact only at boundaries others program
54 against (files, wire formats, CLI, config, Lua SDK); code blocks are
55 illustrative unless the section says otherwise.
564. Open questions: stop and ask. No guessing.
575. Invoke spec work: `/smith <topic>`. Commands are defined once,
58 harness-agnostically, in `.claude/skills/<name>/SKILL.md`
59 (smith, pioneer, handmade, sabotnik); `.pi/prompts/` holds thin pi
60 adapters that defer to them.
616. Cargo is the sole build system. See `docs/PROJECT-INVARIANTS.md` §1.
627. Agents must not modify `docs/SPEC.md` or `docs/PROJECT-INVARIANTS.md` without approval.

docs/PROJECT-INVARIANTS.md

Modified

+3 / −2 text lines

5252└── PROJECT-INVARIANTS.md # this file
5454prototypes/ # ← disposable spec-validation prototypes
55├── AGENTS.md # prototype rules
55├── CLAUDE.md # prototype rules
5656└── PLAN.md # prototype plan + result blocks
5757```
267267Files that coding agents SHOULD read before modifying:
268268- `docs/SPEC.md` (the canonical spec)
269- `AGENTS.md` (project overview)
269- `CLAUDE.md` (project overview)
271271## 6. Spec-Code Relationship
430430| Date | Change | Author |
431431|------|--------|--------|
432| 2026-07-16 | AGENTS.md files renamed to CLAUDE.md repo-wide; references updated (user-directed) | smith-spec |
432433| 2026-07-15 | §8a CI wording scoped to release automation; §4 fetch-providers source models.dev; §1 zig/cargo-zigbuild exception (user-approved) | smith-spec |
433434| 2026-07-15 | §2 tree: design/ absorbed into SPEC.md and deleted; prototypes/ added (user-approved) | smith-spec |
434435| 2026-05-23 | Add architecture gates and pinned-nightly pup exception | smith-spec |

docs/research/AGENTS.md

Deleted
deleted file mode 100644

+0 / −19 text lines

1# docs/research
2
3Research is evidence, not authority.
4
5Rules:
6- `docs/SPEC.md` is canonical. Research must not define requirements.
7- Research docs collect facts, tradeoffs, links, commands, measurements, and examples.
8- Do not reference SPEC sections or old spec IDs from research. Keep research reusable.
9- Use neutral language: observed, measured, compared, failed, succeeded.
10- Put conclusions as candidates, not mandates.
11- If research implies a spec change, report it separately; do not smuggle requirements into research.
12- External code is untrusted. Do not copy code without license review.
14Sparse checkout policy:
15- Do not vendor external repos into this jj repo.
16- Store external sparse clones under `~/.pi/research/repos/`.
17- Commit only small manifests/notes describing source URL, revision, sparse paths, and why it matters.
18- Tier 1 sources are excellent Rust code samples agents may consult for style/patterns.
19- Tier 2 sources are candidates for learning/inclusion only; agents must not use them as coding style exemplars.

docs/research/CLAUDE.md

Added
new file mode 100644

+23 / −0 text lines

1# docs/research
2
3Research is evidence, not authority.
4
5Rules:
6- `docs/SPEC.md` is canonical. Research must not define requirements.
7- Research docs collect facts, tradeoffs, links, commands, measurements, and examples.
8- Do not derive requirements from SPEC references or old spec IDs; keep
9 research reusable. Exception: supersession pointers ("superseded — canonical
10 in SPEC §N") are required when a research conclusion has been absorbed or
11 contradicted, so stale research cannot masquerade as current.
12- Use neutral language: observed, measured, compared, failed, succeeded.
13- Put conclusions as candidates, not mandates.
14- If research implies a spec change, report it separately; do not smuggle requirements into research.
15- External code is untrusted. Do not copy code without license review.
17Sparse checkout policy:
18- Do not vendor external repos into this repo.
19- Store external sparse clones outside the repository (any local cache
20 location; harness-specific paths are the user's choice).
21- Commit only small manifests/notes describing source URL, revision, sparse paths, and why it matters.
22- Tier 1 sources are excellent Rust code samples agents may consult for style/patterns.
23- Tier 2 sources are candidates for learning/inclusion only; agents must not use them as coding style exemplars.

prototypes/AGENTS.md

Deleted
deleted file mode 100644

+0 / −33 text lines

1# prototypes
2
3Purpose: prove or invalidate `../docs/SPEC.md` with tiny disposable prototypes.
4
5Rules:
6- Read `../AGENTS.md`, this file, then `../docs/SPEC.md` before work.
7- One prototype = one SPEC claim/risk.
8- Keep code minimal. No production crates. No broad implementations.
9- Prefer compile checks, focused tests, and runnable repros.
10- Every prototype must have a command that verifies the claim.
11- Evidence beats opinion. Report SPEC defects with exact command output.
12- Do not edit `../docs/SPEC.md` unless explicitly asked.
13- Delete throwaway work unless user asks to keep it.
15Required result JSON:
16```json
17{
18 "status": "complete|blocked|failed",
19 "proved": [],
20 "disproved": [],
21 "specIssues": [
22 {
23 "file": "../docs/SPEC.md",
24 "issue": "missing/false/unclear requirement",
25 "evidence": "prototype path + command + result",
26 "severity": "P0|P1|P2|P3"
27 }
28 ],
29 "prototypeArtifacts": [],
30 "commands": [],
31 "nextSteps": []
32}
33```

prototypes/CLAUDE.md

Added
new file mode 100644

+44 / −0 text lines

1# prototypes
2
3Purpose: prove or invalidate `../docs/SPEC.md` with tiny disposable prototypes.
4
5Rules:
6- Read `../CLAUDE.md`, this file, then `../docs/SPEC.md` before work.
7- One prototype = one SPEC claim/risk.
8- Keep code minimal. No production crates. No broad implementations.
9- Prefer compile checks, focused tests, and runnable repros.
10- Every prototype must have a command that verifies the claim.
11- Evidence beats opinion. Report SPEC defects with exact command output.
12- Do not edit `../docs/SPEC.md` unless explicitly asked.
13- Completed prototypes are kept as evidence: locked deps, verify commands
14 that exit 0, and a result block in `PLAN.md`. Delete only scratch work
15 that never became a plan entry.
17Required result format — Markdown, not JSON (canonical contract lives in
18`../.claude/skills/pioneer/SKILL.md`):
20```markdown
21## Status
22complete | blocked | failed
24## Proved
25- spec claims supported by prototype evidence
27## Disproved
28- spec claims contradicted by prototype evidence
30## Spec Issues
31- `path`
32 - Issue: what spec must clarify or change
33 - Evidence: prototype path, command, compiler/test result
34 - Severity: P0 | P1 | P2 | P3
36## Prototype Artifacts
37- paths created
39## Commands
40- commands run
42## Next Steps
43- concrete spec or design actions
44```

prototypes/PLAN.md

Modified

+5 / −21 text lines

33Purpose: prove or invalidate high-risk `../docs/SPEC.md` claims before production
44Rust exists.
6Rules from `AGENTS.md` apply:
6Rules from `CLAUDE.md` apply:
88- one prototype = one claim/risk,
99- minimal runnable proof,
10991099## Reporting Template
1101Each completed prototype updates this plan with a result block:
1103```json
1105 "status": "complete|blocked|failed",
1106 "proved": [],
1107 "disproved": [],
1108 "specIssues": [
1109 {
1110 "file": "../docs/SPEC.md",
1111 "issue": "...",
1112 "evidence": "prototype path + command + result",
1113 "severity": "P0|P1|P2|P3"
1114 }
1115 ],
1116 "prototypeArtifacts": [],
1117 "commands": [],
1118 "nextSteps": []
1120```
1101Each completed prototype updates this plan with a result block in the
1102Markdown shape required by `prototypes/CLAUDE.md` (canonical:
1103`.claude/skills/pioneer/SKILL.md`). Result blocks recorded before
11042026-07-16 use the earlier JSON shape and stand as historical records.