Skill: get-branch-name
Generate or extract a git branch name for the current feature work.
Purpose
Standardize branch naming across Ralph projects for consistent git workflow.
Branch Naming Convention
code
feature/{kebab-case-project-or-feature-name}
Examples
| Project/Feature | Branch Name |
|---|---|
| Calculator Web API | feature/calculator-web-api |
| User Authentication | feature/user-authentication |
| Pharmacy Slack Bot | feature/pharmacy-slack-bot |
| Bug Fix: Login Timeout | bugfix/login-timeout |
Rules
- •Use
feature/prefix for new features (default) - •Use
bugfix/prefix for bug fixes - •Use
refactor/prefix for refactoring work - •Convert project name to kebab-case (lowercase, hyphens)
- •Keep branch names under 50 characters
- •No special characters except hyphens
How to Determine Branch Name
- •Read the
## Project Overviewsection ofprd.md - •Extract the Project Name field
- •Convert to kebab-case
- •Prefix with
feature/(or appropriate prefix)
PowerShell Example
powershell
$line = Get-Content prd.md | Where-Object { $_ -match "Project Name:" } | Select-Object -First 1
$projectName = ($line -replace '.*:\s*', '').Trim().ToLower() -replace '\s+', '-' -replace '[^a-z0-9-]', ''
$branchName = "feature/$projectName"
Write-Output $branchName
Git Workflow Integration
powershell
# Create and switch to feature branch $branchName = # ... extract as above git checkout -b $branchName # After Ralph completes, push and create PR git push -u origin $branchName