Hooks-driven instinct learning framework. Turns spiral iteration experience into atomic instincts with confidence decay, clustering into Rules/Skills/Agents.
Meta-review phase of Spiral SOP. Deterministic observation + atomic instincts + confidence decay.
Skills fire ~50-80% probabilistically. Hooks fire 100% deterministically.
PreToolUse / PostToolUse Hooks
│
│ append every tool call + outcome
▼
observations.jsonl (rotate: 10MB max, archive after 7 days)
│
│ pattern detection (4 categories)
▼
┌─ user_corrections → instinct (confidence 0.5, direct signal)
├─ error_resolutions → instinct (confidence 0.3, needs validation)
├─ repeated_workflows → instinct (confidence 0.5, frequency-based)
└─ tool_preferences → instinct (confidence 0.4, behavioral signal)
{
"hooks": {
"PreToolUse": [{ "matcher": "*", "hooks": [{
"type": "command",
"command": "<observer-script> pre"
}]}],
"PostToolUse": [{ "matcher": "*", "hooks": [{
"type": "command",
"command": "<observer-script> post"
}]}]
}
}
One trigger, one action. Smallest knowledge unit.