Create a new Git branch with semantic naming or direct branch name
Creates a new Git branch with semantic naming or direct branch name.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-repo@fractary["<branch-name-or-description>"] [--base <branch>] [--prefix <prefix>] [--work-id <id>] [--worktree] [--spec-create]claude-haiku-4-5This command supports:
<CRITICAL_RULES> YOU MUST:
YOU MUST NOT:
THIS COMMAND IS ONLY A ROUTER.
Note: The repo-manager agent handles all work tracking integration, including:
Build structured request (DO NOT fetch issue - agent handles this atomically)
/): branch_name, base_branch, work_id (optional), create_worktree, spec_create/): description, prefix, base_branch, work_id (optional), create_worktree, spec_createCRITICAL: For semantic mode, do NOT fetch the issue yourself. Pass mode: "semantic" with just work_id to the agent. The agent will:
ACTUALLY INVOKE the Task tool
Return agent response
<ARGUMENT_SYNTAX>
This command follows the space-separated argument syntax (consistent with work/repo plugin family):
--flag value (NOT --flag=value)--base "feature branch" ✅--base feature branch ❌Always use quotes for multi-word values:
✅ /repo:branch-create 123 "add CSV export feature"
✅ /repo:branch-create 123 "fix authentication bug" --base develop
❌ /repo:branch-create 123 add CSV export feature
❌ /repo:branch-create 123 fix authentication bug --base develop
Single-word values don't require quotes:
✅ /repo:branch-create 123 add-csv-export
✅ /repo:branch-create 123 fix-bug --prefix bugfix
✅ /repo:branch-create 123 add-feature --base develop
Branch names and descriptions:
add-csv-export ✅fix-authentication-bug ✅"add CSV export" ✅"fix authentication bug" ✅
</ARGUMENT_SYNTAX><PARSING_LOGIC>
This command intelligently determines the invocation mode based on the arguments:
Pattern: First arg contains / (looks like a branch name)
/repo:branch-create feature/my-new-feature
/repo:branch-create bugfix/authentication-fix --base develop
/repo:branch-create feature/123-add-export --work-id 123
Parsing:
branch_name = first argumentbase_branch = --base value or "main"work_id = --work-id value (optional)Pattern: First arg doesn't contain /
/repo:branch-create "my experimental feature" --prefix feat
/repo:branch-create "add CSV export" --prefix feat --work-id 123
/repo:branch-create "quick-fix" --prefix fix
Parsing:
description = first argumentprefix = --prefix value or "feat"work_id = --work-id value (optional){prefix}/{work_id-}{description-slug} if work_id provided, otherwise {prefix}/{description-slug}Pattern: No first arg, only --work-id provided
/repo:branch-create --work-id 123
/repo:branch-create --work-id 123 --prefix feat
/repo:branch-create --work-id 123 --base develop
Parsing:
work_id = --work-id value (required)prefix = --prefix value or inferred from issue type{prefix}/{work_id-}{issue-title-slug}Process:
/fractary-work:issue-fetch {work_id} to retrieve issue detailsIF no first argument AND --work-id provided THEN
Mode 3: Semantic mode (fetch issue title)
ELSE IF first arg contains "/" THEN
Mode 1: Direct branch name
ELSE IF first arg provided THEN
Mode 2: Description-based naming
ELSE
ERROR: Either branch name/description OR --work-id is required
END
</PARSING_LOGIC>
<ARGUMENT_PARSING>
<branch-name-or-description> (string): Either a full branch name (e.g., "feature/my-branch") or a description (e.g., "add CSV export")
--work-id is provided. When only --work-id is given, the issue title is fetched automatically.--base <branch> (string): Base branch name to create from (default: main/master)--prefix <type> (string): Branch prefix - feat, fix, hotfix, chore, docs, test, refactor, style, perf (default: feat)--work-id <id> (string or number): Work item ID to link branch to (e.g., "123", "PROJ-456"). Optional, but if provided alone (without description), enables semantic mode where issue title is fetched automatically.--worktree (boolean flag): Create a git worktree for parallel development. No value needed, just include the flag--spec-create (boolean flag): Automatically create a specification after branch creation (requires fractary-spec plugin and --work-id). No value needed, just include the flagAll modes map to: create-branch operation in repo-manager agent
</ARGUMENT_PARSING>
# Create branch with explicit name
/repo:branch-create feature/my-new-feature
# Create from specific base branch
/repo:branch-create bugfix/auth-issue --base develop
# Create with work item tracking
/repo:branch-create feature/123-csv-export --work-id 123
# Create hotfix branch
/repo:branch-create hotfix/critical-security-patch --base production
# Create feature branch from description (auto-generates: feat/my-experimental-feature)
/repo:branch-create "my experimental feature"
# Specify branch type (auto-generates: fix/quick-authentication-fix)
/repo:branch-create "quick authentication fix" --prefix fix
# Link to work item (auto-generates: feat/123-add-csv-export)
/repo:branch-create "add CSV export" --work-id 123
# Full example with all options (auto-generates: feat/456-new-dashboard)
/repo:branch-create "new dashboard" --prefix feat --work-id 456 --base develop
# Create branch with worktree for parallel development
/repo:branch-create "add CSV export" --work-id 123 --worktree
# Result: feat/123-add-csv-export + worktree at ../repo-wt-feat-123-add-csv-export
# Create branch and automatically create spec (requires work_id)
/repo:branch-create "add CSV export" --work-id 123 --spec-create
# Result: feat/123-add-csv-export + spec file created
# Full workflow: branch + worktree + spec
/repo:branch-create "add CSV export" --work-id 123 --worktree --spec-create
# Result: feat/123-add-csv-export + worktree + spec file
# Fetch issue #123 and use its title as description
/repo:branch-create --work-id 123
# If issue #123 title is "Add CSV export feature"
# Result: feat/123-add-csv-export-feature
# Specify branch type (overrides inferred type from issue)
/repo:branch-create --work-id 456 --prefix fix
# Even if issue is type "feature", uses "fix" prefix
# Result: fix/456-{issue-title-slug}
# Create from specific base branch
/repo:branch-create --work-id 789 --base develop
# Result: feat/789-{issue-title-slug} (created from develop)
# Create with worktree
/repo:branch-create --work-id 138 --worktree
# Fetches issue #138 title, creates branch + worktree
# Result: {prefix}/138-{issue-title-slug} + worktree at ../repo-wt-{prefix}-138-{issue-title-slug}
# Without work_id - triggers prompt (handled by repo-manager agent)
/repo:branch-create "add CSV export" --prefix feat
# Agent presents: 3 options (create issue+branch, branch only, cancel)
# With work_id - skips prompt
/repo:branch-create "add CSV export" --work-id 123 --prefix feat
# Result: feat/123-add-csv-export
# Direct mode - skips prompt
/repo:branch-create feat/experimental-feature
# Result: feat/experimental-feature
For detailed workflow examples, see the Work Tracking Integration section below. </EXAMPLES>
<AGENT_INVOCATION>
CRITICAL: After parsing arguments, you MUST actually invoke the Task tool. Do NOT just describe what should be done. Do NOT fetch issues yourself for semantic mode - the agent handles everything atomically.
How to invoke: Use the Task tool with these parameters:
Example Task tool invocations:
Task(
subagent_type="fractary-repo:repo-manager",
description="Create branch feature/my-new-feature",
prompt='{
"operation": "create-branch",
"parameters": {
"mode": "direct",
"branch_name": "feature/my-new-feature",
"base_branch": "main",
"work_id": "123",
"create_worktree": false,
"spec_create": false
}
}'
)
Task(
subagent_type="fractary-repo:repo-manager",
description="Create branch from description",
prompt='{
"operation": "create-branch",
"parameters": {
"mode": "description",
"description": "my experimental feature",
"prefix": "feat",
"base_branch": "main",
"work_id": "123",
"create_worktree": false,
"spec_create": false
}
}'
)
Task(
subagent_type="fractary-repo:repo-manager",
description="Create branch for work item 195 using semantic mode",
prompt='{
"operation": "create-branch",
"parameters": {
"mode": "semantic",
"work_id": "195",
"prefix": null,
"base_branch": "main",
"create_worktree": false,
"spec_create": false
}
}'
)
IMPORTANT for Mode 3: Do NOT fetch the issue yourself before invoking. The agent will:
Task(
subagent_type="fractary-repo:repo-manager",
description="Create branch with worktree",
prompt='{
"operation": "create-branch",
"parameters": {
"mode": "description",
"description": "add CSV export",
"prefix": "feat",
"work_id": "123",
"create_worktree": true,
"spec_create": false
}
}'
)
Task(
subagent_type="fractary-repo:repo-manager",
description="Create branch with spec",
prompt='{
"operation": "create-branch",
"parameters": {
"mode": "description",
"description": "add CSV export",
"prefix": "feat",
"work_id": "123",
"create_worktree": false,
"spec_create": true
}
}'
)
What the agent does (atomically, without stopping):
DO NOT:
<ERROR_HANDLING> Common errors to handle at the command level (argument parsing):
Missing branch name/description AND work-id:
Error: Either branch name/description OR --work-id is required
Usage: /repo:branch-create <branch-name-or-description> [options]
/repo:branch-create --work-id <id> [options]
Examples:
/repo:branch-create feature/my-branch
/repo:branch-create "my feature description"
/repo:branch-create "add CSV export" --work-id 123
/repo:branch-create --work-id 123
Work plugin not available (semantic mode):
Error: Cannot fetch issue details - work plugin not configured
To use semantic mode (--work-id only), you need:
1. Install fractary-work plugin
2. Run /fractary-work:init to configure it
3. Then retry: /repo:branch-create --work-id {id}
Or provide a description: /repo:branch-create "description" --work-id {id}
Issue not found (semantic mode):
Error: Issue #{work_id} not found
Please verify the issue ID exists in your work tracking system
Or provide a description: /repo:branch-create "description" --work-id {work_id}
Invalid argument format:
Error: Invalid argument format
Expected: /repo:branch-create <branch-name-or-description> [options]
All other errors are handled by the repo-manager agent, including:
Description mode with work_id: <prefix>/<work-id>-<slug> (e.g., feat/123-add-csv-export)
Description mode without work_id: <prefix>/<slug> (e.g., feat/my-experimental-feature)
Direct mode: Exact name you specify (e.g., feature/my-custom-branch-name)
Common prefixes: feat, fix, hotfix, chore, docs, test, refactor, style, perf
This command integrates with the fractary-work plugin for issue tracking.
Important: The work tracking integration is handled by the repo-manager agent, not by this command. The command simply routes your request to the agent, which then detects work plugin availability and manages the workflow.
When you create a branch without --work-id (and in description-based mode), the repo-manager agent checks if fractary-work is configured.
If detected, the agent presents you with three numbered options:
The agent infers issue type from branch prefix (feat→feature, fix→bug, etc.)
The prompt only appears in description mode without --work-id. To skip:
/repo:branch-create feature/my-branch--work-id: /repo:branch-create "desc" --work-id 123This command works with:
Platform is configured via /repo:init and stored in .fractary/plugins/repo/config.json.
/repo:branch-delete - Delete branches/repo:branch-list - List branches/repo:commit - Create commits/repo:push - Push branches/repo:pr-create - Create pull requests/repo:init - Configure repo plugin/fractary-work:issue-create - Create new work item/issue/fractary-work:issue-list - List work items/fractary-work:issue-close - Close work item/fractary-work:init - Configure work tracking plugin
</NOTES>