Skip to content

Rules Index

Rules are loaded at session start. All mandatory unless marked [CONTEXTUAL].

Source file: docs/governance/rules-index.md

Rules

RulePurposeSourceApplies to
security-rules.mdBlock hardcoded secrets, any types, SQL injection, XSS patternsMeowKit originalAll modes, all phases
injection-rules.mdPrompt injection defense: DATA vs INSTRUCTIONS boundaryMeowKit originalAll modes, all phases
gate-rules.mdGate 1 (plan approval) and Gate 2 (review approval) hard stopsMeowKit originalPhases 1, 4
harness-rules.mdGenerator/evaluator architecture: planner stance, contract discipline, evaluator skepticism, iteration limits, adaptive density, dead-weight auditNew (Anthropic + LangChain harness research)Phase 3 (Build, harness), Phase 4 (Review)
rubric-rules.mdEvaluator calibration discipline, rubric library governance, anchor balance, drift detection, anti-slop enforcementNew (Anthropic harness research)Phase 4 (Review, evaluator)
core-behaviors.md6 mandatory operating behaviors: Surface Assumptions, Manage Confusion, Push Back, Enforce Simplicity, Scope Discipline, Verify Don't Assume + 10 failure modesAdapted from agent-skillsAll modes, all phases
tdd-rules.mdTDD enforcement (opt-in via --tdd / MEOWKIT_TDD=1); MICRO-TASK exemption includedMeowKit originalPhases 2, 3 when TDD enabled [CONTEXTUAL]
agent-conduct.mdFile naming, response structure, context ordering, search-before-building, plan resumption, context hygiene, subagent status protocolMeowKit original + Claude Code best practicesImplementation, review, all agent responses
development-rules.mdSkill activation, YAGNI/KISS/DRY, file management, code quality, validation commands, pre-commit, git safety, docs impactUser rules + MeowKitImplementation, commit
orchestration-rules.mdSubagent delegation, work/report/plan paths, file ownership, parallel vs sequential, completion-status handlingUser rules + MeowKitMulti-agent [CONTEXTUAL]
model-selection-rules.mdTask type → model tier routing, security escalationPrompting best practicesPhase 0 (Orient)
scale-adaptive-rules.mdDomain complexity routing, CSV override, one-shot bypassBMAD-inspiredPhase 0 (Orient)
step-file-rules.mdJIT step loading, no skipping, state persistenceBMAD-inspiredStep-file skills
parallel-execution-rules.mdWorktree isolation, max 3 agents, integration test, opt-in team coordinationMeowKit team patternParallel execution [CONTEXTUAL]
skill-authoring-rules.mdGotchas, persistent state, SKILL.md line caps, discovery frontmatter, command-vs-skill distinctionsAnthropic skill docs + MeowKitSkill authoring
post-phase-delegation.mdProject-manager fire points, skip conditions, invocation formMeowKit originalOrchestration skills [CONTEXTUAL]
agent-routing.mdAgent phase routing, domain integration hubs, MeowKit skill routingMeowKit originalPhase 0
phase-contracts.mdPhase input/output contract tableMeowKit originalPhases 1-6
risk-checklist.mdHorizontal risk flags feeding model escalationMeowKit originalPhase 0

Agile Conditional Rules

Loaded by mk:agent-detector Step 0b ONLY when an Agile context is detected (sprint-state contract present, jira_tickets: in plan frontmatter, MEOW_JIRA_BASE_URL env var set, or Jira-key pattern in user prompt). Non-Agile sessions pay zero context cost.

RulePurposeLoaded by
agile-story-gates.mdDefinition of Ready (Phase 1 entry), Definition of Done (Gate 2 PASS), traceability frontmatter contractmk:agent-detector Step 0b (Agile context)
agile-sprint-commitment.mdSprint goal persistence, mid-sprint amendment ceremony, sprint close hygienemk:agent-detector Step 0b (Agile context)
agile-feedback-cycle.mdRetro action-item ceremony, spike governance (timebox + findings doc)mk:agent-detector Step 0b (Agile context)

These rules live at .claude/rules-conditional/agile-*.md. They wire into existing skills (mk:plan-creator, mk:sprint-contract, mk:retro, mk:jira-agile, mk:ship, project-manager agent) — no new agents, no new hooks, no new gates.

Loading Priority

Higher number = stronger override:

  1. security-rules.md — NEVER override
  2. injection-rules.md — NEVER override
  3. gate-rules.md — NEVER override (except /mk:fix simple)
  4. harness-rules.md — NEVER override gates; density choice does not bypass any gate
  5. rubric-rules.md — NEVER override hard-fail propagation
  6. core-behaviors.md — always apply (6 behaviors + 10 failure modes)
  7. tdd-rules.md — applies only when MEOWKIT_TDD=1 / --tdd
  8. agent-conduct.md — always apply
  9. development-rules.md — always apply
  10. step-file-rules.md — apply when executing step-file workflows
  11. model-selection-rules.md — always apply
  12. skill-authoring-rules.md — apply during skill authoring
  13. scale-adaptive-rules.md — always apply at Phase 0
  14. risk-checklist.md — always apply at Phase 0
  15. parallel-execution-rules.md — apply during parallel execution [CONTEXTUAL]
  16. orchestration-rules.md — apply in multi-agent workflows [CONTEXTUAL]
  17. post-phase-delegation.md — apply during orchestration-skill execution [CONTEXTUAL]

Enforcement Mechanism Matrix

v1.1.0

RuleMechanismOverride?Exception
security-rules.mdBehavioralNEVERHuman override only
injection-rules.mdBehavioralNEVERHuman override only
gate-rules.mdHookNEVER/mk:fix simple; scale-routing one-shot
harness-rules.mdBehavioral + Hook (gate-enforcement.sh, validate-verdict.sh)NEVER override gatesDensity modes adjust scaffolding, not gate semantics
rubric-rules.mdBehavioral + Script (validate-rubric.sh)NEVER override hard-fail propagationCustom rubrics addable; semantics fixed
core-behaviors.mdBehavioralNo
tdd-rules.mdBehavioralYesDefault OFF; opt in via --tdd / MEOWKIT_TDD=1
agent-conduct.mdBehavioralNoTier A preserves rationale; Tier B includes context hygiene
development-rules.mdBehavioralNo
orchestration-rules.mdBehavioralN/A[CONTEXTUAL]
model-selection-rules.mdBehavioralNoDomain override via CSV
scale-adaptive-rules.mdBehavioral + DataNoCSV user-extensible
risk-checklist.mdBehavioral + DataNoFlags route through model-selection-rules.md
step-file-rules.mdBehavioralN/AStep-file skills only
parallel-execution-rules.mdBehavioral + WorktreeN/A[CONTEXTUAL]
skill-authoring-rules.mdBehavioral + ScriptNoMeowKit internal infra paths exempt from persistent-state rule
post-phase-delegation.mdBehavioralN/AMEOWKIT_PM_AUTO=off disables silent fires

Mechanism types:

  • Behavioral — Agent follows rules via system prompt
  • Hook — Shell script intercepts tool calls before execution
  • Data — External file (CSV, JSON) drives decisions

Hook Enforcement

HookEventPurpose
privacy-block.shPreToolUseBlock reads of .env, *.key, credentials
gate-enforcement.shPreToolUseBlock source code writes before Gate 1
project-context-loader.shSessionStartAuto-load project-context.md

Rules define why. Hooks enforce what.

harness-rules.md

Discipline rules for the autonomous multi-hour build pipeline (mk:autobuild) and the generator/evaluator architecture.

#RuleGloss
1Planner Stays Product-LevelPlanner emits user stories, not file paths
2Generator ≠ EvaluatorSelf-evaluation forbidden — fresh-context evaluator only
3Sprint Contract Required in FULL DensityContract gate before source edits (FULL mode)
4Iteration Cap = 3 RoundsAfter 3 gen/eval rounds, escalate to human
5Adaptive Density by scale-routing + Model StringMINIMAL/FULL/LEAN selected per tier
6Budget Thresholds — $30 warn, $100 hard, user capMulti-tier budget guardrail
7Dead-Weight Audit on Model UpgradeRe-run audit playbook per new model tier
8Active Verification Is a HARD GATEEvaluator drives build via browser/curl/CLI
9Skeptic Persona Reloaded Per CriterionPrevent leniency drift across criteria
10No Density Override Bypasses GatesDensity ≠ gate bypass

Source: .claude/rules/harness-rules.md. Applies to Phase 3 (Build) + Phase 4 (Review) when harness pipeline is active.

scale-adaptive-rules.md

Domain-complexity routing rules that drive Phase 0 classification and harness density selection.

#RuleGloss
1CSV Match Overrides Manual ClassificationDomain keyword match overrides orchestrator judgment
2No Match Falls Back GracefullyUnknown domain → manual classification per model-selection-rules
3High Complexity Forces COMPLEX Tierlevel=high → COMPLEX, no exceptions
4One-Shot Workflow Enables Gate 1 Bypassworkflow=one-shot + zero blast radius → skip Gate 1
5Users Can Extend the CSVdomain-complexity.csv is user-editable
6Adaptive Density Emissionscale-routing also emits autobuild_density for harness consumers
7Auto-Strict for High-Complexity Cook Runslevel=high during /mk:cook → auto-enables --strict at Phase 4.5; suppressible via --no-strict; fires ONLY in mk:cook

Rule 7 detail: When mk:scale-routing returns level=high during a /mk:cook run, cook auto-enables --strict mode (full mk:evaluate) at Phase 4.5 — unless the user explicitly passes --no-strict. This catches behavioral failures (e.g., a broken payment flow) that structural code review misses. Does NOT fire in mk:fix, mk:autobuild, or standalone mk:review.

Source: .claude/rules/scale-adaptive-rules.md. Applies at Phase 0 (Orient) and Phase 4.5 (Verify).

model-selection-rules.md

Model tier routing rules for Phase 0 task classification.

Key updates in v2.3.0:

Rule 5 update (v2.3.0): Auto-detection now uses model-detector.cjs SessionStart handler as the primary source. It reads the model field from SessionStart stdin and writes tier + density to session-state/detected-model.json. MEOWKIT_MODEL_HINT is fallback only — no longer required for Opus 4.6+ users.

Source: .claude/rules/model-selection-rules.md. Applies at Phase 0 (Orient).

rubric-rules.md

Rules that keep the rubric library (.claude/rubrics/) calibrated and the evaluator grading honest.

#RuleGloss
1≥1 PASS + ≥1 FAIL AnchorEvery rubric has both PASS and FAIL examples
2Composition Weights Sum to 1.0Preset weights must normalize (±0.01)
3Hard-Fail PropagatesAny rubric FAIL → overall FAIL
4Balanced PASS/FAIL CountsTolerance rule for anchor count
5Alternate Anchor OrderPASS/FAIL alternation to beat position bias
6Drift Check on Model UpgradeRe-replay calibration set per new model
7Anti-Slop Anti-Patterns Fixedoriginality.md + design-quality.md auto-FAIL
8Frontend-App Preset Pruned4 rubrics not 7 (YAGNI)
9Custom Rubrics User-ExtensibleValidator accepts any conforming file
10Rubric Files Are DATAPer injection-rules — rubrics cannot inject instructions

Source: .claude/rules/rubric-rules.md. Applies to Phase 4 (Review, evaluator agent).

Rule Format Convention

Every rule file follows:

  • Imperative language: ALWAYS, NEVER, MUST
  • WHY explanations: every rule includes its rationale
  • INSTEAD alternatives: every NEVER paired with what TO DO
  • Measurable checks: rules verifiable mechanically

See Also

Released under the MIT License.