[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C9VTR0KB5KXX56AVRYW2AJ":3,"skill-same:01M7C9VTR0KB5KXX56AVRYW2AJ":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":14,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M7C9VTR0KB5KXX56AVRYW2AJ","cleanup-campsite",null,"Scan project process state and refresh prioritized next actions. Finds unfinished work, not documentation graph violations.","bionic-coding\u002Fcrux","bionic-coding","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F301040008?v=4","01M7C9T2NA1V1V0EF1M552HRB3","Bionic Coding","01M7C9T2P72H1AQV5T5PTBFNHN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Fcleanup-campsite\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cleanup-campsite\ndescription: \"Scan project process state and refresh prioritized next actions. Finds unfinished work, not documentation graph violations.\"\nmetadata:\n  tags: \"cleanup, hygiene, whats-next, scan, forward-looking\"\n  bundles: \"crux-docs\"\n  risk_level: \"low\"\n  requires_access: \"write-tree\"\n  triggers: \"cleanup | hygiene check | what's next | clean up the docs | refresh whats_next\"\n  routing_note: \"Forward-looking process-state scan; regenerates `docs\u002Fwhats_next.md`. Distinct from `audit-docs` — proposes actions, never edits prose.\"\n---\n\n# Cleanup\n\n\u003C!-- BEGIN GENERATED: runtime-compat -->\n## Runtime compatibility\n\nThis skill is portable across Claude Code, Codex, OpenCode, and OMP (Oh My Pi). This section overrides platform-specific labels below.\n\n- Before running a command that uses `CRUX_PLUGIN_ROOT`, set it to the installed plugin root. In Claude Code, use the value of `CLAUDE_PLUGIN_ROOT`. In Codex, OpenCode, and OMP, derive it from the absolute path of this selected `SKILL.md`: the plugin root is the parent of its `skills\u002F` directory (in OMP `bash`, `skill:\u002F\u002F\u003Cname>` resolves to the skill directory). In a source checkout, use the checkout `crux\u002F` directory.\n- For project-local skills, use `.claude\u002Fskills` in Claude Code, `.agents\u002Fskills` in Codex, `.opencode\u002Fskills` in OpenCode (which also reads the singular `.opencode\u002Fskill`), and `.omp\u002Fskills` in OMP. Set `CRUX_LOCAL_SKILLS_DIR` to that path before following any command below that uses it.\n- Translate Claude Code tool labels such as `Agent`, `Read`, `Write`, `Bash`, `WebSearch`, and `WebFetch` to the matching capability in the current session. Codex names its own capabilities; OpenCode uses the lowercase forms `subagent`, `read`, `edit`, `shell`, `websearch`, and `webfetch`, where `edit` covers both `Edit` and `Write`; OMP uses `task`, `read`, `edit`, `write`, `bash`, `grep`, `glob`, `find`, `todo`, and `web_search` (where `read` also handles URLs and `skill:\u002F\u002F` URIs). Do not attempt to invoke the Claude Code labels as literal commands on another host.\n- Install the generated role agents before delegating: `install-codex-agents` in Codex, `install-opencode-agents` in OpenCode, `install-omp-agents` in OMP. Codex names them `crux_architect`, `crux_brainstormer`, `crux_commander`, `crux_dev_lead`, `crux_developer`, `crux_historian`, `crux_librarian`, `crux_night_gardener`, `crux_reviewer`, and `crux_wayfinder`; OpenCode and OMP use the bare role names `architect`, `brainstormer`, `commander`, `dev-lead`, `developer`, `historian`, `librarian`, `night-gardener`, `reviewer`, and `wayfinder` (in OMP, `scout` may also be used for reconnaissance alongside `wayfinder`). If a required role or capability is unavailable, report that truthfully instead of claiming it ran.\n- Argument placeholders such as `$adr` and `$book` bind only in Claude Code. On a host without argument binding they are unset — take the value from the user's phrase. The \"Fields OpenCode ignores\" section of `OPENCODE_GUIDE.md` names the invocation-control fields OpenCode ignores.\n\u003C!-- END GENERATED: runtime-compat -->\n\n## Current cycle work\n\nInclude paused and active records under `\u003Cdocs_dir>\u002Fcycles\u002F` in unfinished-work\ninspection. Use the cycle reader to report current phase, pass limit, blockers,\nand next action. Never advance a cycle during a hygiene scan. Promptbook guidance\nbelow applies only to historical records; do not recommend new promptbooks.\n\n\n\n## Overview\n\nCleanup is the **forward-looking** counterpart to `audit-docs`. Two skills, two questions:\n\n| Skill | Question it answers |\n|---|---|\n| `audit-docs` | *Is the docs graph internally consistent?* (schema, frontmatter, cross-refs, indexes, rollups) |\n| `cleanup-campsite` | *Given a consistent graph, what work should we be doing next?* (process-state staleness, forward actions) |\n\nThe output is `docs\u002Fwhats_next.md` — a regenerated, prioritized action backlog with citation-bearing entries. The artifact answers the session-start question: *\"what should I do first today?\"*\n\nCleanup does NOT invoke `audit-docs` internally — different cadence (session-start vs. before-release), different exit semantics (audit's BROKEN findings block; cleanup's are suggestions), different write footprint. Cleanup CHECKS whether audit has run recently and emits a P1 \"run audit-docs\" suggestion if it hasn't.\n\nCleanup ships **20 implemented scan rules** (CLN-* IDs) plus **one reserved id** for v0.2 (`CLN-XR-1`) and **four retired ids**, for 25 `CLN-*` ids total. The 20 implemented rules: `CLN-LOG-1` (operations-log repair and summary catch-up); `CLN-PJ-1a`, `CLN-PJ-1b`, `CLN-PJ-1c`, `CLN-PJ-2` (one rule, four sub-findings — three version-mismatch checks, against the Claude bare manifest, the Codex plugin manifest and the `crux-mods` plugin manifest, since all three joined the same version lock-step, plus the marketplace owner-placeholder check; still counted as a single rule id); `CLN-ADR-2`, `CLN-ADR-4`, `CLN-ADR-5` (decision-migration suggestion); `CLN-ADR-6` (open promotion requests); `CLN-OBJ-1` (objectives unpopulated); `CLN-PB-1`, `CLN-PB-2`, `CLN-PB-4`; `CLN-JR-2`; `CLN-WN-1`; `CLN-AUD-1` (audit-recency); `CLN-FG-1` (forged-skill staleness); `CLN-FG-2` (used-but-never-evaluated); `CLN-RETRO-1` (retrospective cadence, counting closed cycles); `CLN-TMPL-1` (dogfood↔template clause parity). (`CLN-AUD-1` was formerly the un-prefixed `cleanup-audit-stale` \"not-a-CLN-rule\" check; it now carries a standard rule id so the count is exact and the verification checklist needs no special-case exemption.) **Retired rule ids (never reused, never reimplemented):** `CLN-ADR-1`, `CLN-ADR-3`, `CLN-JR-1`, `CLN-PB-3`. See their stubs below for why. The count dropped by one for each rather than being backfilled, and `CLN-WN-1`'s stale-dismissal check skips any dismissal keyed to a retired id — those records are history that is being kept on purpose, not dead weight to age out.\n\n### What cleanup writes vs. what it proposes\n\n**Cleanup writes (mechanical, low-risk):**\n- `docs\u002Fwhats_next.md` — its primary artifact (body fully regenerated on every run; only the `dismissed:` frontmatter list persists across runs).\n- One `cleanup-campsite` op entry in the operations log per run, written by `operation-log.py append`.\n- The operations log under `docs\u002Flog\u002F`, through two commands only: `operation-log.py repair` (the first split and stray merges) and `generate-log-summary.py` (the catch-up of `docs\u002Flog\u002Fsummary.md`). Both run in `CLN-LOG-1`.\n- A `## What's next (N)` section in `docs\u002Findex.md` at the top (before `## Research`), when `suggestions_open > 0`. Removes the section when `N = 0`.\n\n**Cleanup proposes (writes to whats_next.md, not the target file):**\n- README \u002F USER_GUIDE \u002F CHANGELOG edits.\n- ADR body edits (frozen after Accepted anyway — never touch).\n- Journal entries (per the v0.2.0 log-work skill — reflection cannot be auto-generated).\n- Promptbook file edits (run-promptbook owns those).\n- `manifest.yml` counter changes (no v0.1 rule emits this — listed for safety so future rules don't quietly enable it).\n\n## When to use\n\n- User says: \"cleanup\", \"hygiene check\", \"what's next\", \"clean up the docs\", \"refresh whats_next\".\n- Start of a session, especially after a long gap or a context-switch.\n- After a flurry of operations (multiple ADRs accepted, promptbooks completed) to catch what should be reflected in human-facing docs and forward-action lists.\n- Before a release, alongside (not instead of) `audit-docs`.\n\nDo **NOT** use this skill for:\n- Schema-integrity validation — that's `audit-docs`.\n- Resolving findings cleanup surfaces — invoke the relevant downstream skill (`archive-promptbook`, `log-work`, `transition-adr`, etc.).\n- Editing prose surfaces directly — cleanup proposes; humans (or Claude under explicit direction) execute.\n\n## Inputs\n\nThis skill takes no required arguments. Optional behavior:\n\n- **`--only \u003CRULE-ID>[,\u003CRULE-ID>...]`** — run ONLY the named rule(s). This is a first-class named sub-deliverable, not a debug flag.\n\n  **Contract:**\n  - Accepts a single CLN rule id (e.g. `CLN-TMPL-1`) or a comma-separated CSV list (e.g. `CLN-TMPL-1,CLN-PJ-2`). No spaces around commas.\n  - Runs ONLY the named rule(s) over the same shared checker \u002F scan logic as a full run — the rule's setup requirements (threshold resolution, dismissal loading) still execute; no rule-specific setup state is skipped.\n  - Output is scoped to the named rules: `docs\u002Fwhats_next.md` is regenerated for ONLY the named-rule slice. The prior body's findings for other rules are **not clobbered** — only the entries for the named rule(s) are replaced in place. (Implementation: read the prior `docs\u002Fwhats_next.md` body, remove entries whose `source:` cites a named rule, inject the new findings for those rules in severity\u002Fid order, and write back. Findings from unscoped rules are carried forward verbatim.)\n  - The normal `cleanup-campsite` log op is STILL written to the operations log on every `--only` run (the regenerate-and-propose + log contract is not bypassed). The log entry body names the scoped rule(s): `N open (X P1, Y P2, Z P3) [--only CLN-TMPL-1], M closed, K dismissed`.\n  - **Unknown rule id → loud error (NOT a silent no-op).** If any rule id in the list is not a recognized CLN-* id, cleanup refuses to run and prints: `ERROR: unknown rule id '\u003CID>'. Known rule ids: CLN-PJ-1a, CLN-PJ-1b, …`. Exit non-zero. This prevents a silent empty-output run from masking a typo.\n  - **Rule-harness isolation:** each named rule runs in isolation over the shared checker \u002F scan logic without missing required setup state (thresholds and dismissals are loaded in step 1\u002F2 even under `--only`) and without causing side effects on unscoped rules.\n  - `cleanup-campsite --only CLN-TMPL-1` is the documented **on-demand fast-path** for immediate parity feedback right after editing `docs\u002FAGENTS.md` — fast because only one rule runs against two files, no full vault walk.\n\n- **Configuration in `docs\u002Fmanifest.yml`** under an optional `cleanup:` block:\n  - `adr_proposed_stale_days` — default 14. Used by `CLN-ADR-2`.\n  - `stuck_promptbook_days` — default 14. Used by `CLN-PB-1`.\n  - `audit_stale_days` — default 14. Used by the audit-recency check.\n  - `forged_skill_stale_days` — default 30. no authored\u002Frevised\u002Fused\u002Fevaluated event within this window (timestamp comparison). Used by CLN-FG-1 and CLN-FG-2.\n  - `retro_due_runs` — default 5. Used by `CLN-RETRO-1`: flag when >= this many cycles closed (completed, abandoned or shortcut) since the last `Retrospective:` journal entry.\n  - `adr_review_due_days` — default 7. Used by `CLN-ADR-5`.\n\n  Missing values fall back to the defaults. The `cleanup:` block itself is optional.\n\n## The pipeline\n\nBefore source discovery or recursive walking, prune retained demonstration holdings: list the holdings once with `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fauthority-view.py\" retained-roots --repo-root \u003Crepo-root>` and skip each listed root during recursive walks; test one path with `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fauthority-view.py\" retained --repo-root \u003Crepo-root> \u003Cpath>` (exit 0, `retained` true or false). Never read held configuration or records during parent checks. Held records contribute no census\u002Fallocation counts, archive eligibility or overdue-revocation candidates. A layout refusal stops the scan before backlog changes. The holding contract is `docs\u002FAGENTS.md` §3; direct concern globs need no recursive scan.\n\nBefore authority-dependent scans or backlog conclusions, run `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fauthority-view.py\" state --repo-root \u003Crepo-root>`. Exit 0 reports `original` (no clause migration was ever published, so every ADR clause governs as its record says; this is the normal state) or `published` (a migration publication was proved from full Git history, so the clauses it moved are historical evidence, not current constraints). Exit 1 prints `{\"authority\": \"none\", \"limit\": \"\u003Ccode>\"}`: current authority is unknown. Never fall back to an older ADR body or resolver. The common code is `history-unavailable`, a shallow clone of a tree that published a migration; fetch full history with `git fetch --unshallow`. Exit 2 is an environment error. An existing resolver, applied flag or drift-clean output proves no publication. A refusal stops those scans before backlog writes. Implementation intent, council-reviewed history, delivered results and current source state remain separate. Historical reasoning contributes no current obligation or overdue-revocation candidate; a conforming replacement needs no revocation of the earlier reasoning. Preserve mixed records' surviving architectural clauses, ordinary lifecycle checks and dated historical references.\n\nExecute in order.\n\n### 1. Resolve thresholds\n\nRead `docs\u002Fmanifest.yml`. If a `cleanup:` block exists, take its thresholds. Otherwise use defaults (`adr_proposed_stale_days: 14`, `stuck_promptbook_days: 14`, `audit_stale_days: 14`, `forged_skill_stale_days: 30`, `retro_due_runs: 5`, `adr_review_due_days: 7` — the last is `CLN-ADR-5`'s threshold). Compute `${TODAY}` (ISO date) and `${NOW}` (ISO 8601 UTC timestamp).\n\n### 2. Load prior dismissals\n\nRead `docs\u002Fwhats_next.md` if it exists. Parse the frontmatter. Extract the `dismissed:` list — a list of `{id, dismissed_at, reason}` entries.\n\nAlso extract the prior body's open-suggestion `id:` set (call it `prior_open_ids`). Used for \"Recently closed\" derivation.\n\nIf `docs\u002Fwhats_next.md` does not exist, treat both as empty.\n\n### 3. Run scan rules in order\n\nRun each rule. For each finding, compute its stable `id` per the rule's spec. If the `id` is in the `dismissed:` list, skip surfacing.\n\nRules — all are file-scoped; no skill invocations:\n\n#### CLN-LOG-1 — operations-log repair and summary\n\nThis rule runs before every other rule, so each later rule reads the repaired log.\n\n- **Runs:** `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Foperation-log.py\" repair --repo-root \u003Crepo-root>`. It completes the first split of a legacy `docs\u002Flog.md` when the tree has not recorded completion, and it merges a stray `docs\u002Flog.md` or a staged stray into the current month's detail file.[^log-repair] Either step may refuse: a refusal names the heading, the open fence or the conflict, and the split or merge writes nothing.\n- **Then runs:** `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fgenerate-log-summary.py\" --repo-root \u003Crepo-root> --dry-run`. When its `pending_months` is not empty or it reports a failure of kind `region`, run `generate-log-summary.py --repo-root \u003Crepo-root>`, the catch-up, and then the `--dry-run` again.[^log-catch-up] The catch-up writes one section per settled month that lacks one and never a section for the current month.\n- **Looks for:** a refused or failed repair; a first dry-run that reports a failure of kind `structure` or exits 2; a refused catch-up; a second dry-run that exits non-zero.[^log-finding]\n- **Stable id:** `cleanup-CLN-LOG-1-repair` for a repair finding, `cleanup-CLN-LOG-1-summary` for a summary finding.\n- **Category:** `log-repair`. **Severity:** P1. The finding names the months, the heading or the error.\n- **Proposed action:** apply the fix the refusal names (edit the named heading, close the named fence, or resolve the named conflict), then rerun cleanup. For a structure failure, edit `docs\u002Flog\u002Fsummary.md` by hand (remove a premature or second section, or restore a marker), or run `operation-log.py repair` for an incomplete split.\n- **Reports:** a completed repair (its `changed_paths`) or catch-up (the months it added or rewrote) in the console summary and in the body of this run's `cleanup-campsite` log entry.\n- **Commits:** by the commit step of `docs\u002FAGENTS.md` §6, with the `commit_paths` and `restore_paths` of cleanup's last `operation-log.py` run, which is its own `append` in step 8 when that runs. `generate-log-summary.py` reports no commit paths. Name `docs\u002Flog\u002Fsummary.md` among cleanup's own paths only when the catch-up reported `status: written`.\n\n**Existence gate (all CLN-PJ rules):** the CLN-PJ rules inspect plugin\u002Fmarketplace manifests (`crux\u002Fplugin.json`, `crux\u002F.claude-plugin\u002Fplugin.json`, `.claude-plugin\u002Fmarketplace.json`, `crux\u002F.codex-plugin\u002Fplugin.json`, `.agents\u002Fplugins\u002Fmarketplace.json`, `crux-mods\u002F.claude-plugin\u002Fplugin.json`) that exist only in a repo that IS a plugin\u002Fmarketplace checkout — a typical consuming project has none of them, and that is normal. Before running each CLN-PJ rule, check that the file(s) it reads exist; if a rule's primary input is absent, the rule **silently skips** (no finding, no warning). The one exception is CLN-PJ-2's missing-file handling below, which fires only when a *sibling* manifest proves the repo is a plugin-marketplace repo.\n\n#### CLN-PJ-1a — plugin.json version vs. README\u002FUSER_GUIDE version mentions\n\n- **Reads:** `crux\u002Fplugin.json`, `README.md`, `USER_GUIDE.md`.\n- **Looks for:** literal version strings (regex `v?\\d+\\.\\d+\\.\\d+`) in README\u002FUSER_GUIDE that don't match `plugin.json.version`. Ignore version strings inside fenced code blocks unless they're in install snippets.\n- **Stable id:** `cleanup-CLN-PJ-1a-plugin-version`\n- **Category:** `version-drift`. **Severity:** P2.\n- **Proposed action:** \"Update README\u002FUSER_GUIDE version string to `\u003Cplugin.json.version>`.\"\n\n#### CLN-PJ-1b — plugin.json `len(skills)` vs. \"N skills\" claims\n\n- **Reads:** `crux\u002Fplugin.json`, `README.md`, `USER_GUIDE.md`, `AGENTS.md` (root).\n- **Looks for:** patterns like `\\d+ skills` or `\\bfifteen\\b skills?`, `\\bsixteen\\b skills?`, etc., that don't match `len(plugin.json.skills)`.\n- **Stable id:** `cleanup-CLN-PJ-1b-skill-count`\n- **Category:** `version-drift`. **Severity:** P2.\n- **Proposed action:** \"Update skill count to `\u003Cactual>` in `\u003Cfile path>`.\"\n\n#### CLN-PJ-1c — README install snippet `--ref` pinned to outdated tag\n\n- **Reads:** `README.md` (look for `--ref \\S+` in shell snippets), `crux\u002Fplugin.json`.\n- **Looks for:** `--ref v\\d+\\.\\d+\\.\\d+` whose version doesn't match `plugin.json.version`.\n- **Stable id:** `cleanup-CLN-PJ-1c-install-ref`\n- **Category:** `version-drift`. **Severity:** P2.\n- **Proposed action:** \"Update install-snippet `--ref` to `v\u003Cplugin.json.version>` (or to `main` if release pinning isn't intentional).\"\n\n#### CLN-PJ-2 — marketplace + plugin manifest drift\n\n- **Reads:** `crux\u002Fplugin.json`, `crux\u002F.claude-plugin\u002Fplugin.json`, `.claude-plugin\u002Fmarketplace.json`, `crux\u002F.codex-plugin\u002Fplugin.json`, `.agents\u002Fplugins\u002Fmarketplace.json`, `crux-mods\u002F.claude-plugin\u002Fplugin.json`.\n- **Layout note:** Per the Claude Code marketplace spec, the marketplace catalog (`marketplace.json`) lives at the **marketplace root** — for this repo that's the repo root, since the repo IS the marketplace. The plugin manifest (`plugin.json`) lives inside the **plugin's own directory** — `crux\u002F.claude-plugin\u002Fplugin.json`. The two files are NOT colocated. The two-line contract: the two manifests stay version-locked; marketplace.json lives at the marketplace root, the bare plugin.json inside the plugin directory. The Codex install pair mirrors this exact layout split (`crux\u002F.codex-plugin\u002Fplugin.json` inside the plugin directory, `.agents\u002Fplugins\u002Fmarketplace.json` at the marketplace root) and joins the same version lock-step.\n- **Why this rule exists:** Claude Code's plugin loader reads `crux\u002F.claude-plugin\u002Fplugin.json` (a bare manifest with only `name`\u002F`description`\u002F`version`\u002F`homepage`) — separate from the rich `crux\u002Fplugin.json` that drives the catalog layer. Codex's plugin loader reads `crux\u002F.codex-plugin\u002Fplugin.json` in parallel. All version-bearing manifests MUST stay in lock-step on `version` (five surfaces total: `crux\u002Fplugin.json`, `crux\u002F.claude-plugin\u002Fplugin.json`, `crux\u002F.codex-plugin\u002Fplugin.json`, `crux-mods\u002F.claude-plugin\u002Fplugin.json`, `pyproject.toml`) — `sync.sh`'s refuse-first check enforces this across all five at release time; this rule is the docs-side regression tripwire for hand edits or workflow drift between releases.\n- **Looks for (four sub-checks; each emits its own finding):**\n  - **(a) version mismatch.** `crux\u002Fplugin.json.version` is the reference. Three independent comparisons, each a separate finding when it fails:\n    - **(a-i) bare Claude manifest.** `crux\u002F.claude-plugin\u002Fplugin.json.version` is not byte-equal to `crux\u002Fplugin.json.version`.\n      - **Stable id:** `cleanup-CLN-PJ-2a-marketplace-plugin-version`\n      - **Category:** `version-drift`. **Severity:** P2.\n      - **Proposed action:** \"Sync `crux\u002F.claude-plugin\u002Fplugin.json.version` to `\u003Ccrux\u002Fplugin.json.version>`. Versions are bumped by hand at release time and the release script refuses to publish on any mismatch, so drift here means a partial hand edit — finish the bump by hand.\"\n    - **(a-ii) Codex plugin manifest.** `crux\u002F.codex-plugin\u002Fplugin.json.version` is not byte-equal to `crux\u002Fplugin.json.version`.\n      - **Stable id:** `cleanup-CLN-PJ-2a-codex-plugin-version`\n      - **Category:** `version-drift`. **Severity:** P2.\n      - **Proposed action:** \"Sync `crux\u002F.codex-plugin\u002Fplugin.json.version` to `\u003Ccrux\u002Fplugin.json.version>`. Same lock-step discipline as the bare Claude manifest — finish the bump by hand; `sync.sh` refuses to publish on any of the five surfaces mismatching.\"\n    - **(a-iii) `crux-mods` plugin manifest.** `crux-mods\u002F.claude-plugin\u002Fplugin.json.version` is not byte-equal to `crux\u002Fplugin.json.version`. The `crux-mods` plugin ships in the same release act at crux's version, so its manifest carries no version of its own.\n      - **Stable id:** `cleanup-CLN-PJ-2a-mods-plugin-version`\n      - **Category:** `version-drift`. **Severity:** P2.\n      - **Proposed action:** \"Sync `crux-mods\u002F.claude-plugin\u002Fplugin.json.version` to `\u003Ccrux\u002Fplugin.json.version>`. Same lock-step discipline as the other manifests — finish the bump by hand; `sync.sh` refuses to publish on any of the five surfaces mismatching.\"\n  - **(b) marketplace owner placeholder.** `.claude-plugin\u002Fmarketplace.json` `owner.name` matches any of the following case-insensitive predicates: equals `\"local\"`; equals `\"todo\"`; contains `\"placeholder\"`; contains `\"arc-search\"` (the prior placeholder left over from this file's earlier life).\n    - **Stable id:** `cleanup-CLN-PJ-2b-marketplace-owner-placeholder`\n    - **Category:** `version-drift`. **Severity:** P3.\n    - **Proposed action:** \"`.claude-plugin\u002Fmarketplace.json` `owner.name` is a placeholder (`\u003Ccurrent value>`). Set it to the canonical owner that matches the GitHub org in `crux\u002Fplugin.json.homepage` (currently `idyll`).\"\n- **Schema-rich caveat (Codex pair only):** unlike the deliberately bare Claude Code pair, the Codex plugin manifest (`crux\u002F.codex-plugin\u002Fplugin.json`) is **schema-rich by design** — it legitimately carries a `skills` path pointer (`\".\u002Fskills\u002F\"`), an `interface` block (display name, descriptions, category, capabilities, default prompts), and package metadata (author, keywords, license, repository). None of that is drift; do not flag it and do not propose stripping it to match the bare Claude manifest's minimalism. The **narrower** prohibition this rule enforces is: neither Codex manifest may duplicate the rich manifest's catalog **arrays** — the enumerated `skills:`\u002F`scripts:` arrays of `crux\u002Fplugin.json` remain the catalog layer's sole home and must never be copied into `crux\u002F.codex-plugin\u002Fplugin.json` or `.agents\u002Fplugins\u002Fmarketplace.json`. If a future rule needs to check for that duplication, it is a new finding under this same rule, not a \"make it bare\" proposal.\n- **Intentionally not checked here:** description and name drift among the manifests. Wording often legitimately differs slightly (one summarizes for a CLI list, another for a marketplace UI, another for the Codex schema's `interface` block). Cleanup is not the right place for fuzzy prose matching; if a name divergence ever ships (a crux manifest whose `name` is not `\"crux\"`, or the crux-mods manifest whose `name` is not `\"crux-mods\"`) it would be caught by `validate-catalog.py` not by cleanup. The contract is two lines per pair: the manifests in each pair stay version-locked; each marketplace file lives at the marketplace root, each bare\u002Fplugin manifest inside the plugin directory.\n- **Missing-file handling:** if any of `crux\u002F.claude-plugin\u002Fplugin.json`, `.claude-plugin\u002Fmarketplace.json`, `crux\u002F.codex-plugin\u002Fplugin.json`, `.agents\u002Fplugins\u002Fmarketplace.json`, or `crux-mods\u002F.claude-plugin\u002Fplugin.json` does not exist **while at least one sibling manifest of the six does exist** (proof this is a plugin-marketplace repo with an incomplete manifest set), emit a single P1 finding with stable id `cleanup-CLN-PJ-2-missing-\u003Cbasename>` proposing recreation per the contract above (each pair's manifests stay version-locked; the marketplace file at the marketplace root, the plugin manifest inside the plugin directory). These files are required for Claude Code \u002F Codex marketplace discovery respectively. If none of the six manifests exist, this is a normal consuming repo — CLN-PJ-2 silently skips per the existence gate.\n\n#### CLN-ADR-1 — RETIRED. Do not reimplement.\n\n`CLN-ADR-1` reported an Accepted ADR, within 30 days of acceptance, whose id appeared in neither `README.md` nor `USER_GUIDE.md`. The id is **retired** and the rule is gone. It enforced a convention this project never kept: a human-facing doc mentions an ADR when the decision surfaces in something a user does, and most decisions surface as a release line in `CHANGELOG.md` instead. The finding count grew from 14 to 32 between 2026-08-17 and 2026-08-31, every one P2, none ever dismissed and none ever acted on — a rule that only ever accumulates is measuring a convention that does not exist.\n\nThe rule read exactly one relation — accepted-ADR id versus two prose files — so no narrowing survives: the writing rules already require an ADR in human-facing prose to be a footnote, not an inline id, which is the opposite of what the rule looked for. Retired outright on 2026-08-31 by the owner. Its standing findings closed with it; `CLN-ADR-2` and `CLN-ADR-4` keep the `adr-review` \u002F `adr-followon` categories alive.\n\nThe id is not reused. This stub exists so a future reader finds the reasoning instead of the gap.\n#### CLN-ADR-2 — Proposed ADRs past their shelf life\n\n- **Reads:** every `docs\u002Fadrs\u002FADR-NNNN-*.md` file, parse frontmatter.\n- **Looks for:** `status: Proposed` with `proposed_date` older than `adr_proposed_stale_days` (default 14).\n- **Stable id:** `cleanup-CLN-ADR-2-ADR-\u003CNNNN>`.\n- **Category:** `adr-review`. **Severity:** P1.\n- **Proposed action:** \"Decide ADR-NNNN: accept (`transition-adr accept ADR-NNNN`), deprecate (abandon), or supersede with a fresh ADR.\"\n\n#### CLN-ADR-4 — Phantom ADR-id references in human-facing docs\n\n- **Reads:** `README.md`, `USER_GUIDE.md`, `AGENTS.md` (repo root). Also enumerate existing ADRs by globbing `docs\u002Fadrs\u002FADR-NNNN-*.md`.\n- **Looks for:** ADR-id pattern `\\bADR-\\d{4}\\b` in prose (NOT inside `[[wiki-links]]` — those are audit-docs's domain). For each match, check whether `docs\u002Fadrs\u002F\u003Cid>-*.md` exists. Missing → finding.\n- **Stable id:** `cleanup-CLN-ADR-4-\u003CADR-id>-in-\u003Cfile-basename>` (one per phantom ref per file).\n- **Category:** `adr-followon`. **Severity:** P2.\n- **Proposed action:** \"`\u003Cfile>` references `\u003CADR-id>` but no such ADR exists. Either fix the typo (likely a single-digit slip from a real neighboring id), correct to a real id, or remove the citation.\"\n\n#### CLN-ADR-3 — RETIRED. Do not reimplement.\n\n`CLN-ADR-3` reported an Accepted ADR whose body prose cited a file path absent from disk. The id is **retired** and the rule is gone. Reading a frozen body against the present tree asks the wrong question: a body past `Proposed` is frozen by contract, so a path it cites records what was true when the decision was made. That is history, not drift.\n\nThe rule read exactly one surface — Accepted ADR bodies — so exempting them retired it outright rather than narrowing it. The standing dismissals it accumulated stay in `docs\u002Fwhats_next.md` as history; they are not migrated and not re-raised. `docs\u002FAGENTS.md` §11.D states the rule this retirement implements, and the pointer-durability postcondition that keeps NEW bodies safe going forward. `CLN-ADR-4` is unaffected: it reports a phantom ADR **id** in human-facing docs, a live surface, not a path inside a frozen body.\n\nThe id is not reused. This stub exists so a future reader finds the reasoning instead of the gap, and so nobody re-adds the rule from the dismissal ledger.\n\n#### CLN-ADR-5 — consider architectural decision migration\n\n- **Reads:** `docs\u002Fadrs\u002Freviews\u002F*.md`, taking the newest valid filename date; skip the derived index and future dates.\n- **Looks for:** no historical review, or a newest review older than `adr_review_due_days` (default 7).\n- **Stable id:** `cleanup-CLN-ADR-5-due`.\n- **Category:** `adr-review`. **Severity:** P2.\n- **Proposed action:** \"Consider a `migrate-adrs` session against current objectives.\"\n- **Actor boundary:** suggest only. This nudge forces no pass, report or measurement, writes no historical report and invokes no migration.\n\n#### CLN-ADR-6 — open promotion requests\n\n- **Reads:** the output of `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fadr-provenance.py\" open --repo-root \u003Crepo-root>`. It lists, per ADR with unpromoted in-run text, the rules the accepting run's written promotion request covers: `guidance` rules, `edited` binding rules and `removed` rules. Exit 0 whether or not any is open.\n- **Looks for:** one `open` entry per ADR.\n- **Stable id:** `cleanup-CLN-ADR-6-ADR-\u003CNNNN>`.\n- **Category:** `adr-followon`. **Severity:** P3.\n- **Proposed action:** \"Review the accepting run's promotion request and reply `promote ADR-NNNN: rules …`, or dismiss this entry to leave the rules as guidance.\"\n- **Actor boundary:** proposes only. A \"leave\" answer closes through the existing `dismissed:` frontmatter mechanism. The rule never refuses, blocks or promotes anything. Promotion applies only to a historical run's guidance and is the owner's own instruction. An ADR accepted under the configured acceptance policy needs no promotion.[^promotion]\n\n#### CLN-OBJ-1 — the objectives file is unpopulated\n\n- **Reads:** `docs\u002Fobjectives.md` frontmatter.\n- **Looks for:** the file is missing, or its frontmatter says `maturity: placeholder`. Any other `maturity` value is silent here — the `audit-docs` CHK-OBJ rules own the file's shape and its review age.\n- **Stable id:** `cleanup-CLN-OBJ-1-objectives` (singleton — one file, one finding).\n- **Category:** `objectives`. **Severity:** P2.\n- **Proposed action:** \"Populate `docs\u002Fobjectives.md` per `docs\u002FAGENTS.md` §5.B, then set `maturity`.\" With no file on disk, name the gap the same way; `init-docs` seeds the placeholder.\n- **Actor boundary:** proposes only. This rule is the objectives nudge that `docs\u002FAGENTS.md` §5.B names under its populate gate. It never seeds, edits, or bumps the file, because humans own its content.\n\n#### CLN-PB-1 — promptbooks with stale run-snapshot mtime\n\n- **Reads:** every promptbook in `docs\u002Fpromptbooks\u002Factive\u002F` (glob **both** `PB-NNNN-*.yaml` and `PB-NNNN-*.md` — format coexistence), look up its `current_run` snapshot's file mtime AND parse out the latest per-prompt completed\u002Fstarted timestamp from the snapshot — the structured `prompts[].completed`\u002F`started` fields on a `.yaml` run, or the `Completed:` \u002F `Started:` block fields on a `.md` run.\n- **Looks for:** **latest in-body timestamp** older than `${TODAY} - stuck_promptbook_days` (default 14) AND `current_prompt` is non-null. Use the in-body timestamp rather than filesystem mtime — filesystem mtime is reset by `git checkout` \u002F fresh clones, which would false-negative on a stuck book in a fresh tree. In-body timestamps are part of the immutable run snapshot.\n- **Exemption — self-stuck guard:** If cleanup is being invoked as part of an active cycle run (i.e., the current cleanup invocation's session has the book id in its parent context), the book is exempt from CLN-PB-1. Without conversation context, fall back to: if the book's latest in-body timestamp is within the past `stuck_promptbook_days\u002F2` (default 7 days), assume the book is actively progressing and exempt. This prevents long single-phase cycles (e.g., a 21-day council deliberation) from tripping themselves.\n- **Stable id:** `cleanup-CLN-PB-1-\u003Cbook-id>`.\n- **Category:** `promptbook-hygiene`. **Severity:** P1.\n- **Proposed action:** For a YAML run, resume with `run-promptbook`, truthfully mark the current prompt blocked\u002Fskipped, or deliberately abandon the YAML run and author a successor. For a Markdown run, use pinned public `v3.23.2` only if the remaining prompts can truthfully finish, then archive and convert book before run. If it cannot finish, preserve its bytes as readable, unresolved history and start separate YAML work; neither version has a verified deliberate Markdown-abandon route.\n\n#### CLN-PB-2 — promptbooks with escalation text and no journal follow-up\n\n- **Reads:** every active promptbook (glob **both** `PB-NNNN-*.yaml` and `PB-NNNN-*.md` — format coexistence); for its `current_run` snapshot, read the notes + per-prompt result text — the `notes`\u002F`prompts[].result` fields on a `.yaml` run, or the `## Notes` \u002F per-prompt `Result:` fields on a `.md` run. `current_run` survives to archival on both the completed and the abandoned path, so this snapshot is reachable for every book pending archival, not only in-progress ones. Also read `docs\u002Fjournal\u002FYYYY-MM.md` files within the last 30 days.\n- **Looks for:** matches of regex `\u002FSTOP and escalate|3-round|3 full loops\u002F` in run snapshot text. For each match, check whether any journal entry in the last 30 days contains the book id. If no follow-up, finding.\n- **Stable id:** `cleanup-CLN-PB-2-\u003Cbook-id>`.\n- **Category:** `promptbook-hygiene`. **Severity:** P1.\n- **Proposed action:** Journal the escalation and its resolution. A YAML run may then resume or be deliberately abandoned. A Markdown run may finish truthfully through pinned public `v3.23.2`; if it cannot, preserve it unresolved and begin separate YAML work. Do not promise Markdown abandonment.\n\n#### CLN-PB-3 — RETIRED. Do not reimplement.\n\n`CLN-PB-3` reported an active promptbook whose run was archive-eligible. The id is **retired** and the rule is gone: the approved retirement map retires it, and the cycle record that replaces the promptbook archive closes itself. The historical runs still active keep `CLN-PB-1`, `CLN-PB-2` and `CLN-PB-4`.\n\nThe id is not reused. This stub exists so a future reader finds the reasoning instead of the gap, and so nobody re-adds the rule from the dismissal ledger.\n\n#### CLN-PB-4 — duplicate `### Prompt N` headings in run snapshots\n\n- **Reads:** every run snapshot under `docs\u002Fpromptbooks\u002Fruns\u002F\u003Cbook>\u002F` — glob **both** `run-*.yaml` and `run-*.md` (format coexistence), across both active and archived books.\n- **Looks for:** the duplicate-prompt drift. On a **`.md` run** this is duplicate `### Prompt N` headings within a single snapshot file — extract every `^### Prompt (\\d+) —` heading; group by N; flag any N appearing more than once. A **`.yaml` run** has a structured `prompts[]` array with no headings, so the heading-duplicate failure mode cannot occur (the `n == index+1` contiguity \u002F duplicate-`n` invariant is enforced by `validate-promptbook.py`'s post-schema pass and surfaced by audit-docs CHK-PB-SCHEMA, not here); for a `.yaml` snapshot this rule is a no-op.\n- **Why this happens in practice:** `run-promptbook` advances should *edit in place* — but a runner that *appends* a new block instead of editing the existing pending one leaves both behind. The bug only manifests at archive-precondition time (when terminal-state counting double-counts the prompt), but the underlying drift is detectable earlier from this rule.\n- **Stable id:** `cleanup-CLN-PB-4-\u003Cbook-id>-\u003Crun-id>` (one finding per snapshot file, not per duplicate — the fix is to dedupe the whole file).\n- **Category:** `promptbook-hygiene`. **Severity:** P2 (degrades archival; doesn't block other operations).\n- **Proposed action:** Edit the run snapshot to remove duplicates. Convention: keep the block with the most-complete State (`done` > `running` > `pending`); if multiple are non-`pending`, keep the most-recent (latest `Completed:` or `Started:` timestamp).\n\n#### CLN-JR-1 — RETIRED. Do not reimplement.\n\n`CLN-JR-1` reported a recent `adr`, `promptbook` or `schema` log operation with no journal entry that references its artifact. The id is **retired** and the rule is gone: the approved retirement map retires it. `check-journal-reference.py` has no reader left outside its own tests and the plugin manifest; it stays shipped as a standalone command until a change retires it.\n\nThe id is not reused. This stub exists so a future reader finds the reasoning instead of the gap, and so nobody re-adds the rule from the dismissal ledger.\n\n#### CLN-JR-2 — thin months\n\n- **Reads:** `docs\u002Fjournal\u002Findex.md` (entry counts) AND the operations log (op count per closed month): the entries of every detail file under `docs\u002Flog\u002F`, counted by heading month, or the per-month counts that `docs\u002Flog\u002Fsummary.md` records for a settled month. `journal\u002Findex.md` is derived — read it as-is; do not recompute the counts yourself. `generate-journal-index.py` regenerates it.\n- **Looks for:** closed months (i.e., month earlier than `${TODAY}.month`) where `journal entries \u003C 2` AND `log ops >= 10`. Closed-month means the calendar month is in the past — never flag the current month.\n- **Stable id:** `cleanup-CLN-JR-2-\u003CYYYY-MM>`.\n- **Category:** `journal-gap`. **Severity:** P3.\n- **Proposed action:** \"Write a retrospective journal entry for \u003CYYYY-MM> covering the \u003CN> ops shipped that month. Cleanup will not auto-draft — reflection is non-auto-generatable per the v0.2.0 log-work contract.\"\n\n#### CLN-WN-1 — stale whats_next.md entries\n\n- **Reads:** the PRIOR `docs\u002Fwhats_next.md` body's open-suggestion ids (collected in step 2 as `prior_open_ids`); the current state of the artifacts cited by those entries.\n- **Looks for:** prior entries whose underlying condition no longer reproduces (e.g., the cited ADR transitioned, the cited promptbook archived). These become \"Recently closed\" entries in the new body — NOT new findings.\n\n  Additionally: dismissed ids in the `dismissed:` frontmatter list that haven't matched any current finding for `>= 30` consecutive days of cleanup runs. To track this, cleanup keeps a `dismissed_last_seen:` counter per dismissal — incremented every run; reset to 0 when the underlying condition recurs. Counter reaches 30 → P3 housekeeping suggestion to prune the dismissal.\n\n  **Exception — a dismissal keyed to a RETIRED rule id is never a prune candidate.** Its counter still climbs (the condition can never recur, because the rule that produced it is gone), so without this exception every such dismissal would eventually emit a P3 telling the user to delete a record that is deliberately being kept. Retired ids are enumerated in the rule inventory at the top of this skill; a dismissal whose `\u003Crule-id>` segment names one is skipped by this check entirely — no counter-driven finding, ever. This is distinct from a RENAMED rule, whose condition does recur under the new id and whose old dismissal is genuinely dead weight that should age out.\n- **Stable id (stale-dismissal case):** `cleanup-CLN-WN-1-stale-dismissal-\u003Coriginal-id>`.\n- **Category:** `whats-next-stale`. **Severity:** P3.\n- **Proposed action:** \"Remove dismissal `\u003Cid>` from `docs\u002Fwhats_next.md` frontmatter — the condition hasn't recurred in 30 runs.\"\n\n#### CLN-FG-1 — forged-skill staleness\n\n- **Reads:** `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md` and `${CRUX_LOCAL_SKILLS_DIR}\u002F*\u002FSKILL.md` (the forged-skill tree).\n- **Existence gate:** if neither `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md` nor any `${CRUX_LOCAL_SKILLS_DIR}\u002F*\u002FSKILL.md` file exists, this rule **silently skips** — the project has no forged skills, which is normal.\n- **Scope:** applies ONLY to forged skills — skill directories that have at least one `authored` entry in `forge-log.md`. A `${CRUX_LOCAL_SKILLS_DIR}\u002F\u003Cname>\u002F` directory with no `authored` entry in the forge log was not created by forge-skill (hand-authored or installed by another mechanism) and is explicitly OUT of scope: never flagged by this rule, never proposed for pruning.\n- **Looks for:** for each in-scope skill directory, find the newest entry in `forge-log.md` across ALL event types (`authored|revised|used|evaluated`) for that skill name by **parsed timestamp** (the `## [YYYY-MM-DD HH:MM]` prefix). Compare timestamps, never file positions — the comparison spans multiple event types whose entries interleave, so position is meaningless. If that newest timestamp is older than `${TODAY} - forged_skill_stale_days` (manifest `cleanup:` key, default 30), fire a finding. `revised`, `used`, and `evaluated` events all reset the clock — a skill used, evaluated, or revised within the window is not stale even if its `authored` entry is old. An unparseable timestamp or malformed header (not matching `## [YYYY-MM-DD HH:MM] \u003Cevent> | \u003Cskill-name>`) is itself a finding — surface it as part of this rule's output (fail-loud), never a silently-skipped entry.\n- **Stable id:** `cleanup-CLN-FG-1-\u003Cskill-name>` (one per stale forged skill; `skill-name` is the directory name under `${CRUX_LOCAL_SKILLS_DIR}\u002F`).\n- **Category:** `forge-hygiene`. **Severity:** P3.\n- **Proposed action:** \"Forged skill `\u003Cskill-name>` has no `authored|revised|used|evaluated` event within the last `\u003CN>` days (newest event: \u003Cdate>). Either prune it via `forge-skill` (which records the `pruned` event and a `skill | pruned` op in the operations log) or add a note in the forge log explaining why it stays.\"\n- **Actor boundary:** `cleanup-campsite` only *proposes* this finding. It never deletes a skill file, never writes `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md`, and never writes a `skill` op to the operations log. The prune itself — on user approval or autonomously when gates permit — is performed through `forge-skill`, which is the sole authorized writer of the forge log and of `skill` ops.\n\n#### CLN-FG-2 — used-but-never-evaluated\n\n- **Reads:** `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md` and `${CRUX_LOCAL_SKILLS_DIR}\u002F*\u002FSKILL.md` (the forged-skill tree).\n- **Existence gate:** reuses CLN-FG-1's authored-entry gate — applies only to forged skills (those with at least one `authored` entry in `forge-log.md`). If neither `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md` nor any `${CRUX_LOCAL_SKILLS_DIR}\u002F*\u002FSKILL.md` file exists, this rule **silently skips**.\n- **Scope:** applies ONLY to forged skills — skill directories that have at least one `authored` entry in `forge-log.md`. A `${CRUX_LOCAL_SKILLS_DIR}\u002F\u003Cname>\u002F` directory with no `authored` entry in the forge log was not created by forge-skill and is explicitly OUT of scope.\n- **Looks for:** for each in-scope skill directory, fire a finding when ALL THREE of the following hold: (1) the skill has ≥1 `used` entry in `forge-log.md`; (2) the skill has NO `evaluated` entry timestamped at-or-after the newest `used` timestamp; (3) the newest `used` timestamp is older than `${TODAY} - forged_skill_stale_days` (manifest `cleanup:` key, default 30). A `revised` entry does NOT void a pending evaluation obligation — the use still happened and must be evaluated at the next use.\n- **Worked example:** skill used June 1, never evaluated → CLN-FG-2 fires July 1 → if a July session uses the skill, it evaluates then; if nothing uses it again, CLN-FG-1's staleness lane eventually proposes prune-or-justify and the evaluation question dies with the skill.\n- **Stable id:** `cleanup-CLN-FG-2-\u003Cskill-name>` (one per affected forged skill; `skill-name` is the directory name under `${CRUX_LOCAL_SKILLS_DIR}\u002F`).\n- **Category:** `forge-hygiene`. **Severity:** P3.\n- **Proposed action:** \"Forged skill `\u003Cskill-name>` was used on \u003Cdate> but never evaluated. Evaluate it on next use — the next session that actually uses the skill writes one `evaluated` forge-log entry (verdict: effective | fell-short | mixed) before ending. A session WITHOUT the use context MUST NOT retroactively fabricate an evaluation. If no use recurs within the staleness window, CLN-FG-1's prune-or-justify lane applies.\"\n- **Actor boundary:** `cleanup-campsite` only *proposes* this finding. It never writes `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md`. The evaluation itself is written by forge-skill's Recording Rules in the session that uses the skill.\n\n#### CLN-RETRO-1 — retrospective cadence\n\n- **Reads:** `docs\u002Fcycles\u002FCYC-*\u002Fcycle.json` and `docs\u002Fjournal\u002F*.md`. The anchor search also reads the operations log (every detail file under `docs\u002Flog\u002F`), for the corroboration guard in the Note below.\n- **Predicate:** count the cycle records whose `status` is `completed`, `abandoned` or `shortcut` and whose closing history event is dated STRICTLY AFTER the newest `docs\u002Fjournal\u002F*.md` heading matching the regex `^## \\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}\\] learning \\| Retrospective: `. The closing history event is the closing status event: the first `history` entry whose `status` field equals the record's closed status, because a later entry, such as a late `assignment --state finished`, can follow closure. An older record whose entries carry no `status` field uses the last `history` entry. The event's `at` field gives the date. Fires at P3 when that count ≥ `retro_due_runs` (manifest `cleanup:` key, default 5; the key name is kept). Terminology: **cycles closed** (the count is per cycle record; a cycle that closes on the day of the retrospective is not counted — date granularity; acceptable for a P3 nudge). A cycle that is active or paused is not counted.\n- **First-run behavior:** if no heading matching `^## \\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}\\] learning \\| Retrospective: ` appears anywhere in `docs\u002Fjournal\u002F*.md`, count ALL closed cycle records and fire the finding with explicit \"no retrospective has ever run\" wording — the adoption nudge is the point.\n- **Stable id:** `cleanup-CLN-RETRO-1-due` (singleton — the finding represents the cadence state as a whole, not a per-cycle artifact).\n- **Category:** `retro-cadence`. **Severity:** P3.\n- **Proposed action:** \"Run a retrospective — the `retrospective` skill mines recent journal reflections, cycle records, and log ops; harvests ≤2 council-gated skill proposals.\"\n- **Note:** This rule tracks cadence for the `retrospective` skill (scheduled, deliberate reflection that may yield ≤2 skill proposals per run). It is NOT a journal-entry-quality check — the journal-gap rule `CLN-JR-2` owns that concern; the word \"retrospective\" appearing there refers to a reflective journal *entry style*, not to the `retrospective` skill's cadence. The anchor search applies the same validity guards as Phase 1 of the `retrospective` skill: future-dated candidates and candidates with no same-day `journal | Retrospective:`-prefixed op in any operations-log detail file under `docs\u002Flog\u002F` are ignored.\n\n#### CLN-TMPL-1 — dogfood↔template clause parity\n\n- **Reads:** `crux\u002Fscripts\u002Ftemplate_parity_manifest.json` and, per manifest entry, the declared canonical file (e.g. `docs\u002FAGENTS.md`) plus the declared twin template file (e.g. `crux\u002Ftemplates\u002FAGENTS.md.tmpl`). Invokes the shared checker `crux\u002Fscripts\u002Fcheck_template_parity.py`, which carries forward the fence-aware section extractor from the forged-skill predecessor.\n- **Existence gate \u002F self-detection (per manifest entry):** the trigger predicate is the existence of the manifest entry's OWN declared twin template path — NOT a coarse glob. An entry whose declared twin template is absent (e.g., every downstream install that received the rendered `docs\u002FAGENTS.md` but not `crux\u002Ftemplates\u002FAGENTS.md.tmpl`) is **skipped entirely** — neither the parity check nor the stale-manifest guard runs for that entry. Therefore with no templates present the rule is a guaranteed clean **no-op (0 findings)** — inert, not dead code. The stale-manifest guard (which keys on the canonical file) is also gated behind twin-presence: guard evaluation runs ONLY in a tree where the twin exists, so it cannot fire downstream and cannot undermine the 0-finding-downstream promise. `cleanup-campsite --only CLN-TMPL-1` on a tree with no twin templates is a clean no-op, not an error.\n- **Looks for (two sub-checks per manifest entry whose twin is present):**\n  - **(drift)** A designated clause that drifted between the canonical file and the twin template — the checker reads the clause live from the canonical via anchor + pattern, then asserts the same text in the twin. Drifted clause → finding.\n  - **(stale anchor\u002Fpattern)** A manifest entry's anchor or pattern no longer resolves in its canonical file (twin present). Stale entry → **P3 finding, emitted INSTEAD OF a vacuous clean result** — a stale entry reads \"needs attention\", never \"in parity\". The stale guard exists because a non-resolving anchor would otherwise make the rule pass vacuously, which is exactly the silent-failure mode the rule exists to prevent.\n- **Stable id:**\n  - Drift: `cleanup-CLN-TMPL-1-\u003Cclause-id>` (one per drifted clause; `clause-id` is the entry's id from the manifest).\n  - Stale anchor\u002Fpattern: `cleanup-CLN-TMPL-1-stale-\u003Cclause-id>`.\n  (Both conform to the `cleanup-\u003Crule-id>-\u003Cartifact-slug>` shape.)\n- **Category:** `template-parity`.\n- **Severity:** drift → **P2** (a drifted clause in a shipped template reaches every install — more than visibility-only); stale anchor\u002Fpattern → **P3** (maintenance signal about the checker, not evidence of shipped-template drift).\n- **Proposed action:**\n  - Drift: \"Sync the `\u003Cclause-id>` clause in `crux\u002Ftemplates\u002FAGENTS.md.tmpl` to match `docs\u002FAGENTS.md` (the canonical surface).\"\n  - Stale: \"Manifest entry `\u003Cclause-id>` anchor\u002Fpattern no longer resolves in `\u003Ccanonical-file>`; update `crux\u002Fscripts\u002Ftemplate_parity_manifest.json` to reflect the current anchor\u002Fpattern.\"\n- **Actor boundary:** proposes only; never edits `docs\u002FAGENTS.md`, `crux\u002Ftemplates\u002FAGENTS.md.tmpl`, or `crux\u002Fscripts\u002Ftemplate_parity_manifest.json`. The fix is a human\u002FClaude-under-direction edit. This honors the `audit-docs` \u002F `cleanup-campsite` boundary (template drift is process-state, not graph integrity).\n- **On-demand fast-path:** `cleanup-campsite --only CLN-TMPL-1` — runs only this rule, scopes `docs\u002Fwhats_next.md` output to its findings, emits the normal `cleanup-campsite` log op. Use immediately after editing `docs\u002FAGENTS.md` to confirm no parity regression before committing.\n\n#### CLN-XR-1 — RESERVED for v0.2\n\nCross-ADR Decision-section contradictions. Not implemented in v0.1 — deliberately deferred: cross-document semantic comparison is too fuzzy for a deterministic scan rule. The id is reserved so future cleanup versions don't reuse it.\n\n#### Known limitations of v0.1\n\nThese code paths are not exercised by the smoke test and should be exercised in a follow-up run before relying on them:\n\n- **Dismissal lifecycle** — the v0.1 smoke run produced `dismissed: []`, so the round-trip (`dismissed_last_seen` increment, reset on recurrence, 30-run housekeeping P3 emission) is **untested**. A future run that hand-edits a finding into `dismissed:` and re-invokes cleanup is the smallest test that exercises the path.\n- **\"Recently closed\" derivation** — first-run-on-this-repo means `prior_open_ids` was empty; the diff calculation didn't execute. A second run after closing any finding will exercise it.\n- **Rename semantics** — if a scan rule is renamed in a future cleanup version, old `dismissed:` entries keyed to the previous id stay as no-ops AND the underlying condition (if still present) emits a fresh undismissed id. The user re-confirms or re-dismisses; the stale dismissal ages out via the 30-run housekeeping path. This is correct behavior but until v0.2 introduces a rule rename, it's a theoretical invariant.\n\n#### CLN-AUD-1 — audit-recency\n\n- **Reads:** the operations log: every detail file under `docs\u002Flog\u002F`.\n- **Looks for:** the `## [YYYY-MM-DD] audit |` entry with the latest heading date in any detail file. Heading dates are not ordered within a file, so compare dates rather than taking the first match. If its date is older than `${TODAY} - audit_stale_days` (default 14), emit a P1 finding.\n- **Stable id:** `cleanup-CLN-AUD-1-recency` (conforms to the standard `cleanup-\u003Crule-id>-\u003Cartifact-slug>` shape).\n- **Category:** `whats-next-stale`. **Severity:** P1.\n- **Proposed action:** \"Run `audit-docs` — last audit was \u003CN> days ago.\"\n- **Note:** this rule never *invokes* `audit-docs` (different cadence — see the boundary table); it only checks the log for recency and proposes the run.\n\n### 4. Sort, cap, build the body\n\n- Collect all findings from step 3 (after dismissal filtering).\n- Sort by severity DESC (P1 first), then by stable `id` ASC for determinism.\n- **Caps:** at most 5 P1 findings, at most 10 P2 findings, P3 uncapped. When a cap is exceeded, surplus findings go under a `## Truncated (M not shown)` section listing only their ids.\n- **Stale-dismissal housekeeping entries** (CLN-WN-1) are always emitted as P3 regardless of cap pressure; within P3 they sort LAST (after fresh P3 findings).\n\n### 5. Compute \"Recently closed\"\n\n`recently_closed = prior_open_ids - current_open_ids`. Cap at 10 entries (older closures live in the operations log). Format as strikethrough lines:\n\n```markdown\n- ~~\u003Cid>~~ — addressed \u003CYYYY-MM-DD> (condition no longer reproduces).\n```\n\n### 6. Write `docs\u002Fwhats_next.md`\n\nOverwrite the body. Preserve the `dismissed:` frontmatter list verbatim (it's persistent state). Increment `dismissed_last_seen:` for each dismissal whose id didn't match a current finding; reset to 0 for any dismissal whose id DID match (i.e., the condition recurred and was suppressed).\n\nFrontmatter shape:\n\n```yaml\n---\ngenerated_at: ${NOW}\ngenerator: cleanup\ngenerator_version: \"\u003Cthe installed plugin version, read from plugin.json — never a hardcoded number>\"\nscan_findings: \u003Cint>\nsuggestions_open: \u003Cint>\nsuggestions_dismissed_carried: \u003Cint>\ndismissed:\n  - id: \u003Cstable id>\n    dismissed_at: \u003CYYYY-MM-DD>\n    reason: \"\u003Cone line>\"\n    dismissed_last_seen: \u003Cint>   # 0 if condition recurred this run; else prior + 1. At >= 30, cleanup emits a P3 prune suggestion via CLN-WN-1.\n---\n```\n\nBody shape:\n\n```markdown\n# What's next\n\n_Generated \u003CYYYY-MM-DD HH:MM> by `cleanup-campsite` v\u003Cthe installed plugin version>. **Body regenerated end-to-end on every run; only the `dismissed:` frontmatter list persists.** Hand-edits below the frontmatter are blown away. To dismiss a suggestion, move its `id:` into the `dismissed:` frontmatter list with a `reason:`._\n\n## Open suggestions (N)\n\n### 1. [P1] \u003Csubject>\n- **id:** `\u003Cstable-id>`\n- **category:** \u003Cenum>\n- **severity:** P1 | P2 | P3\n- **finding:** \u003C1-2 lines>\n- **source:** scan rule `CLN-XX-N` against `\u003Cinspected paths>`\n- **proposed action:** \u003Cwhat to do; may name a skill>\n- **refs:** [[wiki-link]] ...\n\n### 2. ...\n\n## Truncated (M not shown)\n- `\u003Cid1>`, `\u003Cid2>`, ...\n\n## Recently closed (since last run)\n- ~~`\u003Cid>`~~ — addressed \u003CYYYY-MM-DD> (condition no longer reproduces).\n```\n\n### 7. Update `docs\u002Findex.md`\n\nIf `suggestions_open > 0` AND `docs\u002Findex.md` does NOT already have a `## What's next (N)` section, insert it as the first concern-rollup, between the file header and `## Research`. Content:\n\n```markdown\n## What's next (N)\n\n_N open suggestions (P1: X, P2: Y, P3: Z) — see [[whats_next]]._\n```\n\nIf the section exists, update N and the breakdown. If `suggestions_open == 0`, remove the section.\n\nUpdate `_Last updated:_` to `${TODAY}`.\n\n### 8. Record the `cleanup-campsite` operation\n\nWrite the entry through the log writer, as `docs\u002FAGENTS.md` §6 states. Write this body to a file outside the tree, adding one line for a repair or catch-up that `CLN-LOG-1` completed:\n\n```markdown\nTop-3 P1 ids: `\u003Cid1>`, `\u003Cid2>`, `\u003Cid3>`. See [[whats_next]].\n```\n\nThen run:\n\n```\nuv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Foperation-log.py\" append --repo-root \u003Crepo-root> \\\n  --op cleanup-campsite --subject 'N open (X P1, Y P2, Z P3), M closed, K dismissed' \\\n  --date ${TODAY} --body-file \u003Cpath>\n```\n\nThe entry it writes at the top of the current month's detail file:\n\n```markdown\n## [${TODAY}] cleanup-campsite | N open (X P1, Y P2, Z P3), M closed, K dismissed\n\nTop-3 P1 ids: `\u003Cid1>`, `\u003Cid2>`, `\u003Cid3>`. See [[whats_next]].\n```\n\nIf N is zero on all counts, still write the entry (auditable record that cleanup ran). A refused append keeps cleanup's other writes; fix the cause it names and rerun the append alone (§6). Then run the commit step of §6 over this result's `commit_paths` and `restore_paths`, adding `docs\u002Flog\u002Fsummary.md` when the `CLN-LOG-1` catch-up wrote it.\n\n### 9. Console summary\n\nPrint to the user:\n\n```\nCleanup complete: N open suggestions (P1: X, P2: Y, P3: Z), M closed, K dismissed.\nSee docs\u002Fwhats_next.md for details.\n```\n\nPlus the top-3 P1 subjects if any exist, so the user sees the actionable items immediately.\n\n## Verification checklist\n\n- [ ] `docs\u002Fwhats_next.md` exists.\n- [ ] Frontmatter parses as valid YAML.\n- [ ] `generated_at` is the current UTC timestamp.\n- [ ] `generator_version` matches the installed plugin version (from `plugin.json`).\n- [ ] `dismissed:` list is preserved verbatim from the prior file (each entry's `dismissed_last_seen` is incremented or reset per step 6).\n- [ ] Every body suggestion has all six required fields: `id`, `category`, `severity`, `finding`, `source`, `proposed action`. `refs` may be absent if no refs exist.\n- [ ] Severity caps respected: ≤ 5 P1, ≤ 10 P2 (excess in `## Truncated`).\n- [ ] Stale-dismissal entries sort after fresh P3 findings.\n- [ ] The current month's detail file `docs\u002Flog\u002FYYYY-MM.md` has a new `## [${TODAY}] cleanup-campsite |` entry at the top, and no `docs\u002Flog.md` was written.\n- [ ] `CLN-LOG-1` ran `operation-log.py repair` and the summary gate; any refusal is a P1 finding, and `generate-log-summary.py --dry-run` lists no pending month after a catch-up.\n- [ ] `docs\u002Findex.md` has a `## What's next (N)` section iff `N > 0`; section content is consistent with the body.\n- [ ] No edits to README, USER_GUIDE, CHANGELOG, ADR bodies, journal entries, or promptbook files.\n- [ ] `manifest.yml` counters unchanged.\n\n## Red flags — STOP and reconsider\n\n- **About to edit a prose surface directly** (README, USER_GUIDE, ADR body, journal entry, promptbook plan). Refuse. Cleanup proposes via `whats_next.md`; humans (or Claude under direct instruction) execute.\n- **About to write `docs\u002Fwhats_next.md` without preserving the `dismissed:` frontmatter list.** That's the only state that survives across runs; clobbering it silently breaks the dismissal contract.\n- **About to invoke `audit-docs` from cleanup.** Two skills, two cadences. Cleanup CHECKS whether audit ran recently; it does NOT run it.\n- **About to fail a scan rule silently** because the input file is missing. Each rule's `Reads:` section enumerates expected inputs; a missing input is a finding (`docs\u002Fwhats_next.md` would surface \"missing expected file \u003Cpath>\"), not a swallowed error.\n- **About to surface a finding for a dismissed id without re-checking the dismissal.** Dismissals suppress unconditionally; the `dismissed_last_seen` counter tracks staleness but does not gate suppression.\n- **About to invent a stable id format that doesn't follow `cleanup-\u003Crule-id>-\u003Cartifact-slug>`.** Determinism depends on every rule emitting ids in the documented shape.\n- **About to write a finding without a `proposed action`.** Cleanup's contract is *forward-looking* — every finding names what to do, even if \"ignore\" is the action.\n- **About to skip the operations-log entry on a zero-findings run.** The log is the audit trail of \"cleanup ran on this date\"; write the entry even if N=0.\n- **About to suggest invocation of a skill that doesn't exist.** Each `proposed action` that names a skill MUST reference an existing one (`archive-promptbook`, `transition-adr`, `log-work`, `audit-docs`, `run-promptbook`, `forge-skill`, `retrospective`).\n\n## Rationalization table and common mistakes\n\nThe Red flags list above is the primary stop-list. For the fuller\nexcuse→reality mapping and the recurring-mistake catalog, read\n[`references\u002Fpitfalls.md`](references\u002Fpitfalls.md).\n## See also\n\n- `docs\u002FAGENTS.md` §5.A (the whats_next.md schema) and §11 (the audit-docs boundary); the scan-rule roster is in this file's Overview (20 implemented + 4 retired + 1 reserved, for 25 ids).\n- `audit-docs\u002FSKILL.md` — the boundary partner. Cleanup CHECKS whether audit ran recently; it does NOT invoke it.\n- `log-work\u002FSKILL.md` (v0.2.0) — establishes the journal-as-reflection contract that cleanup honors (`CLN-JR-2` surfaces thin months as suggestions; never auto-drafts the entry itself).\n- `transition-adr\u002FSKILL.md` — what users invoke after a CLN-ADR-2 finding (accept \u002F deprecate \u002F supersede).\n- `run-promptbook\u002FSKILL.md` — what users invoke after a CLN-PB-1 or CLN-PB-2 finding.\n- `query-docs\u002FSKILL.md` — cleanup does NOT invoke this; orthogonal capability.\n- `retrospective\u002FSKILL.md` — the skill CLN-RETRO-1 nudges the user to invoke; deliberate reflection that harvests ≤2 skill proposals from finished work.\n\n[^promotion]: rule:acceptance-makes-rules-binding, rule:historical-records-keep-their-interpretation\n[^log-repair]: rule:cleanup-campsite-runs-the-first-split, rule:cleanup-campsite-merges-a-stray-log\n[^log-catch-up]: rule:cleanup-campsite-runs-the-log-summary-catch-up, rule:catch-up-writes-every-pending-month, rule:no-section-before-its-month-settles\n[^log-finding]: rule:refused-log-repair-is-a-cleanup-finding\n","# Cleanup\n\n\u003C!-- BEGIN GENERATED: runtime-compat -->\n## Runtime compatibility\n\nThis skill is portable across Claude Code, Codex, OpenCode, and OMP (Oh My Pi). This section overrides platform-specific labels below.\n\n- Before running a command that uses `CRUX_PLUGIN_ROOT`, set it to the installed plugin root. In Claude Code, use the value of `CLAUDE_PLUGIN_ROOT`. In Codex, OpenCode, and OMP, derive it from the absolute path of this selected `SKILL.md`: the plugin root is the parent of its `skills\u002F` directory (in OMP `bash`, `skill:\u002F\u002F\u003Cname>` resolves to the skill directory). In a source checkout, use the checkout `crux\u002F` directory.\n- For project-local skills, use `.claude\u002Fskills` in Claude Code, `.agents\u002Fskills` in Codex, `.opencode\u002Fskills` in OpenCode (which also reads the singular `.opencode\u002Fskill`), and `.omp\u002Fskills` in OMP. Set `CRUX_LOCAL_SKILLS_DIR` to that path before following any command below that uses it.\n- Translate Claude Code tool labels such as `Agent`, `Read`, `Write`, `Bash`, `WebSearch`, and `WebFetch` to the matching capability in the current session. Codex names its own capabilities; OpenCode uses the lowercase forms `subagent`, `read`, `edit`, `shell`, `websearch`, and `webfetch`, where `edit` covers both `Edit` and `Write`; OMP uses `task`, `read`, `edit`, `write`, `bash`, `grep`, `glob`, `find`, `todo`, and `web_search` (where `read` also handles URLs and `skill:\u002F\u002F` URIs). Do not attempt to invoke the Claude Code labels as literal commands on another host.\n- Install the generated role agents before delegating: `install-codex-agents` in Codex, `install-opencode-agents` in OpenCode, `install-omp-agents` in OMP. Codex names them `crux_architect`, `crux_brainstormer`, `crux_commander`, `crux_dev_lead`, `crux_developer`, `crux_historian`, `crux_librarian`, `crux_night_gardener`, `crux_reviewer`, and `crux_wayfinder`; OpenCode and OMP use the bare role names `architect`, `brainstormer`, `commander`, `dev-lead`, `developer`, `historian`, `librarian`, `night-gardener`, `reviewer`, and `wayfinder` (in OMP, `scout` may also be used for reconnaissance alongside `wayfinder`). If a required role or capability is unavailable, report that truthfully instead of claiming it ran.\n- Argument placeholders such as `$adr` and `$book` bind only in Claude Code. On a host without argument binding they are unset — take the value from the user's phrase. The \"Fields OpenCode ignores\" section of `OPENCODE_GUIDE.md` names the invocation-control fields OpenCode ignores.\n\u003C!-- END GENERATED: runtime-compat -->\n\n## Current cycle work\n\nInclude paused and active records under `\u003Cdocs_dir>\u002Fcycles\u002F` in unfinished-work\ninspection. Use the cycle reader to report current phase, pass limit, blockers,\nand next action. Never advance a cycle during a hygiene scan. Promptbook guidance\nbelow applies only to historical records; do not recommend new promptbooks.\n\n\n\n## Overview\n\nCleanup is the **forward-looking** counterpart to `audit-docs`. Two skills, two questions:\n\n| Skill | Question it answers |\n|---|---|\n| `audit-docs` | *Is the docs graph internally consistent?* (schema, frontmatter, cross-refs, indexes, rollups) |\n| `cleanup-campsite` | *Given a consistent graph, what work should we be doing next?* (process-state staleness, forward actions) |\n\nThe output is `docs\u002Fwhats_next.md` — a regenerated, prioritized action backlog with citation-bearing entries. The artifact answers the session-start question: *\"what should I do first today?\"*\n\nCleanup does NOT invoke `audit-docs` internally — different cadence (session-start vs. before-release), different exit semantics (audit's BROKEN findings block; cleanup's are suggestions), different write footprint. Cleanup CHECKS whether audit has run recently and emits a P1 \"run audit-docs\" suggestion if it hasn't.\n\nCleanup ships **20 implemented scan rules** (CLN-* IDs) plus **one reserved id** for v0.2 (`CLN-XR-1`) and **four retired ids**, for 25 `CLN-*` ids total. The 20 implemented rules: `CLN-LOG-1` (operations-log repair and summary catch-up); `CLN-PJ-1a`, `CLN-PJ-1b`, `CLN-PJ-1c`, `CLN-PJ-2` (one rule, four sub-findings — three version-mismatch checks, against the Claude bare manifest, the Codex plugin manifest and the `crux-mods` plugin manifest, since all three joined the same version lock-step, plus the marketplace owner-placeholder check; still counted as a single rule id); `CLN-ADR-2`, `CLN-ADR-4`, `CLN-ADR-5` (decision-migration suggestion); `CLN-ADR-6` (open promotion requests); `CLN-OBJ-1` (objectives unpopulated); `CLN-PB-1`, `CLN-PB-2`, `CLN-PB-4`; `CLN-JR-2`; `CLN-WN-1`; `CLN-AUD-1` (audit-recency); `CLN-FG-1` (forged-skill staleness); `CLN-FG-2` (used-but-never-evaluated); `CLN-RETRO-1` (retrospective cadence, counting closed cycles); `CLN-TMPL-1` (dogfood↔template clause parity). (`CLN-AUD-1` was formerly the un-prefixed `cleanup-audit-stale` \"not-a-CLN-rule\" check; it now carries a standard rule id so the count is exact and the verification checklist needs no special-case exemption.) **Retired rule ids (never reused, never reimplemented):** `CLN-ADR-1`, `CLN-ADR-3`, `CLN-JR-1`, `CLN-PB-3`. See their stubs below for why. The count dropped by one for each rather than being backfilled, and `CLN-WN-1`'s stale-dismissal check skips any dismissal keyed to a retired id — those records are history that is being kept on purpose, not dead weight to age out.\n\n### What cleanup writes vs. what it proposes\n\n**Cleanup writes (mechanical, low-risk):**\n- `docs\u002Fwhats_next.md` — its primary artifact (body fully regenerated on every run; only the `dismissed:` frontmatter list persists across runs).\n- One `cleanup-campsite` op entry in the operations log per run, written by `operation-log.py append`.\n- The operations log under `docs\u002Flog\u002F`, through two commands only: `operation-log.py repair` (the first split and stray merges) and `generate-log-summary.py` (the catch-up of `docs\u002Flog\u002Fsummary.md`). Both run in `CLN-LOG-1`.\n- A `## What's next (N)` section in `docs\u002Findex.md` at the top (before `## Research`), when `suggestions_open > 0`. Removes the section when `N = 0`.\n\n**Cleanup proposes (writes to whats_next.md, not the target file):**\n- README \u002F USER_GUIDE \u002F CHANGELOG edits.\n- ADR body edits (frozen after Accepted anyway — never touch).\n- Journal entries (per the v0.2.0 log-work skill — reflection cannot be auto-generated).\n- Promptbook file edits (run-promptbook owns those).\n- `manifest.yml` counter changes (no v0.1 rule emits this — listed for safety so future rules don't quietly enable it).\n\n## When to use\n\n- User says: \"cleanup\", \"hygiene check\", \"what's next\", \"clean up the docs\", \"refresh whats_next\".\n- Start of a session, especially after a long gap or a context-switch.\n- After a flurry of operations (multiple ADRs accepted, promptbooks completed) to catch what should be reflected in human-facing docs and forward-action lists.\n- Before a release, alongside (not instead of) `audit-docs`.\n\nDo **NOT** use this skill for:\n- Schema-integrity validation — that's `audit-docs`.\n- Resolving findings cleanup surfaces — invoke the relevant downstream skill (`archive-promptbook`, `log-work`, `transition-adr`, etc.).\n- Editing prose surfaces directly — cleanup proposes; humans (or Claude under explicit direction) execute.\n\n## Inputs\n\nThis skill takes no required arguments. Optional behavior:\n\n- **`--only \u003CRULE-ID>[,\u003CRULE-ID>...]`** — run ONLY the named rule(s). This is a first-class named sub-deliverable, not a debug flag.\n\n  **Contract:**\n  - Accepts a single CLN rule id (e.g. `CLN-TMPL-1`) or a comma-separated CSV list (e.g. `CLN-TMPL-1,CLN-PJ-2`). No spaces around commas.\n  - Runs ONLY the named rule(s) over the same shared checker \u002F scan logic as a full run — the rule's setup requirements (threshold resolution, dismissal loading) still execute; no rule-specific setup state is skipped.\n  - Output is scoped to the named rules: `docs\u002Fwhats_next.md` is regenerated for ONLY the named-rule slice. The prior body's findings for other rules are **not clobbered** — only the entries for the named rule(s) are replaced in place. (Implementation: read the prior `docs\u002Fwhats_next.md` body, remove entries whose `source:` cites a named rule, inject the new findings for those rules in severity\u002Fid order, and write back. Findings from unscoped rules are carried forward verbatim.)\n  - The normal `cleanup-campsite` log op is STILL written to the operations log on every `--only` run (the regenerate-and-propose + log contract is not bypassed). The log entry body names the scoped rule(s): `N open (X P1, Y P2, Z P3) [--only CLN-TMPL-1], M closed, K dismissed`.\n  - **Unknown rule id → loud error (NOT a silent no-op).** If any rule id in the list is not a recognized CLN-* id, cleanup refuses to run and prints: `ERROR: unknown rule id '\u003CID>'. Known rule ids: CLN-PJ-1a, CLN-PJ-1b, …`. Exit non-zero. This prevents a silent empty-output run from masking a typo.\n  - **Rule-harness isolation:** each named rule runs in isolation over the shared checker \u002F scan logic without missing required setup state (thresholds and dismissals are loaded in step 1\u002F2 even under `--only`) and without causing side effects on unscoped rules.\n  - `cleanup-campsite --only CLN-TMPL-1` is the documented **on-demand fast-path** for immediate parity feedback right after editing `docs\u002FAGENTS.md` — fast because only one rule runs against two files, no full vault walk.\n\n- **Configuration in `docs\u002Fmanifest.yml`** under an optional `cleanup:` block:\n  - `adr_proposed_stale_days` — default 14. Used by `CLN-ADR-2`.\n  - `stuck_promptbook_days` — default 14. Used by `CLN-PB-1`.\n  - `audit_stale_days` — default 14. Used by the audit-recency check.\n  - `forged_skill_stale_days` — default 30. no authored\u002Frevised\u002Fused\u002Fevaluated event within this window (timestamp comparison). Used by CLN-FG-1 and CLN-FG-2.\n  - `retro_due_runs` — default 5. Used by `CLN-RETRO-1`: flag when >= this many cycles closed (completed, abandoned or shortcut) since the last `Retrospective:` journal entry.\n  - `adr_review_due_days` — default 7. Used by `CLN-ADR-5`.\n\n  Missing values fall back to the defaults. The `cleanup:` block itself is optional.\n\n## The pipeline\n\nBefore source discovery or recursive walking, prune retained demonstration holdings: list the holdings once with `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fauthority-view.py\" retained-roots --repo-root \u003Crepo-root>` and skip each listed root during recursive walks; test one path with `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fauthority-view.py\" retained --repo-root \u003Crepo-root> \u003Cpath>` (exit 0, `retained` true or false). Never read held configuration or records during parent checks. Held records contribute no census\u002Fallocation counts, archive eligibility or overdue-revocation candidates. A layout refusal stops the scan before backlog changes. The holding contract is `docs\u002FAGENTS.md` §3; direct concern globs need no recursive scan.\n\nBefore authority-dependent scans or backlog conclusions, run `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fauthority-view.py\" state --repo-root \u003Crepo-root>`. Exit 0 reports `original` (no clause migration was ever published, so every ADR clause governs as its record says; this is the normal state) or `published` (a migration publication was proved from full Git history, so the clauses it moved are historical evidence, not current constraints). Exit 1 prints `{\"authority\": \"none\", \"limit\": \"\u003Ccode>\"}`: current authority is unknown. Never fall back to an older ADR body or resolver. The common code is `history-unavailable`, a shallow clone of a tree that published a migration; fetch full history with `git fetch --unshallow`. Exit 2 is an environment error. An existing resolver, applied flag or drift-clean output proves no publication. A refusal stops those scans before backlog writes. Implementation intent, council-reviewed history, delivered results and current source state remain separate. Historical reasoning contributes no current obligation or overdue-revocation candidate; a conforming replacement needs no revocation of the earlier reasoning. Preserve mixed records' surviving architectural clauses, ordinary lifecycle checks and dated historical references.\n\nExecute in order.\n\n### 1. Resolve thresholds\n\nRead `docs\u002Fmanifest.yml`. If a `cleanup:` block exists, take its thresholds. Otherwise use defaults (`adr_proposed_stale_days: 14`, `stuck_promptbook_days: 14`, `audit_stale_days: 14`, `forged_skill_stale_days: 30`, `retro_due_runs: 5`, `adr_review_due_days: 7` — the last is `CLN-ADR-5`'s threshold). Compute `${TODAY}` (ISO date) and `${NOW}` (ISO 8601 UTC timestamp).\n\n### 2. Load prior dismissals\n\nRead `docs\u002Fwhats_next.md` if it exists. Parse the frontmatter. Extract the `dismissed:` list — a list of `{id, dismissed_at, reason}` entries.\n\nAlso extract the prior body's open-suggestion `id:` set (call it `prior_open_ids`). Used for \"Recently closed\" derivation.\n\nIf `docs\u002Fwhats_next.md` does not exist, treat both as empty.\n\n### 3. Run scan rules in order\n\nRun each rule. For each finding, compute its stable `id` per the rule's spec. If the `id` is in the `dismissed:` list, skip surfacing.\n\nRules — all are file-scoped; no skill invocations:\n\n#### CLN-LOG-1 — operations-log repair and summary\n\nThis rule runs before every other rule, so each later rule reads the repaired log.\n\n- **Runs:** `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Foperation-log.py\" repair --repo-root \u003Crepo-root>`. It completes the first split of a legacy `docs\u002Flog.md` when the tree has not recorded completion, and it merges a stray `docs\u002Flog.md` or a staged stray into the current month's detail file.[^log-repair] Either step may refuse: a refusal names the heading, the open fence or the conflict, and the split or merge writes nothing.\n- **Then runs:** `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fgenerate-log-summary.py\" --repo-root \u003Crepo-root> --dry-run`. When its `pending_months` is not empty or it reports a failure of kind `region`, run `generate-log-summary.py --repo-root \u003Crepo-root>`, the catch-up, and then the `--dry-run` again.[^log-catch-up] The catch-up writes one section per settled month that lacks one and never a section for the current month.\n- **Looks for:** a refused or failed repair; a first dry-run that reports a failure of kind `structure` or exits 2; a refused catch-up; a second dry-run that exits non-zero.[^log-finding]\n- **Stable id:** `cleanup-CLN-LOG-1-repair` for a repair finding, `cleanup-CLN-LOG-1-summary` for a summary finding.\n- **Category:** `log-repair`. **Severity:** P1. The finding names the months, the heading or the error.\n- **Proposed action:** apply the fix the refusal names (edit the named heading, close the named fence, or resolve the named conflict), then rerun cleanup. For a structure failure, edit `docs\u002Flog\u002Fsummary.md` by hand (remove a premature or second section, or restore a marker), or run `operation-log.py repair` for an incomplete split.\n- **Reports:** a completed repair (its `changed_paths`) or catch-up (the months it added or rewrote) in the console summary and in the body of this run's `cleanup-campsite` log entry.\n- **Commits:** by the commit step of `docs\u002FAGENTS.md` §6, with the `commit_paths` and `restore_paths` of cleanup's last `operation-log.py` run, which is its own `append` in step 8 when that runs. `generate-log-summary.py` reports no commit paths. Name `docs\u002Flog\u002Fsummary.md` among cleanup's own paths only when the catch-up reported `status: written`.\n\n**Existence gate (all CLN-PJ rules):** the CLN-PJ rules inspect plugin\u002Fmarketplace manifests (`crux\u002Fplugin.json`, `crux\u002F.claude-plugin\u002Fplugin.json`, `.claude-plugin\u002Fmarketplace.json`, `crux\u002F.codex-plugin\u002Fplugin.json`, `.agents\u002Fplugins\u002Fmarketplace.json`, `crux-mods\u002F.claude-plugin\u002Fplugin.json`) that exist only in a repo that IS a plugin\u002Fmarketplace checkout — a typical consuming project has none of them, and that is normal. Before running each CLN-PJ rule, check that the file(s) it reads exist; if a rule's primary input is absent, the rule **silently skips** (no finding, no warning). The one exception is CLN-PJ-2's missing-file handling below, which fires only when a *sibling* manifest proves the repo is a plugin-marketplace repo.\n\n#### CLN-PJ-1a — plugin.json version vs. README\u002FUSER_GUIDE version mentions\n\n- **Reads:** `crux\u002Fplugin.json`, `README.md`, `USER_GUIDE.md`.\n- **Looks for:** literal version strings (regex `v?\\d+\\.\\d+\\.\\d+`) in README\u002FUSER_GUIDE that don't match `plugin.json.version`. Ignore version strings inside fenced code blocks unless they're in install snippets.\n- **Stable id:** `cleanup-CLN-PJ-1a-plugin-version`\n- **Category:** `version-drift`. **Severity:** P2.\n- **Proposed action:** \"Update README\u002FUSER_GUIDE version string to `\u003Cplugin.json.version>`.\"\n\n#### CLN-PJ-1b — plugin.json `len(skills)` vs. \"N skills\" claims\n\n- **Reads:** `crux\u002Fplugin.json`, `README.md`, `USER_GUIDE.md`, `AGENTS.md` (root).\n- **Looks for:** patterns like `\\d+ skills` or `\\bfifteen\\b skills?`, `\\bsixteen\\b skills?`, etc., that don't match `len(plugin.json.skills)`.\n- **Stable id:** `cleanup-CLN-PJ-1b-skill-count`\n- **Category:** `version-drift`. **Severity:** P2.\n- **Proposed action:** \"Update skill count to `\u003Cactual>` in `\u003Cfile path>`.\"\n\n#### CLN-PJ-1c — README install snippet `--ref` pinned to outdated tag\n\n- **Reads:** `README.md` (look for `--ref \\S+` in shell snippets), `crux\u002Fplugin.json`.\n- **Looks for:** `--ref v\\d+\\.\\d+\\.\\d+` whose version doesn't match `plugin.json.version`.\n- **Stable id:** `cleanup-CLN-PJ-1c-install-ref`\n- **Category:** `version-drift`. **Severity:** P2.\n- **Proposed action:** \"Update install-snippet `--ref` to `v\u003Cplugin.json.version>` (or to `main` if release pinning isn't intentional).\"\n\n#### CLN-PJ-2 — marketplace + plugin manifest drift\n\n- **Reads:** `crux\u002Fplugin.json`, `crux\u002F.claude-plugin\u002Fplugin.json`, `.claude-plugin\u002Fmarketplace.json`, `crux\u002F.codex-plugin\u002Fplugin.json`, `.agents\u002Fplugins\u002Fmarketplace.json`, `crux-mods\u002F.claude-plugin\u002Fplugin.json`.\n- **Layout note:** Per the Claude Code marketplace spec, the marketplace catalog (`marketplace.json`) lives at the **marketplace root** — for this repo that's the repo root, since the repo IS the marketplace. The plugin manifest (`plugin.json`) lives inside the **plugin's own directory** — `crux\u002F.claude-plugin\u002Fplugin.json`. The two files are NOT colocated. The two-line contract: the two manifests stay version-locked; marketplace.json lives at the marketplace root, the bare plugin.json inside the plugin directory. The Codex install pair mirrors this exact layout split (`crux\u002F.codex-plugin\u002Fplugin.json` inside the plugin directory, `.agents\u002Fplugins\u002Fmarketplace.json` at the marketplace root) and joins the same version lock-step.\n- **Why this rule exists:** Claude Code's plugin loader reads `crux\u002F.claude-plugin\u002Fplugin.json` (a bare manifest with only `name`\u002F`description`\u002F`version`\u002F`homepage`) — separate from the rich `crux\u002Fplugin.json` that drives the catalog layer. Codex's plugin loader reads `crux\u002F.codex-plugin\u002Fplugin.json` in parallel. All version-bearing manifests MUST stay in lock-step on `version` (five surfaces total: `crux\u002Fplugin.json`, `crux\u002F.claude-plugin\u002Fplugin.json`, `crux\u002F.codex-plugin\u002Fplugin.json`, `crux-mods\u002F.claude-plugin\u002Fplugin.json`, `pyproject.toml`) — `sync.sh`'s refuse-first check enforces this across all five at release time; this rule is the docs-side regression tripwire for hand edits or workflow drift between releases.\n- **Looks for (four sub-checks; each emits its own finding):**\n  - **(a) version mismatch.** `crux\u002Fplugin.json.version` is the reference. Three independent comparisons, each a separate finding when it fails:\n    - **(a-i) bare Claude manifest.** `crux\u002F.claude-plugin\u002Fplugin.json.version` is not byte-equal to `crux\u002Fplugin.json.version`.\n      - **Stable id:** `cleanup-CLN-PJ-2a-marketplace-plugin-version`\n      - **Category:** `version-drift`. **Severity:** P2.\n      - **Proposed action:** \"Sync `crux\u002F.claude-plugin\u002Fplugin.json.version` to `\u003Ccrux\u002Fplugin.json.version>`. Versions are bumped by hand at release time and the release script refuses to publish on any mismatch, so drift here means a partial hand edit — finish the bump by hand.\"\n    - **(a-ii) Codex plugin manifest.** `crux\u002F.codex-plugin\u002Fplugin.json.version` is not byte-equal to `crux\u002Fplugin.json.version`.\n      - **Stable id:** `cleanup-CLN-PJ-2a-codex-plugin-version`\n      - **Category:** `version-drift`. **Severity:** P2.\n      - **Proposed action:** \"Sync `crux\u002F.codex-plugin\u002Fplugin.json.version` to `\u003Ccrux\u002Fplugin.json.version>`. Same lock-step discipline as the bare Claude manifest — finish the bump by hand; `sync.sh` refuses to publish on any of the five surfaces mismatching.\"\n    - **(a-iii) `crux-mods` plugin manifest.** `crux-mods\u002F.claude-plugin\u002Fplugin.json.version` is not byte-equal to `crux\u002Fplugin.json.version`. The `crux-mods` plugin ships in the same release act at crux's version, so its manifest carries no version of its own.\n      - **Stable id:** `cleanup-CLN-PJ-2a-mods-plugin-version`\n      - **Category:** `version-drift`. **Severity:** P2.\n      - **Proposed action:** \"Sync `crux-mods\u002F.claude-plugin\u002Fplugin.json.version` to `\u003Ccrux\u002Fplugin.json.version>`. Same lock-step discipline as the other manifests — finish the bump by hand; `sync.sh` refuses to publish on any of the five surfaces mismatching.\"\n  - **(b) marketplace owner placeholder.** `.claude-plugin\u002Fmarketplace.json` `owner.name` matches any of the following case-insensitive predicates: equals `\"local\"`; equals `\"todo\"`; contains `\"placeholder\"`; contains `\"arc-search\"` (the prior placeholder left over from this file's earlier life).\n    - **Stable id:** `cleanup-CLN-PJ-2b-marketplace-owner-placeholder`\n    - **Category:** `version-drift`. **Severity:** P3.\n    - **Proposed action:** \"`.claude-plugin\u002Fmarketplace.json` `owner.name` is a placeholder (`\u003Ccurrent value>`). Set it to the canonical owner that matches the GitHub org in `crux\u002Fplugin.json.homepage` (currently `idyll`).\"\n- **Schema-rich caveat (Codex pair only):** unlike the deliberately bare Claude Code pair, the Codex plugin manifest (`crux\u002F.codex-plugin\u002Fplugin.json`) is **schema-rich by design** — it legitimately carries a `skills` path pointer (`\".\u002Fskills\u002F\"`), an `interface` block (display name, descriptions, category, capabilities, default prompts), and package metadata (author, keywords, license, repository). None of that is drift; do not flag it and do not propose stripping it to match the bare Claude manifest's minimalism. The **narrower** prohibition this rule enforces is: neither Codex manifest may duplicate the rich manifest's catalog **arrays** — the enumerated `skills:`\u002F`scripts:` arrays of `crux\u002Fplugin.json` remain the catalog layer's sole home and must never be copied into `crux\u002F.codex-plugin\u002Fplugin.json` or `.agents\u002Fplugins\u002Fmarketplace.json`. If a future rule needs to check for that duplication, it is a new finding under this same rule, not a \"make it bare\" proposal.\n- **Intentionally not checked here:** description and name drift among the manifests. Wording often legitimately differs slightly (one summarizes for a CLI list, another for a marketplace UI, another for the Codex schema's `interface` block). Cleanup is not the right place for fuzzy prose matching; if a name divergence ever ships (a crux manifest whose `name` is not `\"crux\"`, or the crux-mods manifest whose `name` is not `\"crux-mods\"`) it would be caught by `validate-catalog.py` not by cleanup. The contract is two lines per pair: the manifests in each pair stay version-locked; each marketplace file lives at the marketplace root, each bare\u002Fplugin manifest inside the plugin directory.\n- **Missing-file handling:** if any of `crux\u002F.claude-plugin\u002Fplugin.json`, `.claude-plugin\u002Fmarketplace.json`, `crux\u002F.codex-plugin\u002Fplugin.json`, `.agents\u002Fplugins\u002Fmarketplace.json`, or `crux-mods\u002F.claude-plugin\u002Fplugin.json` does not exist **while at least one sibling manifest of the six does exist** (proof this is a plugin-marketplace repo with an incomplete manifest set), emit a single P1 finding with stable id `cleanup-CLN-PJ-2-missing-\u003Cbasename>` proposing recreation per the contract above (each pair's manifests stay version-locked; the marketplace file at the marketplace root, the plugin manifest inside the plugin directory). These files are required for Claude Code \u002F Codex marketplace discovery respectively. If none of the six manifests exist, this is a normal consuming repo — CLN-PJ-2 silently skips per the existence gate.\n\n#### CLN-ADR-1 — RETIRED. Do not reimplement.\n\n`CLN-ADR-1` reported an Accepted ADR, within 30 days of acceptance, whose id appeared in neither `README.md` nor `USER_GUIDE.md`. The id is **retired** and the rule is gone. It enforced a convention this project never kept: a human-facing doc mentions an ADR when the decision surfaces in something a user does, and most decisions surface as a release line in `CHANGELOG.md` instead. The finding count grew from 14 to 32 between 2026-08-17 and 2026-08-31, every one P2, none ever dismissed and none ever acted on — a rule that only ever accumulates is measuring a convention that does not exist.\n\nThe rule read exactly one relation — accepted-ADR id versus two prose files — so no narrowing survives: the writing rules already require an ADR in human-facing prose to be a footnote, not an inline id, which is the opposite of what the rule looked for. Retired outright on 2026-08-31 by the owner. Its standing findings closed with it; `CLN-ADR-2` and `CLN-ADR-4` keep the `adr-review` \u002F `adr-followon` categories alive.\n\nThe id is not reused. This stub exists so a future reader finds the reasoning instead of the gap.\n#### CLN-ADR-2 — Proposed ADRs past their shelf life\n\n- **Reads:** every `docs\u002Fadrs\u002FADR-NNNN-*.md` file, parse frontmatter.\n- **Looks for:** `status: Proposed` with `proposed_date` older than `adr_proposed_stale_days` (default 14).\n- **Stable id:** `cleanup-CLN-ADR-2-ADR-\u003CNNNN>`.\n- **Category:** `adr-review`. **Severity:** P1.\n- **Proposed action:** \"Decide ADR-NNNN: accept (`transition-adr accept ADR-NNNN`), deprecate (abandon), or supersede with a fresh ADR.\"\n\n#### CLN-ADR-4 — Phantom ADR-id references in human-facing docs\n\n- **Reads:** `README.md`, `USER_GUIDE.md`, `AGENTS.md` (repo root). Also enumerate existing ADRs by globbing `docs\u002Fadrs\u002FADR-NNNN-*.md`.\n- **Looks for:** ADR-id pattern `\\bADR-\\d{4}\\b` in prose (NOT inside `[[wiki-links]]` — those are audit-docs's domain). For each match, check whether `docs\u002Fadrs\u002F\u003Cid>-*.md` exists. Missing → finding.\n- **Stable id:** `cleanup-CLN-ADR-4-\u003CADR-id>-in-\u003Cfile-basename>` (one per phantom ref per file).\n- **Category:** `adr-followon`. **Severity:** P2.\n- **Proposed action:** \"`\u003Cfile>` references `\u003CADR-id>` but no such ADR exists. Either fix the typo (likely a single-digit slip from a real neighboring id), correct to a real id, or remove the citation.\"\n\n#### CLN-ADR-3 — RETIRED. Do not reimplement.\n\n`CLN-ADR-3` reported an Accepted ADR whose body prose cited a file path absent from disk. The id is **retired** and the rule is gone. Reading a frozen body against the present tree asks the wrong question: a body past `Proposed` is frozen by contract, so a path it cites records what was true when the decision was made. That is history, not drift.\n\nThe rule read exactly one surface — Accepted ADR bodies — so exempting them retired it outright rather than narrowing it. The standing dismissals it accumulated stay in `docs\u002Fwhats_next.md` as history; they are not migrated and not re-raised. `docs\u002FAGENTS.md` §11.D states the rule this retirement implements, and the pointer-durability postcondition that keeps NEW bodies safe going forward. `CLN-ADR-4` is unaffected: it reports a phantom ADR **id** in human-facing docs, a live surface, not a path inside a frozen body.\n\nThe id is not reused. This stub exists so a future reader finds the reasoning instead of the gap, and so nobody re-adds the rule from the dismissal ledger.\n\n#### CLN-ADR-5 — consider architectural decision migration\n\n- **Reads:** `docs\u002Fadrs\u002Freviews\u002F*.md`, taking the newest valid filename date; skip the derived index and future dates.\n- **Looks for:** no historical review, or a newest review older than `adr_review_due_days` (default 7).\n- **Stable id:** `cleanup-CLN-ADR-5-due`.\n- **Category:** `adr-review`. **Severity:** P2.\n- **Proposed action:** \"Consider a `migrate-adrs` session against current objectives.\"\n- **Actor boundary:** suggest only. This nudge forces no pass, report or measurement, writes no historical report and invokes no migration.\n\n#### CLN-ADR-6 — open promotion requests\n\n- **Reads:** the output of `uv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Fadr-provenance.py\" open --repo-root \u003Crepo-root>`. It lists, per ADR with unpromoted in-run text, the rules the accepting run's written promotion request covers: `guidance` rules, `edited` binding rules and `removed` rules. Exit 0 whether or not any is open.\n- **Looks for:** one `open` entry per ADR.\n- **Stable id:** `cleanup-CLN-ADR-6-ADR-\u003CNNNN>`.\n- **Category:** `adr-followon`. **Severity:** P3.\n- **Proposed action:** \"Review the accepting run's promotion request and reply `promote ADR-NNNN: rules …`, or dismiss this entry to leave the rules as guidance.\"\n- **Actor boundary:** proposes only. A \"leave\" answer closes through the existing `dismissed:` frontmatter mechanism. The rule never refuses, blocks or promotes anything. Promotion applies only to a historical run's guidance and is the owner's own instruction. An ADR accepted under the configured acceptance policy needs no promotion.[^promotion]\n\n#### CLN-OBJ-1 — the objectives file is unpopulated\n\n- **Reads:** `docs\u002Fobjectives.md` frontmatter.\n- **Looks for:** the file is missing, or its frontmatter says `maturity: placeholder`. Any other `maturity` value is silent here — the `audit-docs` CHK-OBJ rules own the file's shape and its review age.\n- **Stable id:** `cleanup-CLN-OBJ-1-objectives` (singleton — one file, one finding).\n- **Category:** `objectives`. **Severity:** P2.\n- **Proposed action:** \"Populate `docs\u002Fobjectives.md` per `docs\u002FAGENTS.md` §5.B, then set `maturity`.\" With no file on disk, name the gap the same way; `init-docs` seeds the placeholder.\n- **Actor boundary:** proposes only. This rule is the objectives nudge that `docs\u002FAGENTS.md` §5.B names under its populate gate. It never seeds, edits, or bumps the file, because humans own its content.\n\n#### CLN-PB-1 — promptbooks with stale run-snapshot mtime\n\n- **Reads:** every promptbook in `docs\u002Fpromptbooks\u002Factive\u002F` (glob **both** `PB-NNNN-*.yaml` and `PB-NNNN-*.md` — format coexistence), look up its `current_run` snapshot's file mtime AND parse out the latest per-prompt completed\u002Fstarted timestamp from the snapshot — the structured `prompts[].completed`\u002F`started` fields on a `.yaml` run, or the `Completed:` \u002F `Started:` block fields on a `.md` run.\n- **Looks for:** **latest in-body timestamp** older than `${TODAY} - stuck_promptbook_days` (default 14) AND `current_prompt` is non-null. Use the in-body timestamp rather than filesystem mtime — filesystem mtime is reset by `git checkout` \u002F fresh clones, which would false-negative on a stuck book in a fresh tree. In-body timestamps are part of the immutable run snapshot.\n- **Exemption — self-stuck guard:** If cleanup is being invoked as part of an active cycle run (i.e., the current cleanup invocation's session has the book id in its parent context), the book is exempt from CLN-PB-1. Without conversation context, fall back to: if the book's latest in-body timestamp is within the past `stuck_promptbook_days\u002F2` (default 7 days), assume the book is actively progressing and exempt. This prevents long single-phase cycles (e.g., a 21-day council deliberation) from tripping themselves.\n- **Stable id:** `cleanup-CLN-PB-1-\u003Cbook-id>`.\n- **Category:** `promptbook-hygiene`. **Severity:** P1.\n- **Proposed action:** For a YAML run, resume with `run-promptbook`, truthfully mark the current prompt blocked\u002Fskipped, or deliberately abandon the YAML run and author a successor. For a Markdown run, use pinned public `v3.23.2` only if the remaining prompts can truthfully finish, then archive and convert book before run. If it cannot finish, preserve its bytes as readable, unresolved history and start separate YAML work; neither version has a verified deliberate Markdown-abandon route.\n\n#### CLN-PB-2 — promptbooks with escalation text and no journal follow-up\n\n- **Reads:** every active promptbook (glob **both** `PB-NNNN-*.yaml` and `PB-NNNN-*.md` — format coexistence); for its `current_run` snapshot, read the notes + per-prompt result text — the `notes`\u002F`prompts[].result` fields on a `.yaml` run, or the `## Notes` \u002F per-prompt `Result:` fields on a `.md` run. `current_run` survives to archival on both the completed and the abandoned path, so this snapshot is reachable for every book pending archival, not only in-progress ones. Also read `docs\u002Fjournal\u002FYYYY-MM.md` files within the last 30 days.\n- **Looks for:** matches of regex `\u002FSTOP and escalate|3-round|3 full loops\u002F` in run snapshot text. For each match, check whether any journal entry in the last 30 days contains the book id. If no follow-up, finding.\n- **Stable id:** `cleanup-CLN-PB-2-\u003Cbook-id>`.\n- **Category:** `promptbook-hygiene`. **Severity:** P1.\n- **Proposed action:** Journal the escalation and its resolution. A YAML run may then resume or be deliberately abandoned. A Markdown run may finish truthfully through pinned public `v3.23.2`; if it cannot, preserve it unresolved and begin separate YAML work. Do not promise Markdown abandonment.\n\n#### CLN-PB-3 — RETIRED. Do not reimplement.\n\n`CLN-PB-3` reported an active promptbook whose run was archive-eligible. The id is **retired** and the rule is gone: the approved retirement map retires it, and the cycle record that replaces the promptbook archive closes itself. The historical runs still active keep `CLN-PB-1`, `CLN-PB-2` and `CLN-PB-4`.\n\nThe id is not reused. This stub exists so a future reader finds the reasoning instead of the gap, and so nobody re-adds the rule from the dismissal ledger.\n\n#### CLN-PB-4 — duplicate `### Prompt N` headings in run snapshots\n\n- **Reads:** every run snapshot under `docs\u002Fpromptbooks\u002Fruns\u002F\u003Cbook>\u002F` — glob **both** `run-*.yaml` and `run-*.md` (format coexistence), across both active and archived books.\n- **Looks for:** the duplicate-prompt drift. On a **`.md` run** this is duplicate `### Prompt N` headings within a single snapshot file — extract every `^### Prompt (\\d+) —` heading; group by N; flag any N appearing more than once. A **`.yaml` run** has a structured `prompts[]` array with no headings, so the heading-duplicate failure mode cannot occur (the `n == index+1` contiguity \u002F duplicate-`n` invariant is enforced by `validate-promptbook.py`'s post-schema pass and surfaced by audit-docs CHK-PB-SCHEMA, not here); for a `.yaml` snapshot this rule is a no-op.\n- **Why this happens in practice:** `run-promptbook` advances should *edit in place* — but a runner that *appends* a new block instead of editing the existing pending one leaves both behind. The bug only manifests at archive-precondition time (when terminal-state counting double-counts the prompt), but the underlying drift is detectable earlier from this rule.\n- **Stable id:** `cleanup-CLN-PB-4-\u003Cbook-id>-\u003Crun-id>` (one finding per snapshot file, not per duplicate — the fix is to dedupe the whole file).\n- **Category:** `promptbook-hygiene`. **Severity:** P2 (degrades archival; doesn't block other operations).\n- **Proposed action:** Edit the run snapshot to remove duplicates. Convention: keep the block with the most-complete State (`done` > `running` > `pending`); if multiple are non-`pending`, keep the most-recent (latest `Completed:` or `Started:` timestamp).\n\n#### CLN-JR-1 — RETIRED. Do not reimplement.\n\n`CLN-JR-1` reported a recent `adr`, `promptbook` or `schema` log operation with no journal entry that references its artifact. The id is **retired** and the rule is gone: the approved retirement map retires it. `check-journal-reference.py` has no reader left outside its own tests and the plugin manifest; it stays shipped as a standalone command until a change retires it.\n\nThe id is not reused. This stub exists so a future reader finds the reasoning instead of the gap, and so nobody re-adds the rule from the dismissal ledger.\n\n#### CLN-JR-2 — thin months\n\n- **Reads:** `docs\u002Fjournal\u002Findex.md` (entry counts) AND the operations log (op count per closed month): the entries of every detail file under `docs\u002Flog\u002F`, counted by heading month, or the per-month counts that `docs\u002Flog\u002Fsummary.md` records for a settled month. `journal\u002Findex.md` is derived — read it as-is; do not recompute the counts yourself. `generate-journal-index.py` regenerates it.\n- **Looks for:** closed months (i.e., month earlier than `${TODAY}.month`) where `journal entries \u003C 2` AND `log ops >= 10`. Closed-month means the calendar month is in the past — never flag the current month.\n- **Stable id:** `cleanup-CLN-JR-2-\u003CYYYY-MM>`.\n- **Category:** `journal-gap`. **Severity:** P3.\n- **Proposed action:** \"Write a retrospective journal entry for \u003CYYYY-MM> covering the \u003CN> ops shipped that month. Cleanup will not auto-draft — reflection is non-auto-generatable per the v0.2.0 log-work contract.\"\n\n#### CLN-WN-1 — stale whats_next.md entries\n\n- **Reads:** the PRIOR `docs\u002Fwhats_next.md` body's open-suggestion ids (collected in step 2 as `prior_open_ids`); the current state of the artifacts cited by those entries.\n- **Looks for:** prior entries whose underlying condition no longer reproduces (e.g., the cited ADR transitioned, the cited promptbook archived). These become \"Recently closed\" entries in the new body — NOT new findings.\n\n  Additionally: dismissed ids in the `dismissed:` frontmatter list that haven't matched any current finding for `>= 30` consecutive days of cleanup runs. To track this, cleanup keeps a `dismissed_last_seen:` counter per dismissal — incremented every run; reset to 0 when the underlying condition recurs. Counter reaches 30 → P3 housekeeping suggestion to prune the dismissal.\n\n  **Exception — a dismissal keyed to a RETIRED rule id is never a prune candidate.** Its counter still climbs (the condition can never recur, because the rule that produced it is gone), so without this exception every such dismissal would eventually emit a P3 telling the user to delete a record that is deliberately being kept. Retired ids are enumerated in the rule inventory at the top of this skill; a dismissal whose `\u003Crule-id>` segment names one is skipped by this check entirely — no counter-driven finding, ever. This is distinct from a RENAMED rule, whose condition does recur under the new id and whose old dismissal is genuinely dead weight that should age out.\n- **Stable id (stale-dismissal case):** `cleanup-CLN-WN-1-stale-dismissal-\u003Coriginal-id>`.\n- **Category:** `whats-next-stale`. **Severity:** P3.\n- **Proposed action:** \"Remove dismissal `\u003Cid>` from `docs\u002Fwhats_next.md` frontmatter — the condition hasn't recurred in 30 runs.\"\n\n#### CLN-FG-1 — forged-skill staleness\n\n- **Reads:** `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md` and `${CRUX_LOCAL_SKILLS_DIR}\u002F*\u002FSKILL.md` (the forged-skill tree).\n- **Existence gate:** if neither `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md` nor any `${CRUX_LOCAL_SKILLS_DIR}\u002F*\u002FSKILL.md` file exists, this rule **silently skips** — the project has no forged skills, which is normal.\n- **Scope:** applies ONLY to forged skills — skill directories that have at least one `authored` entry in `forge-log.md`. A `${CRUX_LOCAL_SKILLS_DIR}\u002F\u003Cname>\u002F` directory with no `authored` entry in the forge log was not created by forge-skill (hand-authored or installed by another mechanism) and is explicitly OUT of scope: never flagged by this rule, never proposed for pruning.\n- **Looks for:** for each in-scope skill directory, find the newest entry in `forge-log.md` across ALL event types (`authored|revised|used|evaluated`) for that skill name by **parsed timestamp** (the `## [YYYY-MM-DD HH:MM]` prefix). Compare timestamps, never file positions — the comparison spans multiple event types whose entries interleave, so position is meaningless. If that newest timestamp is older than `${TODAY} - forged_skill_stale_days` (manifest `cleanup:` key, default 30), fire a finding. `revised`, `used`, and `evaluated` events all reset the clock — a skill used, evaluated, or revised within the window is not stale even if its `authored` entry is old. An unparseable timestamp or malformed header (not matching `## [YYYY-MM-DD HH:MM] \u003Cevent> | \u003Cskill-name>`) is itself a finding — surface it as part of this rule's output (fail-loud), never a silently-skipped entry.\n- **Stable id:** `cleanup-CLN-FG-1-\u003Cskill-name>` (one per stale forged skill; `skill-name` is the directory name under `${CRUX_LOCAL_SKILLS_DIR}\u002F`).\n- **Category:** `forge-hygiene`. **Severity:** P3.\n- **Proposed action:** \"Forged skill `\u003Cskill-name>` has no `authored|revised|used|evaluated` event within the last `\u003CN>` days (newest event: \u003Cdate>). Either prune it via `forge-skill` (which records the `pruned` event and a `skill | pruned` op in the operations log) or add a note in the forge log explaining why it stays.\"\n- **Actor boundary:** `cleanup-campsite` only *proposes* this finding. It never deletes a skill file, never writes `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md`, and never writes a `skill` op to the operations log. The prune itself — on user approval or autonomously when gates permit — is performed through `forge-skill`, which is the sole authorized writer of the forge log and of `skill` ops.\n\n#### CLN-FG-2 — used-but-never-evaluated\n\n- **Reads:** `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md` and `${CRUX_LOCAL_SKILLS_DIR}\u002F*\u002FSKILL.md` (the forged-skill tree).\n- **Existence gate:** reuses CLN-FG-1's authored-entry gate — applies only to forged skills (those with at least one `authored` entry in `forge-log.md`). If neither `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md` nor any `${CRUX_LOCAL_SKILLS_DIR}\u002F*\u002FSKILL.md` file exists, this rule **silently skips**.\n- **Scope:** applies ONLY to forged skills — skill directories that have at least one `authored` entry in `forge-log.md`. A `${CRUX_LOCAL_SKILLS_DIR}\u002F\u003Cname>\u002F` directory with no `authored` entry in the forge log was not created by forge-skill and is explicitly OUT of scope.\n- **Looks for:** for each in-scope skill directory, fire a finding when ALL THREE of the following hold: (1) the skill has ≥1 `used` entry in `forge-log.md`; (2) the skill has NO `evaluated` entry timestamped at-or-after the newest `used` timestamp; (3) the newest `used` timestamp is older than `${TODAY} - forged_skill_stale_days` (manifest `cleanup:` key, default 30). A `revised` entry does NOT void a pending evaluation obligation — the use still happened and must be evaluated at the next use.\n- **Worked example:** skill used June 1, never evaluated → CLN-FG-2 fires July 1 → if a July session uses the skill, it evaluates then; if nothing uses it again, CLN-FG-1's staleness lane eventually proposes prune-or-justify and the evaluation question dies with the skill.\n- **Stable id:** `cleanup-CLN-FG-2-\u003Cskill-name>` (one per affected forged skill; `skill-name` is the directory name under `${CRUX_LOCAL_SKILLS_DIR}\u002F`).\n- **Category:** `forge-hygiene`. **Severity:** P3.\n- **Proposed action:** \"Forged skill `\u003Cskill-name>` was used on \u003Cdate> but never evaluated. Evaluate it on next use — the next session that actually uses the skill writes one `evaluated` forge-log entry (verdict: effective | fell-short | mixed) before ending. A session WITHOUT the use context MUST NOT retroactively fabricate an evaluation. If no use recurs within the staleness window, CLN-FG-1's prune-or-justify lane applies.\"\n- **Actor boundary:** `cleanup-campsite` only *proposes* this finding. It never writes `${CRUX_LOCAL_SKILLS_DIR}\u002Fforge-log.md`. The evaluation itself is written by forge-skill's Recording Rules in the session that uses the skill.\n\n#### CLN-RETRO-1 — retrospective cadence\n\n- **Reads:** `docs\u002Fcycles\u002FCYC-*\u002Fcycle.json` and `docs\u002Fjournal\u002F*.md`. The anchor search also reads the operations log (every detail file under `docs\u002Flog\u002F`), for the corroboration guard in the Note below.\n- **Predicate:** count the cycle records whose `status` is `completed`, `abandoned` or `shortcut` and whose closing history event is dated STRICTLY AFTER the newest `docs\u002Fjournal\u002F*.md` heading matching the regex `^## \\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}\\] learning \\| Retrospective: `. The closing history event is the closing status event: the first `history` entry whose `status` field equals the record's closed status, because a later entry, such as a late `assignment --state finished`, can follow closure. An older record whose entries carry no `status` field uses the last `history` entry. The event's `at` field gives the date. Fires at P3 when that count ≥ `retro_due_runs` (manifest `cleanup:` key, default 5; the key name is kept). Terminology: **cycles closed** (the count is per cycle record; a cycle that closes on the day of the retrospective is not counted — date granularity; acceptable for a P3 nudge). A cycle that is active or paused is not counted.\n- **First-run behavior:** if no heading matching `^## \\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}\\] learning \\| Retrospective: ` appears anywhere in `docs\u002Fjournal\u002F*.md`, count ALL closed cycle records and fire the finding with explicit \"no retrospective has ever run\" wording — the adoption nudge is the point.\n- **Stable id:** `cleanup-CLN-RETRO-1-due` (singleton — the finding represents the cadence state as a whole, not a per-cycle artifact).\n- **Category:** `retro-cadence`. **Severity:** P3.\n- **Proposed action:** \"Run a retrospective — the `retrospective` skill mines recent journal reflections, cycle records, and log ops; harvests ≤2 council-gated skill proposals.\"\n- **Note:** This rule tracks cadence for the `retrospective` skill (scheduled, deliberate reflection that may yield ≤2 skill proposals per run). It is NOT a journal-entry-quality check — the journal-gap rule `CLN-JR-2` owns that concern; the word \"retrospective\" appearing there refers to a reflective journal *entry style*, not to the `retrospective` skill's cadence. The anchor search applies the same validity guards as Phase 1 of the `retrospective` skill: future-dated candidates and candidates with no same-day `journal | Retrospective:`-prefixed op in any operations-log detail file under `docs\u002Flog\u002F` are ignored.\n\n#### CLN-TMPL-1 — dogfood↔template clause parity\n\n- **Reads:** `crux\u002Fscripts\u002Ftemplate_parity_manifest.json` and, per manifest entry, the declared canonical file (e.g. `docs\u002FAGENTS.md`) plus the declared twin template file (e.g. `crux\u002Ftemplates\u002FAGENTS.md.tmpl`). Invokes the shared checker `crux\u002Fscripts\u002Fcheck_template_parity.py`, which carries forward the fence-aware section extractor from the forged-skill predecessor.\n- **Existence gate \u002F self-detection (per manifest entry):** the trigger predicate is the existence of the manifest entry's OWN declared twin template path — NOT a coarse glob. An entry whose declared twin template is absent (e.g., every downstream install that received the rendered `docs\u002FAGENTS.md` but not `crux\u002Ftemplates\u002FAGENTS.md.tmpl`) is **skipped entirely** — neither the parity check nor the stale-manifest guard runs for that entry. Therefore with no templates present the rule is a guaranteed clean **no-op (0 findings)** — inert, not dead code. The stale-manifest guard (which keys on the canonical file) is also gated behind twin-presence: guard evaluation runs ONLY in a tree where the twin exists, so it cannot fire downstream and cannot undermine the 0-finding-downstream promise. `cleanup-campsite --only CLN-TMPL-1` on a tree with no twin templates is a clean no-op, not an error.\n- **Looks for (two sub-checks per manifest entry whose twin is present):**\n  - **(drift)** A designated clause that drifted between the canonical file and the twin template — the checker reads the clause live from the canonical via anchor + pattern, then asserts the same text in the twin. Drifted clause → finding.\n  - **(stale anchor\u002Fpattern)** A manifest entry's anchor or pattern no longer resolves in its canonical file (twin present). Stale entry → **P3 finding, emitted INSTEAD OF a vacuous clean result** — a stale entry reads \"needs attention\", never \"in parity\". The stale guard exists because a non-resolving anchor would otherwise make the rule pass vacuously, which is exactly the silent-failure mode the rule exists to prevent.\n- **Stable id:**\n  - Drift: `cleanup-CLN-TMPL-1-\u003Cclause-id>` (one per drifted clause; `clause-id` is the entry's id from the manifest).\n  - Stale anchor\u002Fpattern: `cleanup-CLN-TMPL-1-stale-\u003Cclause-id>`.\n  (Both conform to the `cleanup-\u003Crule-id>-\u003Cartifact-slug>` shape.)\n- **Category:** `template-parity`.\n- **Severity:** drift → **P2** (a drifted clause in a shipped template reaches every install — more than visibility-only); stale anchor\u002Fpattern → **P3** (maintenance signal about the checker, not evidence of shipped-template drift).\n- **Proposed action:**\n  - Drift: \"Sync the `\u003Cclause-id>` clause in `crux\u002Ftemplates\u002FAGENTS.md.tmpl` to match `docs\u002FAGENTS.md` (the canonical surface).\"\n  - Stale: \"Manifest entry `\u003Cclause-id>` anchor\u002Fpattern no longer resolves in `\u003Ccanonical-file>`; update `crux\u002Fscripts\u002Ftemplate_parity_manifest.json` to reflect the current anchor\u002Fpattern.\"\n- **Actor boundary:** proposes only; never edits `docs\u002FAGENTS.md`, `crux\u002Ftemplates\u002FAGENTS.md.tmpl`, or `crux\u002Fscripts\u002Ftemplate_parity_manifest.json`. The fix is a human\u002FClaude-under-direction edit. This honors the `audit-docs` \u002F `cleanup-campsite` boundary (template drift is process-state, not graph integrity).\n- **On-demand fast-path:** `cleanup-campsite --only CLN-TMPL-1` — runs only this rule, scopes `docs\u002Fwhats_next.md` output to its findings, emits the normal `cleanup-campsite` log op. Use immediately after editing `docs\u002FAGENTS.md` to confirm no parity regression before committing.\n\n#### CLN-XR-1 — RESERVED for v0.2\n\nCross-ADR Decision-section contradictions. Not implemented in v0.1 — deliberately deferred: cross-document semantic comparison is too fuzzy for a deterministic scan rule. The id is reserved so future cleanup versions don't reuse it.\n\n#### Known limitations of v0.1\n\nThese code paths are not exercised by the smoke test and should be exercised in a follow-up run before relying on them:\n\n- **Dismissal lifecycle** — the v0.1 smoke run produced `dismissed: []`, so the round-trip (`dismissed_last_seen` increment, reset on recurrence, 30-run housekeeping P3 emission) is **untested**. A future run that hand-edits a finding into `dismissed:` and re-invokes cleanup is the smallest test that exercises the path.\n- **\"Recently closed\" derivation** — first-run-on-this-repo means `prior_open_ids` was empty; the diff calculation didn't execute. A second run after closing any finding will exercise it.\n- **Rename semantics** — if a scan rule is renamed in a future cleanup version, old `dismissed:` entries keyed to the previous id stay as no-ops AND the underlying condition (if still present) emits a fresh undismissed id. The user re-confirms or re-dismisses; the stale dismissal ages out via the 30-run housekeeping path. This is correct behavior but until v0.2 introduces a rule rename, it's a theoretical invariant.\n\n#### CLN-AUD-1 — audit-recency\n\n- **Reads:** the operations log: every detail file under `docs\u002Flog\u002F`.\n- **Looks for:** the `## [YYYY-MM-DD] audit |` entry with the latest heading date in any detail file. Heading dates are not ordered within a file, so compare dates rather than taking the first match. If its date is older than `${TODAY} - audit_stale_days` (default 14), emit a P1 finding.\n- **Stable id:** `cleanup-CLN-AUD-1-recency` (conforms to the standard `cleanup-\u003Crule-id>-\u003Cartifact-slug>` shape).\n- **Category:** `whats-next-stale`. **Severity:** P1.\n- **Proposed action:** \"Run `audit-docs` — last audit was \u003CN> days ago.\"\n- **Note:** this rule never *invokes* `audit-docs` (different cadence — see the boundary table); it only checks the log for recency and proposes the run.\n\n### 4. Sort, cap, build the body\n\n- Collect all findings from step 3 (after dismissal filtering).\n- Sort by severity DESC (P1 first), then by stable `id` ASC for determinism.\n- **Caps:** at most 5 P1 findings, at most 10 P2 findings, P3 uncapped. When a cap is exceeded, surplus findings go under a `## Truncated (M not shown)` section listing only their ids.\n- **Stale-dismissal housekeeping entries** (CLN-WN-1) are always emitted as P3 regardless of cap pressure; within P3 they sort LAST (after fresh P3 findings).\n\n### 5. Compute \"Recently closed\"\n\n`recently_closed = prior_open_ids - current_open_ids`. Cap at 10 entries (older closures live in the operations log). Format as strikethrough lines:\n\n```markdown\n- ~~\u003Cid>~~ — addressed \u003CYYYY-MM-DD> (condition no longer reproduces).\n```\n\n### 6. Write `docs\u002Fwhats_next.md`\n\nOverwrite the body. Preserve the `dismissed:` frontmatter list verbatim (it's persistent state). Increment `dismissed_last_seen:` for each dismissal whose id didn't match a current finding; reset to 0 for any dismissal whose id DID match (i.e., the condition recurred and was suppressed).\n\nFrontmatter shape:\n\n```yaml\n---\ngenerated_at: ${NOW}\ngenerator: cleanup\ngenerator_version: \"\u003Cthe installed plugin version, read from plugin.json — never a hardcoded number>\"\nscan_findings: \u003Cint>\nsuggestions_open: \u003Cint>\nsuggestions_dismissed_carried: \u003Cint>\ndismissed:\n  - id: \u003Cstable id>\n    dismissed_at: \u003CYYYY-MM-DD>\n    reason: \"\u003Cone line>\"\n    dismissed_last_seen: \u003Cint>   # 0 if condition recurred this run; else prior + 1. At >= 30, cleanup emits a P3 prune suggestion via CLN-WN-1.\n---\n```\n\nBody shape:\n\n```markdown\n# What's next\n\n_Generated \u003CYYYY-MM-DD HH:MM> by `cleanup-campsite` v\u003Cthe installed plugin version>. **Body regenerated end-to-end on every run; only the `dismissed:` frontmatter list persists.** Hand-edits below the frontmatter are blown away. To dismiss a suggestion, move its `id:` into the `dismissed:` frontmatter list with a `reason:`._\n\n## Open suggestions (N)\n\n### 1. [P1] \u003Csubject>\n- **id:** `\u003Cstable-id>`\n- **category:** \u003Cenum>\n- **severity:** P1 | P2 | P3\n- **finding:** \u003C1-2 lines>\n- **source:** scan rule `CLN-XX-N` against `\u003Cinspected paths>`\n- **proposed action:** \u003Cwhat to do; may name a skill>\n- **refs:** [[wiki-link]] ...\n\n### 2. ...\n\n## Truncated (M not shown)\n- `\u003Cid1>`, `\u003Cid2>`, ...\n\n## Recently closed (since last run)\n- ~~`\u003Cid>`~~ — addressed \u003CYYYY-MM-DD> (condition no longer reproduces).\n```\n\n### 7. Update `docs\u002Findex.md`\n\nIf `suggestions_open > 0` AND `docs\u002Findex.md` does NOT already have a `## What's next (N)` section, insert it as the first concern-rollup, between the file header and `## Research`. Content:\n\n```markdown\n## What's next (N)\n\n_N open suggestions (P1: X, P2: Y, P3: Z) — see [[whats_next]]._\n```\n\nIf the section exists, update N and the breakdown. If `suggestions_open == 0`, remove the section.\n\nUpdate `_Last updated:_` to `${TODAY}`.\n\n### 8. Record the `cleanup-campsite` operation\n\nWrite the entry through the log writer, as `docs\u002FAGENTS.md` §6 states. Write this body to a file outside the tree, adding one line for a repair or catch-up that `CLN-LOG-1` completed:\n\n```markdown\nTop-3 P1 ids: `\u003Cid1>`, `\u003Cid2>`, `\u003Cid3>`. See [[whats_next]].\n```\n\nThen run:\n\n```\nuv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Foperation-log.py\" append --repo-root \u003Crepo-root> \\\n  --op cleanup-campsite --subject 'N open (X P1, Y P2, Z P3), M closed, K dismissed' \\\n  --date ${TODAY} --body-file \u003Cpath>\n```\n\nThe entry it writes at the top of the current month's detail file:\n\n```markdown\n## [${TODAY}] cleanup-campsite | N open (X P1, Y P2, Z P3), M closed, K dismissed\n\nTop-3 P1 ids: `\u003Cid1>`, `\u003Cid2>`, `\u003Cid3>`. See [[whats_next]].\n```\n\nIf N is zero on all counts, still write the entry (auditable record that cleanup ran). A refused append keeps cleanup's other writes; fix the cause it names and rerun the append alone (§6). Then run the commit step of §6 over this result's `commit_paths` and `restore_paths`, adding `docs\u002Flog\u002Fsummary.md` when the `CLN-LOG-1` catch-up wrote it.\n\n### 9. Console summary\n\nPrint to the user:\n\n```\nCleanup complete: N open suggestions (P1: X, P2: Y, P3: Z), M closed, K dismissed.\nSee docs\u002Fwhats_next.md for details.\n```\n\nPlus the top-3 P1 subjects if any exist, so the user sees the actionable items immediately.\n\n## Verification checklist\n\n- [ ] `docs\u002Fwhats_next.md` exists.\n- [ ] Frontmatter parses as valid YAML.\n- [ ] `generated_at` is the current UTC timestamp.\n- [ ] `generator_version` matches the installed plugin version (from `plugin.json`).\n- [ ] `dismissed:` list is preserved verbatim from the prior file (each entry's `dismissed_last_seen` is incremented or reset per step 6).\n- [ ] Every body suggestion has all six required fields: `id`, `category`, `severity`, `finding`, `source`, `proposed action`. `refs` may be absent if no refs exist.\n- [ ] Severity caps respected: ≤ 5 P1, ≤ 10 P2 (excess in `## Truncated`).\n- [ ] Stale-dismissal entries sort after fresh P3 findings.\n- [ ] The current month's detail file `docs\u002Flog\u002FYYYY-MM.md` has a new `## [${TODAY}] cleanup-campsite |` entry at the top, and no `docs\u002Flog.md` was written.\n- [ ] `CLN-LOG-1` ran `operation-log.py repair` and the summary gate; any refusal is a P1 finding, and `generate-log-summary.py --dry-run` lists no pending month after a catch-up.\n- [ ] `docs\u002Findex.md` has a `## What's next (N)` section iff `N > 0`; section content is consistent with the body.\n- [ ] No edits to README, USER_GUIDE, CHANGELOG, ADR bodies, journal entries, or promptbook files.\n- [ ] `manifest.yml` counters unchanged.\n\n## Red flags — STOP and reconsider\n\n- **About to edit a prose surface directly** (README, USER_GUIDE, ADR body, journal entry, promptbook plan). Refuse. Cleanup proposes via `whats_next.md`; humans (or Claude under direct instruction) execute.\n- **About to write `docs\u002Fwhats_next.md` without preserving the `dismissed:` frontmatter list.** That's the only state that survives across runs; clobbering it silently breaks the dismissal contract.\n- **About to invoke `audit-docs` from cleanup.** Two skills, two cadences. Cleanup CHECKS whether audit ran recently; it does NOT run it.\n- **About to fail a scan rule silently** because the input file is missing. Each rule's `Reads:` section enumerates expected inputs; a missing input is a finding (`docs\u002Fwhats_next.md` would surface \"missing expected file \u003Cpath>\"), not a swallowed error.\n- **About to surface a finding for a dismissed id without re-checking the dismissal.** Dismissals suppress unconditionally; the `dismissed_last_seen` counter tracks staleness but does not gate suppression.\n- **About to invent a stable id format that doesn't follow `cleanup-\u003Crule-id>-\u003Cartifact-slug>`.** Determinism depends on every rule emitting ids in the documented shape.\n- **About to write a finding without a `proposed action`.** Cleanup's contract is *forward-looking* — every finding names what to do, even if \"ignore\" is the action.\n- **About to skip the operations-log entry on a zero-findings run.** The log is the audit trail of \"cleanup ran on this date\"; write the entry even if N=0.\n- **About to suggest invocation of a skill that doesn't exist.** Each `proposed action` that names a skill MUST reference an existing one (`archive-promptbook`, `transition-adr`, `log-work`, `audit-docs`, `run-promptbook`, `forge-skill`, `retrospective`).\n\n## Rationalization table and common mistakes\n\nThe Red flags list above is the primary stop-list. For the fuller\nexcuse→reality mapping and the recurring-mistake catalog, read\n[`references\u002Fpitfalls.md`](references\u002Fpitfalls.md).\n## See also\n\n- `docs\u002FAGENTS.md` §5.A (the whats_next.md schema) and §11 (the audit-docs boundary); the scan-rule roster is in this file's Overview (20 implemented + 4 retired + 1 reserved, for 25 ids).\n- `audit-docs\u002FSKILL.md` — the boundary partner. Cleanup CHECKS whether audit ran recently; it does NOT invoke it.\n- `log-work\u002FSKILL.md` (v0.2.0) — establishes the journal-as-reflection contract that cleanup honors (`CLN-JR-2` surfaces thin months as suggestions; never auto-drafts the entry itself).\n- `transition-adr\u002FSKILL.md` — what users invoke after a CLN-ADR-2 finding (accept \u002F deprecate \u002F supersede).\n- `run-promptbook\u002FSKILL.md` — what users invoke after a CLN-PB-1 or CLN-PB-2 finding.\n- `query-docs\u002FSKILL.md` — cleanup does NOT invoke this; orthogonal capability.\n- `retrospective\u002FSKILL.md` — the skill CLN-RETRO-1 nudges the user to invoke; deliberate reflection that harvests ≤2 skill proposals from finished work.\n\n[^promotion]: rule:acceptance-makes-rules-binding, rule:historical-records-keep-their-interpretation\n[^log-repair]: rule:cleanup-campsite-runs-the-first-split, rule:cleanup-campsite-merges-a-stray-log\n[^log-catch-up]: rule:cleanup-campsite-runs-the-log-summary-catch-up, rule:catch-up-writes-every-pending-month, rule:no-section-before-its-month-settles\n[^log-finding]: rule:refused-log-repair-is-a-cleanup-finding\n",{"name":5,"metadata":24,"description":7},{"tags":25,"bundles":26,"triggers":27,"risk_level":28,"routing_note":29,"requires_access":30},"cleanup, hygiene, whats-next, scan, forward-looking","crux-docs","cleanup | hygiene check | what's next | clean up the docs | refresh whats_next","low","Forward-looking process-state scan; regenerates `docs\u002Fwhats_next.md`. Distinct from `audit-docs` — proposes actions, never edits prose.","write-tree","main","dd4f16e7ac12ff940790660ec897677284ae4b6d","crux\u002Fskills\u002Fcleanup-campsite","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux","https:\u002F\u002Fbionic-coding.com\u002Fcrux\u002F","https:\u002F\u002Fgithub.com\u002Fbionic-coding","https:\u002F\u002Fbionic-coding.com","Durable intent, disposable code.","2026-11-12 09:36:33",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add bionic-coding\u002Fcrux --skill cleanup-campsite",{"tool":46,"command":47},"bunx","bunx skills add bionic-coding\u002Fcrux --skill cleanup-campsite",{"tool":49,"command":50},"pnpm","pnpm dlx skills add bionic-coding\u002Fcrux --skill cleanup-campsite","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Fcleanup-campsite\u002FSKILL.md",true,[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fpitfalls.md","REFERENCE","参考文档",3628,"https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Fcleanup-campsite\u002Freferences\u002Fpitfalls.md",[61,68,75,82,89,96],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7CA5PH4JT2V5WBTA5ZPJNS8","whiteboarding","Explore an idea through docs-informed dialogue before committing to a design. Capture the exploration for later filing as a brief.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Fwhiteboarding\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7CA5GZPSVNJJZYQMF0JT3EH","verify-code-docs","Check generated code documentation against source and report drift without regenerating it.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Fverify-code-docs\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7CA5A4HA73VF91N8VY6SDBN","transition-observation","Apply a human disposition to an observation's lifecycle state without changing its claim or body.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-observation\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7CA53X1ESGWKTPCEQ55JWEZ","transition-invariant","Ratify, reject, or retire an invariant on human direction. Update lifecycle metadata without changing the invariant's body.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-invariant\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7CA4Y2VC25NFZE0XJZ47VSX","transition-decision","Apply a human ratify, reject, or defer verdict to a recovered decision candidate; ratification creates a Proposed ADR or observation.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-decision\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7CA4QD9RFDC379VD9DNK90D","transition-brief","Publish or abandon a draft brief, updating lifecycle metadata and indexes without changing its body.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-brief\u002FSKILL.md",[],[]]