Skip to content

feat(git): add mainline direct commit protection rule#29

Merged
cblecker merged 1 commit intomainfrom
feat/mainline-commit-protection
Mar 11, 2026
Merged

feat(git): add mainline direct commit protection rule#29
cblecker merged 1 commit intomainfrom
feat/mainline-commit-protection

Conversation

@cblecker
Copy link
Owner

@cblecker cblecker commented Mar 11, 2026

Summary

  • Add explicit NEVER rule to the Git Safety Protocol prohibiting direct commits to the mainline branch unless the user explicitly requests it
  • This protection was present in the old skill-based architecture (PR feat(git): auto-create feature branch when committing on mainline #12, feat/auto-branch-on-mainline) but was lost during the SessionStart rewrite (c2daccb)
  • Uses the same "escape hatch" pattern as the destructive commands rule — blocked by default, overridable with explicit user request

Test plan

  • Run bash git/scripts/git-instructions.sh in a repo with main as mainline — verify output contains "NEVER commit directly to main"
  • Run bash git/scripts/git-instructions.sh in a repo with master as mainline — verify output uses "master" instead
  • Run claude plugin validate ./git — verify validation passes

Summary by CodeRabbit

  • Chores

    • Plugin version bumped to 1.2.0.
  • Documentation

    • Updated development guidelines to enhance safety by preventing direct commits to the main branch without explicit authorization.

Add explicit NEVER rule to the Git Safety Protocol prohibiting direct
commits to the mainline branch unless the user explicitly requests it.
This protection was present in the old skill-based architecture (PR #12)
but was lost during the SessionStart rewrite.

Assisted-by: Claude:claude-opus-4-6
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: cblecker/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ea0f4afb-b68a-4be4-9313-39844ccdc2c8

📥 Commits

Reviewing files that changed from the base of the PR and between f3fd7ee and 3715df7.

📒 Files selected for processing (2)
  • git/.claude-plugin/plugin.json
  • git/scripts/git-instructions.sh

Walkthrough

Version bump of the Claude plugin from 1.1.1 to 1.2.0 and addition of a new safety rule to prevent direct commits to the MAINLINE branch without creating a feature branch first.

Changes

Cohort / File(s) Summary
Plugin Version Update
git/.claude-plugin/plugin.json
Version field bumped from 1.1.1 to 1.2.0.
Git Workflow Safety Rules
git/scripts/git-instructions.sh
Added new prohibition: prevents direct commits to MAINLINE; requires creating a feature branch before committing when on MAINLINE.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a rule to prevent direct commits to the mainline branch, which aligns with the core modification in git-instructions.sh and the stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed The PR modifies only a JSON configuration file and a bash script with no Go test code or Ginkgo test titles present.
Test Structure And Quality ✅ Passed This PR contains no Ginkgo test code, only version bump and Bash script changes, making the Ginkgo check inapplicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/mainline-commit-protection

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cblecker cblecker merged commit 5b26201 into main Mar 11, 2026
7 checks passed
@cblecker cblecker deleted the feat/mainline-commit-protection branch March 11, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant