tool-smith
CLAUDE.md0 starsChanged 4 months agoApache-2.0View on GitHub
smith: agent tools as git repos, adopted per project behind a trust gate. The workflow is new → use → install. The v1 model (personal signed index, register/run/promote, Tier 0/quarantine, $SMITH_HOME/drafts/) is retired — never reintroduce those verbs in code or docs. The command surface and flow are described in several places that drift out of sync silently. Before committing, verify each still matches actual behavior: - [ ] skills/cli-creator/SKILL.md — the agent-loaded authoring skill. Must teach the real verbs…
- Commits and pushes
In this repositoryOne other file it gives its agents.
- cli-creatorSkill
The file
We split this CLAUDE.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 135
Run make test + mise exec -- go vet ./...
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
smith — working notes for Claude
smith: agent tools as git repos, adopted per project behind a trust gate.
The workflow is new → use → install. The v1 model (personal signed index,
register/run/promote, Tier 0/quarantine, $SMITH_HOME/drafts/) is
retired — never reintroduce those verbs in code or docs.
Before every commit / push: sync check
The command surface and flow are described in several places that drift out of sync silently. Before committing, verify each still matches actual behavior:
skills/cli-creator/SKILL.md— the agent-loaded authoring skill. Must teach the real verbs and flow. This has bitten us: a stale skill makes agents run retired commands.README.md— user-facing usage, command list, workflow.usage()incmd/smith/main.go— thesmith helptext. Keep the command list identical to the dispatchswitchabove it.cmdNewprinted "next steps" (cmd/smith/main.go) — the steps a tool author sees aftersmith new. These are the instructions people actually follow; keep them correct.scripts/install.sh— the "next:" hint and any referenced commands (it once pointed at the removedsmith init).internal/scaffold/templates/README.mdandSKILL.md— inherited by every new tool repo; they referencesmith use+ the contract.
Change X → also update Y
- Add / remove / rename a command → dispatch
switchandusage()inmain.go,README.md, and the cli-creator skill if it's part of the author or adopt flow. - Add / rename a
config.FileConfigkey (internal/config/config.go) → add it tov2ConfigKeysincmd/smith/migrate.go. That map is an allowlist; a live key missing from it gets stripped as "retired" bysmith migrate. - Add a runtime (
internal/scaffold/Runtimes) → scaffold templatetool.<runtime>,SourceFile,sourceFiles/materialize switch inadopt.go, the--runtimehelp incmdNew+usage(), the skill's Runtimes section, andsmith contract(contract_test.gopins the list). - Touch what decides a tool's file set —
sourceFiles(legacy) orresolveSources(sources:) — → this is the input tobundleHash, so a change to the LEGACY set re-hashes every already-adopted tool and makesinstall/verifyrefuse them all.TestLegacyBundleHashUnchangedpins that digest deliberately; if it fails, you have a migration on your hands, not a digest to update. All consumers go throughtoolSourceFiles/vendoredSourceFiles(adopt, install, verify, 2 doctor checks, diff) — keep it that way rather than re-deriving a list at a call site. - Change the adoption/trust flow → cli-creator skill, README, and the tool template README all describe it; update together.
- Change the adopt pipeline (clone → checkout → self-test → vendor → pin) →
it's
adoptAtVersionincmd/smith/adopt.go, shared bysmith useandsmith upgrade. Change it once there; don't fork the logic into either caller. - Add a sandbox capability (a new
sandbox:manifest grant) → extendscaffold.SandboxSpec+sandbox.Perms, enforce it in BOTHseatbeltProfileand the bwrap args insandbox.Command(and include it inprofileName's hash), map it inmanifestPerms, surface it incapabilitySummary, and document it (SECURITY.md, README, cli-creator). Perms must stay enforced at the self-test, not just declared.- Build-policy flags are different from mount grants.
sandbox: { build }(python-uv source builds) rides onSandboxSpec/Permsand is surfaced incapabilitySummary, but it gates the uv--no-buildarg (uvArgs), NOT the sandbox profile — so it must be IGNORED byseatbeltProfile/linuxBwrapArgvand stay OUT ofprofileName's hash (else build-opted tools evict/collide on the profile cache). Guarded byTestBuildFlagDoesNotAffectProfile.
- Build-policy flags are different from mount grants.
- Touch per-tool loops (install/verify/list/doctor) → external tools
(
ProjTool.isMise(), adopted viasmith use --mise) have no vendored source, sha,.smith/binentry, or SKILL. Any loop that hashes/materializes/verifies a vendored tool must skipisMise()entries (they're fetched viamise). - Add a health check → add it to the
doctorChecks()registry incmd/smith/doctor.goas a diagnose/apply pair. Reuse the shared halves (activationState,gitignoreMissing,materializeTool,diagnoseV1Home,bundleHash,sandbox.Functional) — don't duplicate detection.--fixruns only fixable (safe/reversible) checks and never runs git. - Add an agent target (
agentTargets()incmd/smith/agents.go) → give it ascope(machine vs project — the claude export is machine-global, see the multi-agent spec's Known limits), keepemitidempotent (a non-idempotent emitter churns a tracked file on everysmith install) and rendering LF-only (upsertManagedBlocktrims the caller's block with cutset"\n"only, so a CRLF-terminated block leaves a dangling\r), and document it inREADME.md+ theagents.targetslist. If it's a new*-mdfile target, also add it toagentInstructionFilesandagentMdTargetNames(cmd/smith/doctor.go) — those are what letsmith doctor'sagents-blockcheck see it at all; forgetting them means doctor silently stops checking the new target.
Human-owned commands
smith publish and merging an adoption PR create/authorize shared artifacts, so
they're human-owned (agents author + propose; humans publish + adopt).
publish requires an explicit --public/--private and never runs itself as a
side effect of another command.
smith doctor
The proactive health command: smith doctor reports machine + project issues,
--fix repairs the safe/reversible ones. It consolidates logic that used to
fire only reactively (during install/use/migrate). When you add repair/verify
behavior anywhere, expose it as a doctor check too, so it's discoverable without
tripping over it.
Releasing (this bit us — read it)
scripts/install.sh downloads cli-creator-SKILL.md as a release asset, so
a skill fix only reaches fresh installs once it's in a new release. After
merging a change that touches the skill or the binary:
- Tag
v<x.y.z>onmain, push the tag. make cross(builds the 4 binaries, copiescli-creator-SKILL.md, and writesSHA256SUMSintodist/).gh release create v<x.y.z> ... dist/smith-* dist/cli-creator-SKILL.md dist/SHA256SUMS(scripts/install.shverifies the downloaded binary againstSHA256SUMS).
Historical register/promote mentions in ROADMAP.md and
docs/history/2026-07-14-original-v1-spec-RETIRED.md are accurate history —
leave the content, but do not assume "not agent-loaded" keeps them harmless.
That assumption failed: the v1 spec used to sit in the repo root as
toolsmith-spec.md with a header telling agents to build from it, and an agent
sent to this repo to learn smith's conventions absorbed the retired model. Hence
the move to docs/history/, the RETIRED filename, and the warning header. Any
doc describing a retired model needs all three.
Keep smith contract true. cmdContract (cmd/smith/contract.go) is the
in-band, authoritative answer for an agent that has the binary but not the
cli-creator skill. If you change a runtime, the self-test's sandbox, the CLI
contract, or which limits are load-bearing, update it — contract_test.go pins
the runtime list against scaffold.Runtimes and asserts the sandbox-scope and
load-bearing-vs-unbuilt sections stay present, but it cannot check prose you
forgot to change.
Repo conventions
mainis protected: land changes via a PR (gh pr create→ CI green → merge). Direct pushes of tags are fine.- Commit trailer:
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>. - Go is pinned via
mise.toml; run Go throughmise exec -- go(ormake). - Run
make test+mise exec -- go vet ./...+mise exec -- gofmt -l .before pushing (CI has a format check;gofmt -l .must print nothing).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

