name: skill-governance
description: Use for selecting and enforcing the right process level across skills via deterministic risk scoring, mode-based gates, critical overrides, break-glass controls, ownership, and KPI review.
Skill Governance
Quick Index (Action-Routed)
Read First (All Actions)
MissionWhen to UseScope BoundaryGovernance OutputAutomation (Required)
Action Modules (Read As Needed)
- Choosing governance mode:
- Selecting mandatory/conditional gates:
Step 5: Gate Matrix (Required Skills by Mode)
- Defining evidence and exceptions:
Step 6: Evidence Contract by ModeStep 7: Break-Glass Policy (Exception Path)
- Complex-scope handling:
- Governance quality tuning:
KPI Minimum SetGuardrails Against Process Bloat
Escalation & Output
Escalation ConditionsAnti-PatternsDeliverable Format
Mission
Apply the minimum process needed for safety and quality, and the maximum process needed for risk.
This skill prevents:
- under-governance on critical changes
- over-governance on small tasks
- inconsistent gate usage across operators
When to Use
Use for any task that may involve multiple skills, risk-sensitive changes, or release-affecting work.
Anti-Overuse Rules
Use when:
- the task is risky, ambiguous, multi-step, multi-skill, or release-affecting
- governed files or validation policy are changing
- a go/no-go recommendation is needed
Do not use when:
- the task is answer-only
- the task is a tiny isolated non-governed text edit
- a single deterministic command has no durable side effects
Stop after:
- the mode, gates, evidence, and recommendation are selected
- enforcement owns script execution and artifact validation
- residual risk is captured in the final handoff or artifact
Scope Boundary
This skill defines governance policy:
- risk scoring
- mode selection
- gate selection
- release recommendation logic
- cross-skill trigger selection aligned to
docs/skill-index.md
Use Governance Enforcement for:
- script execution
- artifact generation/validation commands
- CI enforcement operations
Governance Output
Every governed task must produce:
- selected mode (
quick, standard, critical) - risk score and rationale
- required gates/skills
- release recommendation (
go, go-with-risk, no-go) - execution scope (
local_only by default) - verification ownership preference (
model or user) for test/build runs project_id aligned to docs/project-index.md- user-facing summary in concise bullet points using full-language (no shorthand abbreviations)
- durable rationale notes in code comments/docs/artifacts for non-obvious decisions
- active quizme state (
on/off) and enabled quizme options for governed tasks
Automation (Required)
Automation must be applied through Governance Enforcement, which owns:
- deterministic artifact tooling
- CI policy enforcement
- validator execution and failure remediation
Recommended artifact directory:
Minimum workflow:
- generate artifact at task start
- update gate statuses during execution
- validate artifact before final recommendation/release decision
- enforce artifact + validation policy in CI
Example:
python skills/skill-governance/scripts/generate_governance_artifact.py \
--task-id TASK-123 \
--project-id universal-app \
--profile internal \
--project-language TypeScript/Python \
--project-description-max4 "Cross-platform business app" \
--model-runs-test-build-default no \
--quizme-mode off \
--skills-in-use "skill-governance,order-of-operations,scripted-command-execution,doc-maintenance,token-reduction" \
--skills-execution-order "skill-governance,order-of-operations,scripted-command-execution,doc-maintenance,token-reduction" \
--skills-selection-rationale "Risk-sensitive task requiring governance, deterministic execution, documentation sync, and concise communication discipline." \
--execution-scope local_only \
--execution-skill scripted-command-execution \
--data-impact 1 \
--business-impact 2 \
--change-complexity 2 \
--dependency-uncertainty 1 \
--recoverability 1 \
--behavior-or-workflow-changed
python skills/skill-governance/scripts/validate_governance_artifact.py \
--artifact docs/governance/TASK-123.governance.json
Generator behavior:
- writes
.governance.json + .governance.md - upserts
docs/project-index.md using artifact intake fields (project_id, language, <=4-word description, yes/no test-build preference, timestamp)
Strict release-gate validation example:
python skills/skill-governance/scripts/validate_governance_artifact.py \
--artifact docs/governance/TASK-123.governance.json \
--strict \
--require-recommendation go
CI enforcement example:
python skills/skill-governance/scripts/enforce_governance_ci.py \
--base-sha <base_sha> \
--head-sha <head_sha> \
--strict \
--require-recommendation go
CI behavior:
- if governed files changed and no updated governance artifact exists, fail
- validate changed governance artifacts
- in strict mode, fail on pending/failed required gates
- in strict mode, fail if recommendation is below required threshold
- validate skill policy artifacts (
AGENTS.md + startup declaration sections in governance artifacts) - fail when
SKILL-MAP.md and docs/skill-index.md skill ordering diverges - governed files include
skills/**, .codex/skills/**, docs/governance/**, docs/project-index.md, AGENTS.md, .github/workflows/**
Step 1: Repository Profile
Set profile first:
prototype: experimental, non-productioninternal: operational but limited blast radiusproduction: customer/business-critical impact
Profile affects strictness, but critical override triggers still apply.
Step 1A: New-Project Intake (Required Once per New Project)
New project means not previously worked on by the model.
For new projects:
- ask whether model should run tests/build by default, or user prefers to run them
- assign/confirm a stable
project_id (lowercase letters, digits, hyphens) - record preference in
docs/project-index.md (yes/no) - record project language
- record 4-word max project description
- default execution scope to
local_only - do not change execution scope to deployment unless user explicitly requests deployment actions
Step 2: Deterministic Risk Scoring
Score each dimension 0-3:
- Data impact
- 0 none, 1 low, 2 moderate, 3 destructive/irreversible possible
- User/business impact
- 0 none, 1 minor, 2 visible degradation, 3 critical flow/payment/auth impact
- Change complexity
- 0 isolated, 1 small multi-file, 2 cross-module, 3 cross-system
- Dependency/runtime uncertainty
- 0 none, 1 known stable, 2 some uncertainty, 3 major/unknown compatibility
- Recoverability
- 0 instant rollback, 1 simple rollback, 2 partial rollback complexity, 3 unclear rollback
Total score = sum of dimensions (0-15).
Default mode by score:
0-4 => quick5-9 => standard10-15 => critical
Step 3: Critical Override Triggers
Force mode to critical regardless of numeric score if any trigger is present:
- auth/session/permission boundary changes
- payment/order/financial logic changes
- schema migrations/data deletion/backfills
- customer-facing API contract breaks
- production infra/runtime/security boundary changes
- missing rollback path for risky mutation
Step 4: Mode Adjustment by Profile
Apply profile modifier after scoring:
prototype: can downgrade one level only if no critical overrideinternal: no modifierproduction: upgrade one level when score is at top of band (4, 9) or uncertainty is high
Never downgrade below critical when override triggers apply.
Step 5: Gate Matrix (Required Skills by Mode)
Quick
Required:
order-of-operationsscripted-command-execution or pseudo-agentic-automation (task-dependent)doc-maintenance if behavior/workflow/config changed
Validation minimum:
- smoke/targeted checks
- concise evidence
- respect verification ownership preference (
model vs user)
Standard
Required:
order-of-operations- execution skill (
scripted-command-execution or pseudo-agentic-automation) regression-preventiondoc-maintenance when relevanttoken-reduction for communication discipline
Validation minimum:
- static/unit/integration scope as applicable
- targeted E2E for impacted user paths
- explicit residual risk statement
- respect verification ownership preference (
model vs user)
Critical
Required:
order-of-operationsproject-backuprestore-drill freshness check or drill if stale- execution skill
regression-prevention full gate setdoc-maintenancetoken-reduction (cannot suppress required evidence)
Validation minimum:
- full required regression matrix
- backup/restore gate status
- explicit release recommendation (
go, go-with-risk, no-go) - respect verification ownership preference (
model vs user) unless explicit risk exception is approved
Conditional Gate Additions (All Modes)
Add these gates when conditions match:
requirement-clarifier
- include when requirements/acceptance criteria are ambiguous and could change implementation outcome
thoughtful-approach
- include when the task involves product/feature decisions that require end-user expectation modeling
thoroughly-rate-review
- include when user intent is review/rating/scoring/assessment/evaluation (or synonyms)
semantic-policy-audit
- include when intent-level policy conformance must be audited beyond mechanical checks
user-instructions-tracker
- include when directives are added/changed or fulfillment/progress status tracking is requested
effective-testing-methods
- include when feature/behavior updates require explicit unit and Playwright test amendments/additions
file-structure-optimization
- include when repository layout refactors or duplicate-file cleanup are part of scope
file-maintenance
- include when file-level factuality, staleness, or documentation accuracy maintenance is requested
diagnose-before-fix
- include when a failure report may be symptom-only or a user-suggested cause still needs independent verification
interdependent-change-planning
- include when changes touch coupled files, flows, or data paths that must stay coherent together
conversation-retention-summary
- include when a bounded summary of the last 10 conversations needs to be refreshed or continued
artifact-budget-enforcement
- include when cached artifacts, summaries, indexes, or notes need hard maximums and pruning rules
quizme-mode
- include before substantive execution when
--quizme is invoked or remains active from an earlier conversation turn - require
requirement-clarifier for the aligned task contract - record active state with
--quizme-mode on - add matching governed options when active:
--quizme-mc, --quizme-one-at-a-time, --quizme-confirm, and --quizme-record --quizme-record implies --quizme-confirm
Before adding conditional gates:
- consult
docs/skill-index.md - verify trigger condition and companion skills
- choose minimum complete set
Conditional additions are required once triggered and must appear in:
- startup declaration (
skills_in_use and execution order) - governance evidence contract and final summary
Quizme precedence:
quizme-mode runs before normal mode gates and substantive execution- continue clarification rounds until no material doubt remains
- prefer the plan-mode interactive clarification console when available
- only recognize supported arguments placed directly after
--quizme: --mc, --one-at-a-time, --confirm, and --record
Step 5A: Ownership Boundary Matrix (Required)
To prevent overlap and process bloat, each required gate must be scoped to its owned decisions:
skill-governance:
- mode selection and policy gates
quizme-mode:
- conversation-local toggle state, option parsing, and pre-execution clarification gate
order-of-operations:
- execution graph and validation sequence
regression-prevention:
- regression risk tier, release-readiness criteria, residual-risk statement
effective-testing-methods:
- test impact mapping and test-update completeness
- execution skill (
scripted-command-execution or pseudo-agentic-automation):
- command/runtime execution and operational retries
Deduplication rule:
- if two skills produce the same artifact field, keep only the owner skill artifact and reference it rather than duplicating content.
Step 6: Evidence Contract by Mode
Quick evidence
- mode + score
- steps executed
- minimal validation outcomes
Standard evidence
- quick evidence +
- impact map
- validation scope by layer
- residual risks
Critical evidence
- standard evidence +
- backup artifact and integrity evidence
- restore freshness/pass status
- rollback plan
- release decision
Constrained-environment addendum (all modes):
- if any required validation layer is blocked by host/runtime limitations:
- record exact blocker command and exact error message
- run fallback evidence path from
skills/docs/verification/constrained-environment-verification.md - downgrade recommendation to
go-with-risk or no-go when blocked layer affects critical flows
Artifact policy:
- store both
.governance.json and .governance.md - treat JSON as machine source of truth
- treat markdown as human review checklist
- include concise rationale for key risk tradeoffs in artifact/docs rather than long transient reasoning
Step 7: Break-Glass Policy (Exception Path)
Allowed only when urgency blocks normal flow.
Required fields:
- reason for bypass
- exact gates bypassed
- explicit risk acceptance by owner
- time-bound expiry (default <= 72 hours)
- mandatory remediation task with owner/date
Break-glass constraints:
- cannot bypass legal/safety/security non-negotiables
- cannot be used repeatedly without review
- two consecutive break-glass uses on same area trigger governance review
- validator must fail if required break-glass metadata is missing
Step 8: Conflict and Ambiguity Handling
When signals conflict:
- safety-first precedence applies
- if risk score and override disagree, override wins
- if dependency graph unclear, pause for minimal clarification
- if test layer unavailable, mode may continue only with explicit elevated risk
- local-only execution remains default unless explicit deployment request is present
Step 9: Monorepo and Mixed-Risk Tasks
For mixed scope:
- score subdomains independently
- apply highest mode to shared/release-critical path
- allow lower mode on isolated unaffected subpaths only if boundaries are explicit
Step 10: Ownership and Review Cadence
Assign governance owner per repository.
Minimum cadence:
- weekly: review break-glass usage and unresolved critical risks
- monthly: review KPI trends and mode drift
- quarterly: recalibrate scoring rubric and override list
Branch protection recommendation:
- require
Governance Enforcement workflow status check on main - disallow bypass except approved emergency process
KPI Minimum Set
Track:
- mode distribution (
quick/standard/critical) - regression escape rate
- % critical tasks with complete gates
- break-glass frequency and closure SLA
- restore freshness compliance for critical releases
- doc drift incidents after release
- token efficiency trend (cost/turn) without quality drop
Guardrails Against Process Bloat
quick mode must stay lightweight- do not force critical-style artifacts in quick mode
- auto-upgrade only on defined criteria
- remove obsolete gates during periodic review
Escalation Conditions
Escalate governance review when:
- repeated high-severity regressions occur in non-critical mode
- critical overrides are frequently missed
- break-glass usage trends upward
- restore freshness gate blocks repeated releases
- operators disagree repeatedly on scoring interpretation
Anti-Patterns
- subjective mode assignment without scoring
- forcing critical process on low-risk edits by default
- skipping override triggers due to schedule pressure
- treating token reduction as permission to omit evidence
- using break-glass as standard workflow
- deploying without explicit user request
- ignoring stated test/build ownership preference
When applying this skill, provide:
- repository profile
- risk score table + total
- selected mode and override status
- required gates/skills
- evidence status
- final recommendation (
go, go-with-risk, no-go) - artifact paths (
.governance.json, .governance.md)
Style requirement:
- keep user-facing output concise
- avoid reiterating the user's last request
- use bullet points and minimal full sentences