lathe

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Lathe

Generate hands-on technical tutorials on demand, then read them in your browser with verified working code.

Lathe targets topics where good documentation is scarce — "build a digital synth in Zig", "build a 3D slicer from scratch", "build a database from scratch in Go". You get an expert guide that walks you through the work step by step, with each checkpoint independently runnable. Tutorials are generated by a Claude Code skill, then stored, served, and verified by a Go CLI.

How it works

Two layers with a clean boundary:

  • Claude Code skills — generate and work with tutorials, all run in your interactive Claude Code session: /lathe writes part-01.md, /lathe-extend adds the next part, /lathe-verify works through a tutorial to confirm it compiles and runs, /lathe-ask answers questions about a part you're reading, and /lathe-tag adds search tags to existing tutorials. Running them interactively keeps the work on your Claude subscription (headless claude -p is metered as of 2026-06-15; interactive use is not).
  • lathe CLI (Go) — copies tutorials into ~/.lathe/tutorials/, serves the rendered output at http://localhost:4242, and owns all durable state. It never calls claude itself: the web buttons and the lathe verify/lathe extend commands just hand you the skill command to paste into your session, and the skills call back into the CLI (lathe store, lathe verify-result, lathe extend-start/extend-commit) to record results.
User: /lathe "build a digital synth in Zig"     (interactive Claude Code)
        │
        ▼
  [/lathe skill]                     generates part-01.md
        │
        ▼  lathe store /tmp/lathe-<slug>
  [lathe CLI]                        copies files (status: unverified)
        │
        ├── ~/.lathe/tutorials/<slug>/
        │       metadata.json        status: unverified
        │       part-01.md, part-02.md, …
        │
        └── lathe serve → "Verify"/"Add Part"/"Ask" buttons hand you a command
                │
                ▼  paste into your session: /lathe-verify <slug>
            [/lathe-verify skill, interactively]
                works through each step, runs every checkpoint command, then
                `lathe verify-result` updates metadata: verifying → verified | failed | skipped

User: lathe serve  →  http://localhost:4242  (browser opens automatically)

Install

Lathe is a single self-contained binary. All you need is lathe on your $PATH; the skills run in an interactive Claude Code (or Cursor) session — the binary never spawns claude itself.

Homebrew (macOS, recommended):

brew install devenjarvis/tap/lathe

Distributed as a cask (a pre-built binary), so it's macOS-only — on Linux use the install script or go install below.

Install script (curl | sh):

curl -sSf https://raw.githubusercontent.com/devenjarvis/lathe/main/install.sh | sh

Go (needs Go 1.25+):

go install github.com/devenjarvis/lathe@latest

From source:

git clone https://github.com/devenjarvis/lathe
cd lathe
go build -o lathe
Install the skills

The skills are bundled into the binary. After installing lathe, drop them into a project so Claude Code can discover them:

lathe skills install                 # ./.claude/skills/<name>/SKILL.md (this project)
lathe skills install --user          # ~/.claude/skills/<name>/SKILL.md (all projects)
lathe skills install --agent cursor  # ./.cursor/commands/<slug>.md (Cursor slash commands)
lathe skills install --agent all     # both Claude Code and Cursor
lathe skills list                    # show the bundled skills

Cursor commands are slash-invoked as /<slug> (e.g. /lathe); the interactive handoff model is documented for Claude Code, so a few runtime details differ on Cursor.

Usage

Generate a tutorial inside any Claude Code session:

/lathe build a digital synth in Zig

Then open it:

lathe serve              # starts the web server, opens the browser

Other commands:

lathe list               # show all stored tutorials with status badges
lathe open <slug>        # open a specific tutorial (requires lathe serve)
lathe store <path>       # save a tutorial directory manually (status: unverified)
lathe store <path> --tag rust --tag audio   # save with search tags
lathe store <path> --verify   # save, then print the /lathe-verify command to run
lathe verify <slug>      # print the /lathe-verify <slug> command to run in your session
lathe extend <slug>      # print the /lathe-extend <slug> command to run in your session
lathe tag <slug> --set rust,audio   # set/--add/--remove a tutorial's tags
lathe rm <slug>          # delete a stored tutorial (prompts unless --force)

You can also delete tutorials from the web UI — each row on the list page has a × button that removes the tutorial after a confirmation.

Finding tutorials

As your library grows, the web list page (lathe serve) has a search box and filters to narrow it down — all client-side, so it stays fast and offline:

  • Search matches a tutorial's title, slug, topic, and tags.
  • Sort by newest, oldest, or title (A–Z).
  • Filter by status, by type (single vs. series), and by tag — each tutorial's tags also show as pills on its card.

Tags come from the tags field in metadata.json. New tutorials get them when /lathe passes --tag to lathe store; for tutorials made before tagging existed, run /lathe-tag <slug> in your session (or /lathe-tag to backfill every untagged one) — the skill reads the tutorial and records tags via lathe tag. Untagged tutorials still show up and stay searchable by title/topic.

Default port is 4242; override with --port.

Storage layout

Tutorials live globally in ~/.lathe/tutorials/, one directory per slug:

~/.lathe/tutorials/
  digital-synth-zig/
    metadata.json
    part-01.md
    part-02.md
    part-03.md
  database-from-scratch-go/
    metadata.json
    index.md

metadata.json:

{
  "slug": "digital-synth-zig",
  "title": "Build a Digital Synth in Zig",
  "topic": "build a digital synth in Zig",
  "created": "2026-05-03T19:00:00Z",
  "status": "unverified",
  "tags": ["zig", "audio", "dsp"],
  "parts": ["part-01.md", "part-02.md", "part-03.md"]
}

Status is one of unverified (the default after lathe store; renders no badge), verifying, verified, failed, or skipped. On failure, a verify-result.json is written alongside with the failed part, step number, and error output; the web UI renders it as a panel on the tutorial page.

Verification

Verification is opt-in and runs in your interactive Claude Code session. Storing a tutorial leaves it unverified — nothing runs until you ask. The lathe verify <slug> command, the --verify flag on lathe store, and the Verify this tutorial button in the web UI all just hand you the same command to paste into your session:

/lathe-verify <slug>

The /lathe-verify skill works through every step in the tutorial — creating files in a fresh mktemp -d scratch dir (never your repo), running commands, executing each ## Checkpoint block — then calls lathe verify-result to record the outcome in the tutorial's metadata.json. It marks the run verifying when it starts and a terminal verified / failed / skipped when it finishes; while a run is in flight the web page auto-refreshes every 5s, so the badge moves ⏳ → ✅ / ❌ / ⚠️ on its own.

Verification only makes sense where the tutorial's toolchain is installed. If a required tool is missing (e.g. no zig binary), the run is reported as skipped (⚠️) rather than failed — "couldn't verify here" is not the same as "broken."

Because verification now runs in your own interactive session, it executes under your normal Claude Code permission model — you see and approve the tool calls. The scratch-dir convention keeps build artifacts out of your repo, but treat it as soft isolation, not a security boundary.

Dependencies

  • spf13/cobra — CLI command structure
  • yuin/goldmark + goldmark-highlighting — markdown rendering with Chroma syntax highlighting
  • claude CLI — Claude Code, where the /lathe, /lathe-verify, /lathe-extend, /lathe-ask, and /lathe-tag skills run

Repository layout

cmd/                CLI commands (root, list, open, rm, serve, store, verify, extend,
                    verify-result, extend-start, extend-commit, tag)
internal/config/    ~/.lathe/tutorials path resolution
internal/store/     copy + metadata read/write, slug detection
internal/serve/     HTTP server, markdown renderer, embedded HTML templates, handoff endpoints
internal/extend/    NextPartFilename helper
.claude/skills/     lathe, lathe-verify, lathe-extend, lathe-ask, lathe-tag skills (user-invoked, interactive)
internal/skills/    embedded copies of those skills (data/) + the skills install/catalog logic
internal/buildinfo/ version/commit/date stamped into the binary at build time
docs/superpowers/   design spec and bootstrap plan
main.go             cobra entrypoint

Releasing

Releases are cut by pushing a semver tag:

git tag v0.1.0
git push origin v0.1.0

The release workflow runs GoReleaser (config in .goreleaser.yaml): it builds darwin/linux × amd64/arm64 binaries, publishes a GitHub Release with checksums and a generated changelog, and updates the Homebrew cask in devenjarvis/homebrew-tap. The tap update needs a HOMEBREW_TAP_GITHUB_TOKEN repo secret (a PAT with contents:write on the tap repo).

Dry-run locally without tagging:

goreleaser check
goreleaser release --snapshot --clean

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd/list.go
cmd/list.go
internal
buildinfo
Package buildinfo carries the version metadata stamped into the lathe binary.
Package buildinfo carries the version metadata stamped into the lathe binary.
skills
Package skills bundles the Lathe Claude Code skills into the binary so `lathe skills install` can write them out with no repo clone.
Package skills bundles the Lathe Claude Code skills into the binary so `lathe skills install` can write them out with no repo clone.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL