literate-guide
Create a narrative guide to a codebase or feature in the style of Knuth's Literate Programming — code and prose interwoven as a single essay, ordered for human understanding rather than compiler needs. Use when the user asks to 'explain this codebase as a story', 'write a literate guide', 'create a narrative walkthrough', 'tell the story of this code', 'Knuth-style documentation', 'weave a guide for this feature', or when they want deep, readable documentation that treats the program as literature. Also trigger when someone wants a document that a thoughtful reader could follow from start to finish and come away understanding both WHAT the code does and WHY every design choice was made.
What this skill does
# Literate Guide
Create a guide that tells the story of a codebase or feature the way Knuth intended programs to be read: as literature. The output is a single narrative essay where code excerpts and prose are interwoven, ordered by the logic of human understanding rather than file layout or execution order.
## The Idea Behind This
Knuth's core observation was simple: programs are read far more often than they are written, yet we organize them for the compiler's convenience, not the reader's. A literate program reverses this — the author decides the order of presentation based on what a human needs to understand first, and the code appears *within* that narrative exactly where it becomes relevant.
For an existing codebase, this means:
- **Don't follow the file tree.** Follow the conceptual thread. Start where understanding starts, not where `main()` lives.
- **Each section introduces one idea**, shows the code that embodies it, and explains the reasoning behind the design. Sections are numbered with the section sign: `§1`, `§2`, `§3`... (that's the `§` character, U+00A7 — not the letter "S"). Sections cross-reference each other using this same notation.
- **The prose does the heavy lifting.** Code excerpts are windows into the implementation, not the primary content. A reader should be able to follow the narrative even if they skip over the code blocks.
- **Design decisions are first-class content.** "We use X instead of Y because..." is the heartbeat of a literate guide. Alternatives considered, tradeoffs accepted, constraints that shaped the design — these are what make the document valuable long after the code has changed.
## Workflow
### Step 1: Understand the Scope
Ask the user what they want the guide to cover:
```
question: "What should this literate guide cover?"
header: "Scope"
options:
- label: "Entire codebase"
description: "The full story of this project, end to end"
- label: "A specific feature or subsystem"
description: "Deep narrative on one part of the codebase"
- label: "A recent change or PR"
description: "The story of a specific set of changes and why they were made"
```
If they choose a feature or subsystem, clarify which one. If the codebase is large (50+ files), strongly recommend scoping to a subsystem — a good literate guide goes deep, and breadth dilutes that.
Also ask about audience:
```
question: "Who will read this?"
header: "Audience"
options:
- label: "A developer joining the team"
description: "Assumes general programming knowledge, no project-specific context"
- label: "A senior engineer reviewing the architecture"
description: "Assumes deep technical knowledge, wants to understand design rationale"
- label: "Future me"
description: "Personal documentation for a system I'll forget the details of"
- label: "Open source contributors"
description: "External developers who want to understand the project well enough to contribute"
```
### Step 2: Deep Reading
Read the codebase thoroughly. This isn't a skim — you're looking for the *story*. Investigate in this order:
1. **The problem** — What does this software exist to solve? Check README, docs, comments, commit messages, issue trackers.
2. **The domain model** — What are the core abstractions? What do they represent in the real world?
3. **The architecture** — How do the pieces fit together? What are the boundaries?
4. **The flows** — Trace 2-3 primary operations end to end. These become narrative throughlines.
5. **The design decisions** — Where are the interesting tradeoffs? Look for:
- Comments that explain "why" (not "what")
- Places where simpler approaches were avoided — there's usually a reason
- Abstractions that seem overbuilt — they often encode hard-won lessons
- Configuration and feature flags — they reveal the axes of variation the authors anticipated
6. **The history** — `git log` for major refactors, pivots, or rewrites. These are plot points in the story.
### Step 3: Find the Narrative Thread
Before writing, identify:
- **The opening** — What idea or problem should the reader encounter first? This is rarely the entry point of the code. It's the *motivation*: the problem that makes the rest of the code necessary.
- **The arc** — What's the natural progression of understanding? Usually: problem → domain → core abstraction → how it works → how edge cases are handled → how it connects to the rest of the system.
- **The key decisions** — 3-5 design choices that define the system's character. These are the moments in the narrative where you pause the code walkthrough and say "here's why."
- **The sections** — Break the narrative into numbered sections using the `§` symbol: `§1`, `§2`, etc. (not "S1" or "Section 1" — the section sign `§` is a deliberate stylistic choice from Knuth's TeX tradition). Each section should have a name that describes the *idea*, not the file. "§4. Why events, not callbacks" is better than "§4. The EventEmitter class."
### Step 4: Write the Guide
Follow the template in [references/guide-template.md](references/guide-template.md). Key principles:
**Voice and tone:**
- Write in a warm, direct, first-person-plural voice ("we," "our"). The guide is a conversation between the author and the reader, not a specification.
- Be specific and concrete. "This handles edge cases" is empty. "This catches the case where a user submits a form twice before the first request completes" is useful.
- Embrace the author's perspective. Knuth didn't pretend to be objective — he explained what *he* was thinking and why. Do the same. "I chose X over Y because..." or "The team decided to..." with real reasons.
**Code excerpts:**
- Show only the code relevant to the point being made. Trim aggressively. If a function is 40 lines but the interesting part is 8 lines, show the 8 lines with a note about what the rest does.
- Always include the file path and line range above the code block so the reader can find it.
- Annotate the code. Don't just show it and move on — point out the significant details. "Notice that `retries` is passed as a parameter, not read from config. This makes testing deterministic (§12)."
- Use cross-references (`§N`) when code in one section relates to concepts explained in another.
**Section structure:**
- Open with prose that explains the idea and its motivation
- Show the relevant code
- Explain the design reasoning — alternatives considered, constraints, tradeoffs
- Close with a transition that connects to the next section. Every section ending should bridge to what comes next — this is what makes the guide read as a continuous narrative rather than a series of isolated entries. Examples: "With this normalization in place, we can now trust that the reducer (§7) receives clean input." or "This raises a question: how does the system handle the case where...? That's the subject of §9."
**Cross-references:**
- Use the `§` symbol for all cross-references: "as we saw in §3", "this connects to the retry logic in §12", "the transport layer (§8) hides this complexity". The `§` symbol is load-bearing — it's the visual cue that tells the reader "this refers to another section in this document."
- Cross-references are what make the document a *web* rather than a linear sequence. Use them generously — a good literate guide has at least 2-3 cross-references per section, weaving backward to reinforce earlier ideas and forward to foreshadow upcoming ones.
**Diagrams:**
- Include Mermaid diagrams where they aid understanding — typically one system-level overview near the beginning, and sequence diagrams for complex flows
- Diagrams supplement the prose; they don't replace it
### Step 5: Review the Draft
Before delivering, read the guide as if you've never seen the codebase:
1. **Does it tell a story?** Can you follow the narrative from §1 to the end without getting lost? If any section feels like a non sequitur, it needs a better transition or should be reordered.
2. **Is eRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.