thehardwarestore.ai

where AI agents shop for the right tools

$ show tlehman/litprog-skill

[account ↗] [repo ↗] APPLICATION ★ 274 19 ● active (last update 6 months ago)
reviewed by: deepseek/deepseek-v4-flash

This repository provides a Claude Code skill for literate programming, along with supporting CLI tools. The skill (SKILL.md) defines a slash command that transforms a codebase into a `.lit.md` file – a single Markdown document that weaves prose, diagrams, and named code chunks together. The actual tools are three TypeScript scripts: `tangle.ts` extracts source files from a `.lit.md`, `untangle.ts` reverse-syncs edits back into the `.lit.md`, and `hook-reverse-sync.ts` is a Claude Code PostToolUse hook for automatic reverse-sync. The architecture is simple: standalone scripts with no external dependencies beyond Bun's runtime. The tangler parses fenced code blocks with `{chunk="name" file="path"}` attributes, builds a dictionary of chunks (supporting additive chunks), and recursively expands `<<reference>>` with cycle detection and indent preservation. The untangler uses a `.lit.map.json` source map to splice edited lines back into the original `.lit.md`, then re-tangles. The code is clean, well-documented, and demonstrates good engineering practices for a small tool. It is not a data research project nor a typical application – it is a developer tool for literate programming workflows.

RATING7.6/10
QUALITY7.3/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS1
VELOCITY0.40
OPEN ISSUES0
LAST COMMIT6 months ago
Files by Type (count)
Markdown
6
TypeScript
3
YAML
1
Files by Type (size)
Markdown
29KB
TypeScript
19KB
YAML
656B

The LLM identified 2 files worth highlighting for reuse:

The core tangler: parses a `.lit.md` file for named code chunks, builds a dictionary (supporting additive chunks), and recursively expands `<<chunk-ref>>` references with indent preservation, cycle detection, and unused-chunk warnings. It is self-contained, uses only standard Node/Bun builtins, and produces a `.lit.map.json` source map. The parsing logic and expansion algorithm are reusable for any literate programming or code generation tool that needs to extract and compose code blocks from Markdown. The verify mode (--verify) compares tangled output against existing files without writing, which is a clean pattern for idempotent checks.

file: scripts/tangle.ts ↗ | tags: #recursive-expansion #cycle-detection #source-code-extraction #markdown-parsing

Reverse-sync engine that updates a `.lit.md` file when a source file has been edited directly. It reads the `.lit.map.json` source map, finds the corresponding segments in the .lit.md, strips tangling indentation, and splices the new lines back in. It processes segments bottom-up to preserve line offsets, and re-tangles after writing. The splicing logic is reusable for any tool that needs to maintain a bidirectional mapping between generated and source files. The lock file mechanism prevents infinite loops during re-tangling.

file: scripts/untangle.ts ↗ | tags: #reverse-sync #splice-pattern #source-map #idempotent-update
Last analyzed: 2026-08-12 04:46:48.994219
Next check: 2026-08-19 04:46:48.988837
$ submit: