create-git-branch

Generate Git branch names and create branches from an updated base.

2|Updated Jun 1, 2017
One-click install
npx skills add https://github.com/carlos-algms/dotfiles --skill create-git-branch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-git-branch
Source: https://github.com/carlos-algms/dotfiles/tree/main/AI-configs/skills/create-git-branch
Command: npx skills add https://github.com/carlos-algms/dotfiles --skill create-git-branch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents chaotic branch naming and unsafe Git operations by enforcing a consistent workflow for creating new branches from an up-to-date base branch.

Core Features & Use Cases

  • Hard safety rules for branch creation: Requires explicit user intent, pulls the base branch before branching, and forbids risky commands by using only git switch / git switch -c.
  • Consistent naming conventions: Supports Jira-based names (cgomes/XXX-000-short-topic) or scope-based names (scope/short-topic) with strict kebab-case and character/format constraints.
  • Workflow with guardrails: Ensures the branch name is shown before creation, optionally performs draft-only suggestions, and asks when required inputs (like base scope) are unclear; also prompts when switching would discard uncommitted work.

Quick Start

Tell the AI to create a new branch from your Jira ticket or your goal (for example, "Create a new branch for XXX-1234 to fix login redirect").

Frequently Asked Questions about create-git-branch

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

FAQPage Schema
How do I create a new git branch from a Jira ticket ID?

The workflow generates a Jira-based branch name like user/XXX-000-short-topic, validates kebab-case formatting, and creates the branch using git switch -c. You simply provide the Jira identifier and confirm the branch name before creation.

What is the safest way to create feature branches and avoid losing uncommitted work?

Safe branch creation uses git switch exclusively, pulls the base branch with fast-forward-only behavior, and prompts you if switching would discard uncommitted work. It requires explicit authorization before creating the new branch.

How do I enforce consistent git branch naming conventions for my team?

Consistent branch naming is enforced through strict kebab-case and character constraints. The workflow supports Jira-based names like user/XXX-000-short-topic or scope-based names like scope/short-topic to maintain version control safety.

Can I create a git branch without pulling the latest changes from the base branch?

No, the workflow runs git pull on the selected base branch with fast-forward-only behavior before creating the new branch. This ensures your feature, fix, docs, or test branch starts from a consistently updated base.

Why does git switch fail when trying to create a branch with uncommitted changes?

Git switch blocks branch creation to prevent losing uncommitted work. The workflow detects this scenario and explicitly prompts you, ensuring you stash or commit changes before proceeding with the branch creation workflow.

Does this branch creation workflow support draft-only branch name suggestions?

The workflow optionally performs draft-only branch name suggestions, but blocks actual creation for draft-only requests. It requires explicit user authorization before executing git switch -c to create the branch.