branch-protection

Prevents direct commits and destructive operations on protected branches via configurable rules.

35|3|Updated Jun 24, 2025
One-click install
npx skills add https://github.com/intelligentcode-ai/intelligent-claude-code --skill branch-protection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: branch-protection
Source: https://github.com/intelligentcode-ai/intelligent-claude-code/tree/main/src/skills/branch-protection
Command: npx skills add https://github.com/intelligentcode-ai/intelligent-claude-code --skill branch-protection

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Branch protection prevents risky git operations by blocking direct commits to main/master and preventing destructive actions like force pushes or resets, enabling a reliable dev-first workflow.

Core Features & Use Cases

  • Enforce protected branches: prevent direct pushes to main and dev and require PR-based merges.
  • Dev-first workflow enforcement: ensure all changes flow through the dev branch before main.
  • Configurable rules: tweak protection behavior via icc.config.json.
  • Use Case: teams collaborate on features by creating feature/* branches, merging through dev, then releasing from dev to main.

Quick Start

Enable default protection by setting icc.config.json and create the Branch Hierarchy (main, dev, feature/*). Work on a feature branch, open a PR to dev, test, and once dev is stable, open a PR to main.

Frequently Asked Questions about branch-protection

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

FAQPage Schema
How do I prevent direct commits to main and dev branches in Git?

Branch protection prevents direct commits to main and dev branches by blocking direct pushes and requiring pull-request-based merges. You configure these rules via icc.config.json to govern protection without needing external tools.

How does branch protection work for a dev-first branching model?

Branch protection enforces a dev-first workflow by ensuring changes flow from feature/* branches through dev, then release from dev to main. It blocks destructive operations like force pushes to maintain this hierarchy.

Can I configure git branch protection rules without external tools?

Yes, you can configure branch protection rules without external tools by using the icc.config.json file. This allows you to tweak protection behavior and enforce rules using standard Git commands.

What is the best way to block force pushes and resets to protected branches?

The best way to block force pushes and resets to protected branches is by applying branch protection rules. This prevents destructive git operations, ensuring a reliable dev-first workflow without external dependencies.

Do I need a specific Git hosting platform to enforce branch protection locally?

No, you do not need a specific Git hosting platform to enforce branch protection locally. The Skill implements protection rules via icc.config.json and standard Git commands, requiring no external tools or platforms.