Literate Programming

Transform a codebase into a single .lit.md literate program document.

241|15|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/tlehman/litprog-skill --skill literate-programming-tlehman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Literate Programming
Source: https://github.com/tlehman/litprog-skill/tree/main
Command: npx skills add https://github.com/tlehman/litprog-skill --skill literate-programming-tlehman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This skill enables transforming a codebase into a cohesive literate program: a narrative document that weaves prose, diagrams, and code while enabling code tangling back to the original sources.

Core Features & Use Cases

  • Generates a .lit.md literate document from a codebase, serving as a single source of truth for both documentation and code.
  • Tangles the document to produce the original source files and a .lit.map.json, enabling round-tripping.
  • Weaves the literate program into PDFs via Pandoc (with Mermaid diagrams) and supports TikZ as an alternative.
  • Includes reverse-sync: updates .lit.md automatically when source files change, then re-tangles.
  • Supports a post-tool-use hook for automatic reverse-sync and a smooth workflow for onboarding and maintenance.

Quick Start

Install the skill and run the /literate-programming workflow on your codebase to generate and weave a .lit.md document.

Frequently Asked Questions about Literate Programming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a codebase into a single literate programming document?

To convert a codebase into a literate programming document, run the literate-programming workflow to generate a .lit.md file that weaves prose, diagrams, and code into a single source of truth.

What is reverse-sync and how does it work with literate programs?

Reverse-sync in literate programs automatically updates the .lit.md document when source files change, then re-tangles the document to ensure the narrative and code remain perfectly synchronized.

Can I use pandoc and mermaid to weave literate programs into PDFs?

Yes, you can weave literate programs into PDFs using Pandoc with Mermaid diagrams for visualization, with TikZ available as an alternative diagram format for the generated .lit.md document.

How do I tangle code from a markdown file back into original source files?

You tangle code from a .lit.md document by parsing named chunks and building a root-chunk dictionary, which produces the original source files and a .lit.map.json for round-tripping.

Does literate programming work for large software projects with onboarding needs?

Literate programming works for software projects of any size where readability and knowledge transfer are priorities, enabling a cohesive narrative document that simplifies onboarding and maintenance.

How do I keep code and documentation synchronized when source files change?

You keep code and documentation synchronized by using a post-tool-use hook for automatic reverse-sync, which updates the .lit.md file whenever source files change and then re-tangles the output.