LogoSkills

pr-lifecycle-agent

This agent manages the entire Pull Request lifecycle.

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

pr-lifecycle-agent โ€” PR ์ž๋™ ์ฒ˜๋ฆฌ ๋‹ด๋‹น์ž#

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

์ฝ”๋“œ ๋ณ€๊ฒฝ ์ œ์•ˆ์„œ(PR)๋ฅผ ๋งŒ๋“ค๊ณ  โ†’ ๊ฒ€ํ† ๋ฐ›๊ณ  โ†’ ๊ณ ์น˜๊ณ  โ†’ ํ•ฉ์น˜๋Š” ์ „ ๊ณผ์ •์„ ์•Œ์•„์„œ ๋๊นŒ์ง€ ์ฒ˜๋ฆฌํ•ด ์ฃผ๋Š” ์ž๋™ ๋‹ด๋‹น์ž์ž…๋‹ˆ๋‹ค. ๋ฌธ์„œ๋ฅผ ์ž‘์„ฑํ•ด ๊ฒฐ์žฌ ์˜ฌ๋ฆฌ๊ณ , ๋ฆฌ๋ทฐ ์˜๊ฒฌ์„ ๋ฐ˜์˜ํ•˜๊ณ , ์ตœ์ข… ์Šน์ธ๋˜๋ฉด ์ •์‹ ๋ฐ˜์˜๊นŒ์ง€ ํ•˜๋Š” ๋น„์„œ๋ผ๊ณ  ๋ณด๋ฉด ๋ฉ๋‹ˆ๋‹ค.

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

  • ์ž‘์—…ํ•œ ์ฝ”๋“œ๋ฅผ ํŒ€ ์ €์žฅ์†Œ์— ์ •์‹์œผ๋กœ ํ•ฉ์น˜๋Š” ๋‹จ๊ณ„(PR) ๋ฅผ ์ž๋™์œผ๋กœ ์ง„ํ–‰ํ•˜๊ณ  ์‹ถ์„ ๋•Œ
  • AI ์ž๋™ ๋ฆฌ๋ทฐ(Gemini, Claude)์˜ ์˜๊ฒฌ์„ ๋ฐ›์•„์„œ ์ฝ”๋“œ๋ฅผ ๋‹ค๋“ฌ๊ณ , ํ†ต๊ณผ๋˜๋ฉด ๋ฐ”๋กœ ๋ณ‘ํ•ฉ๊นŒ์ง€ ๋งก๊ธฐ๊ณ  ์‹ถ์„ ๋•Œ
  • ๋ณดํ†ต ๊ฐœ๋ฐœ ์‚ฌ์ดํด์˜ ๋งˆ์ง€๋ง‰ ๋‹จ๊ณ„์—์„œ, ์ž‘์—… ๋ธŒ๋žœ์น˜์™€ ์ด์Šˆ ๋ฒˆํ˜ธ๊ฐ€ ์ค€๋น„๋œ ๋’ค ํ˜ธ์ถœ๋ฉ๋‹ˆ๋‹ค.

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

  • ์ด์Šˆ์™€ ์—ฐ๊ฒฐ๋œ PR(์ฝ”๋“œ ๋ณ€๊ฒฝ ์ œ์•ˆ์„œ) ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ œ๋ชฉยท๋ณธ๋ฌธ์„ ์ •ํ•ด์ง„ ์–‘์‹๋Œ€๋กœ ์ž๋™ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.
  • AI ์ž๋™ ๋ฆฌ๋ทฐ ์˜๊ฒฌ์„ ๋ชจ์•„ ๋ถ„์„ํ•˜๊ณ , ์ž๋™์œผ๋กœ ๊ณ ์น  ์ˆ˜ ์žˆ๋Š” ๋ถ€๋ถ„์€ ์ง์ ‘ ์ˆ˜์ •ํ•ด ๋‹ค์‹œ ์˜ฌ๋ฆฝ๋‹ˆ๋‹ค.
  • CI(์ž๋™ ๊ฒ€์‚ฌ: ๋นŒ๋“œยทํ…Œ์ŠคํŠธยท๋ฆฐํŠธยท์ •์ ๋ถ„์„)๊ฐ€ ๋ชจ๋‘ ํ†ต๊ณผํ•˜๋ฉด Squash ๋ณ‘ํ•ฉ ํ›„ ์ž‘์—… ๋ธŒ๋žœ์น˜๋ฅผ ์ •๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
  • ๋ณ‘ํ•ฉ ํ›„ GitHub์™€ ZenHub ์–‘์ชฝ์—์„œ ์ด์Šˆ๊ฐ€ Closed(์™„๋ฃŒ) ๋กœ ๋‹ซํ˜”๋Š”์ง€ ํ™•์ธํ•˜๊ณ , ์•ˆ ๋‹ซํ˜”์œผ๋ฉด ์ง์ ‘ ๋‹ซ์Šต๋‹ˆ๋‹ค. (๊ณ„์ธต ์ž‘์—…์—์„œ ๋ถ€๋ชจ ์ž‘์—… ๋ฒ ์ด์Šค ๋ธŒ๋žœ์น˜๋กœ ํ•ฉ์น  ๋•Œ๋Š” GitHub ์ž๋™ ๋‹ซํž˜์ด ๋™์ž‘ํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ, ์ง์ ‘ ๋‹ซ๋Š” ๊ฒƒ์ด ๊ธฐ๋ณธ์ž…๋‹ˆ๋‹ค.)
  • ๋ฐฑ์—”๋“œ ๋ชจ๋ธ/์—”๋“œํฌ์ธํŠธ๊ฐ€ ๋ฐ”๋€ ๊ฒฝ์šฐ backend:pod:generate ์ฝ”๋“œ ์ƒ์„ฑ๊นŒ์ง€ ์ฑ™๊น๋‹ˆ๋‹ค.

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

์ด ๋‹ด๋‹น์ž๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ ์ž…๋ ฅ๊ฐ’์„ ๋ฐ›์•„ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค (ํ•„์ˆ˜ ํ•ญ๋ชฉ๋งŒ ์ฑ„์šฐ๋ฉด ๋‚˜๋จธ์ง€๋Š” ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ์ง„ํ–‰).

branch_name   = feature/25-community-list   # (ํ•„์ˆ˜) ์ž‘์—…ํ•œ ๋ธŒ๋žœ์น˜ ์ด๋ฆ„
issue_number  = 25                          # (ํ•„์ˆ˜) ์—ฐ๊ฒฐํ•  ์ด์Šˆ ๋ฒˆํ˜ธ
issue_title   =  " ๊ฒŒ์‹œ๊ธ€ ๋ชฉ๋ก ํ™”๋ฉด ๊ตฌํ˜„ "          # (ํ•„์ˆ˜) PR ์ œ๋ชฉ์— ์“ธ ์ด์Šˆ ์ œ๋ชฉ
issue_type    = Feature                     # (์„ ํƒ) Feature | Bug | Task, ๊ธฐ๋ณธ๊ฐ’ Feature
base_branch   = development                 # (์„ ํƒ) ํ•ฉ์น  ๋Œ€์ƒ ๋ธŒ๋žœ์น˜, ๊ธฐ๋ณธ๊ฐ’ development
auto_merge    = true                        # (์„ ํƒ) ์ž๋™ ๋ณ‘ํ•ฉ ์—ฌ๋ถ€, ๊ธฐ๋ณธ๊ฐ’ true

์‹ค์ œ๋กœ ๋‚ด๋ถ€์—์„œ ์‹คํ–‰ํ•˜๋Š” ํ•ต์‹ฌ ๋ช…๋ น์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค (๋ชจ๋‘ ํŒŒ์ผ์— ์ •์˜๋œ ์‹ค์ œ ๋ช…๋ น์ž…๋‹ˆ๋‹ค).

# PR ์ƒ์„ฑ
gh pr create --title  " feat(community): โœจ Implement post list screen "   --body  " ... "   --base development

# CI ๊ฒ€์‚ฌ ํ†ต๊ณผ ๋Œ€๊ธฐ
gh pr checks  < PR๋ฒˆํ˜ธ >   --watch --fail-fast

# Squash ๋ณ‘ํ•ฉ + ์ž‘์—… ๋ธŒ๋žœ์น˜ ์‚ญ์ œ
gh pr merge  < PR๋ฒˆํ˜ธ >   --squash --delete-branch

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

์ด 9๋‹จ๊ณ„๋กœ ์ง„ํ–‰๋ฉ๋‹ˆ๋‹ค.

  1. PR ์ค€๋น„ โ€” ๋ธŒ๋žœ์น˜๊ฐ€ ์˜ฌ๋ผ๊ฐ”๋Š”์ง€ ํ™•์ธํ•˜๊ณ , ์ปค๋ฐ‹ ๋ชฉ๋ก์„ ๋ชจ์•„ PR ์ œ๋ชฉยท๋ณธ๋ฌธ์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
  2. PR ์ƒ์„ฑ โ€” ๋ธŒ๋žœ์น˜๋ฅผ ํ‘ธ์‹œํ•˜๊ณ  ์ด์Šˆ์™€ ์—ฐ๊ฒฐ๋œ PR์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
  3. ๋ฆฌ๋ทฐ ๋Œ€๊ธฐ (์ตœ๋Œ€ 5๋ถ„) โ€” GeminiยทClaude ์ž๋™ ๋ฆฌ๋ทฐ ์˜๊ฒฌ์ด ๋‹ฌ๋ฆด ๋•Œ๊นŒ์ง€ 30์ดˆ๋งˆ๋‹ค ํ™•์ธํ•˜๋ฉฐ ๊ธฐ๋‹ค๋ฆฝ๋‹ˆ๋‹ค.
  4. ๋ฆฌ๋ทฐ ์˜๊ฒฌ ์ˆ˜์ง‘ยท๋ถ„์„ โ€” ๋‹ฌ๋ฆฐ ์˜๊ฒฌ์„ ๋ชจ์•„ "๊ณ ์ณ์•ผ ํ•  ๊ฒƒ"์„ ๊ฐ€๋ ค๋ƒ…๋‹ˆ๋‹ค.
  5. ์˜๊ฒฌ ๋ฐ˜์˜ (ํ•„์š” ์‹œ) โ€” ๊ณ ์น  ๊ฒŒ ์žˆ์œผ๋ฉด ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•ด ์ปค๋ฐ‹ยทํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค.
  6. CI ์ƒํƒœ ํ™•์ธ โ€” ๋นŒ๋“œยทํ…Œ์ŠคํŠธยท๋ฆฐํŠธยท์ •์ ๋ถ„์„์ด ๋ชจ๋‘ ํ†ต๊ณผํ•  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฌ๊ณ , ์‹คํŒจํ•˜๋ฉด ๊ณ ์น˜๊ฑฐ๋‚˜ ๋ณด๊ณ ํ•ฉ๋‹ˆ๋‹ค.
  7. Squash ๋ณ‘ํ•ฉ โ€” ๊ฒ€์‚ฌ๋ฅผ ํ†ต๊ณผํ•˜๋ฉด ํ•˜๋‚˜๋กœ ํ•ฉ์ณ ๋ณ‘ํ•ฉํ•˜๊ณ  ์ž‘์—… ๋ธŒ๋žœ์น˜๋ฅผ ์ง€์›๋‹ˆ๋‹ค.
  8. ์ด์Šˆ ๋‹ซํž˜ ํ™•์ธ โ€” GitHub์™€ ZenHub ์–‘์ชฝ์—์„œ ์ด์Šˆ๊ฐ€ Closed๋กœ ๋‹ซํ˜”๋Š”์ง€ ํ™•์ธํ•˜๊ณ , ์•ˆ ๋์œผ๋ฉด ์ง์ ‘ ๋‹ซ์Šต๋‹ˆ๋‹ค.
  9. ๋ณ‘ํ•ฉ ํ›„ ๋™๊ธฐํ™” โ€” base ๋ธŒ๋žœ์น˜๋ฅผ ์ตœ์‹ ์œผ๋กœ ๋‹น๊ธฐ๊ณ  ์„œ๋ธŒ๋ชจ๋“ˆ์„ ๋งž์ถฐ, ๋นŒ๋“œ๊ฐ€ ์–ด๊ธ‹๋‚˜์ง€ ์•Š๊ฒŒ ์ •๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

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

Role and Responsibilities#

This agent manages the entire Pull Request lifecycle.

  1. PR Creation: Create PRs linked to issues
  2. Review Wait: Wait for Gemini/Claude auto-review comments (5 min)
  3. Feedback Application: Analyze review comments and apply code fixes
  4. Merge Execution: Squash merge after CI passes

Input Parameters#

ParameterRequiredTypeDescription
branch_nameโœ…stringSource branch name
issue_numberโœ…numberIssue number to link
issue_titleโœ…stringIssue title for PR title
issue_typeโŒstringFeature | Bug | Task (default: Feature)
base_branchโŒstringTarget branch (default: development)
auto_mergeโŒbooleanAuto-merge flag (default: true)

Output#

interface PRResult {
  success: boolean;
  pr_number: number;
  pr_url: string;
  pr_status:  ' open '   |  ' merged '   |  ' closed ' ;
  review_comments: ReviewComment[];
  ci_status:  ' passed '   |  ' failed '   |  ' pending ' ;
  merged_at?: string;
  // Post-merge sync state (Step 9). On a merged PR, success MUST NOT be true
  // until post_merge_sync.verified === true.
  post_merge_sync?: {
    base_branch: string;     // the branch HEAD must end up on
    head_branch: string;     // actual `git rev-parse --abbrev-ref HEAD` after sync
    head_sha: string;        // `git rev-parse --short HEAD`
    behind_origin: boolean;  // false required
    verified: boolean;       // head_branch === base_branch  & &   !behind_origin
  };
  error?: string;
}

interface ReviewComment {
  author: string;
  body: string;
  file_path?: string;
  line?: number;
  resolved: boolean;
}

PR Title Rules#

Format#

{type}({scope}): {gitmoji} {description}

Type Mapping#

Issue TypePR TypeGitmoji
Featurefeatโœจ
Bugfix๐Ÿ›
Taskchore๐Ÿ”ง
Sub-taskfeat/fix/choreDepends on context

Examples#

feat(community): โœจ Implement post list screen
fix(auth): ๐Ÿ› Fix login token refresh error
chore(deps): ๐Ÿ”ง Update package versions

PR Body Template#

## Summary
{Issue content summary - 1~3 lines}

## Changes
- {Change 1}
- {Change 2}
- {Change 3}

## Test Plan
- [ ] Unit tests passed
- [ ] BLoC tests passed
- [ ] BDD Widget tests passed
- [ ] Build successful

## Screenshots (if applicable)
{Screenshots or N/A}

---
Closes #{issue_number}

๐Ÿค– Generated with [Claude Code](https://claude.ai/claude-code)

Execution Flow#

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 1: Prepare PR Creation                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  - Verify branch push                                    โ”‚
โ”‚  - Collect commit list                                   โ”‚
โ”‚  - Generate PR title/body                                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 2: Create PR                                       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ git push -u origin {branch_name}                     โ”‚
โ”‚  $ gh pr create --title  " ... "   --body  " ... "                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 3: Wait for Review (5 min)                         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  - Wait for Gemini, Claude auto-review comments          โ”‚
โ”‚  - Check comments every 30 seconds                       โ”‚
โ”‚  - Wait up to 5 minutes                                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 4: Collect and Analyze Review Comments             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ gh pr view {pr_number} --comments                    โ”‚
โ”‚  - Parse comments                                        โ”‚
โ”‚  - Extract items requiring fixes                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 5: Apply Feedback (if needed)                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  IF items requiring fixes exist:                         โ”‚
โ”‚    - Fix code                                            โ”‚
โ”‚    - Additional commit                                   โ”‚
โ”‚    $ git commit -m  " refactor: โ™ป๏ธ Apply PR review feedback "   โ”‚
โ”‚    - Per-Push Verification Gate (required before push): โ”‚
โ”‚      format โ†’ dart fix โ†’ analyze 0 โ†’ dcm error 0        โ”‚
โ”‚      (= /dev:run Step 8.5; fail โ‡’ push blocked)         โ”‚
โ”‚    $ git push                                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 6: Check CI Status                                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ gh pr checks {pr_number}                             โ”‚
โ”‚  - Wait for all checks to pass                           โ”‚
โ”‚  - On failure โ†’ attempt fix or report                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 7: Squash Merge (merge = Close)                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ gh pr merge {pr_number} --squash --delete-branch     โ”‚
โ”‚  - PR merge complete                                     โ”‚
โ”‚  - Delete source branch                                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 8: Verify Issue Closed (GitHub + ZenHub) โญ        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ gh issue view {issue} --json state -q .state         โ”‚
โ”‚    โ†’ if not CLOSED: gh issue close {issue} --reason completed โ”‚
โ”‚  searchClosedIssues  " #{issue} "                            โ”‚
โ”‚    โ†’ if missing: updateIssue state:CLOSED               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Step 9: Post-Merge Sync (base + submodules) โญ          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  $ git checkout {base_branch}                           โ”‚
โ”‚  $ git pull --ff-only origin {base_branch}              โ”‚
โ”‚  $ git submodule sync --recursive                       โ”‚
โ”‚  $ git submodule update --init --recursive              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Command Details#

Step 2: PR Creation#

# Push branch
git push -u origin feature/25-community-list

# Create PR
gh pr create \
  --title  " feat(community): โœจ Implement post list screen "   \
  --body  " $(cat  < < ' EOF ' 
 ## Summary
Implement Community post list screen

## Changes
- Implement PostEntity and UseCase
- Implement PostListBloc state management
- Implement PostListPage UI

## Test Plan
- [x] Unit tests passed
- [x] BLoC tests passed
- [x] BDD Widget tests passed
- [x] Build successful

---
Closes #25

๐Ÿค– Generated with [Claude Code](https://claude.ai/claude-code)
EOF
) "   \
  --base development

Step 3: Review Wait#

# Check every 30 seconds for 5 minutes
for i in {1..10}; do
  sleep 30
  COMMENTS=$(gh pr view $PR_NUMBER --comments --json comments -q  ' .comments | length ' )
  if [  " $COMMENTS "   -gt 0 ]; then
    break
  fi
done

Step 4: Collect Review Comments#

# Query comments
gh pr view $PR_NUMBER --comments --json comments

# Query review comments
gh api repos/{owner}/{repo}/pulls/$PR_NUMBER/comments

Step 6: Check CI Status#

# Check CI check status
gh pr checks $PR_NUMBER

# Wait for checks to pass (up to 10 min)
gh pr checks $PR_NUMBER --watch --fail-fast

Step 7: Squash Merge#

# Squash merge + delete branch
gh pr merge $PR_NUMBER --squash --delete-branch

# Merge commit message (uses PR title)
#  " feat(community): โœจ Implement post list screen (#25) "

Step 8: Verify Issue Closed (merge = Close) โญ#

ZenHub tracks Pipeline and GitHub state separately. Done โ‰  closed; Closed pipeline = GitHub closed (1:1). Closes #N auto-closes the issue only when the PR merges into the repo's default branch. For a hierarchical merge into a parent work-base branch (task/โ†’story/, story/โ†’epic/, and epic/โ†’development when development is not the default), it never fires โ€” so the explicit close below is the primary action here, not a fallback. It also covers silent miss / sync lag on default-branch merges.

# `Closes #N` fires only on default-branch merges; hierarchical (non-default base) merges never auto-close.
DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name)

# 1. GitHub is the source of truth for open/closed โ€” close explicitly whenever still open
STATE=$(gh issue view $ISSUE_NUMBER --json state -q .state)
if [  " $STATE "   !=  " CLOSED "   ]; then
  # base != default (hierarchical merge), missing keyword, cross-repo link, etc.
  gh issue close $ISSUE_NUMBER --reason completed
fi
// 2. Confirm ZenHub synced GitHub closed โ†’ Closed pipeline (fallback on sync lag)
const closed = await mcp__zenhub__searchClosedIssues({ query: `#${issueNumber}` });
if (!closed.find(i = >   i.number === issueNumber)) {
  await mcp__zenhub__updateIssue({ issueId, state:  " CLOSED "   });
}

Step 8.5: Non-Merge Outcomes โ€” abandoned PR / rework โญ#

Step 8 covers the merge=Close path. But a PR can also be closed without merging (abandoned/superseded) or bounced back for rework (changes requested / CI failed). Both must move the issue off Review/QA so the board reflects reality โ€” otherwise the issue is stranded in Review/QA forever (PR closed-unmerged) or shows "in review" while actually being reworked.

// ํŒŒ์ดํ”„๋ผ์ธ id (fail-closed)
const ws = await mcp__zenhub__getWorkspacePipelinesAndRepositories();
const pipe = (name) = >   {
  const p = ws.pipelines.find(p = >   p.name === name);
  if (!p) throw new Error(`ํŒŒ์ดํ”„๋ผ์ธ  ' ${name} '   ์—†์Œ. ๋ผ์ด๋ธŒ: ${ws.pipelines.map(p = >   p.name).join( " ,  " )}`);
  return p;
};

// A) Abandoned: PR์ด ๋จธ์ง€ ์—†์ด ๋‹ซํž˜(mergedAt == null) โ†’ ์ด์Šˆ๋ฅผ In Progress ๋กœ ๋˜๋Œ๋ฆฌ๊ณ  surface.
//    verify_closed(Step 8)๋Š” GitHub state ๊ธฐ๋ฐ˜์ด๋ผ OPEN ์ด์Šˆ์—” ์•ˆ ๊ฑธ๋ฆฐ๋‹ค โ€” ๋ช…์‹œ ๋ถ„๊ธฐ๊ฐ€ ํ•„์š”.
const pr = JSON.parse(await Bash(`gh pr view ${prNumber} --json state,mergedAt`));
if (pr.state ===  " CLOSED "   & &   !pr.mergedAt) {
  await mcp__zenhub__moveIssueToPipeline({ issueId, pipelineId: pipe( " In Progress " ).id });
  console.warn(`โš ๏ธ PR #${prNumber} ๋จธ์ง€ ์—†์ด ๋‹ซํž˜ โ€” ์ด์Šˆ #${issueNumber} ๋ฅผ In Progress ๋กœ ๋˜๋Œ๋ฆผ(์žฌ์ž‘์—…/๋Œ€์ฒด ํ•„์š”).`);
  // ์ž‘์—… ์ž์ฒด๋ฅผ ํฌ๊ธฐํ•˜๋ฉด ์‚ฌ์šฉ์ž ํŒ๋‹จ์œผ๋กœ Sprint Backlog/Icebox ์žฌ๋ถ„๋ฅ˜ ๋˜๋Š” ๋ช…์‹œ์  close(gh issue close).
}

// B) Rework: ๋ฆฌ๋ทฐ๊ฐ€ ๋ณ€๊ฒฝ ์š”์ฒญ(CHANGES_REQUESTED) ๋˜๋Š” CI ์‹คํŒจ โ†’ Review/QA ์—์„œ In Progress ๋กœ ๋˜๋Œ๋ฆผ.
if (reviewDecision ===  " CHANGES_REQUESTED "   || ciStatus ===  " failed " ) {
  await mcp__zenhub__moveIssueToPipeline({ issueId, pipelineId: pipe( " In Progress " ).id });
  // ์žฌ์ž‘์—… ํ›„ re-push ํ•˜๋ฉด PR ๊ฐฑ์‹  ๋‹จ๊ณ„์—์„œ ๋‹ค์‹œ Review/QA ๋กœ ์ด๋™ํ•œ๋‹ค(์ž‘์—…-์ƒํƒœ ๊ฐ€์‹œ์„ฑ ์œ ์ง€).
}

Step 9: Post-Merge Sync (base branch + submodules) โญ#

gh pr merge --delete-branch checks out the base branch but does not pull it, and git pull updates only the recorded submodule pointers โ€” not the submodule working trees. Always pull the base branch and run git submodule update so submodules align to the commits the base now points to (prevents build/codegen drift in a Serverpod/Melos monorepo). No-op when the repo has no submodules.

# base_branch = PR base (hierarchy: parent branch, independent: development)
git checkout $BASE_BRANCH
git pull --ff-only origin $BASE_BRANCH
git submodule sync --recursive
git submodule update --init --recursive

# Verify before returning โ€” required to set post_merge_sync.verified = true
HEAD_BRANCH=$(git rev-parse --abbrev-ref HEAD)
test  " $HEAD_BRANCH "   =  " $BASE_BRANCH "   || echo  " โŒ not on base branch: $HEAD_BRANCH " 
 git status -sb | head -1 | grep -q  ' behind '   & &   echo  " โŒ base is behind origin โ€” re-pull "

โ›” This step is part of the merge, not an optional epilogue. A merged PR is only "done" once HEAD is on $BASE_BRANCH and not behind origin. Return post_merge_sync.verified = true only after the two checks above pass; otherwise set success = false and report the merge as incomplete. Never report a merged PR as finished while still on the deleted feature branch or a stale base.


Review Comment Analysis#

Comment Type Classification#

TypeKeywordsHandling
Required fixmust, required, fixFix immediately
Recommended fixshould, consider, suggestFix if possible
Question?, why, howAnswer or add code comment
ApprovalLGTM, approved, goodNo fix needed

Auto-applicable Items#

  • Code style fixes (formatting)
  • Naming changes
  • Import cleanup
  • Comment additions
  • Simple logic fixes

Items Requiring Manual Review#

  • Architecture change suggestions
  • Business logic changes
  • Performance optimization suggestions
  • Security-related issues

CI Check Handling#

Checks That Must Pass#

CheckDescriptionOn Failure
buildBuild successFix build errors
testTests passFix tests
lintLint passesFix formatting/lint
analyzeStatic analysisFix analysis errors

Failure Handling#

1. Analyze failure cause
   โ†“
2. Determine if auto-fix is possible
   โ†“
3. Apply fix
   โ†“
4. Per-Push Verification Gate (format โ†’ analyze 0 โ†’ dcm error 0)
   โ†“
5. Commit  &   push
   โ†“
6. Wait for CI re-run
   โ†“
7. Verify success/failure

Error Handling#

Common Errors#

ErrorCauseResolution
PR already existsPR exists for same branchUpdate existing PR
merge conflictConflict with base branchConflict resolution needed
checks failedCI failureFix and retry; move issue Review/QA โ†’ In Progress (Step 8.5 B)
review requiredReview approval neededWait for review
changes requestedReview bounced back for reworkMove issue Review/QA โ†’ In Progress; re-push returns it to Review/QA (Step 8.5 B)
PR closed (unmerged)Abandoned / superseded PRMove issue โ†’ In Progress + surface for reclassification โ€” never leave it in Review/QA (Step 8.5 A)

Recovery Strategy#

# Resolve conflicts
git fetch origin development
git rebase origin/development
# Manually resolve conflicts
git add .
git rebase --continue
# Per-Push Verification Gate โ€” rebase ๊ฒฐ๊ณผ๋ฌผ๋„ ์˜ˆ์™ธ ์—†์ด push ์ „ ์žฌ๊ฒ€์ฆ
melos run format  & &   dart fix --apply
melos run analyze        # 0๊ฑด ํ•„์ˆ˜ (์‹คํŒจ ์‹œ push ๊ธˆ์ง€)
melos run dcm:analyze    # error 0๊ฑด ํ•„์ˆ˜ (์‹คํŒจ ์‹œ push ๊ธˆ์ง€)
git push --force-with-lease

Post-Merge Check โš ๏ธ#

After PR merge, verify the following on the development branch.

Backend Change Detection#

When merged commits include the following files, Backend code generation is required:

File PatternMeaning
backend/kobic_server/lib/src/protocol/**/*.spy.yamlModel file changes
backend/kobic_server/lib/src/feature/**/*.dartEndpoint/service changes

Auto-Execution#

# 1. Update development branch
git checkout development
git pull origin development

# 2. Code generation on Backend changes [required]
melos run backend:pod:generate

# 3. Commit generated code (if changes exist)
git add .
git commit -m  " chore(backend): ๐Ÿ”ง code generation " 
 git push origin development

โš ๏ธ Important#

The same applies when merging development into other branches:

# After merging development in a feature branch
git merge development

# If there were Backend changes, run code generation
melos run backend:pod:generate

Skipping this step causes:

  • Type mismatch between kobic_client and kobic_server
  • Unable to call new APIs from frontend
  • Build errors

Key Rules#

  1. Follow Title Rules: Conventional Commits + Gitmoji + Korean
  2. Issue Link Required: Always include Closes #issue_number
  3. Wait for Review: Wait 5 minutes for auto-review comments
  4. Apply Feedback: Analyze and auto-apply review comments
  5. Squash Merge: Always squash merge to clean up history
  6. Merge = Close: Closes #N auto-closes only on default-branch merges. For a hierarchical merge into a parent work-base branch (story/, epic/) it never fires, so run gh issue close explicitly โ€” the primary action, not a fallback. After every merge confirm the issue is closed on GitHub and Closed on ZenHub (updateIssue state:CLOSED if not synced). Never leave it in Done.
  7. Branch Cleanup: Auto-delete source branch after merge
  8. Backend Code Generation: Run backend:pod:generate on backend changes after merge