Expand description
The committed LEAN-CTX.md rule artifacts as (relative_path, content)
pairs — the single source shared by the regenerator (gen_rules example)
and the drift gate (tests/rules_drift.rs) so the project copy and the
rust/ copy can never disagree.
Content is forced to the default profile (non-shadow, compression Off) so
the committed bytes are independent of the developer’s local lean-ctx config
and stay deterministic (#498). The live writer
(hooks::ensure_project_agents_integration) renders with the user’s config
instead — that is each user’s own copy, not this repo’s checked-in artifact.
Constants§
- ARTIFACT_
PATHS - Project-relative paths of every committed dedicated-rules artifact. Add new real rule artifacts here — not docs examples or templates.
- CLAUDE_
MOD_ COPIES - The Claude Code mod’s development workspace (
claude plugin test,tsc,--plugin-dir) mirrors the sources the binary embeds and installs (templates/claude_mod/), so what is tested is exactly what ships. - SKILL_
COPY_ PATH - The repo-root skill (installed by
skills/lean-ctx/scripts/install.shand skill marketplaces) is a verbatim copy of the templatelean-ctx setupinstalls, so the two can never drift apart again.
Functions§
- artifacts
(relative_path, content)for every artifact the generator writes: the versioned rule artifacts (one canonical body), the skill copy, and the Claude Code mod workspace copies.- canonical_
body - Canonical body of a project
LEAN-CTX.md: the owner banner, the long-form rules block (non-shadow, compressionOff), and a trailing newline. Inverse of what the drift gate reads back. Longform becauseLEAN-CTX.mdis opened on demand (AGENTS.md pointer), never auto-loaded — it can afford the verbose teaching sections the injected profiles fold away (#578).