Commit Discipline
Commit discipline is a session-scoped layer injected into AGENTS.md and reinforced by SessionStart hooks. It differs from governances — disciplines are always-on rules the agent follows every session, not reference standards loaded on demand.
What it is
Section titled “What it is”Commit discipline encodes:
- When to commit — after each unit of work, not at the end
- What counts as a unit — one coherent, independently revertable change
- How to stage —
git add <files>, verify withgit diff --cached - Message format — Conventional Commits
Unit of work: one coherent, independently revertable change — one feature, one bugfix, one refactor in one domain, one config change. Never two unrelated concerns in one commit. A TDD red-green-refactor cycle alone is not a commit boundary; commit when the full intended change is complete and tests pass.
- Use Conventional Commits:
feat:,fix:,refactor:,test:,docs:,chore: - One concern per commit; never batch unrelated changes
- Stage only files for this unit:
git add <files>, then verify withgit diff --cached - Never use
git add .,git add -A, orgit add -p(interactive — agents cannot run it) - Never commit with red tests; run the repo’s validation command first
Auto-commit
Section titled “Auto-commit”When opted in, the auto-commit rule adds:
When a unit of work is complete and verified, commit it immediately — do not wait for the user to ask. Batching multiple units into one commit, or finishing all work before committing, are both violations of this rule.
Auto-commit is opt-in — the init-commit-discipline skill (commit-discipline plugin) asks before injecting this rule.
Conventional Commits reference
Section titled “Conventional Commits reference”| Type | When to use |
|---|---|
feat: | New feature or behavior |
fix: | Bug fix |
refactor: | Code change with no behavior change |
test: | Adding or updating tests |
docs: | Documentation only |
chore: | Tooling, config, dependencies |
Scopes are optional: feat(auth):, fix(cli):. Subject line: imperative mood, ≤72 characters.
Setting it up
Section titled “Setting it up”Run init-commit-discipline to inject the rules and register the SessionStart hook:
# Install the skill (solo, globally)npx skills add cyberuni/cyberplace --skill init-commit-discipline -gThen in your agent: run the init-commit-discipline skill.
The skill:
- Resolves a commit helper skill
- Asks about auto-commit opt-in
- Injects
## Commit DisciplineintoAGENTS.md - Registers a SessionStart hook — reinjects the rules at every session start
How it works at runtime
Section titled “How it works at runtime”On Claude Code, Cursor, and Codex, a SessionStart hook runs:
npx cyberplace@<version> hook run \ --extract AGENTS.md \ --heading "Commit Discipline"This injects the ## Commit Discipline section from AGENTS.md into the agent’s context at the start of every session — so the rules are active without the agent having to load them manually.
For agents without hook support, the AGENTS.md section alone carries the rules.
Upgrading
Section titled “Upgrading”After upgrading cyberplace, re-run init-commit-discipline to bump the pinned version in the SessionStart hook command.
Related
Section titled “Related”- the
init-commit-disciplineskill (commit-disciplineplugin) — sets up commit discipline in a repo - the
commitskill (commit-disciplineplugin) — minimal commit helper - hook CLI —
hook registerandhook runcommands