claude-handoff
MAmattpocock/skills337k近 7 天新增 4,978 个 star
Verify that a stored Lathe tutorial actually works by following it end to end in a fresh scratch dir, in session. Use when the user invokes /lathe-verify with a slug like "/lathe-verify digital-synth-zig" (the "Verify this tutorial" button in `lathe serve` hands you that command).
Follow a stored tutorial exactly as a reader would, in a throwaway directory, and record whether it actually works. Triggered by /lathe-verify <slug>. Isolation is by instruction — a fresh mktemp -d, under the user's normal interactive permissions. No sandbox-exec, no Docker.
This skill is read-only with respect to the tutorial: never edit the parts or the metadata. The only writes are status updates through lathe verify-result, which also saves the reconstructed code as a per-part git history (the code snapshot) so the reader can check out or diff the code at any part afterwards.
Lathe MCP tools. If your session has the lathe_verify_result tool (lathe serve provides Lathe's MCP tools when it hosts you as its agent), record every status with it instead of running lathe verify-result. The flags map one-to-one onto its arguments: --status → status, --part → part, --failed-step → failed_step, --error → error, --code → code (an absolute path); the session's slug is the default. Without the tool, run the CLI commands below as written.
Hosted by lathe serve. When lathe serve --agent runs you for the Verify button, it makes the scratch dir for you and names it in the prompt: use that dir as $SCRATCH in step 2 instead of mktemp -d (Lathe deletes it after the run, once your result is recorded). Commands may only run there.
Opt-out: if the user invoked /lathe-verify <slug> --no-save, skip every snapshot step below (no git init, no commits or tags, no --code). Everything else is unchanged.
Mark it in-flight first:
lathe verify-result <slug> --status verifying
This sets the spinner badge in the web UI. If it errors with "cannot verify while it is extending", stop — a part is mid-flight; don't verify on top of it.
Make a fresh scratch dir and work there:
cd "$(mktemp -d)" && SCRATCH="$PWD"
Everything the tutorial tells the reader to create happens here, not in the user's project. (Status is set by this skill, never by the web/CLI button — so an unclicked button can never strand a tutorial at verifying.)
Then start the snapshot repo at the scratch root, ignoring dependency and build-output dirs so only source is kept:
git init --quiet
printf '%s\n' node_modules/ target/ .zig-cache/ zig-cache/ zig-out/ __pycache__/ .venv/ venv/ .gradle/ .DS_Store > .git/info/exclude
Add any other dependency/build-output dir the tutorial's toolchain produces to .git/info/exclude as you meet it. (Use .git/info/exclude, not a .gitignore, so the snapshot never contains a file the tutorial didn't ask for.)
Follow each part in order. Read ~/.lathe/tutorials/<slug>/part-NN.md from part-01 up. Install the prerequisites, create the files and paste the code blocks exactly as written, in order, then run the ## Checkpoint command and compare against the stated expected output.
> [!PREDICT], > [!RECALL], and > [!UNVERIFIED] are not verifiable steps. They prompt the reader or flag uncertainty; there's nothing to execute.```jig blocks — they are interactive reader aids, not steps. But a jig can assert a fact (a Guess first answer key, an expected value): if your run contradicts one, report it as a failure the same way you'd report wrong prose.$SCRATCH, tag = the part's filename without .md):
git -C "$SCRATCH" add -A
git -C "$SCRATCH" -c user.name=lathe -c user.email=lathe@localhost commit --quiet --allow-empty -m "part-NN: <part title>"
git -C "$SCRATCH" tag part-NN
Do this only for parts that pass, so every tag marks code that worked. If the tutorial itself runs git init at the scratch root (it manages its own repo there), don't fight it: skip the snapshot for this run and tell the user why.Record the terminal result with the matching command:
Pass --code "$SCRATCH" with verified and failed (when at least one part was tagged) so the CLI saves the snapshot into the tutorial; never copy it into ~/.lathe/ yourself. Leave it off for skipped, for --no-save, and when no part was tagged.
lathe verify-result <slug> --status verified --code "$SCRATCH"lathe verify-result <slug> --status skipped
This is not a failure — it's the ⚠️ Skipped badge, meaning "couldn't run it here," not "the tutorial is wrong." Use it whenever the toolchain the tutorial needs (compiler, runtime, SDK) is missing locally.lathe verify-result <slug> --status failed \
--part <part-NN.md> \
--failed-step <1-indexed step number within that part> \
--error "<the error message or mismatched output>" \
--code "$SCRATCH"
The snapshot then holds the parts that passed, up to the one before the failure.verify-result reports that the status was recorded but the snapshot couldn't be saved, the result still stands; tell the user why the code wasn't kept.Report to the user what happened — verified clean, skipped (and which tool was missing), or where exactly it failed — and, when a snapshot was saved, which parts it covers (e.g. git -C ~/.lathe/tutorials/<slug>/code diff part-03 part-04).
part-NN.md, metadata.json, verify-result.json, or the code/ snapshot directly — the only state writes are via lathe verify-result (or the lathe_verify_result MCP tool).mktemp -d scratch dir plus instruction, under the user's normal permission model. Don't reach for sandbox-exec or Docker.skipped. Reserve failed for the tutorial being genuinely broken.MAmattpocock/skills337k近 7 天新增 4,978 个 star
MAmattpocock/skills337k近 7 天新增 4,978 个 star
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star
AFaffaan-m/ECC315k近 7 天新增 4,381 个 star
DIDietrichGebert/ponytail203k近 7 天新增 4,904 个 star