一键导入
iflow-cleanup
Post-merge branch hygiene: switch to the default branch and delete merged local branches under one consolidated confirm. Never -D.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Post-merge branch hygiene: switch to the default branch and delete merged local branches under one consolidated confirm. Never -D.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Plan a larger change as a staged epic: draft epic<N>_plan.md with stages of manageable issue specs. Draft-only — publishing to GitHub is a separate step.
Smart dispatcher: detect where the focus issue stands and dispatch to /iflow-init, /iflow-plan, /iflow-start, or /iflow-close.
Front door: choose the next issue, create the issue branch, and run /iflow-init.
Read-only snapshot of where every issue stands, locally and on GitHub.
Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.
| name | iflow-cleanup |
| description | Post-merge branch hygiene: switch to the default branch and delete merged local branches under one consolidated confirm. Never -D. |
| disable-model-invocation | true |
| issue-flow-version | 0.4.2a4 |
/iflow-cleanup)Follow this skill to run post-merge branch hygiene after a PR has been merged (typically the PR opened by /iflow-close).
Invoke: type iflow cleanup in chat, or /iflow-cleanup from the slash menu (iflow-cleanup also works).
Profile: economy — Prioritize speed and token economy over deep reasoning.
In Cursor: use Auto or a fast model before invoking this step.
Keep scope tight to what this step requires.
Before any git, gh, or .issueflows/ path operation in this workflow:
Resolution order (stop when unambiguous):
root:<path>, repo:<folder-basename> (directory name, e.g. cellpy-core), or repo:owner/name.issue-flow agent resolve [-C <start>] [--from-file <active-file>] [--json]. Use the returned project_root and repo; pass -C <project_root> to other issue-flow agent … subcommands. When the answer came from the workspace registry, the payload sets resolved_via_workspace_default: true.^\d+- → that root..issueflows/ tree visible in the workspace → that root.issueflow-workspace.toml at the workspace root (created with issue-flow workspace init) may name a default member repo; use it when no scaffold matched above. Tell the user the default was used.After resolution, treat the result as <project_root> and <owner/repo>:
git -C <project_root> … (or issue-flow agent … -C <project_root> for supported ops).gh … --repo <owner/repo> — never rely on gh's implicit cwd default..issueflows/… paths are under <project_root>.When .issueflows/04-designs-and-guides/multi-repo-workspaces.md exists, read it for layout and cross-repo guidance.
Detect the default branch. Prefer gh repo view --repo <owner/repo> --json defaultBranchRef -q .defaultBranchRef.name, else git -C <project_root> symbolic-ref --quiet --short refs/remotes/origin/HEAD, else main.
Identify the target branch. If the user named a branch after /iflow-cleanup, use it. Else use the current branch (git branch --show-current). If the current branch is the default, skip to step 4 (folder sweep only).
Check PR / merge state. Prefer gh pr view <branch> --json state,mergedAt,mergeCommit,headRefName. If gh is unavailable, approximate with git fetch --prune then git cherry origin/<default> <branch> (all commits marked - means squash-merged).
git switch <default> before unrelated work and re-run /iflow-cleanup after the PR merges. Stop. Do not delete anything.Consolidated confirm — one yes/no prompt listing every action:
git switch <default>git pull --ff-onlygit fetch --pruneorigin/<default> (include squash-merges via git cherry). List them explicitly before running git branch -d <branch> for each. Never use -D; if -d refuses, report the branch and move on./iflow-close planned a tag it did not create — check the focus issue's status file and the newest HISTORY.md release section for a version whose tag is missing from git tag -l — include creating it here: git tag <planned> then git push origin <planned> (or gh release create <planned> --generate-notes). Run it after the pull so the tag lands on the merged squash commit.Optional folder sweep (safe; no destructive git). In .issueflows/01-current-issues/, for each issue<N>_* group whose status file contains - [x] Done (case-insensitive on done), move the group to .issueflows/03-solved-issues/. Leave groups without a checked Done in place — routing them to .issueflows/02-partly-solved-issues/ is /iflow-pause's job.
Report. Summarize: default branch, PR/merge status, commands run, branches deleted, branches skipped (with reason), folder sweep result. If issue-flow agent resolve --json reports sibling_roots, list them and remind the user that each scaffolded repo needs its own /iflow-cleanup — do not loop automatically in this step.
git branch -D or git push --force./iflow-close. The only version action allowed here is creating a release tag that /iflow-close planned (tag-derived strategy), inside the consolidated confirm.