git-workflow

Guides branching, committing, pushing, and stacked PR workflows in Git repositories.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing Git operations safely is error-prone: developers risk overwriting unrelated work, committing secrets, pushing broken code, or mangling stacked pull requests. This Skill provides a disciplined, step-by-step Git workflow that preserves work in progress and enforces commit and branch conventions. ## Core Features & Use Cases - Safe Inspect-Branch-Commit-Push Pipeline: Checks working tree state, preserves unrelated changes, stages only intended files, and enforces conventional commit message formats. - Stacked PR Support: Integrates the gh stack GitHub CLI extension to build, submit, sync, and merge chains of small reviewable PRs for large or dependent changes. - Structured Results and Safety Rules: Returns JSON success/error payloads and enforces guardrails like never force-pushing main and never committing credentials. - Use Case: You have a large feature split into auth, API, and frontend layers. Use this Skill to create a stacked branch chain with gh stack, submit review-ready PRs, and keep each layer rebased and mergeable. ## Quick Start Ask the agent to create a feature branch, commit the current changes with a conventional commit message, and push it for review.

Frequently Asked Questions about git-workflow

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

FAQPage Schema
How do I create stacked pull requests on GitHub?▼

Install the gh-stack extension with gh extension install github/gh-stack, then run gh stack init, gh stack add for each layer, and gh stack submit --auto --open to push branches and open review-ready PRs. Each PR is based on the branch below it in the chain.

How do I commit changes without including unrelated work in progress?▼

Start by running git status --porcelain and git diff --stat to identify staged, unstaged, and untracked files. Stage only the intended files with git add, review the staged diff with git diff --cached, then commit with a conventional message.

What commit message format does this workflow use?▼

It uses a conventional format of type, subject, body, and footer. Types include feat, fix, refactor, test, docs, and chore, with imperative subjects and issue links in the footer.

Can I force-push to main or master with this workflow?▼

No. The workflow explicitly forbids force-pushing main or master and requires resolving conflicts and running the full test suite before any push. Destructive Git commands require explicit approval.

Why does gh stack submit create draft PRs instead of review-ready ones?▼

Drafts happen when the --open flag is omitted. Always run gh stack submit --auto --open, since drafts skip CI and review automation. Also pass non-interactive flags like --json and --yes to avoid blocking TTY prompts.

When should I use stacked PRs instead of a single branch?▼

Use stacked PRs for large or dependent changes that should land as a chain of small reviewable PRs rather than one big diff. Stacks are strictly linear, so use a separate stack per independent line of work.