| name | ctx-kb-site-review |
| description | Mechanical structural audit of the kb. Coerces malformed capitalization, flags malformed closeout frontmatter, and refuses to make judgment calls that require evidence. Writes a site-review closeout for the audit trail. |
Site-Review Pass
Walk .context/kb/ and .context/ingest/closeouts/ mechanically.
Fix what is unambiguous (capitalization drift, missing frontmatter
fields the CLI knows how to coerce). Flag what is not (claims
that read as broken but require evidence to fix). Never invent
prose. Never mint EV-### rows. Never modify a claim's
Confidence band.
This is a janitor pass, not an editorial pass. Editorial judgment
lives in /ctx-kb-ingest.
Authoritative background reading:
.context/ingest/KB-RULES.md §Authority boundary;
specs/kb-editorial-pipeline.md §Validation Rules.
When to Use
- The user says "audit the kb", "check kb for rot", "run a
site-review", or invokes the explicit slash form.
- Before a release / handover where structural cleanliness
matters.
- After bulk ingest where drift may have accumulated.
- When the doctor advisory has surfaced structural warnings the
user wants triaged.
When NOT to Use
- The user wants new material extracted (use
/ctx-kb-ingest).
- The user wants kb claims re-grounded against external sources
(use
/ctx-kb-ground).
- The user is asking a content question (use
/ctx-kb-ask).
- The user wants to capture a quick finding (use
/ctx-kb-note).
Authority Boundary (vs Other Skills)
/ctx-kb-site-review: mechanical structural audit. May
coerce capitalization that the spec deems lossless (e.g.
Confidence: High → high). May flag any other malformation
in the closeout's What changed block. May not modify a
claim, an EV-### row's content, a Confidence band, a topic
page's prose, or a ledger state. Those require evidence
judgment.
/ctx-kb-ingest: handles anything this skill flags as
evidence-dependent.
/ctx-kb-ground: handles anything this skill flags as
source-staleness.
Usage Examples
/ctx-kb-site-review
No arguments. The pass walks the kb in full.
Pre-Write Gates
Three distinct refusals, each leaves zero residue:
.context/ missing → suggest ctx init and stop.
.context/kb/ missing → suggest ctx init --upgrade and
stop.
- Kb scope undeclared (placeholder in
.context/kb/index.md)
→ refuse with the scope message and stop.
Process
-
Verify pre-write gates. Refuse cleanly if any gate fails.
Zero residue on refusal.
-
Walk topic pages. For every
.context/kb/topics/<slug>/index.md and every sibling
sub-page:
- Status block check: does the page have the
four-field Status block (
Subject, Last verified,
Author, Confidence)? Missing fields → flag in
What changed. Do not synthesize.
- Author field check:
Author: hand-authored is
prohibited per KB-RULES.md. Flag (do not auto-coerce;
human intent matters).
- Confidence band coercion:
high|medium|low|speculative
are the only valid values. Coerce capitalization
(High → high, MEDIUM → medium) silently and record
in What changed. Any other malformation (e.g.
Confidence: probable) is flagged for the user.
TBD-cite markers: count them per page. The
Confidence floor for any page with TBD-cite is
speculative. If the page's Confidence is above
speculative while TBD-cite is present, flag (do not
auto-demote; demotion is evidence work).
EV-### citation resolution: every EV-### cited on
the page must resolve to a row in
.context/kb/evidence-index.md. Unresolved IDs → flag.
## Related concepts in this kb presence: if the
page is more than the lede + Status block AND the kb has
plausibly adjacent topics, the section should be present.
Absence is a soft flag (not auto-fixable).
-
Walk evidence-index.md.
- Duplicate
EV-### IDs: flag every duplicate; name
both files / line numbers. The LLM cleanup pass (per
spec's P1) handles renumbering, not this skill.
- Three-digit padding:
EV-12 should be EV-012. Flag
(do not auto-coerce; renumbering cascades to citations on
topic pages, which is ingest work).
- : same rule as topic pages.
Edge Cases
| Case | Expected behavior |
|---|
.context/ missing | Refuse; suggest ctx init. No residue. |
.context/kb/ missing | Refuse; suggest ctx init --upgrade. No residue. |
| Kb scope undeclared | Refuse with the scope message. No residue. |
| Zero topic pages on disk | Walk closeouts and ledger anyway. Note the bootstrap state in the closeout. Not a failure mode. |
| Zero closeouts on disk | Walk topic pages and ledger anyway. Note in the closeout body. Not a failure mode. |
Confidence: High (capitalization drift) | Coerce to high silently; record in What changed. |
Confidence: probable (unknown band) | Flag for the user; do not coerce. |
Author: hand-authored | Flag for the user; do not coerce (human intent matters). |
Duplicate EV-### ID across files | Flag both files; defer renumbering to the LLM cleanup pass per spec's P1. |
EV-12 (missing zero-pad) | Flag for the user; do not auto-pad (cascades to citations). |
Unresolved EV-### on a topic page | Flag; recommend /ctx-kb-ingest <slug> in Next pass hint. |
Ledger row Updated predates source file mtime | Flag (lying-to-the-ledger advisory). Do not auto-edit. |
Illegal ledger transition (e.g. comprehensive → highlights-extracted without superseded) | Flag; recommend the corrective ingest invocation. Do not auto-correct. |
Closeout missing pass-mode frontmatter field | Flag; the handover-fold skips malformed closeouts so the user can fix or delete. |
Closeout body's Pass-mode Declared: disagrees with frontmatter pass-mode: | Flag (false-finish signal); recommend hand-edit. |
Closeout's Adjacency pre-flight is free prose instead of or a slug-list |
Anti-Patterns
- Auto-fixing anything that requires evidence judgment
(Confidence promotion/demotion, claim text edits,
EV-###
renumbering, ledger state changes, prose synthesis).
- Skipping the closeout once pre-write gates pass.
- Hand-editing
INBOX.md or SESSION_LOG.md (other skills'
surfaces; never this one's).
- Coercing
Author: hand-authored to anything else. The user's
intent matters; flag and wait.
- Auto-renumbering duplicate
EV-### IDs. The cascade to
citations is ingest work; this skill flags only.
Output Contract
For pre-write refusals, return only the specified refusal text
and stop. No residue.
For passes that clear pre-write gates, end with this structured
summary:
- Walked: counts (topic pages, evidence rows, ledger rows,
closeouts).
- Coercions applied: count + one-line categories (e.g.
"3 capitalization fixes on Confidence bands").
- Flags raised: count + categories (e.g. "2 unresolved
EV-### citations; 1 ledger mtime mismatch").
- Closeout: filename on its own line.
- Next-recommended-action: explicit invocations to address
each flag category (or
none if the kb is clean).
Quality Checklist
Before reporting completion, verify: