epic-cleanup
After an Epic pull request is merged, delete the remote branch, the local branch and the Epic worktree, leaving local and remote clean. Sub-skill of epic-implementer.
- License 许可
- MIT
- 最近更新
- 2026-10-28
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- epic-cleanup
- description
- After an Epic pull request is merged, delete the remote branch, the local branch and the Epic worktree, leaving local and remote clean. Sub-skill of epic-implementer.
03 SKILL.md 正文
User Input
$ARGUMENTS
The input must contain the pull request number, the Epic branch name and the worktree path.
Objective
Remove every resource created for the Epic once its pull request is merged.
1. Precondition
Confirm the pull request state is MERGED (gh pr view <pr> --json state).
If it is not merged, do nothing and return SKIPPED. Never clean up an unmerged Epic.
2. Leave the Worktree
Run every following command from the main repository checkout, never from inside the Epic worktree.
Do not switch branches or pull in the main checkout: it may hold the user's own work. Only run git fetch origin.
3. Remove the Worktree
- Confirm the worktree has no uncommitted or unpushed changes. If it has, stop and report
BLOCKEDinstead of discarding work. git worktree remove <worktree-path>git worktree prune
The worktree must be removed before the local branch, because a branch checked out in a worktree cannot be deleted.
4. Delete the Local Branch
git branch -d <branch>- If it fails because the branch is not merged into the current
HEAD(the main checkout may be on another branch, or the merge was a squash/rebase) and section 1 confirmedMERGED, usegit branch -D <branch>.
5. Delete the Remote Branch
- If the branch still exists on the remote,
git push origin --delete <branch>. git fetch --prune
A remote branch already deleted by GitHub is not an error.
6. Verify
Confirm that:
git worktree listno longer shows the Epic worktree.git branch --list <branch>is empty.git ls-remote --heads origin <branch>is empty.- The worktree directory no longer exists.
7. Final Output
Return:
- Decision:
CLEANED,SKIPPED(not merged) orBLOCKED - Worktree removed
- Local branch deleted
- Remote branch deleted
Return this output to the calling skill and continue its flow. Do not end the run here unless this skill was invoked directly by the user.
04 同仓库更多 Skills
utils-implementation
Write and organize utils (pure helpers for formatting, mapping, filtering, math, parsing, ids, storage) as one namespace object per domain with clear, readable names. Use before creating or changing any util.
test-writer
Write tests for the current implementation
tech-lead
Analyze a project, turn the user's goal into an implementation-ready GitHub Epic and Issues (following project rules, the Command Bus architecture and Fragiola UI), then start epic-implementer automatically (use the no-implement flag to stop after planning).
tech-lead-publish
Publish a final Epic and its Issues to GitHub, linked and labeled, keeping dependency and execution information. Sub-skill of tech-lead.
setup-command-system
Install the Command System architecture in the project
reviewer
Review code changes and provide feedback