{"id":22050,"plugin_id":"plugins_6aaff56b7f048191894b661584c8e86d","kind":"skill","collection_source":null,"comparison_source":null,"observed_at":"2026-09-30T23:17:07.860Z","digest":"043493df9dc2a578528682708303ca02bcff0ede4ff61ecae84c0e9297ebed32","against":null,"payload":{"description":"Use for the receiving project's KB linting, stale-content review, context refresh, lifecycle hygiene, contradiction/duplication audits, archival, and safe cleanup.","included_files":[{"relative_path":"agents/openai.yaml","size_in_bytes":233},{"relative_path":"references/linting.md","size_in_bytes":5865},{"relative_path":"requirements.txt","size_in_bytes":38},{"relative_path":"scripts/kb_lint.py","size_in_bytes":16066}],"name":"kb-maintenance","skill_md_contents":"---\nname: kb-maintenance\ndescription: Use for the receiving project's KB linting, stale-content review, context refresh, lifecycle hygiene, contradiction/duplication audits, archival, and safe cleanup.\n---\n\n# KB Maintenance Skill\n\nApply the [receiving-project contract](../../references/project-context.md) for project paths, authority, companion skills, and the lint script's supported layout.\n\n## Goal\nKeep the active knowledge surface small, current, coherent, and cheap for agents to load while preserving historical rationale outside the default retrieval path.\n\n## Trigger\nUse for periodic maintenance, milestone-exit hygiene, stale-context review, archive/supersede work, decision cleanup, or KB quality audits. Also run after major migrations, balance phase exits, architecture changes, large decision growth, or long multi-session work series.\n\n## Maintenance modes\n### Light hygiene\nRun frequently or at major task boundaries:\n- broken links\n- missing/invalid metadata\n- duplicate IDs\n- stale active Work state\n- expired `review_after`\n- active indexes pointing to superseded/archived owners\n- missing replacement links\n- obvious orphan context/index files\n\n### Deep hygiene\nRun at milestones or periodically:\n- semantic contradictions\n- duplicated canonical concepts\n- long-lived temporary decisions\n- stale `_Context.md` versus canonical docs\n- completed work still in active paths\n- obsolete migration/audit artifacts\n- Source-of-Truth ownership drift\n- oversized operational monoliths that should be indexed/split\n\n## Hot/Warm/Cold policy\nMaintenance protects progressive disclosure:\n- Hot = root agent guide, project state, relevant domain context.\n- Warm = triggered skills, active canonical docs, active decisions/work.\n- Cold = legacy/superseded/history/research/archive.\n\nSuperseded or archived material must not leak into Hot/active indexes unless explicitly referenced for history.\n\n## Action policy\n- **Retain:** historically valuable decisions, major audits, final validations.\n- **Archive:** completed trackers, stale working-state snapshots, superseded methodologies, historical snapshots.\n- **Delete:** only clear duplicates, empty/stub notes, accidental copies, or disposable intermediates whose unique content is already compiled elsewhere.\n\nAmbiguous destructive deletion requires owner approval.\n\n## Deterministic-first rule\nMechanical checks should be implemented in scripts when possible, e.g. `kb_lint.py`, rather than repeatedly asking an LLM to reason about them. LLM reasoning is reserved for semantic contradiction, duplicate meaning, staleness, merge/split decisions, and lifecycle judgment.\n\n### Current lint script\nRead [runtime and project profiles](references/linting.md) before the first run. Resolve this installed skill's [lint script](scripts/kb_lint.py), use Python 3.9+ with its [runtime dependencies](requirements.txt), and pass the receiving vault root explicitly. The following paths are placeholders to replace with those resolved locations:\n\n```bash\npython3 \"/absolute/path/to/installed/kb-maintenance/scripts/kb_lint.py\" \"/absolute/path/to/target-vault\"\n```\n\nUse `--json` for machine-readable output and `--stale-work-days N` to change the default 30-day Work staleness threshold. Select the project's `.kb-lint.json` or pass `--config` with an explicit profile. For audit-only tasks, use an existing profile or a temporary one rather than writing new project configuration. Inspect reported settings, matched files and skipped checks before claiming coverage; zero matching files or exit code 0 alone is not a clean audit.\n\nThe script checks YAML metadata/lifecycle, local Markdown links and wikilinks, duplicate decision definitions, current canonical ownership, expired review dates, stale active Work, archive links, replacement metadata and context orphans under the selected conventions. A clean mechanical lint does not replace semantic review. If Python/dependencies are unavailable, state the limitation and continue only the checks the host can actually perform.\n\n## Maintenance output\nProduce a compact report grouped by: automatic-safe fixes, archive/supersede candidates, semantic-review candidates, destructive-delete candidates requiring approval, context/index refreshes, and unresolved ownership conflicts.\n\nAfter accepted maintenance, rebuild affected indexes/context, read back changed artifacts, and ensure `PROJECT_STATE.md` remains compact rather than becoming a maintenance log.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}