/** * Slice 028 (Q2=A): `peaks standards migrate` rewrites a consumer * project's `CLAUDE.md` to drop the legacy heartbeat block. * * The legacy block (rendered by `peaks standards init` / `peaks * standards update` before slice 028) contained instructions that: * 1. pointed the LLM at the legacy `.peaks/.active-skill.json` path; * 2. required the LLM to invoke `peaks skill heartbeat:touch` and * `peaks skill presence:clear` on every turn; * 3. ended with an `External reference: https://github.com/affaan-m/...` * line that was peaks-cli-internal, not consumer-facing. * * The replacement text matches the post-slice-025 peaks-cli repo's own * `CLAUDE.md`: route the LLM through `peaks skill presence --json` and * render a compact status header when a valid skill is active. This * service is the deterministic in-place rewriter that brings existing * consumer trees in line with the new template. * * Behavior: * - `migrateStandards({ project, apply: true })` — rewrites the * file when the legacy block is present, returns * `applied: true`. * - `migrateStandards({ project, dryRun: true })` — returns the * would-change preview, no write. * - `migrateStandards({ project })` — defaults to a * dry-run. `--apply` is the only opt-in for a destructive write. * - File missing → `file: null`, no throw. * - Legacy block not present → `foundOldBlock: false`, no write. */ export declare const NEW_TEMPLATE_TEXT = "Active Peaks-Cli skill presence: at the start of every response, run `peaks skill presence --json` to read the active skill marker. The CLI handles canonical-path resolution (`.peaks/_runtime/active-skill.json` with back-compat fallback to `.peaks/.active-skill.json`); do not read those files directly. When the response includes a valid skill name, display the compact status header: `Peaks-Cli Skill: | Peaks-Cli Gate: | Next: `. Display the header on every turn while the CLI returns an active skill; omit when the CLI returns no active skill."; export type MigrateStandardsInput = { project: string; apply?: boolean; dryRun?: boolean; }; export type MigrateStandardsData = { file: string | null; foundOldBlock: boolean; wouldChange: boolean; applied: boolean; before: { lines: number; } | null; after: { lines: number; } | null; nextActions: string[]; }; export type MigrateStandardsResult = { ok: true; data: MigrateStandardsData; warnings: string[]; }; export declare function detectLegacyBlock(content: string): { found: boolean; start: number; end: number; }; export declare function rewriteLegacyBlock(content: string, newText?: string): { rewritten: string; replaced: boolean; }; export declare function migrateStandards(input: MigrateStandardsInput): MigrateStandardsResult;