Generate semantic branch names from work item metadata following conventions
Generates semantic branch names from work item metadata following conventions. Used by repo-manager and /repo:branch command when creating branches from work items.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-repo@fractaryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Your responsibility is to generate semantic, convention-compliant branch names from work item metadata. You take work item information (ID, type, description) and produce branch names that follow the configured naming pattern.
You are invoked by:
You delegate to the active source control handler to generate platform-specific branch names. </CONTEXT>
<CRITICAL_RULES> NEVER VIOLATE THESE RULES:
Branch Naming Conventions
Validation
Handler Invocation
Idempotency
{
"operation": "generate-branch-name",
"parameters": {
"prefix": "feat",
"description": "add user export feature",
"work_id": "123" // optional
}
}
Required Parameters:
prefix (string) - Branch prefix: feat|fix|chore|hotfix|docs|test|refactor|style|perfdescription (string) - Brief description for branch slugOptional Parameters:
work_id (string) - Work item identifier (if provided, will be included in branch name)pattern (string) - Override default branch naming pattern
</INPUTS>
1. OUTPUT START MESSAGE:
šÆ STARTING: Branch Name Generator
Work ID: {work_id or "none"}
Type: {prefix}
Description: {description}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
2. LOAD CONFIGURATION:
Load repo configuration to determine:
Use repo-common skill to load configuration.
3. VALIDATE INPUTS:
4. INVOKE HANDLER:
Invoke the active source control handler skill.
IMPORTANT: You MUST use the Skill tool to invoke the handler. The handler skill name is constructed as follows:
config.handlers.source_control.active (e.g., "github")fractary-repo:handler-source-control-<platform>fractary-repo:handler-source-control-githubDO NOT use any other handler name pattern. The correct pattern is always fractary-repo:handler-source-control-<platform>.
Use the Skill tool with:
fractary-repo:handler-source-control-<platform> (where <platform> is from config)The handler will:
5. VALIDATE RESPONSE:
6. OUTPUT COMPLETION MESSAGE:
ā
COMPLETED: Branch Name Generator
Branch Name: {branch_name}
Pattern Used: {pattern}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Next: Create branch with branch-manager skill or return name to caller
</WORKFLOW>
<COMPLETION_CRITERIA> ā Configuration loaded successfully ā All inputs validated ā Handler invoked and returned success ā Branch name generated following conventions ā Branch name is Git-compatible </COMPLETION_CRITERIA>
<OUTPUTS> Return structured JSON response:{
"status": "success",
"operation": "generate-branch-name",
"branch_name": "feat/123-add-user-export-feature",
"pattern": "feat/{issue_id}-{slug}",
"platform": "github"
}
On Error:
{
"status": "failure",
"operation": "generate-branch-name",
"error": "Invalid branch prefix: invalid-type",
"error_code": 2
}
</OUTPUTS>
<HANDLERS>
This skill uses the handler pattern to support multiple platforms:
The active handler is determined by configuration: config.handlers.source_control.active
</HANDLERS>
<ERROR_HANDLING>
Invalid Inputs (Exit Code 2):
Configuration Error (Exit Code 3):
Handler Error (Exit Code 1):
Branch Name Validation Error (Exit Code 2):
</ERROR_HANDLING>
<USAGE_EXAMPLES>
Example 1: Generate Feature Branch Name (with work_id)
INPUT:
{
"operation": "generate-branch-name",
"parameters": {
"prefix": "feat",
"description": "add CSV export functionality",
"work_id": "123"
}
}
OUTPUT:
{
"status": "success",
"branch_name": "feat/123-add-csv-export-functionality"
}
Example 2: Generate Feature Branch Name (without work_id)
INPUT:
{
"operation": "generate-branch-name",
"parameters": {
"prefix": "feat",
"description": "add CSV export functionality"
}
}
OUTPUT:
{
"status": "success",
"branch_name": "feat/add-csv-export-functionality"
}
Example 3: Generate Fix Branch Name
INPUT:
{
"operation": "generate-branch-name",
"parameters": {
"prefix": "fix",
"description": "authentication timeout bug",
"work_id": "456"
}
}
OUTPUT:
{
"status": "success",
"branch_name": "fix/456-authentication-timeout-bug"
}
Example 4: Custom Pattern
INPUT:
{
"operation": "generate-branch-name",
"parameters": {
"prefix": "feat",
"description": "user dashboard",
"work_id": "789",
"pattern": "{prefix}_{issue_id}_{slug}"
}
}
OUTPUT:
{
"status": "success",
"branch_name": "feat_789_user_dashboard"
}
</USAGE_EXAMPLES>
<INTEGRATION>Called By:
repo-manager agent - For programmatic branch name generation/repo:branch command - For user-initiated branch creationframe-manager - During Frame phase setupCalls:
repo-common skill - For configuration loadinghandler-source-control-{platform} skill - For platform-specific name generationDoes NOT Call:
This skill is lightweight and focused:
By separating branch naming from branch creation, we enable: