Rules Index
The 6 always-on MeowKit rules, where the other rules load from, and how each is enforced.
.claude/rules/ holds exactly 6 files. Claude Code loads that directory every session, so these are the only rules that cost context unconditionally. Every other rule sits in the references/ folder of the skill that loads it and reaches context only when that skill runs.
MeowKit ships no root CLAUDE.md. A project may keep its own; the kit never installs or refreshes it.
Always-on rules
| Rule | Purpose | Mechanism |
|---|---|---|
meowkit-core.md | Role, workflow, the ship check in brief, the boundary between data and instructions, the memory contract, the compaction policy | Instruction, plus a byte-budget script |
security-rules.md | Blocked patterns: hardcoded secrets, any types, SQL interpolation, v-html with user content and the rest of the table | Instruction. A human can override, and the override is documented |
injection-rules.md | Prompt-injection defense: the data and instructions boundary, and Rule 11 (the Skill Rule of Two) | Instruction. A human can override |
core-behaviors.md | Six operating behaviors and the anti-rationalization list | Instruction |
development-rules.md | YAGNI, KISS, DRY, file management, code quality, commits, docs impact, tool-output limits | Instruction |
agent-conduct.md | A1 subagent status protocol, A3 eureka documentation, B2 response structure | Instruction |
mewkit validate checks that all 6 are present. A rule that is not a hook is an instruction the agent follows, and nothing checks it. The two hooks that refuse an action are privacy-block.cjs, which blocks reads of .env, keys and credentials, and pre-ship.cjs, which runs the ship check on commit, push, merge and PR commands. project-context-loader.cjs loads project-context.md at session start. Hooks describes them.
Rules are not the only text a session carries before any skill runs. Every skill's name, description and when_to_use, and every agent's name and description, are listed too. scripts/check-always-on-budget.cjs holds both under a byte ceiling: 18,191 B for the rules alone, and 70,000 B for the rules plus that metadata. They measure 18,191 B and 43,794 B today. The script exits non-zero when either ceiling is exceeded.
Priority, highest first: security-rules.md and injection-rules.md are never overridden, then core-behaviors.md, meowkit-core.md, agent-conduct.md and development-rules.md. A rule loaded by a skill never overrides an always-on rule. harness-rules.md and rubric-rules.md never override the ship check, tdd-rules.md applies only with MEOWKIT_TDD=1 or --tdd, and context-budget-rules.md is advisory.
Where the other rules live
| Rule | Location | Loaded by |
|---|---|---|
harness-rules.md | .claude/skills/cook/references/ | mk:cook, mk:autobuild |
tdd-rules.md | .claude/skills/cook/references/ | mk:cook (Phases 2 and 3), mk:fix |
phase-contracts.md | .claude/skills/cook/references/ | mk:agent-detector Step 0b |
post-phase-delegation.md | .claude/skills/cook/references/ | Orchestration skills |
task-state-emission.md | .claude/skills/cook/references/ | mk:cook, mk:autobuild |
parallel-execution-rules.md | .claude/skills/cook/references/ | mk:worktree, mk:team-config, parallel runs |
orchestration-rules.md | .claude/skills/cook/references/ | Multi-agent workflows |
agent-conduct-extended.md | .claude/skills/cook/references/ | Sections A2, B1, B3 to B6 of agent conduct |
model-selection-rules.md | .claude/skills/agent-detector/references/ | mk:agent-detector Step 0b |
scale-adaptive-rules.md | .claude/skills/agent-detector/references/ | mk:agent-detector Step 0b |
risk-checklist.md | .claude/skills/agent-detector/references/ | mk:agent-detector Step 0b |
agent-routing.md | .claude/skills/agent-detector/references/ | mk:agent-detector Step 0b |
context-budget-rules.md | .claude/skills/agent-detector/references/ | mk:agent-detector, mk:context-audit |
rubric-rules.md | .claude/skills/rubric/references/ | mk:rubric, evaluator agent |
skill-authoring-rules.md | .claude/skills/skill-creator/references/ | mk:skill-creator, skill audits |
dead-weight-audit-rules.md | .claude/skills/benchmark/references/ (maintainer-only, not in the shipped kit) | mk:benchmark |
step-file-rules.md | Inlined as ## Step-File Contract in each step-filed skill's workflow.md | mk:plan-creator, mk:review, mk:evaluate, mk:autobuild, mk:trace-analyze |
anti-rationalization.md | Merged into core-behaviors.md | Always on |
intervention-recording-rules.md | Merged into meowkit-core.md | Always on |
Agile rules
mk:agent-detector Step 0b loads these three only in an Agile context: a sprint-state contract exists, the active plan has jira_tickets: in its frontmatter, MEOW_JIRA_SITE_URL is set, or the prompt contains a Jira key. Other sessions pay no context cost.
| Rule | Purpose |
|---|---|
agile-story-gates.md | Definition of Ready (Phase 1 entry), Definition of Done (review verdict PASS), traceability frontmatter. Advisory |
agile-sprint-commitment.md | Sprint goal persistence, mid-sprint amendment, sprint close hygiene |
agile-feedback-cycle.md | Retro action items, spike governance (timebox and findings document) |
They live in .claude/skills/agent-detector/references/agile-*.md and add no agents or hooks.
harness-rules.md
Discipline for the autonomous build pipeline (mk:autobuild) and the generator and evaluator split. It applies to Phase 3 (Build) and Phase 4 (Review) when the harness runs. Source: .claude/skills/cook/references/harness-rules.md.
| # | Rule | Summary |
|---|---|---|
| 1 | Planner stays product-level | The planner emits user stories, not file paths |
| 2 | Generator is not evaluator | No self-evaluation; a fresh-context evaluator grades |
| 3 | Sprint contract by density | FULL: signed before source edits (no hook checks it). LEAN: optional. MINIMAL: skipped |
| 4 | Iteration cap | After 3 generate and evaluate rounds, escalate to a human |
| 5 | Adaptive density | mk:scale-routing and the model string select MINIMAL, FULL or LEAN |
| 6 | Budget thresholds | $30 warns, $100 halts the run, and a user cap (budget.cap or --budget) overrides the halt |
| 7 | Dead-weight audit | Re-run the audit playbook on each new model tier |
| 8 | Active verification | The evaluator drives the build through a browser, curl or the CLI |
| 9 | Skeptic persona | Reloaded per criterion to prevent leniency drift |
| 10 | No density override lowers the bar | Density changes scaffolding, not the checks |
scale-adaptive-rules.md
Domain-complexity routing that drives Phase 0 classification and harness density. Source: .claude/skills/agent-detector/references/scale-adaptive-rules.md.
| # | Rule | Summary |
|---|---|---|
| 1 | CSV match overrides manual classification | A domain keyword match beats the orchestrator's judgment |
| 2 | No match falls back | An unknown domain is classified manually under the model-selection rules |
| 3 | High complexity forces COMPLEX | level=high gives the COMPLEX tier |
| 4 | One-shot workflow skips the plan | workflow=one-shot with zero blast radius needs no plan file |
| 5 | Users can extend the CSV | domain-complexity.csv is user-editable |
| 6 | Autobuild owns density | mk:scale-routing emits no density; mk:autobuild picks its own |
| 7 | Auto-strict for high complexity | level=high during /mk:cook turns on --strict (full mk:evaluate) at Phase 4.5 unless you pass --no-strict. It fires only in mk:cook, not in mk:fix, mk:autobuild or standalone mk:review |
model-selection-rules.md
Model tier routing for Phase 0 task classification. Detection reads the model field from SessionStart input through the model-detector handler and writes the tier and density to .meowkit/state/detected-model.json. MEOWKIT_MODEL_HINT is the fallback. Source: .claude/skills/agent-detector/references/model-selection-rules.md.
rubric-rules.md
Rules that keep the rubric library (.claude/skills/rubric/rubrics/) calibrated and the evaluator's grading consistent. They apply to Phase 4 (Review). Source: .claude/skills/rubric/references/rubric-rules.md.
| # | Rule | Summary |
|---|---|---|
| 1 | PASS and FAIL anchors | Every rubric has at least one of each |
| 2 | Composition weights sum to 1.0 | Preset weights normalize within 0.01 |
| 3 | Hard-fail propagates | Any rubric FAIL makes the overall result FAIL |
| 4 | Balanced anchor counts | A tolerance rule for PASS and FAIL anchor counts |
| 5 | Alternate anchor order | Alternating PASS and FAIL counters position bias |
| 6 | Drift check on model upgrade | Replay the calibration set for each new model |
| 7 | Anti-slop anti-patterns fixed | originality.md and design-quality.md auto-fail |
| 8 | Frontend-app preset pruned | 4 rubrics, not 7 |
| 9 | Custom rubrics allowed | The validator accepts any conforming file |
| 10 | Rubric files are data | Rubrics cannot inject instructions |
Rule format
Every rule file uses imperative language (ALWAYS, NEVER, MUST), gives the reason for each rule, pairs each NEVER with what to do instead, and states checks that can be verified mechanically.
See also
- Agents Reference: the agent roster
- Skills Reference: skills by phase
- Hooks Reference: the hooks