repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

CLAUDE.md

Raw

smith

Rust coding agent TUI. Phase: spec/planning. No production code until specs are final; disposable spec-validation prototypes live under prototypes/ (SPEC §18).

Architecture

smith/ (types, StreamFn, AgentTool, Lua, config)
  → smith-ai/ | smith-core/ | smith-tui/ (parallel)
  → smith-harness/ (wiring, plugins, SDK)
  → smith-cli/ (binary)

Locked Decisions

Decision Rationale
Latest stable Rust, ed. 2024 Rolling MSRV follows stable compiler
mlua + LuaJIT Performance, coroutines
CBOR sessions Compact, binary-safe
Secret proxy (no keychain) Cross-platform
XDG dirs Linux standards
jj VCS Modern DVCS
StreamFn abstraction Decouples agent from providers
Lua plugins with sandbox Safe extensibility
Rust widgets, Lua layout Performance + flexibility
Cargo-only build system Single entry point, no make/just/scripts

Source of Truth

CLAUDE.md is a navigation index. Do not mirror individual source-of-truth file lists here; use the canonical directories and docs tree instead.

Former docs/design/ subsystem docs and the P1–P20 prototype report are fully absorbed into docs/SPEC.md and deleted (see git history).

Rules

  1. Spec before code. No production .rs until docs/SPEC.md covers the work; prototype .rs under prototypes/ is sanctioned by SPEC §18.
  2. CLAUDE.md is the navigation index. docs/SPEC.md is the canonical project spec.
  3. Every spec section answers: interfaces, data, errors, tests — as named shapes and behavior, not code. Exact only at boundaries others program against (files, wire formats, CLI, config, Lua SDK); code blocks are illustrative unless the section says otherwise.
  4. Open questions: stop and ask. No guessing.
  5. Invoke spec work: /smith <topic>. Commands are defined once, harness-agnostically, in .claude/skills/<name>/SKILL.md (smith, pioneer, handmade, sabotnik); .pi/prompts/ holds thin pi adapters that defer to them.
  6. Cargo is the sole build system. See docs/PROJECT-INVARIANTS.md §1.
  7. Agents must not modify docs/SPEC.md or docs/PROJECT-INVARIANTS.md without approval.
Markdown source
File outline
# smith

Rust coding agent TUI. Phase: spec/planning. No production code until specs
are final; disposable spec-validation prototypes live under `prototypes/`
(SPEC §18).

## Architecture

```
smith/ (types, StreamFn, AgentTool, Lua, config)
  → smith-ai/ | smith-core/ | smith-tui/ (parallel)
  → smith-harness/ (wiring, plugins, SDK)
  → smith-cli/ (binary)
```

## Locked Decisions

| Decision | Rationale |
|----------|-----------|
| Latest stable Rust, ed. 2024 | Rolling MSRV follows stable compiler |
| mlua + LuaJIT | Performance, coroutines |
| CBOR sessions | Compact, binary-safe |
| Secret proxy (no keychain) | Cross-platform |
| XDG dirs | Linux standards |
| jj VCS | Modern DVCS |
| StreamFn abstraction | Decouples agent from providers |
| Lua plugins with sandbox | Safe extensibility |
| Rust widgets, Lua layout | Performance + flexibility |
| Cargo-only build system | Single entry point, no make/just/scripts |

## Source of Truth

CLAUDE.md is a navigation index. Do not mirror individual source-of-truth file
lists here; use the canonical directories and docs tree instead.

- Spec: `docs/SPEC.md` — canonical project specification.
- Research: `docs/research/` — ecosystem research and tool analysis
  (evidence, non-normative).
- Plans: `docs/plans/` — task breakdowns and documentation plans.
- Invariants: `docs/PROJECT-INVARIANTS.md` — build system, directory
  structure, coding standards, and canonical docs inventory.
- Prototypes: `prototypes/` — spec-validation prototypes and their plan.

Former `docs/design/` subsystem docs and the P1–P20 prototype report are fully
absorbed into `docs/SPEC.md` and deleted (see git history).

## Rules

1. Spec before code. No production `.rs` until `docs/SPEC.md` covers the
   work; prototype `.rs` under `prototypes/` is sanctioned by SPEC §18.
2. CLAUDE.md is the navigation index. `docs/SPEC.md` is the canonical project spec.
3. Every spec section answers: interfaces, data, errors, tests — as named
   shapes and behavior, not code. Exact only at boundaries others program
   against (files, wire formats, CLI, config, Lua SDK); code blocks are
   illustrative unless the section says otherwise.
4. Open questions: stop and ask. No guessing.
5. Invoke spec work: `/smith <topic>`. Commands are defined once,
   harness-agnostically, in `.claude/skills/<name>/SKILL.md`
   (smith, pioneer, handmade, sabotnik); `.pi/prompts/` holds thin pi
   adapters that defer to them.
6. Cargo is the sole build system. See `docs/PROJECT-INVARIANTS.md` §1.
7. Agents must not modify `docs/SPEC.md` or `docs/PROJECT-INVARIANTS.md` without approval.