code-walkthrough
Generate structured, hallucination-proof code walkthroughs using Showboat. Use when the user asks to "walk me through this code", "explain this codebase", "create a walkthrough", "document how this works", "give me a tour of this repo", or wants a readable narrative document that explains code with real verified snippets. Also triggers on "showboat", "linear walkthrough", or "code documentation". Not for quick code questions — this produces a full markdown document.
What this skill does
# Code Walkthrough
Generate a structured, **linear** walkthrough of a codebase (or a single file) using [Showboat](https://github.com/simonw/showboat). The output is a markdown document meant to be read top-to-bottom in one sitting — a single narrative thread that builds understanding incrementally, not a reference manual you jump around in.
**What "linear" means:** The agent decides on a teaching sequence and the reader follows it from beginning to end. This is deliberately different from API docs (jump to what you need), READMEs (overview), code comments (scattered inline), or wiki pages (interlinked, no single path). A linear walkthrough has a beginning, middle, and end — like a guided tour where the guide chooses the route.
The walkthrough mixes narrative explanation with real code snippets extracted via shell commands — never from memory.
## Why Showboat
The agent writes `showboat exec demo.md bash "cat src/main.py | head -30"` instead of pasting code from its context window. The document contains *executed output*, not *recalled content*. This eliminates hallucination risk entirely — every snippet is ground truth from the filesystem.
Showboat also supports `showboat verify` to re-run all code blocks and diff against recorded output — making walkthroughs reproducible proof of work, not just documentation.
## Prerequisites
Showboat must be installed. Check with `showboat --version`. If missing:
```bash
uv tool install showboat
# or: pip install showboat
# or: go install github.com/simonw/showboat@latest
```
## Showboat Commands
Familiarize yourself with the full command set before starting:
| Command | Purpose |
|---------|---------|
| `showboat init <file> <title>` | Create a new document |
| `showboat note <file> [text]` | Append narrative/commentary (text or stdin) |
| `showboat exec <file> <lang> [code]` | Run code, capture command + output |
| `showboat image <file> <path>` | Copy image into document |
| `showboat pop <file>` | Remove the most recent entry (undo) |
| `showboat verify <file>` | Re-run all code blocks, diff against recorded output |
| `showboat extract <file>` | Emit commands that would recreate the document |
**Key details:**
- `exec` prints output to stdout AND appends to the document. React to errors — use `pop` to remove failed entries.
- `exec` supports multiple languages: `bash`, `python`, `python3`, etc. Use the appropriate lang for the snippet.
- `--workdir <dir>` sets the working directory for code execution (useful when the target code is in a different directory).
- Commands accept stdin when the text/code argument is omitted: `cat script.sh | showboat exec demo.md bash`
## Workflow
### 1. Scope the walkthrough
Determine what to cover:
- **Single file**: walk through one file in logical order (e.g., entry point, config, a complex module)
- **Multi-file / repo**: walk through the codebase in teaching order — entry point first, then data model, then business logic, then edge cases
Ask the user what they want covered if it's ambiguous. Default to the most useful scope — for a small repo, cover everything; for a large one, focus on the entry points and core logic.
### 2. Read and plan
Before writing anything, read the target code thoroughly:
- Traverse imports and dependencies to understand the call graph
- Identify the entry point(s)
- Note the key abstractions, data models, and design decisions
- Decide on a **teaching sequence** — the order a human would want to learn this, not the order files appear alphabetically
The teaching sequence matters. Build understanding incrementally — don't reference concepts before they're introduced.
### 3. Check for existing walkthrough
Before creating or editing anything, check if the output file already exists:
```bash
# If the file exists, verify it FIRST
showboat verify <output-path>
```
**If the file exists:** `showboat verify` re-runs every code block and diffs against recorded output. This tells you exactly which snippets have drifted — stale line ranges, renamed functions, deleted files. **Use the verify output as your editing guide.** Only update what's changed; don't rewrite sections that still match. After fixes, run verify again to confirm.
**If the file doesn't exist:** Initialize a new document:
```bash
showboat init <output-path> "<Title> — Walkthrough"
```
Default output location: `docs/<name>-walkthrough.md` in the current repo. Create the `docs/` directory if it doesn't exist. The walkthrough is a repo artifact — it should live alongside the code it describes, not in a temp directory.
### 4. Build the walkthrough
Alternate between `showboat note` (narrative) and `showboat exec` (code) to build the document:
**For narrative sections:**
```bash
showboat note <file> "## Section Title
Explanation of what this section covers and why it matters."
```
**For code snippets — use shell commands to extract real code:**
```bash
showboat exec <file> bash "sed -n '10,25p' src/main.py"
```
Good extraction commands:
- `sed -n '10,25p' <file>` — line range (most common)
- `head -n 20 <file>` — first N lines
- `grep -A 5 'def main' <file>` — function signature + context
- `cat <file>` — whole file (only for short files)
Use sed, grep, cat, head, or whatever shell command best extracts the relevant snippet. The point is: **the code must come from the filesystem via a shell command, never pasted from your context window.** This is the core anti-hallucination mechanism — the document contains executed output, not recalled content.
For non-bash code (e.g., demonstrating a Python script), use the appropriate language:
```bash
showboat exec <file> python3 "print('Hello from the walkthrough')"
```
**After each code block, explain what it does:**
```bash
showboat note <file> "This function does X because Y. Notice the Z pattern — it connects to the W we saw earlier."
```
### 5. Maintain the rhythm
A good walkthrough alternates: context → code → explanation → context → code → explanation. Each code block should be preceded by *why we're looking at this* and followed by *what it means*.
Keep code blocks focused — 10-30 lines is ideal. Don't dump an entire 200-line file; extract the relevant section and explain it.
### 6. Close with perspective
End with a brief section summarizing the overall shape — how many files, what the architecture looks like at a glance, what's deliberate about the design. This gives the reader a mental model to hold onto.
### 7. Verify
Always run verify after completing edits or additions:
```bash
showboat verify <output-path>
```
This re-executes every code block and diffs against the recorded output. For new walkthroughs, it confirms everything was captured correctly. For updates, it confirms your fixes resolved all drift. **Don't consider the walkthrough done until verify passes clean.**
## Key Constraints
- **Never paste code from memory.** Every code snippet must come through `showboat exec` running a real shell command. This is the core anti-hallucination mechanism — as Simon Willison puts it, use "sed or grep or cat or whatever you need to include snippets of code you are talking about" so the document can't contain hallucinated or paraphrased code.
- **Teaching order, not file order.** Arrange sections so understanding builds incrementally.
- **Explain the why, not just the what.** "This function validates input" is weak. "This function validates input before it hits the database — without it, malformed requests would silently corrupt the session store" is useful.
- **Use `showboat pop`** if a command produces an error or unwanted output. Remove it and redo.
- **Use `showboat image`** when a screenshot or diagram would help explain the code (e.g., UI output, architecture diagrams).
## Example
Here's what the workflow looks like for a single-file walkthrough:
```bash
# Initialize
showboat init docs/api-walkthrough.md "API Server — Walkthrough"
# Intro
showboat note docs/api-walkthrough.md "server.py is the entry Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.