{
"name": "knowledge-ratchet",
"category": "methodology",
"priority": "critical",
"trigger_patterns": [
"quality tracking",
"correction rate",
"loop detection",
"ratchet",
"benchmark",
"intelligence improvement",
"learning from mistakes",
"failure patterns",
"sensor fusion",
"session scoring"
],
"requires": [
"knowledge-ratchet/ directory",
"Node.js runtime",
"Claude Code hooks system"
],
"when_to_use": [
"Checking quality metrics or trends",
"Investigating correction patterns",
"Adding new prevention rules",
"Running benchmarks",
"Understanding why corrections happen",
"Working on a project with high loop count"
],
"when_not_to_use": [
"Normal development work (system runs automatically)",
"Single corrections (system handles via hooks)"
],
"outputs": [
"Session quality scores",
"Loop detection with past resolutions",
"Learned rules from resolved loops",
"Project subsystem danger maps",
"Benchmark trends (R2 novel/repeat, R3 density, R4 resolution speed)",
"HTML dashboard on port 9077"
],
"integration": {
"automatic": [
"SessionStart: loop briefing + state reset",
"UserPromptSubmit: loop intervention + correction detection + realtime scoring",
"PostToolUse: tool call tracking",
"PreToolUse: preflight review for danger files",
"Stop: fast pipeline (2.7s) + dashboard regeneration"
],
"manual": [
"node pipeline.js — fast pipeline",
"node analyze-all.js --limit=50 — full batch with LLM",
"node benchmark-ratchet.js — all benchmarks",
"node dashboard.js --serve — dashboard on port 9077",
"node loop-detector.js --match='project:type:files' — query past loops",
"node project-mapper.js --verbose — subsystem discovery"
]
}
}