/cogni-knowledge:knowledge-lintfrom cogni-knowledge
Runs semantic lint on a cogni-knowledge base to surface stale pages, claim drift, broken reverse links, and entries-count drift. Optionally repairs mechanical issues with --fix.
Ships in cogni-knowledge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run the semantic lint pass on a cogni-knowledge base — surface stale pages, stale drafts, claim drift, missing reverse links, entries-count drift, and formatting findings, and optionally repair the mechanical classes with --fix. This is the standalone analog of cogni-wiki:wiki-lint, computed natively on the vendored lint_wiki.py engine (resolved vendored-first via resolve_wiki_scripts()), so a Karpathy base is lintable with no cogni-wiki plugin installed.
Lint is read-only by default (a pure audit). It writes to the wiki only when the user passes --fix — and even then only the mechanical, deterministic repair classes the engine owns. This is the tokenful semantic counterpart to knowledge-health's cheap structural gate: run health first, reach for lint when you want to inspect or repair drift.
Read ${CLAUDE_PLUGIN_ROOT}/references/delegation-contract.md once at the start of a session so you remember the wiki-engine boundary — cogni-knowledge runs the lint pass on the vendored wiki-lint engine, it does not dispatch cogni-wiki:wiki-lint.
knowledge-health and wanting to reconcile itknowledge-finalize run, to clean reverse links and drift the synthesis would otherwise inherit.cogni-knowledge/binding.json — offer knowledge-setup instead.knowledge-health is the cheap structural integrity gate (vendored health.py); knowledge-lint is the semantic hygiene pass (vendored lint_wiki.py). They share the bound base but answer different questions — run health for "is it broken?", lint for "is it stale / can it be tidied?".knowledge-finalize already runs lint --fix=all as its deposit-time conformance gate. This skill exposes the full lint CLI for deliberate, operator-driven runs (audit, --suggest, selective --fix=<class>).| Parameter | Required | Description |
|---|---|---|
--knowledge-slug | Yes | Slug of the knowledge base to lint. Resolves to cogni-knowledge/<slug>/ unless --knowledge-root overrides. |
--knowledge-root | No | Override the default knowledge-base directory. |
--fix | No | Repair mode. --fix=all enables every mechanical class; --fix=<class> enables one. Writes to the wiki. Default OFF (audit only). Classes: reverse_link_missing, synthesis_no_wiki_source, entries_count_drift, frontmatter_defaults, alphabetisation, raw_citation_depth, portal_heading_dedup — plus the opt-in misplaced_control_files (see note below). |
--suggest | No | Emit suggested fixes for findings without applying them (read-only). |
--dry-run | No | Show what --fix would change without writing. |
Opt-in fix class. misplaced_control_files is accepted only as an explicit --fix=misplaced_control_files — it is excluded from --fix=all, so the per-deposit conformance gate (knowledge-finalize runs lint --fix=all on every deposit) can never trigger a layout migration. It relocates flat-root control files into wiki/meta/ by delegating to the curated-layout migrator (migrate-layout.py --relocate-only: control-file moves only; a pre-0.0.8 base is refused with a pointer to knowledge-index --migrate, never silently migrated). Run it when knowledge-health reports curated_layout_violation.
Required engine. This skill runs the lint pass on the vendored wiki-lint engine — cogni-knowledge ships a byte-identical copy in-tree under scripts/vendor/cogni-wiki/, so a bound base is lintable without cogni-wiki installed. Probe it so the skill aborts cleanly here rather than failing mid-skill:
# vendored-first: the in-tree wiki-lint scripts are self-contained
test -d "${CLAUDE_PLUGIN_ROOT}/scripts/vendor/cogni-wiki/skills/wiki-lint/scripts" && WIKI_OK=yes || WIKI_OK=no
If WIKI_OK is no, abort:
cogni-knowledge's vendored wiki-lint scripts are missing. Reinstall cogni-knowledge, then retry.
This probe is the early-abort gate only — Step 2's resolve_wiki_scripts is the authoritative resolver for the actual lint_wiki.py path; keep the two vendored probes in sync.
Resolve knowledge_root:
--knowledge-root is set, use it.knowledge_root = cogni-knowledge/<knowledge-slug>/ (relative to the current working directory).Read the binding:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/knowledge-binding.py read \
--knowledge-root <knowledge_root>
On success: false, abort and offer knowledge-setup. Do not auto-create.
Extract from the binding: knowledge_slug, knowledge_title, wiki_path.
Validate the binding's knowledge_slug matches --knowledge-slug. Mismatch → abort.
lint_wiki.py)Resolve the vendored wiki-lint scripts dir vendored-first (the same resolve_wiki_scripts posture knowledge-resume / knowledge-dashboard use), then invoke lint_wiki.py directly — no Skill dispatch:
. "${CLAUDE_PLUGIN_ROOT}/scripts/resolve-wiki-scripts.sh"
WIKI_LINT_SCRIPTS=$(resolve_wiki_scripts wiki-lint lint_wiki.py) \
|| abort "cogni-knowledge's vendored wiki-lint scripts are missing. Reinstall cogni-knowledge, then retry."
Build the invocation from the parameters. Default (no --fix) is a read-only audit:
python3 "${WIKI_LINT_SCRIPTS}/lint_wiki.py" --wiki-root "<wiki_path>"
Map the user's flags through verbatim:
--fix=<class|all> → pass --fix=<value> (the engine validates the class; all enables every standard class — misplaced_control_files is opt-in only and never part of all, so the per-deposit conformance gate can never trigger a layout migration). This writes to the wiki. Confirm the user intends a write before passing it; on --dry-run the engine reports what it would change without writing.--suggest → pass --suggest (read-only; emits suggested fixes for findings).--dry-run → pass --dry-run.Parse the JSON envelope {success, data, error}. On success: false, surface error and stop. Otherwise capture data.errors, data.warnings, data.info, data.stats, and — in fix mode — data.fixed[], data.failed[], plus data.suggestions[] under --suggest.
Print a compact report:
<knowledge_title> (<knowledge_slug>) — <wiki_path> — mode: audit / fix=<value> / dry-run / suggest.warnings and info — errors is reserved and stays empty in the current engine, so lead with warnings (cap 15), then info (cap 10), each as its finding class + the affected page; surface a non-empty errors list (cap 20) above them only on the off chance the engine ever populates it. The high-signal classes are stale_page, stale_draft, and claim_drift; surface those first within warnings.<len(fixed)> repaired — list each fixed[] entry (class + page); then <len(failed)> failed with each failed[] entry and its reason. On --dry-run, label the list "would repair".--suggest only). List each suggestions[] entry (read-only — nothing was written).knowledge-lint --knowledge-slug <slug> --fix=all to repair the mechanical classes (reverse links, drift, formatting); the semantic findings (stale_page / claim_drift) need a research refresh — knowledge-refresh --knowledge-slug <slug>."failed[] → "Some classes could not be auto-repaired — see the failed list; they need a manual look or a research refresh."wiki_path no longer does. lint_wiki.py returns success: false. Surface its error and stop.--fix class. The engine rejects it via its choices validation; surface the error rather than guessing a class.--fix write fails mid-run. The engine reports per-class failed[] with reasons; never claim a class was fixed when it is in failed[].health.py integrity gate — that is knowledge-health.cogni-wiki:wiki-lint — the pass is computed natively on the vendored engine.--fix is passed; never writes to the binding.A lint report printed to the user. Writes to the wiki only under --fix (the engine's mechanical repair classes).
${CLAUDE_PLUGIN_ROOT}/references/delegation-contract.md — delegation boundary (lint computed natively on the vendored engine)${CLAUDE_PLUGIN_ROOT}/scripts/vendor/cogni-wiki/skills/wiki-lint/scripts/lint_wiki.py — the vendored lint engine invoked in Step 2${CLAUDE_PLUGIN_ROOT}/scripts/knowledge-binding.py --helpWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
knowledge-base, wiki-lint, semantic-audit, knowledge-hygiene
21 skills in this plugin
/knowledge-composePhase 5 of the inverted pipeline. Reads <project>/.metadata/plan.json + <project>/.metadata/ingest-manifest.json + the populated cogni-wiki, dispatches a wiki-composer pass (plus ONE bounded fail-soft zero-network coverage-gated re-dispatch when a sub-question has ingested evidence the draft left uncited), and lands <project>/output/draft-vN.md + <project>/.metadata/citation-manifest.json. Supports --source wiki to compose a report grounded only in the bound wiki + fetch-cache with no web crawl (default web unchanged; local/hybrid staged). Use this skill whenever the user says 'compose the draft', 'write the report from the wiki', 'wiki-only report', 'compose from the wiki only', 'no web crawl report', 'phase 5 of the knowledge pipeline', 'knowledge compose', 'draft v1', or 'run the writer'. After compose, knowledge-verify will run the zero-network claim alignment./knowledge-curatePhase 2 of the inverted pipeline. Reads plan.json, dispatches one source-curator agent per sub-question to WebSearch + score candidate sources AND fetch each survivor's body via WebFetch into the shared fetch-cache, then merges the per-sub-question batches into candidates.json via candidate-store.py. Each candidate carries a fetch sub-object. Use this skill whenever the user says 'curate sources for the eu-ai-act plan', 'discover candidates for project X', 'run the curators on plan.json', 'knowledge curate', 'phase 2 of the knowledge pipeline'. After curate, run knowledge-fetch (cobrowse reconcile; a near no-op unless --cobrowse).npx claudepluginhub cogni-work/insight-wave --plugin cogni-knowledgeOther plugins' skills for the same job