self-governance

self-governance is a skill for Claude Code, Codex from davisjam/model-based-agentic-software-engineering. It costs 291 tokens per session (2,008 once invoked), scanned A, original, MIT.

A method for guiding an agent through engineering work by identifying the situation, deciding what must be known or preserved, choosing an action, and checking the evidence. It also turns lasting lessons from failures into durable controls.

In plain words
What is it for?
Use it to choose between modeling and alignment work, select the right capability, act within a governed environment, evaluate results, diagnose failures, and improve the engineering process.
Why use it?
It helps prevent agents from jumping straight into changes without understanding the problem or the conditions that must remain true. It provides a repeatable way to respond to both success and failure.

Skill for Claude CodeCodex

Part of the mage plugin — 3 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/davisjam/model-based-agentic-software-engineering/self-governance
Any agent
npx skills add davisjam/model-based-agentic-software-engineering --skill self-governance
Clone the repo
git clone --depth 1 https://github.com/davisjam/model-based-agentic-software-engineering

Made for: Claude Code, Codex.

Or install mage, the plugin that ships this one along with the rest of its 3 skills.

Per session 291 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,008 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00291 $0.02008
Opus 5 $0.00146 $0.01004
Sonnet 5 $0.00058 $0.00402
Haiku 4.5 $0.00029 $0.00201

Measured 3d ago against content hash 0c863bb7a13f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

self-governance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/mage/skills/self-governance/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Self-Governance

This skill applies MAGE to the agent's own engineering work. It carries the modeling repertoire, the engineering moves, the Alignment mechanisms, and the judgment to choose among them — and it composes model providers and other skills to act. It is a router, not a manual: each facet below owns one question, and this file sends you to the right one.

The engineering loop

Everything here supports one loop. Run it whenever you engineer.

       recognize the situation
                 |
         what do I need to know?
          /                    \
     MODEL                    ALIGN
   what is missing?        what must hold?
          \                    /
           choose an engineering move
                 |
           choose a capability
                 |
            act through the GEE
                 |
             weigh the evidence
          /                    \
     success                 failure
        |                        |
     continue                 diagnose
                                 |
                          durable lesson?
                           /          \
                          no          yes
                          |            |
                        repair     capitalize

MODEL and ALIGN are the two — and only two — MAGE activities. Modeling makes engineering knowledge explicit; Alignment gives that knowledge authority. Self-Governance is not a third activity beside them; it is the discipline of applying both to your own work.

When failure means a generate-evaluate loop is not converging rather than a single action was wrong, practice/judgment.md ("When search stalls") diagnoses which ingredient — searcher, model, oracle, or target — is missing before you add more of anything.

What this skill establishes

  • Self-Governance applies MAGE to the work. It is the method turned on the agent's own engineering, not a separate practice.
  • Modeling and Alignment remain the two activities. Self-Governance is not a third one.
  • The skill knows the method; model providers know the system. Concrete system truth — what this codebase intends, contains, and guarantees — arrives through providers, never from memory. See system/model-access.md.
  • Specialized capabilities come through other skills. Self-Governance chooses the move; a specialized skill executes it. See skills/repertoire.md.
  • Consequential action stays bounded by the GEE. Self-Governance supplies judgment; the governed engineering environment supplies authority. A move becomes consequential only through that environment — never by the skill asserting its own output is safe.
  • Self-Governance is not Self-Operate. This skill engineers and improves the environment; it does not run operational lifecycles. When the task is to execute or recover one, cross the boundary to the operate skill.
  • Self-Governance is not self-certification. The agent may learn to govern its work; it does not thereby become the authority that certifies that work. Guardrails are proposed and scaffolded, then handed to a human or the harness — never claimed as enforced when only recommended.

Read the full file on GitHub · 162 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 162 lines · 291 tokens per session scan A 0c863bb7a13f

Subscribe to this mod's changes

self-governance is a skill published in the GitHub repository davisjam/model-based-agentic-software-engineering (18 stars, last pushed 3d ago), licensed MIT. It adds 291 tokens to every session and 2,008 once invoked, about $0.0015 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

moai-ref-ui-polish

UI polish and interface-completion reference: the small visual details — concentric border radius, optical alignment, shadow-vs-border, motion easing, typography smoothing, tabular numbers, icon stroke weight, hit areas — that separate polished interfaces from generic ones. Agent-extending skill that amplifies…

modu-ai/moai-adk · 98 tokens

trellis-brainstorm

Guides collaborative requirements discovery before implementation. Creates task directory, seeds PRD, asks high-value questions one at a time, researches technical choices, and converges on MVP scope. Use when requirements are unclear, there are multiple valid approaches, or the user describes a new feature or complex…

mindfold-ai/Trellis · 65 tokens

llm-friendly-context

Clarifies inputs, outputs, success criteria, decisions, and unresolved conditions so downstream consumers can execute without guessing. Use when writing or revising LLM-facing prompts, handoffs, planning artifacts, reviews, reports, or generated instructions.

shinpr/claude-code-workflows · 52 tokens

link-check

Verify @file references in AIWG skills and agents against the linking contract — per-file or corpus-wide, with optional auto-fix.

jmagly/aiwg · 29 tokens

ralph-specum-requirements

This skill should be used only when the user explicitly asks to use $ralph-specum-requirements, or explicitly asks Ralph Specum in Codex to run the requirements phase.

tzachbon/smart-ralph · 45 tokens

eval-agent

Run evaluation tests against an agent to assess quality and archetype resistance.

jmagly/aiwg · 16 tokens