본문으로 건너뛰기
cccskills
무료GitHub에 공개

codex-branch-finisher

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work — guides completion of development work by presenting structured options for merge, PR, or cleanup

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구GitHub
설치 방법 보기

포함된 파일(2)

  • SKILL.md5.0 KB
  • agents/openai.yaml297 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

TL;DR

Verify tests → Present 4 options (merge, PR, keep, discard) → Execute choice → Clean up worktree. Never leave work in limbo.

Finishing a Development Branch

Activation

  1. Activate on $codex-branch-finisher, $finish, or $finish-branch.
  2. Activate when all tasks in a plan are complete.
  3. Activate after codex-subagent-execution completes all tasks.
  4. Activate after codex-execution-quality-gate passes.
  5. Activate after codex-workflow-autopilot reaches ship mode.

Announce at start: "I'm using codex-branch-finisher to complete this work."

The Iron Law

NO COMPLETION WITHOUT TEST VERIFICATION
NO OPEN-ENDED "WHAT NEXT?" — PRESENT STRUCTURED OPTIONS

The Process

Step 1: Verify Tests

Before presenting options, verify tests pass:

# Bash
npm test  # or: cargo test / pytest / go test ./...
# PowerShell
npm test  # or equivalent for your stack

If tests fail:

Tests failing (<N> failures). Must fix before completing:

[Show failures]

Cannot proceed with merge/PR until tests pass.

STOP. Do not proceed to Step 2.

If tests pass: Continue to Step 2.

Step 2: Determine Base Branch

git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
git merge-base HEAD main 2>$null; if ($LASTEXITCODE -ne 0) { git merge-base HEAD master 2>$null }

Or ask: "This branch split from main — is that correct?"

Step 3: Present Options

Present exactly these 4 options — no more, no less, no open-ended questions:

Implementation complete. What would you like to do?

1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work

Which option?

Don't add explanation — keep options concise.

Step 4: Execute Choice

Option 1: Merge Locally

git checkout <base-branch>
git pull
git merge <feature-branch>
<test command>                    # Verify on merged result
git branch -d <feature-branch>   # Only after merge success

Then: Cleanup worktree (Step 5).

Option 2: Push and Create PR

git push -u origin <feature-branch>
gh pr create --title "<title>" --body "## Summary
- <bullet 1>
- <bullet 2>

## Test Plan
- [ ] All tests pass
- [ ] Manual verification complete"
git push -u origin <feature-branch>
gh pr create --title "<title>" --body "## Summary`n- <bullet 1>`n`n## Test Plan`n- [ ] All tests pass"

Then: Cleanup worktree (Step 5).

Option 3: Keep As-Is

Report: "Keeping branch <name>. Worktree preserved at <path>."

Don't cleanup worktree.

Option 4: Discard

Confirm first:

This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>

Type 'discard' to confirm.

Wait for exact confirmation. Then:

git checkout <base-branch>
git branch -D <feature-branch>

Then: Cleanup worktree (Step 5).

Step 5: Cleanup Worktree

For Options 1, 2, 4:

Check if in worktree:

git worktree list | grep $(git branch --show-current)
git worktree list | Select-String (git branch --show-current)

If yes:

git worktree remove <worktree-path>

For Option 3: Keep worktree.

Quick Reference

OptionMergePushKeep WorktreeCleanup Branch
1. Merge locally✓——✓
2. Create PR—✓✓—
3. Keep as-is——✓—
4. Discard———✓ (force)

Common Mistakes

MistakeFix
Skipping test verificationAlways verify tests before offering options
Open-ended "What should I do?"Present exactly 4 structured options
Auto worktree cleanupOnly cleanup for Options 1 and 4
No confirmation for discardRequire typed "discard" confirmation
Force-push without explicit requestNever force-push unless user explicitly asks

Integration

Called ByWhen
codex-subagent-executionAfter all tasks complete
codex-workflow-autopilotAfter ship mode completes
codex-execution-quality-gateAfter gate passes
Direct invocation$finish or $finish-branch
Pairs WithPurpose
codex-git-worktreesCleans up worktree created by that skill
codex-verification-disciplineTests must PASS before presenting options

Script Invocation Discipline

  1. When this workflow calls helper scripts from other skills, run --help first.
  2. Treat helper scripts as black-box tools and execute by contract before reading source.
  3. Read script source only when customization or bug-fixing is required.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when a project has 50+ files, missing context, or explicit $codex-genome request; generates multi-layer project context to reduce hallucination.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Bang-isme/CodexAI---Skills102026년 10월 5일 업데이트

Use for DESIGN.md visual identity contracts; author, scaffold, lint, diff, and export design contracts with the upstream spec and CLI.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Bang-isme/CodexAI---Skills102026년 10월 5일 업데이트

Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Bang-isme/CodexAI---Skills102026년 10월 5일 업데이트

Use when code changes may require documentation updates; maps git diff to candidate docs without auto-editing documentation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Bang-isme/CodexAI---Skills102026년 10월 5일 업데이트

Use for documents, reports, memos, guides, academic papers, or formal text that needs clear structure, reliable tone, formatting, and diagrams.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Bang-isme/CodexAI---Skills102026년 10월 5일 업데이트

Use when frontend, backend, mobile, data, DevOps, or security work needs domain routing and at most four focused references.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Bang-isme/CodexAI---Skills102026년 10월 5일 업데이트

Bang-isme의 스킬 모두 보기

이 스킬의 문제 신고