git-discipline

Enforces branch, commit, squash, and push rules with an L0-L3 autonomy ladder for agent workflows.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/toderian/project_template --skill git-discipline-toderian
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-discipline
Source: https://github.com/toderian/project_template/tree/main/plugins/agents-core/skills/git-discipline
Command: npx skills add https://github.com/toderian/project_template --skill git-discipline-toderian

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Agents working in git repositories often make inconsistent branching decisions, write poor commit messages, or attempt dangerous operations like pushes and history rewrites. This Skill provides canonical rules for where to commit, how to write commits, when to squash, and how far an agent may act autonomously. ## Core Features & Use Cases - Repo Mode Resolution: Determines whether work happens on the default branch, current branch, or a task branch based on user instructions, AGENTS.md, task metadata, or .config/repos.project.md. - Commit Discipline: Enforces conventional commit summaries with a structured What changed / Why / Checks body, sliced into coherent reviewable units. - Push and Safety Rules: Treats pushing as a human-only action blocked by the block-dangerous-git hook, and routes squashing through the agents-core:squash-workspace-commits skill. - Autonomy Ladder (L0-L3): Caps agent behavior from read-only inspection (L0) through local commits (L1), branch push and CI repair (L2), to draft PR validation (L3), with strict precedence resolution. - Use Case: An agent implementing a tracked task checks the repo registry, confirms L1 autonomy, commits each phase slice with a structured message, and stops before pushing. ## Quick Start Ask the agent to commit the current changes following the git-discipline rules and confirm the repo's work mode and autonomy level first.

Frequently Asked Questions about git-discipline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a conventional commit message for agent work?

Use a concise conventional summary line with a prefix like feat:, fix:, or chore:, followed by a body structured as What changed, Why, and Checks. Stage only files belonging to the completed slice and run relevant checks first.

How do I decide which git branch an agent should work on?

Resolve the repo work mode from user instructions, task files, AGENTS.md, or `.config/repos.project.md`. Modes include default-branch, same-branch, task-branch, read-only, and ask; do not create feature branches unless the mode or user requires it.

What are autonomy levels L0 through L3 for coding agents?

L0 is read-only inspection, L1 allows local edits and commits, L2 adds pushing and CI repair on the approved branch, and L3 adds draft PR creation and validation. The default is L1, and the strictest applicable rule always wins.

Can an agent push commits or force-push at higher autonomy levels?

No. The block-dangerous-git hook refuses git push, reset --hard, branch -D, and similar commands at every autonomy level including L2 and L3. Pushing is treated as a human action requiring explicit user confirmation at the time of action.

When should task commits be squashed in git history?

Squash only after a task is fully implemented, validated, and reviewed, and route the cleanup through the agents-core:squash-workspace-commits skill. Never rewrite pushed or shared history without explicit user approval.