LogoSkills

issue-branch-agent

This agent creates and checks out Git branches based on ZenHub/GitHub issues.

ํ•ญ๋ชฉ๋‚ด์šฉ
Modelhaiku

issue-branch-agent โ€” ์ด์Šˆ์šฉ ์ž‘์—… ๊ฐ€์ง€ ๋งŒ๋“ค๊ธฐ#

ํ•œ๋งˆ๋””๋กœ#

์ด์Šˆ(ํ•  ์ผ ์นด๋“œ) ํ•˜๋‚˜๋ฅผ ๋ฐ›์•„, ๊ทธ ์ž‘์—…๋งŒ ๋”ฐ๋กœ ์ง„ํ–‰ํ•  ์ „์šฉ ์ž‘์—… ๊ณต๊ฐ„(๋ธŒ๋žœ์น˜) ์„ ์ž๋™์œผ๋กœ ๋งŒ๋“ค์–ด ์ฃผ๋Š” ๋„๊ตฌ์ž…๋‹ˆ๋‹ค. ๊ณต๋™ ๋ฌธ์„œ์—์„œ ๋ฐ”๋กœ ๊ณ ์น˜์ง€ ์•Š๊ณ , "๋‚ด ์‚ฌ๋ณธ"์„ ๋– ์„œ ์ž‘์—…ํ•˜๋‹ค๊ฐ€ ๋‚˜์ค‘์— ํ•ฉ์น˜๋Š” ๊ฒƒ๊ณผ ๊ฐ™์•„์š”.

๋ˆ„๊ฐ€ยท์–ธ์ œ ์“ฐ๋‚˜์š”#

  • ๊ฐœ๋ฐœ์ž(๋˜๋Š” ์ž๋™ํ™” ์—์ด์ „ํŠธ)๊ฐ€ ZenHub/GitHub ์ด์Šˆ ํ•˜๋‚˜๋ฅผ ๋ณธ๊ฒฉ์ ์œผ๋กœ ์ž‘์—…ํ•˜๊ธฐ ์‹œ์ž‘ํ•  ๋•Œ
  • ๋ณดํ†ต /dev:issue ์ž๋™ ํ๋ฆ„ ์•ˆ์—์„œ ์ฒซ ๋‹จ๊ณ„๋กœ ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค. ์ด์Šˆ ์ •๋ณด๋ฅผ ์กฐํšŒํ•œ ๋’ค, ์ฝ”๋“œ๋ฅผ ์งœ๊ธฐ(implementation) ์ง์ „์— ์ด ๋„๊ตฌ๊ฐ€ ์ž‘์—… ๊ฐ€์ง€๋ฅผ ๋จผ์ € ๋งŒ๋“ค์–ด ๋‘ก๋‹ˆ๋‹ค.

๋ฌด์—‡์„ ํ•ด์ฃผ๋‚˜์š”#

  • ์ด์Šˆ ๋ฒˆํ˜ธ์™€ ์ œ๋ชฉ์œผ๋กœ ์ผ๊ด€๋œ ๊ทœ์น™์˜ ๋ธŒ๋žœ์น˜ ์ด๋ฆ„์„ ์ž๋™ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
    • ์˜ˆ: feature/25-community-list, bugfix/30-login-error, epic/10-author-management
  • ์ž‘์—… ์ข…๋ฅ˜์— ๋”ฐ๋ผ ์•ž๋จธ๋ฆฌ(prefix)๋ฅผ ๋ถ™์—ฌ ์ค๋‹ˆ๋‹ค. ๊ธฐ๋Šฅ์€ feature/, ๋ฒ„๊ทธ๋Š” bugfix/, ๊ธด๊ธ‰ ์ˆ˜์ •์€ hotfix/, ํฐ ๋ฌถ์Œ์€ epic/.
  • ํ•œ๊ธ€ ์ œ๋ชฉ์€ ์ž๋™์œผ๋กœ ๋กœ๋งˆ์ž(์˜๋ฌธ)๋กœ ์˜ฎ๊ฒจ ๊น”๋”ํ•œ ์ด๋ฆ„์œผ๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ํ•œ๊ธ€๋งŒ ์žˆ๋Š” ์ œ๋ชฉ๋„ ๋นˆ ์ด๋ฆ„์ด ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. (์˜ˆ: [Story] Community ์—”ํ‹ฐํ‹ฐ ์ •์˜ โ†’ feature/28-story-community-entity, ์ปค๋ฎค๋‹ˆํ‹ฐ ๋ชฉ๋ก โ†’ feature/25-keomyuniti-moklog)
  • ์ƒˆ ๊ฐ€์ง€๋ฅผ ๋งŒ๋“ค๊ธฐ ์ „์— ํ•˜๋˜ ์ž‘์—…์ด ๋‚ ์•„๊ฐ€์ง€ ์•Š๋„๋ก ์•ˆ์ „ํ•˜๊ฒŒ ์ž„์‹œ ๋ณด๊ด€(stash)ํ•˜๊ณ , ์ตœ์‹  ๊ธฐ์ค€ ๋ธŒ๋žœ์น˜์—์„œ ์ถœ๋ฐœํ•ฉ๋‹ˆ๋‹ค.

์–ด๋–ป๊ฒŒ ์“ฐ๋‚˜์š”#

# ๊ธฐ๋ณธ: ๊ธฐ๋Šฅ ์ด์Šˆ
/dev:issue-branch 25  " Community list screen " 
 # ๊ฒฐ๊ณผ โ†’ feature/25-community-list

# ๋ฒ„๊ทธ ์ˆ˜์ •: --type bugfix ๋กœ ์ข…๋ฅ˜ ์ง€์ •
/dev:issue-branch 30  " Fix login error "   --type bugfix
# ๊ฒฐ๊ณผ โ†’ bugfix/30-login-error

# ํ•œ๊ธ€ ์ œ๋ชฉ: ์ž๋™์œผ๋กœ ๋กœ๋งˆ์ž(์˜๋ฌธ)๋กœ ๋ณ€ํ™˜ โ€” ํ•œ๊ธ€๋งŒ ์žˆ์–ด๋„ ๋นˆ ์ด๋ฆ„์ด ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค
/dev:issue-branch 28  " [Story] Community ์—”ํ‹ฐํ‹ฐ ์ •์˜ " 
 # ๊ฒฐ๊ณผ โ†’ feature/28-story-community-entity
/dev:issue-branch 25  " ์ปค๋ฎค๋‹ˆํ‹ฐ ๋ชฉ๋ก " 
 # ๊ฒฐ๊ณผ โ†’ feature/25-keomyuniti-moklog  (์˜ˆ์ „์—” feature/25- ๋กœ ๊นจ์กŒ์Œ)
  • --type ์œผ๋กœ ์ž‘์—… ์ข…๋ฅ˜(feature / bugfix / hotfix)๋ฅผ ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ƒ๋žตํ•˜๋ฉด feature ์ž…๋‹ˆ๋‹ค.
  • --base ๋กœ ์–ด๋А ๋ธŒ๋žœ์น˜์—์„œ ๊ฐ€์ง€๋ฅผ ์น ์ง€ ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ƒ๋žตํ•˜๋ฉด development ์—์„œ ์ถœ๋ฐœํ•ฉ๋‹ˆ๋‹ค.

์•ˆ์—์„œ ๋ฌด์Šจ ์ผ์ด ๋ฒŒ์–ด์ง€๋‚˜์š”#

  1. ์ง€๊ธˆ ์ƒํƒœ ํ™•์ธ โ€” ์ €์žฅํ•˜์ง€ ์•Š์€ ๋ณ€๊ฒฝ์ด ์žˆ๋Š”์ง€ ์‚ดํŽด๋ด…๋‹ˆ๋‹ค.
  2. ํ•˜๋˜ ์ผ ์ž„์‹œ ๋ณด๊ด€ โ€” ๋ณ€๊ฒฝ์ด ์žˆ์œผ๋ฉด ์•ˆ์ „ํ•˜๊ฒŒ ๋”ฐ๋กœ ์ฑ™๊ฒจ ๋‘ก๋‹ˆ๋‹ค(stash). ์ž‘์—…์ด ์‚ฌ๋ผ์ง€์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  3. ๊ธฐ์ค€ ๋ธŒ๋žœ์น˜ ์ตœ์‹ ํ™” โ€” ์ถœ๋ฐœ์ ์ด ๋  ๋ธŒ๋žœ์น˜๋กœ ์˜ฎ๊ฒจ ์ตœ์‹  ์ƒํƒœ๋กœ ๋งž์ถฅ๋‹ˆ๋‹ค. ์ƒ์œ„ ์ด์Šˆ๊ฐ€ ์žˆ์œผ๋ฉด ๊ทธ ๋ถ€๋ชจ ๋ธŒ๋žœ์น˜์—์„œ, ์—†์œผ๋ฉด development ์—์„œ ์ถœ๋ฐœํ•ฉ๋‹ˆ๋‹ค.
  4. ์ƒˆ ์ž‘์—… ๊ฐ€์ง€ ์ƒ์„ฑยท์ด๋™ โ€” ์ •ํ•ด์ง„ ๊ทœ์น™์˜ ์ด๋ฆ„์œผ๋กœ ๋ธŒ๋žœ์น˜๋ฅผ ๋งŒ๋“ค๊ณ  ๊ทธ ์œ„๋กœ ์˜ฎ๊น๋‹ˆ๋‹ค. ๊ฐ™์€ ์ด๋ฆ„์ด ์ด๋ฏธ ์žˆ์œผ๋ฉด ์ƒˆ๋กœ ๋งŒ๋“ค์ง€ ์•Š๊ณ  ๊ทธ ๋ธŒ๋žœ์น˜๋กœ ์ด๋™๋งŒ ํ•ฉ๋‹ˆ๋‹ค.
  5. ๊ฒฐ๊ณผ ํ™•์ธ โ€” ์ง€๊ธˆ ์˜ฌ๋ฐ”๋ฅธ ๋ธŒ๋žœ์น˜์— ์žˆ๋Š”์ง€ ์ ๊ฒ€ํ•˜๊ณ , ์–ด๋А ๊ธฐ์ค€์—์„œ ์ถœ๋ฐœํ–ˆ๋Š”์ง€ ์ •๋ณด๋ฅผ ๋Œ๋ ค์ค๋‹ˆ๋‹ค.

โš™๏ธ ์ƒ์„ธ ์˜ต์…˜ยท์‹คํ–‰ ๋ช…์„ธ (๊ฐœ๋ฐœ์ž / AI ์—์ด์ „ํŠธ์šฉ)

Role and Responsibilities#

This agent creates and checks out Git branches based on ZenHub/GitHub issues.

  1. Branch Name Generation: Auto-generate branch name from issue number and title
  2. Safe Checkout: Check current working state before safely switching branches
  3. Base Branch Sync: Sync and branch from the latest development branch

Input Parameters#

ParameterRequiredTypeDescription
issue_numberโœ…numberGitHub issue number
issue_titleโœ…stringIssue title
issue_typeโŒstringfeature | bugfix | hotfix (default: feature)
base_branchโŒstringBase branch (default: development)

Output#

interface BranchResult {
  success: boolean;
  branch_name: string;
  base_branch: string;
  error?: string;
}

Branch Naming Rules#

Format#

{type}/{issue_number}-{slug}

Prefix by Type#

Issue TypeBranch TypeExample
Epicepicepic/10-author-management
Feature/Storyfeaturefeature/25-community-list
Bugbugfixbugfix/30-fix-login-error
Hotfixhotfixhotfix/35-critical-security-fix
Taskfeaturefeature/28-entity-definition
Sub-taskfeaturefeature/29-usecase-implementation

Slug Generation Rules#

  1. Romanize non-ASCII (do NOT delete): Transliterate Korean/CJK/other scripts to ASCII before slugging โ€” e.g. ์ปค๋ฎค๋‹ˆํ‹ฐ ๋ชฉ๋ก โ†’ keomyuniti-moklog. Never strip non-ASCII to nothing: a Korean-only title that is deleted yields an empty slug and a degenerate branch like feature/25-.
  2. Lowercase: Convert all characters to lowercase
  3. Remove Special Characters: Keep only letters/numbers (Unicode-aware), drop punctuation/symbols
  4. Spaces โ†’ Hyphens: Separate words with hyphens
  5. Max Length: 50 character limit
  6. Never empty: If the slug ends up empty, fall back to the issue-type word (e.g. feature/25-story) โ€” never emit a number-only branch (feature/25-).
// IMPORTANT: if `title` contains non-ASCII (e.g. Korean), romanize it to ASCII FIRST (Rule 1),
// then pass the romanized string here. createSlug NEVER returns an empty string.
function createSlug(title: string, issueTypeWord: string =  ' work ' ): string {
  const slug = title
    .toLowerCase()
    .replace(/[^\p{L}\p{N}\s-]/gu,  ' ' ) // strip punctuation/symbols; keep Unicode letters/numbers
    .replace(/[\s_]+/g,  ' - ' )           // spaces/underscores โ†’ hyphens
    .replace(/-+/g,  ' - ' )               // collapse consecutive hyphens
    .substring(0, 50)                  // length limit
    .replace(/^-|-$/g,  ' ' );            // trim leading/trailing hyphens
  // Empty-slug guard (LANG-04): a non-romanized Korean-only title must NOT yield  ' ' .
  return slug || issueTypeWord;
}

Execution Flow#

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 1: Check Current State                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ git status                                           โ”‚
โ”‚  - Check for uncommitted changes                         โ”‚
โ”‚  - Determine if stash is needed                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 2: Handle Changes                                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  IF changes exist:                                       โ”‚
โ”‚    $ git stash push -m  " WIP: before #{issue_number} "      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 3: Sync Base Branch (hierarchical branch support)  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ git checkout {base_branch}                           โ”‚
โ”‚  $ git pull origin {base_branch}                        โ”‚
โ”‚                                                         โ”‚
โ”‚  base_branch determination:                              โ”‚
โ”‚  โ”œโ”€โ”€ --base option specified โ†’ use that branch           โ”‚
โ”‚  โ”œโ”€โ”€ Sub-task โ†’ parent Story branch                      โ”‚
โ”‚  โ”œโ”€โ”€ Story โ†’ parent Epic branch                          โ”‚
โ”‚  โ”œโ”€โ”€ Epic โ†’ development                                 โ”‚
โ”‚  โ””โ”€โ”€ Independent issue โ†’ development (default)           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 4: Create and Checkout Branch                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ git checkout -b {branch_name}                        โ”‚
โ”‚  - If branch exists โ†’ checkout only                      โ”‚
โ”‚  - Epic issue โ†’ epic/{number}-{slug}                     โ”‚
โ”‚  - Others โ†’ feature/{number}-{slug}                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 5: Verify Result                                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ git branch --show-current                            โ”‚
โ”‚  - Verify branch creation success                        โ”‚
โ”‚  - Return base_branch info                               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Command Details#

Step 1: Status Check#

# Check current state
git status --porcelain

# If output is not empty, changes exist

Step 2: Stash Handling#

# Temporarily save changes
git stash push -m  " WIP: before issue #{issue_number} " 

 # Check stash list
git stash list

Step 3: Base Branch Sync (hierarchical branch support)#

# Move to base_branch (default: development, hierarchical: parent branch)
git checkout ${base_branch}

# Update to latest
git pull origin ${base_branch} --rebase

Step 4: Branch Creation#

# Check if branch exists
git rev-parse --verify {branch_name} 2 > /dev/null

# Create if it doesn ' t exist
git checkout -b {branch_name}

# Checkout only if it exists
git checkout {branch_name}

Step 5: Result Verification#

# Check current branch
git branch --show-current

# Verify it matches the expected branch

Error Handling#

Common Errors#

ErrorCauseResolution
uncommitted changesUncommitted changesStash handling
branch already existsSame branch existsCheckout existing branch
merge conflictConflict on pullNotify that conflict resolution is needed
not a git repositoryNot a git repoReturn error

Recovery Strategy#

# Recover stash (after work is done)
git stash pop

# Recover specific item from stash list
git stash apply stash@{0}

Usage Examples#

Basic Usage#

# Feature issue
/dev:issue-branch 25  " Community list screen " 

 # Result
branch_name: feature/25-community-list

Bug Fix#

# Bug issue
/dev:issue-branch 30  " Fix login error "   --type bugfix

# Result
branch_name: bugfix/30-login-error

Korean Title Handling#

# Mixed Korean/English title โ€” Korean romanized, special chars removed
/dev:issue-branch 28  " [Story] Community ์—”ํ‹ฐํ‹ฐ ์ •์˜ " 
 # Result
branch_name: feature/28-story-community-entity

# Korean-ONLY title โ€” romanized to ASCII, NEVER empty (was the LANG-04 bug:  " feature/25- " )
/dev:issue-branch 25  " ์ปค๋ฎค๋‹ˆํ‹ฐ ๋ชฉ๋ก " 
 # Result
branch_name: feature/25-keomyuniti-moklog

Integration Scenario#

Called from /dev:issue#

1. issue-cycle queries issue info
   โ†“
2. issue-branch-agent called
   - issue_number: 25
   - issue_title:  " Community list screen " 
    - issue_type: feature
   โ†“
3. Branch creation complete
   - branch_name: feature/25-community-list
   โ†“
4. Passed to implementation-agent

Key Rules#

  1. Safety First: Always check current state before starting
  2. Use Stash: Preserve changes via stash when they exist
  3. Hierarchical Base: Branch from base_branch parameter (parent branch or development)
  4. Consistent Naming: epic/ prefix for Epics, feature/ for others
  5. Idempotency: Safe to call again with the same issue
  6. ASCII-safe, never empty: Romanize non-ASCII (Korean/CJK) to ASCII rather than deleting it; if the slug would be empty, fall back to the issue-type word (feature/25-story). Never emit a number-only branch (feature/25-).
  7. Parent Branch Priority: When a parent issue exists, always branch from the parent branch