Install
openclaw skills install cathedral-auditRun a full spec-code audit on the Cathedral codebase. Use after build waves, major refactors, or when spec-code drift is suspected. Produces forward audit (specs→code), reverse audit (code→specs), bug report, and prioritized fix plan. Drives execution of fixes through CC sessions.
openclaw skills install cathedral-auditA structured process for measuring and closing spec-code drift in the Cathedral C# codebase.
1. Forward Audit (specs → code)
2. Reverse Audit (code → specs)
3. Consolidation & Prioritization
4. Execution
5. Verification
For each spec in kitty-specs/, compare what the spec says against what the code does.
Output per spec: One of:
Deliverable: kitty-specs/000-project-context/spec-audit-YYYY-MM-DD.md
Use parallel CC agents (one per spec batch) for speed if memory allows. On memory-constrained hosts (e.g., WSL2), run sequentially — two concurrent CC sessions will OOM. Provide each agent read-only access.
Scan all .cs files in src/Cathedral.Core/ and src/Cathedral.TestHarness/. For each file/subsystem, determine:
Output sections:
Deliverable: kitty-specs/000-project-context/reverse-audit-YYYY-MM-DD.md
Use parallel CC agents (group files by directory/subsystem) for speed if memory allows. Run sequentially on memory-constrained hosts.
Merge findings from both audits into a prioritized action plan:
| Priority | Category | Criteria |
|---|---|---|
| P0 | Bug fixes | Runtime impact — broken endpoints, data corruption, crashes |
| P1 | Dead code removal | Safe deletes that reduce confusion and LOC |
| P2 | Data quality fixes | Dropped data, wrong defaults, double-logging |
| P3 | Spec coverage | Write new specs for unspecced code (no code changes) |
| P4 | Spec accuracy | Update existing specs to document code-exceeding-spec features |
| P5 | Mechanical refactors | Renames, wiring, entity-scoping completion |
| P6 | Architectural gaps | V2 features where code diverges from spec by design (defer) |
Rules:
Deliverable: Recommendations section in the reverse audit report.
Execute fixes by priority tier (P0 first, P6 last or deferred).
Per priority tier:
memory/YYYY-MM-DD.md — tier name, CC session name, what's being attemptedreferences/cc-task-template.md)cat /tmp/task.md | claude -p --allowedTools 'Edit,Write,Read,Bash'dotnet build must passgit diff --stat, verify build manually, fix any issues, log the incidentHard rules:
dotnet build passes before committing. No exceptions. CC may get OOM-killed mid-build-check.Logging template for daily memory:
## [Priority Tier Name]
- CC session: [name] (launched ~HH:MM CST)
- Task: [brief description]
- Status: [RUNNING | ✅ COMPLETE | ❌ FAILED | ⚠️ KILLED]
- Files changed: [count]
- Key actions: [what was done]
- Issues: [any problems encountered]
- Committed as [hash]
After all tiers are complete, optionally run a quick re-audit to measure improvement:
Deliverable: Updated audit files with comparison section.
Every audit produces a complete trail in memory/YYYY-MM-DD.md:
This is non-negotiable. The Feb 17-18 amnesia incident proved that unlogged work is lost work. Log-then-act: write what you're about to do BEFORE doing it, then update with results.
Always compare against the previous audit. Store audits as:
kitty-specs/000-project-context/
spec-audit-YYYY-MM-DD.md (forward)
reverse-audit-YYYY-MM-DD.md (reverse)
The executive summary table with deltas is the key metric:
| Category | Previous | Current | Delta |
|----------|----------|---------|-------|
| Unspecced Code | 38 | 24 | -14 |
| Divergences | 12 | 7 | -5 |
| Dead Code | 14 | 8 | -6 |
| Bugs | 0 | 8 | +8 |
| Conformant | ~60 | ~120 | +60 |
See references/cc-task-template.md for the standard format for CC task briefings.