/** * The fs side of ADR 0008: apply / remove / check harnery's machine-owned * agent-facing content in a consumer repo. `init` calls `applyInstructions`, * `deinit` calls `removeInstructions`, and `init --check` calls * `checkInstructions`. The pure splice mechanics live in `splice.ts` and the * rendered content in `templates.ts`; this module only sequences the reads, * writes, and deletes so init/deinit stay thin and this stays integration- * testable against a temp dir. * * Three files, one dir: * - `AGENTS.md` — the always-on orientation block (a managed region; the * consumer owns the rest of the file). * - `CLAUDE.md` — claude-code only; Claude Code reads CLAUDE.md, not AGENTS.md, * so a fresh consumer gets a CLAUDE.md whose managed region imports * `@AGENTS.md`. A CLAUDE.md that already imports AGENTS.md or already carries * the block (a host that generates CLAUDE.md from AGENTS.md) is left alone. * - `.cursor/rules/harnery-turn-ritual.mdc` — cursor only; an Always Apply * rule that makes the Stop-enforced status footer visible in reply text. * - `//SKILL.md` — fully-owned files, honoring * `skills.exclude` in `.harnery/config.jsonc`. Claude Code uses * `.claude/skills/`; Cursor and Codex use `.agents/skills/`. */ /** Read `skills.exclude` from `.harnery/config.jsonc` (absent/unparseable → none). */ export declare function readSkillsExclude(projectRoot: string): Set; interface ApplyOpts { binName: string; adapter: string; dryRun: boolean; } export interface ApplyResult { actions: string[]; warnings: string[]; } /** * Inject / refresh the instructions block, the CLAUDE.md import shim (claude-code), * and the adapter-native shipped skills. Idempotent: a re-run on current content * writes nothing. `dryRun` reports without touching the fs. */ export declare function applyInstructions(projectRoot: string, opts: ApplyOpts): ApplyResult; interface RemoveOpts { adapter: string; dryRun: boolean; } /** * Reverse {@link applyInstructions}: strip the AGENTS.md block, the CLAUDE.md * import shim, and delete the shipped skill files (only ones harnery generated). * A file that becomes empty once our region is gone is deleted (init created it); * a hand-edited skill (no ownership marker) is left with a warning. */ export declare function removeInstructions(projectRoot: string, opts: RemoveOpts): ApplyResult; export interface CheckResult { status: "fresh" | "drift" | "error"; issues: string[]; } /** * Read-only drift report for `init --check`: the AGENTS.md block and each * shipped skill for the selected adapter. Fresh → exit 0; stale / missing / hand-edit * → drift (exit 2); an unreadable file → error (exit 1). Mirrors the wiki-theme * `--check-only` contract the first host wires into pre-commit. */ export declare function checkInstructions(projectRoot: string, opts: { binName: string; adapter: string; }): CheckResult; export {}; //# sourceMappingURL=apply.d.ts.map