Skip to main content

Module init

Module init 

Source
Expand description

mdlens init — wire mdlens guidance into AI coding harnesses.

Writes a small, idempotent “managed block” of agent instructions into the instruction file each harness reads (CLAUDE.md, AGENTS.md, GEMINI.md, etc.). The block is delimited by HTML comment markers so re-running init updates it in place instead of appending duplicates.

Structs§

TargetOutcome
Result of planning/applying init for one harness.

Enums§

Change
What happened to a single target file.
Harness
A harness mdlens knows how to wire into.

Constants§

BLOCK_BODY
The guidance injected into each harness file. Kept short on purpose: detailed help lives in mdlens --help / mdlens scout --help, so the block stays small.
BLOCK_END
BLOCK_START
Marker bounding the managed region. Anything between these is owned by mdlens.

Functions§

default_harnesses
Default harness set when the user names none: the two most common files.
run_init
Plan + (unless dry_run) apply init across the selected harnesses.
upsert_block
Upsert the managed block into existing file content, returning the new content and whether it differs from the input. Pure string transform — no IO.