/cogni-knowledge:knowledge-healthfrom cogni-knowledge
Runs a read-only structural health check on a cogni-knowledge base — verifies page/link/schema integrity, entries-count drift, and claim drift for the bound wiki.
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.
Give the user a fast, grounded structural health verdict for a cogni-knowledge base — the page/link/schema integrity of the bound wiki, plus entries-count drift and claim drift. This is the standalone analog of cogni-wiki:wiki-health, computed natively on the vendored health.py engine (resolved vendored-first via resolve_wiki_scripts()), so a Karpathy base is health-checkable with no cogni-wiki plugin installed.
This skill is fully read-only — health.py writes nothing (it emits JSON to stdout only). The health-check log line the retired cogni-wiki:wiki-health dispatch used to append was a workflow step of that skill, not of the engine; the native path has no append step.
Read ${CLAUDE_PLUGIN_ROOT}/references/delegation-contract.md once at the start of a session so you remember the wiki-engine boundary — cogni-knowledge computes the health verdict on the vendored wiki-health engine, it does not dispatch cogni-wiki:wiki-health.
knowledge-ingest or a knowledge-finalize run, to confirm the base is still structurally sound.cogni-knowledge/binding.json and the user asks "is everything OK?".cogni-knowledge/binding.json — offer knowledge-setup instead.knowledge-resume runs the same health.py engine for its one-line verdict but layers a full status overlay (deposited projects, next action). Use knowledge-health when you want the structural detail only, without the binding overlay.knowledge-lint is the semantic pass (stale pages, claim drift, reverse-link repair with --fix). knowledge-health is the cheap structural gate; knowledge-lint is the tokenful curation pass. Run health first; reach for lint when health flags drift you want to fix.| Parameter | Required | Description |
|---|---|---|
--knowledge-slug | Yes | Slug of the knowledge base to check. Resolves to cogni-knowledge/<slug>/ unless --knowledge-root overrides. |
--knowledge-root | No | Override the default knowledge-base directory. |
Required engine. This skill computes the health verdict on the vendored wiki-health engine — cogni-knowledge ships a byte-identical copy in-tree under scripts/vendor/cogni-wiki/, so a bound base shows its health without cogni-wiki installed. Probe it so the skill aborts cleanly here rather than failing mid-skill:
# vendored-first: the in-tree wiki-health scripts are self-contained
test -d "${CLAUDE_PLUGIN_ROOT}/scripts/vendor/cogni-wiki/skills/wiki-health/scripts" && WIKI_OK=yes || WIKI_OK=no
If WIKI_OK is no, abort:
cogni-knowledge's vendored wiki-health 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 health.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. Note that wiki_path is read straight from the binding here and not pre-validated at this step — health.py in Step 2 is the authoritative validator of wiki_path / config.json (it is what surfaces a missing or broken wiki path, per the Edge-cases section below).
Validate the binding's knowledge_slug matches --knowledge-slug. Mismatch → abort.
health.py)Resolve the vendored wiki-health scripts dir vendored-first (the same resolve_wiki_scripts posture knowledge-resume / knowledge-dashboard use), then invoke health.py directly — no Skill dispatch:
. "${CLAUDE_PLUGIN_ROOT}/scripts/resolve-wiki-scripts.sh"
WIKI_HEALTH_SCRIPTS=$(resolve_wiki_scripts wiki-health health.py) \
|| abort "cogni-knowledge's vendored wiki-health scripts are missing. Reinstall cogni-knowledge, then retry."
Run the vendored health.py against the bound wiki (it resolves _wikilib itself; fully read-only — JSON to stdout, no file writes):
python3 "${WIKI_HEALTH_SCRIPTS}/health.py" --wiki-root "<wiki_path>"
On a curated-layout base (schema_version >= 0.0.8) the engine additionally asserts the layout shape:
curated_layout_violation (error) — a control file (log.md / context_brief.md / open_questions.md) at the flat wiki/ root, a missing wiki/meta/, or an overview.md still carrying the narrative machine block. Repair: knowledge-lint --fix=misplaced_control_files.missing_subindex (warning) — a sub-indexed type dir with pages but no index.md. Repair: knowledge-index.schema_version_lag (warning) — the base's config.json schema_version trails the engine's current expected structure (ENGINE_SCHEMA), so it predates a curated-layout contract the engine now produces. Repair: knowledge-index --migrate.structural_drift (warning) — a machine-owned curated front-door region a completed phase should have populated is still on its bootstrap state: the index.md OVERVIEW-NARRATIVE block still carries the finalize placeholder, or a ROOT-LINKS span has no theme-scoped deep links. Repair: re-run knowledge-finalize (or knowledge-index) to regenerate the front door. These two structural-drift classes are read-only and fail-soft, never fire on a pre-0.0.8 base, and move the verdict OK -> WARN (never a hard error).render_engine_lag (warning) — the base's curated indexes were rendered by an engine version behind the installed one (its stamped last_rendered_engine_version trails ENGINE_RENDER_VERSION), or carry no engine stamp at all, so a shipped index-renderer upgrade has not been re-rendered into this base. Repair: run knowledge-index to rebuild the indexes (which re-stamps the engine version). Read-only and fail-soft, same posture as schema_version_lag; never fires on a pre-0.0.8 base.entries_count and the page walk; pre-0.0.8 bases are untouched by these assertions.Parse the JSON envelope {success, data, error}. On success: false (e.g. <wiki_path>/.cogni-wiki/config.json absent), surface error and stop. Otherwise capture data.errors, data.warnings, and data.stats (pages_audited, entries_count_config, entries_count_actual, entries_count_drift, claim_drift_count).
Print a compact verdict block:
<knowledge_title> (<knowledge_slug>) — <wiki_path>data.errors is empty, else <N> error(s) — <first error class(es)>.<pages_audited> pages audited · entries config/actual <config>/<actual> + · entries drift <±N> when entries_count_drift != 0 + · claim drift <N> when claim_drift_count > 0.data.errors is non-empty, list each (cap 20, "and N more" for the rest) — each as its class + the affected page/link.data.warnings is non-empty, list each the same way (cap 10).knowledge-lint --knowledge-slug <slug> for the semantic pass (stale pages, claim drift) when you want it."knowledge-lint --knowledge-slug <slug> --fix=all to reconcile, then re-run health."knowledge-lint --knowledge-slug <slug> --fix=all repairs the mechanical classes; the rest need a manual look." A curated_layout_violation repairs via knowledge-lint --knowledge-slug <slug> --fix=misplaced_control_files.missing_subindex warning present (any verdict state) → "Re-render the per-type sub-indexes via knowledge-index."schema_version_lag warning present → "Schema behind the engine — run knowledge-index --migrate to converge the curated layout."structural_drift warning present → "Curated front door degraded (placeholder overview / empty root-links) — re-run knowledge-finalize (or knowledge-index) to regenerate it."render_engine_lag warning present → "Indexes rendered by an older engine — run knowledge-index to rebuild and re-stamp the renderer version."wiki_path no longer does. health.py returns success: false (missing .cogni-wiki/config.json). Surface its error and stop with a clear message.health.py fails for another reason. Surface its error verbatim; do not fabricate a verdict.wiki-lint pass — that is knowledge-lint, a deliberate tokenful pass the user invokes separately.cogni-wiki:wiki-health — the verdict is computed natively on the vendored engine.health.py emits JSON to stdout, nothing else).A health verdict block printed to the user. No files written.
${CLAUDE_PLUGIN_ROOT}/references/delegation-contract.md — delegation boundary (wiki health computed natively on the vendored engine)${CLAUDE_PLUGIN_ROOT}/scripts/vendor/cogni-wiki/skills/wiki-health/scripts/health.py — the vendored health engine invoked in Step 2${CLAUDE_PLUGIN_ROOT}/scripts/knowledge-binding.py --helpWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cogni-work/insight-wave --plugin cogni-knowledge21 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)./knowledge-dashboardRender an HTML dashboard for a bound cogni-knowledge base — runs the vendored wiki-dashboard scripts (render_dashboard.py + build_graph.py) natively against the bound wiki and writes a knowledge-overlay.md sidecar that lists deposited research projects and the latest lint-audit claim_drift count. Use this skill whenever the user says 'show the dashboard for my <slug> base', 'knowledge dashboard', 'visualize my eu-ai-act knowledge base', 'render the knowledge base as HTML', 'knowledge-dashboard <slug>'. The sidecar makes the binding's contribution visible alongside the wiki's own dashboard./knowledge-distillPhase 4.5 of the inverted pipeline (between ingest and compose). Distills the run's source claims into recurring type:concept / type:entity / type:person pages, creating-or-merging them under a lock with claim-level dedup so the bound wiki compounds across runs (distilled pages get enriched, not duplicated). Also synthesizes a citable answer_claims: surface onto each type:question node from its findings' claims (Step 6.1). An optional cross-lingual pass merges DE↔EN twin claims on mixed-language bases (auto-skips otherwise). Fail-soft and optional: a distill failure never blocks compose. Use this skill whenever the user says 'distill the concepts', 'build the concept web', 'phase 4.5', 'knowledge distill', 'extract entities and concepts', 'answer the question nodes', or 'dedupe claims'. After distill, knowledge-compose reads the distilled pages as framing context./knowledge-fetchPhase 3 of the inverted pipeline. Builds fetch-manifest.json from the fetch results the curators already produced in Phase 2 (bodies are already fetched during curate). Cobrowse is OPT-IN (--cobrowse): the skill walks the user through enabling the Claude-in-Chrome extension, then dispatches source-fetcher sequentially to recover WebFetch misses AND to additively top up thin primary-tier sources (reading the fuller browser body beyond WebFetch's cap, superseding only if strictly longer). Use this skill whenever the user says 'fetch candidates for project X', 'build the fetch manifest', 'phase 3 of the knowledge pipeline', 'recover the failed sources', 'deepen the primary sources', 'knowledge fetch'. After fetch, run knowledge-ingest to deposit per-URL wiki pages./knowledge-finalizePhase 7 of the inverted pipeline — deposits the verified draft as a wiki synthesis page, closing the compounding loop. Reads the latest verified draft plus its verify and citation manifests, refuses self-citing loops, atomically writes the synthesis page into the bound wiki, updates the surrounding index, log, and binding state, then runs a fail-soft conformance gate plus advisory contradiction and structural-quality passes. The deposited synthesis becomes visible to future knowledge-compose runs as cross-source framing. Use this skill whenever the user says 'finalize the draft', 'deposit the synthesis', 'phase 7 of the knowledge pipeline', 'knowledge finalize', or 'land the verified draft'.Other plugins' skills for the same job