branch-discipline

Enforces branch-based Git workflows with pull requests and CI gating for all changes.

Updated Mar 10, 2026
One-click install
npx skills add https://github.com/jasoncrawford/brunel --skill branch-discipline-jasoncrawford
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: branch-discipline
Source: https://github.com/jasoncrawford/brunel/tree/main/.claude-plugin/skills/branch-discipline
Command: npx skills add https://github.com/jasoncrawford/brunel --skill branch-discipline-jasoncrawford

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents agents and developers from committing directly to main, bypassing CI, or mixing unrelated work on a single branch, which leads to broken builds, confusing reviews, and destructive cleanup. ## Core Features & Use Cases - Branch-Only Workflow: Requires every change, including one-line fixes and config edits, to go through a branch, pull request, and passing CI before reaching main. - PR and CI Discipline: Defines rules for opening PRs proactively, never enabling auto-merge, fixing CI failures on the same branch, and linking issues with closing keywords like "Closes #42". - One Concern Per Branch: Ensures specs, plans, and features each get dedicated branches, with guidance on worktrees, rebasing, and safe branch cleanup. - Use Case: When multiple AI agents work in parallel on a repository with GitHub Actions, this skill keeps each agent on its own branch so PRs stay reviewable and main stays green. ## Quick Start Ask the agent to implement a change following branch discipline so it creates a branch, commits the work, opens a pull request, and waits for CI and review.

Frequently Asked Questions about branch-discipline

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

FAQPage Schema
How do I stop AI agents from committing directly to main?▼

Apply a branch discipline workflow that treats main as read-only and routes every change through a branch and pull request. The agent pulls latest main, creates a branch, pushes it, opens a PR, and waits for CI and user review before merge.

How should agents handle CI failures on a pull request?▼

Fix CI failures on the same branch and push again so the PR updates and CI re-runs. Never merge with failing CI, bypass branch protection, or push the fix directly to main to unblock things.

When should I use a git worktree instead of a branch?▼

Use a worktree when the checkout is shared by multiple agents or a human working alongside you, to avoid cross-contamination. In an isolated checkout, such as a worker agent with its own clone, a plain branch is sufficient.

Does branch discipline apply to small one-line fixes?▼

Yes, every change including one-line fixes, config edits, docs, and dependency upgrades goes through a branch and PR. The workflow explicitly rejects the rationalization that small changes can skip the process.

Why should a spec or plan document get its own branch?▼

Each branch must contain only one concern, so a spec for feature X goes on a dedicated branch like docs/feature-x. Mixing documents into unrelated feature branches confuses reviewers and can require destructive force-push cleanup.

When does branch discipline not apply to a project?▼

It may not apply in early prototype stages or small repos with no automated tests and mostly config rather than code, where branch and PR overhead adds friction without safety. When in doubt, ask the user.