Files

1.5 KiB
Raw Permalink Blame History

name, description
name description
context Compress docs/ into CONTEXT.md at project root — minimum tokens, lossless

Read every .md file in docs/. Generate CONTEXT.md at the project root.

Goal

Lossless compression of docs/ into a single file optimised for LLM context window use. Every public function, class, constant, invariant, file path, and edge case from docs/ must be present. Target: CONTEXT.md ≈ 4050% byte size of combined docs/ input.

Format rules

  • Symbol legend at top: Legend: → returns * required ? optional @ located at
  • Tables over paragraphs — always
  • Compact signature notation: f(a:T, b:T) → T @ src/foo.py
  • Pipe unions: A | B | C
  • Section references: §0, §1, … — state each fact once, reference elsewhere
  • Inline conditions: if X: Y; else: Z
  • No prose, no motivation, no examples that just illustrate a stated rule
  • No headings deeper than 3 levels

Sections

  • §0 Module map — path + 1-line role
  • §1 Data types — every class: fields, types, invariants
  • §2 Public API — every public function/method: compact signature + constraints
  • §3 Constants — table: name, value, file, where used
  • §4 Workflows — compact arrow notation
  • §5 Configuration — env vars, defaults
  • §6 Edge cases & invariants — one row per rule, exhaustive
  • §7 Build / run / test — exact commands

When to skip

If CONTEXT.md exists and no file in docs/ is newer than it: print context: in sync and stop.