git-workflow

Automates git branching, committing, PR creation, stacking, and release versioning with enforced safety rules.

Updated Aug 3, 2026
One-click install
npx skills add https://github.com/m-de-graaff/skills --skill git-workflow-m-de-graaff
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-workflow
Source: https://github.com/m-de-graaff/skills/tree/main/skills/git-workflow
Command: npx skills add https://github.com/m-de-graaff/skills --skill git-workflow-m-de-graaff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? It removes the burden of remembering git hygiene during a coding session: when to commit, how to split changes, when to branch or open a PR, and how to version a release — while hard-blocking destructive commands like force-push without a lease, reset --hard, and --no-verify. ## Core Features & Use Cases - Repo profiling and checkpoint commits: Detects whether a repo is work (PRs mandatory) or solo, and commits automatically at defined thresholds (5 files, 150 lines, red-to-green tests) using Conventional Commits with repo-derived scopes. - Secret scanning and destructive-command guardrails: Scans staged content for credentials before every commit (via gitleaks or built-in rules) and ships PreToolUse/Stop/SessionStart hooks that block dangerous git operations. - PRs, stacking, and releases: Generates PR bodies from the commit range, stacks PRs via gh stack with a plain-PR fallback, and applies SemVer/release-please rules including rc-to-stable promotion. - Use Case: You finish a refactor across 8 files; the skill scans for secrets, splits the work into two logical commits, pushes a feature branch, and opens a draft PR with a structured body — then marks it ready once CI goes green. ## Quick Start Ask the assistant to commit the current changes and open a pull request, and the skill will profile the repo, scan for secrets, split the commits, and draft the PR automatically.

Frequently Asked Questions about git-workflow

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

FAQPage Schema
How do I automate git commits and pull requests during a coding session?▼

The skill commits automatically at defined checkpoints — 5 files, 150 changed lines, or a red-to-green test transition — using Conventional Commits. It opens PRs with bodies built from the commit range, kept as drafts until CI is green.

How to scan staged files for secrets before committing?▼

Run the included scan-secrets.sh script, which checks staged content for env files, provider key formats, private key blocks, and credential-shaped assignments. It delegates to gitleaks when installed and exits non-zero to block the commit on any finding.

When should I stack PRs instead of opening one large PR?▼

Stack only when the change is at least 400 lines, has 3 or more dependency-ordered layers, and each layer is independently reviewable and revertible. Below that threshold a single PR is cheaper; the skill uses gh stack when available and chained-base PRs otherwise.

Does the skill work with branch protection and team repos?▼

Yes. It profiles the repo first: branch protection, CODEOWNERS, or multiple committers mark it as a work repo where PRs are mandatory and nothing is pushed to the default branch. Solo repos allow small direct commits under strict limits.

Can I disable the git hooks for a single repository?▼

Yes. Create an empty file at .claude/git-workflow-off in the repo root and every script exits early. The skill still performs explicitly requested git work but stops volunteering, and deleting the file re-enables it.

What git commands does the PreToolUse hook block?▼

It blocks force-push without --force-with-lease, force-push to the default branch, reset --hard, clean -fd, checkout or restore over uncommitted work, --no-verify, filter-branch, gh pr merge --admin, stash drop, and reflog expire, each with a suggested safe alternative.