COC template implementation reference — how the five layers are implemented in Kailash COC templates (agents, skills, rules, hooks, commands). Use when asking about template structure, not COC concepts (use co-reference for specs).
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
COC template implementation reference — how the five layers are implemented in Kailash COC templates (agents, skills, rules, hooks, commands). Use when asking about template structure, not COC concepts (use co-reference for specs).
tools
["Read","Glob","Grep"]
COC Template Implementation Reference
How the COC five-layer architecture is implemented in the Kailash COC template repos. For COC spec/concepts (fault lines, value inversion, autonomous execution), see co-reference/coc-spec.md.
Implementation Inventory
CO Layer
COC Artifact Type
Count
Purpose
L1 Intent
Agents
30+
Specialized domain experts
L2 Context
Skills + CLAUDE.md
28+ dirs, 400+ files
Institutional knowledge library
L3 Guardrails
Rules + Hooks
9 rules, 9 hooks
Deterministic enforcement
L4 Instructions
Commands
20 commands
Phase-gated workflow
L5 Learning
Learning pipeline
observations + digest + codification
Knowledge compounding
Layer 3: Defense in Depth
Critical rules have 5-8 independent enforcement layers:
Rule file (soft — AI interprets)
+ Hook script (hard — deterministic, exit code 2 blocks)
+ Anti-amnesia hook (re-injects every message, survives compression)
+ Code review by reviewer
+ Security review by security-reviewer
+ CI pipeline check
The anti-amnesia hook (user-prompt-rules-reminder.js) is the single most important mechanism — fires on every user message.
Layer 4: Seven-Phase Workflow
Phase
Command
Quality Gate
Analysis
/analyze
reviewer
Planning
/todos
Human approval
Implementation
/implement
reviewer + security-reviewer
Validation
/redteam
reviewer
Knowledge
/codify
gold-standards-validator
Release
/release
Human approval
Evidence-based completion: AI cannot claim "done" without file-and-line proof.