openspec-git-discipline

openspec-git-discipline is a skill for Claude Code, Codex from intent-driven-dev/intent-driven-template. It costs 41 tokens per session (646 once invoked), scanned A, original, MIT.

A set of rules for managing Git while using OpenSpec, a workflow that records proposed changes before they are implemented and archived.

In plain words
What is it for?
Use it during OpenSpec propose, continue, apply, verify, archive, branch, merge, and worktree workflows to check when changes must reach main.
Why use it?
It prevents proposal, implementation, and archive artifacts from appearing in the wrong branch or in the wrong order in the project history.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it during OpenSpec propose, continue, apply, verify, archive, branch, merge, and worktree workflows to check when changes must reach main.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/intent-driven-dev/intent-driven-template/openspec-git-discipline
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.

Any agent
npx skills add intent-driven-dev/intent-driven-template --skill openspec-git-discipline
Clone the repo
git clone --depth 1 https://github.com/intent-driven-dev/intent-driven-template

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openspec-git-discipline

README.md
[![agentmods](https://agentmods.dev/badge/skills/intent-driven-dev/intent-driven-template/openspec-git-discipline/github.svg)](https://agentmods.dev/skills/intent-driven-dev/intent-driven-template/openspec-git-discipline)
Your own site
<a href="https://agentmods.dev/skills/intent-driven-dev/intent-driven-template/openspec-git-discipline"><img src="https://agentmods.dev/badge/skills/intent-driven-dev/intent-driven-template/openspec-git-discipline/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for openspec-git-discipline

Your own site · 80×15
<a href="https://agentmods.dev/skills/intent-driven-dev/intent-driven-template/openspec-git-discipline"><img src="https://agentmods.dev/badge/skills/intent-driven-dev/intent-driven-template/openspec-git-discipline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 646 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 57
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.1 $0.00041 $0.00646
Opus 5.5 $0.00016 $0.00258
Sonnet 5.5 $0.00008 $0.00129
Haiku 4.5 $0.00004 $0.00065

Measured 1mo ago against content hash a5d5bcbfaaa9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

openspec-git-discipline 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 1mo 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.

.agents/skills/openspec-git-discipline/SKILL.md · 62 lines

How it starts

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

OpenSpec Git Discipline

Core Rule

Every OpenSpec state change must cross main before the next lifecycle phase depends on it.

  • Propose/continue artifacts may be drafted on a branch, but must be committed and merged to main before apply starts.
  • Apply may run on main, a branch, or a worktree only if that exact proposal change is already available on main.
  • Archive may run only from main after implementation is merged back.

Never create commits, branches, or merges unless the user explicitly asks.

Gates

Moment Gate
Before propose Prefer main; if not, warn and ask whether to continue intentionally.
During continue Before creating the next artifact, ask the user to commit completed artifact changes or explicitly continue without that checkpoint.
After propose Ask the user to commit proposal artifacts; offer to create a PR branch for review.
Before apply Confirm the proposal change is committed on main; then apply may run from main, a branch, or a worktree.
Before archive Stop unless implementation is merged back to main and archive is running from main.
After archive Ask the user to commit archive/spec sync changes.

Required Checks

Before apply:

  1. Run git status --short.
  2. Verify openspec/changes/<change>/ has no uncommitted proposal files.
  3. Verify the proposal change exists on main before applying from any branch/worktree.

Use this language if the proposal has not reached main:

I should not apply this yet because the proposal change has not reached main. A proposal can be drafted on a branch, but apply must start only after that proposal state is available on main. Please merge or commit the proposal to main first, then I can apply from main, a branch, or a worktree.

Before archive:

  1. Run git branch --show-current and git status --short.
  2. Stop if not on main.
  3. Stop if implementation work has not been merged back to main.

Use this language:

Read the full file on GitHub · 62 lines

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. 1mo ago First seen · 62 lines · 41 tokens per session scan A a5d5bcbfaaa9

Subscribe to this mod's changes

openspec-git-discipline is a skill published in the GitHub repository intent-driven-dev/intent-driven-template (169 stars, last pushed yesterday), licensed MIT. It adds 41 tokens to every session and 646 once invoked, about $0.0002 per session on Opus 5.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.