Skip to content
manage-branch logo

Manage Branch Skill

manage-branch

Creates and manages git branches with enforced mriley/ prefix naming convention. Validates branch names, switches branches safely, and handles branch creation with proper base branch selection.

SKILL.md

Full skill instructions

Manage Branch Skill

Purpose

Enforce branch naming conventions and provide safe branch creation/​switching operations with proper validation.

CRITICAL POLICY

Branch Naming Convention

ALL branches MUST be prefixed with mriley/

Valid branch name patterns:

  • mriley/​feat/<descriptive-name>
  • mriley/​fix/<issue-description>
  • mriley/​refactor/<component-name>
  • mriley/​perf/<optimization-description>
  • mriley/​chore/<task-description>
  • mriley/​docs/<documentation-update>
  • mriley/​test/<testing-addition>

Examples of CORRECT names:

  • ✅ mriley/​feat/​user-authentication
  • ✅ mriley/​fix/​parser-null-handling
  • ✅ mriley/​refactor/​api-validation
  • ✅ mriley/​perf/​optimize-query-performance

Examples of INCORRECT names:

  • ❌ feat/​user-authentication (missing mriley/ prefix)
  • ❌ user-authentication (missing prefix and type)
  • ❌ fix-bug (missing mriley/ prefix)
  • ❌ pedro/​feat/​something (wrong user prefix)

Workflow

Operation 1: Create New Branch

Step 1.1: Determine Branch Type

Ask user or infer from context:

  • feat: New feature
  • fix: Bug fix
  • refactor: Code restructuring
  • perf: Performance improvement
  • chore: Maintenance task
  • docs: Documentation
  • test: Test additions
Step 1.2: Generate Branch Name

Based on work description, generate name:

Format:

mriley/<type>/<short-descriptive-name>

Naming guidelines:

  • Use kebab-case (lowercase with hyphens)
  • Be descriptive but concise (2-4 words)
  • Focus on WHAT, not HOW
  • Avoid ticket numbers (unless no description)
  • Max 50 characters total

Examples:

mriley/​feat/​jwt-authentication
mriley/​fix/​memory-leak-parser
mriley/​refactor/​split-monolithic-handler
mriley/​perf/​cache-database-queries
Step 1.3: Validate Branch Name

Check against requirements:

  • ✅ Starts with mriley/
  • ✅ Has type (feat/​fix/​refactor/​etc)
  • ✅ Has descriptive name
  • ✅ Uses kebab-case
  • ✅ Length ≤ 50 characters
Step 1.4: Check Current Git Status
git status

If uncommitted changes exist:

⚠️ Uncommitted changes detected

You have uncommitted changes in your working directory:
- src/​api/​handlers.go (modified)
- pkg/​auth/​validator.go (new file)

Options:
1. Commit changes first (recommended)
2. Stash changes: git stash
3. Discard changes: git restore . (DANGEROUS)

What would you like to do?

STOP and wait for user decision.

Step 1.5: Determine Base Branch

Check which branch to create from:

git branch --show-current

Common scenarios:

  • On main/master → Create from current (typical)
  • On feature branch → Ask if creating from current or from main
  • On develop → Create from current (if using gitflow)

If uncertain, ask user:

Create branch from:
1. Current branch (main)
2. Different branch (specify)
Step 1.6: Create Branch
git checkout -b mriley/<type>/<name>

Or if creating from specific base:

git checkout -b mriley/<type>/<name> origin/​main
Step 1.7: Verify Creation
git branch --show-current

Report success:

✅ Branch created successfully

Branch: mriley/​feat/​jwt-authentication
Base: main
Status: Clean working directory

You can now start working on this branch.

Operation 2: Switch Branch

Step 2.1: Check Current Status
git status

If uncommitted changes:

⚠️ Uncommitted changes detected

Cannot switch branches with uncommitted changes.

Options:
1. Commit changes first (recommended)
2. Stash changes: git stash
3. Discard changes: git restore . (DANGEROUS)

What would you like to do?

STOP and wait for user decision.

Step 2.2: List Available Branches (Optional)

If user unsure which branch to switch to:

git branch -v

Show branches with descriptions:

Available branches:
* main                    a1b2c3d Last commit message
  mriley/​feat/​auth        d4e5f6g Add JWT validation
  mriley/​fix/​parser-bug   g7h8i9j Fix null pointer
Step 2.3: Switch Branch
git checkout <branch-name>

Or fetch and checkout remote branch:

git fetch origin
git checkout -b <branch-name> origin/<branch-name>
Step 2.4: Verify Switch
git branch --show-current

Report success:

✅ Switched to branch: mriley/​feat/​auth

Branch: mriley/​feat/​auth
Latest commit: d4e5f6g Add JWT validation
Status: Up to date with origin/​mriley/​feat/​auth

Operation 3: Validate Existing Branch Name

If checking/​fixing existing branch that doesn't follow convention:

Step 3.1: Get Current Branch
git branch --show-current
Step 3.2: Validate Name

Check if matches mriley/<type>/<name> pattern.

If invalid:

⚠️ Branch name doesn't follow convention

Current: feat/​user-authentication
Required: mriley/​feat/​user-authentication

This branch should be renamed to follow convention.

Options:
1. Rename current branch: git branch -m mriley/​feat/​user-authentication
2. Create new branch with correct name
3. Continue with current name (NOT recommended)

What would you like to do?
Step 3.3: Rename Branch (If Requested)
# Rename local branch
git branch -m mriley/<type>/<name>

# If already pushed, delete old remote and push new
git push origin --delete <old-name>
git push -u origin mriley/<type>/<name>

Integration with Other Skills

This skill is invoked by:

  • create-pr - When creating pull request

This skill may invoke:

  • safe-commit - If user wants to commit before switching

Error Handling

Error: Branch already exists

❌ Branch already exists: mriley/​feat/​auth

Options:
1. Switch to existing branch: git checkout mriley/​feat/​auth
2. Use different name: mriley/​feat/​auth-v2
3. Delete existing branch (DANGEROUS - requires confirmation)

What would you like to do?

Error: Invalid branch name

❌ Invalid branch name

Provided: pedro/​feat/​something
Issue: Must use 'mriley/' prefix, not 'pedro/'

Corrected: mriley/​feat/​something

Shall I use the corrected name?

Error: Cannot switch (uncommitted changes)

❌ Cannot switch branches

Uncommitted changes in:
- src/​api/​handlers.go
- pkg/​auth/​validator.go

Please commit or stash changes first.

Error: Branch doesn't exist

❌ Branch doesn't exist: mriley/​feat/​nonexistent

Available branches matching 'feat':
- mriley/​feat/​auth
- mriley/​feat/​parser

Did you mean one of these?

Best Practices

  1. Always validate - Check branch name follows convention
  2. Check git status - Ensure clean state before operations
  3. Descriptive names - Help future you understand the work
  4. Confirm with user - When renaming or making destructive changes
  5. Report clearly - Show before/​after state
  6. Handle errors gracefully - Provide options, not just errors

Branch Naming Examples

Good Examples

Features:

  • mriley/​feat/​oauth-integration
  • mriley/​feat/​real-time-notifications
  • mriley/​feat/​export-to-csv

Bug Fixes:

  • mriley/​fix/​race-condition-handler
  • mriley/​fix/​memory-leak-cache
  • mriley/​fix/​null-pointer-parser

Refactoring:

  • mriley/​refactor/​extract-validation-logic
  • mriley/​refactor/​split-large-service
  • mriley/​refactor/​improve-error-handling

Performance:

  • mriley/​perf/​optimize-database-queries
  • mriley/​perf/​add-response-caching
  • mriley/​perf/​reduce-memory-allocation

Bad Examples (and corrections)

❌ new-feature → ✅ mriley/​feat/​new-feature ❌ fix-bug-123 → ✅ mriley/​fix/​authentication-timeout ❌ feat/​auth → ✅ mriley/​feat/​auth ❌ mriley/​UpdateCode → ✅ mriley/​refactor/​update-validation-code ❌ mriley/​WIP → ✅ mriley/​feat/​descriptive-name-here


Quick Reference

Create branch:

git checkout -b mriley/​feat/​descriptive-name

Switch branch:

git checkout mriley/​feat/​existing-branch

Rename branch:

git branch -m mriley/​feat/​new-name

List branches:

git branch -v

Delete branch (local):

git branch -d mriley/​feat/​old-branch

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View