openspec-knowledge-audit

Audits OpenSpec knowledge base facts for TTL expiry, anchor drift, and taxonomy sync.

Updated Jun 26, 2026
One-click install
npx skills add https://github.com/pavelvdo/universal-xml-exchange2 --skill openspec-knowledge-audit-pavelvdo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openspec-knowledge-audit
Source: https://github.com/pavelvdo/universal-xml-exchange2/tree/main/.cursor/skills/openspec-knowledge-audit
Command: npx skills add https://github.com/pavelvdo/universal-xml-exchange2 --skill openspec-knowledge-audit-pavelvdo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Knowledge base facts about a codebase silently go stale as the code evolves, leaving teams with outdated anchors, expired TTLs, and taxonomy entries that no longer match the directory structure. This Skill audits the OpenSpec knowledge base to detect drift, verify facts against current source code, and keep indexes and taxonomy synchronized. ## Core Features & Use Cases - Fact verification and read-repair: Re-verifies KB facts against anchors in src/, classifies drift as auto-repairable, review-required, or deprecate-candidate, and automatically repairs mechanical fingerprint mismatches. - Index and metrics maintenance: Rebuilds _index.yaml from KB markdown files with --reindex and reports usage counters, dead facts, and TTL calibration with --metrics. - Taxonomy and structure checks: Compares _taxonomy.yaml against src/*/cfe/* directories with --taxonomy-sync and validates the knowledge folder against a whitelist. - Use Case: After a large refactoring, run /opsx:knowledge-audit --overdue to re-verify only facts with expired TTL, auto-repair trivial drift, and receive a report listing facts that still need a manual decision. ## Quick Start Ask the assistant to run /opsx:knowledge-audit to verify all knowledge base facts against the current source code and generate an audit report.

Frequently Asked Questions about openspec-knowledge-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a knowledge base for stale facts?

Run /opsx:knowledge-audit to re-verify every fact against current source anchors and TTL values. Use --overdue to check only expired or stale facts, or --domain to limit the audit to one domain.

How do I rebuild a knowledge base index from markdown files?

Run /opsx:knowledge-audit --reindex to scan all fact markdown files in the knowledge directory and atomically rewrite the _index.yaml file. The markdown files are treated as the source of truth.

Can the audit delete or deprecate facts automatically?

No. Destructive actions like deprecate, supersede, or delete require an explicit --action flag with --ids, and deletion additionally requires --force-delete. The audit only recommends actions in its report otherwise.

What is read-repair in knowledge base verification?

Read-repair automatically fixes auto-repairable drift, such as outdated fingerprints or body-head hashes, when the anchor and declaration still match the code. It updates verified-at and syncs the index, logging the change in the audit report.

How do I check if knowledge taxonomy matches the codebase structure?

Run /opsx:knowledge-audit --taxonomy-sync to compare _taxonomy.yaml against the src/*/cfe/* directory layout. It reports orphan directories and orphan domains in report-only mode without modifying the YAML.

Why does the audit ask before a full review of all facts?

When the knowledge base contains more than 50 facts and no domain filter is given, the audit asks whether to run a full audit, overdue-only, or by-domain scope. This prevents excessively long verification runs.