Add a new learning to the agent learnings file. Use when the user says /add-learning, asks to record a lesson, or when an implementation produced a reusable insight worth preserving for future agents.
日本語の概要は準備中です。原文の説明を表示しています。
Safely close out completed Incan work after a PR is merged by verifying merge status, syncing the base branch, removing task-owned local worktrees/assets, deleting merged local/remote branches, pruning refs, and reporting dirty or ambiguous leftovers. Use when the user says /closeout, asks to clean up after a merged PR, or wants local RFC/issue branch/worktree cleanup.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
/closeout cleans up local implementation state after a PR has merged. It is for removing task-owned worktrees, local branches, remote topic branches, stale refs, and temporary agent artifacts without touching unrelated user work.
This skill is intentionally conservative. A clean closeout is less important than not deleting active work.
The user may provide:
If no target is provided, infer it from the current branch, current worktree path, recent PR context, or task-owned temp directory names. If inference is ambiguous, ask the user which PR or branch to close out.
git worktree remove, git branch -d, and git push origin --delete <branch> over filesystem deletion.git reset --hard, rm -rf, or git clean -fd as a default cleanup tool.git branch -D, forced worktree removal, and deleting ambiguous assets require direct user confirmation or an unambiguous closeout instruction that task-owned scratch worktrees should go. The exception is the exact PR head branch for a PR that GitHub reports as merged; if git branch -d refuses because the PR was squash-merged or rebase-merged, delete that exact local branch with git branch -D after its worktrees are removed.Collect the current repository state:
git rev-parse --show-toplevel
git status --short --branch
git branch --show-current
git remote -v
git worktree list --porcelain
If the task references a PR, fetch its metadata through the GitHub connector when available. If using gh, be prepared for invalid local auth and fall back to GitHub connector data or plain git merge checks.
Record:
Use the strongest available source:
git branch --merged <base> shows the target branch.Recommended git fallback:
git fetch origin <base-branch> <target-branch>
git merge-base --is-ancestor <target-branch> origin/<base-branch>
GitHub merged status is authoritative for PR closeout when the target branch exactly matches the PR head branch. If GitHub reports the PR as merged but merge-base --is-ancestor fails, treat the branch as squash-merged or rebase-merged: record that ancestry did not prove the merge, then continue cleanup for the exact PR head branch only.
If the PR is open, closed-unmerged, unknown, or there is no reliable merged PR metadata and the branch is not an ancestor of the base branch, stop after reporting status. Do not clean up.
Once merged, update the base branch in the main worktree if it is clean:
git fetch origin --prune
git switch <base-branch>
git pull --ff-only
If the base worktree is dirty, skip the switch/pull and report the dirty files. Cleanup of separate task worktrees can still proceed if those task worktrees are clean and merge status is confirmed.
Identify only task-owned candidates:
ralph-loop or orchestrate-parallel-work,origin/<target-branch> for the merged PR,Use dry-run commands for asset cleanup:
git clean -nd
git status --short --ignored
Do not treat every untracked file as disposable. RFC drafts, docs changes, local notes, snapshots, and generated assets in the main worktree may be intentional user work.
For each candidate worktree:
git -C <main-repo> worktree remove <worktree-path>
If removal fails because the worktree is dirty, do not force-remove it. Report the path and dirty files.
Exception: for task-owned worker worktrees created as scratch slices by ralph-loop or orchestrate-parallel-work, dirty status is expected after the merged orchestrator branch has integrated the work. If the user has confirmed closeout or says those workers should go, remove them with:
git -C <main-repo> worktree remove --force <worker-worktree-path>
Record the removed worker path and branch in the closeout report.
Delete the local branch only after no worktree is using it:
git branch -d <target-branch>
Delete the remote topic branch only when it is the PR head branch and the PR is merged:
git push origin --delete <target-branch>
If git branch -d reports unmerged commits, check whether the branch is the exact head branch of a PR that GitHub reports as merged. If yes, treat it as squash/rebase-merged and delete the local branch with:
git branch -D <target-branch>
Do not use this exception for branches inferred only from names, branches without reliable merged PR metadata, branches that do not match the PR head, or branches still checked out in any worktree. In those cases, stop and report the exact git output unless the user explicitly confirms the commits are disposable.
For confirmed disposable worker branches whose worktrees were force-removed as scratch assets, delete with:
git branch -D <worker-branch>
Use this only for branches that match the closed task and were created as local worker slices, not for arbitrary feature branches.
Prefer worktree removal to manual file deletion. If artifacts remain outside the removed worktree, delete only files that are all of:
For ambiguous .agents/state/*, temp directories, or generated docs assets, ask before deletion unless they are inside the removed task worktree.
Run:
git worktree list
git branch --list <target-branch>
git branch -r --list origin/<target-branch>
git status --short --branch
If the base worktree was updated, also verify it is on the expected branch and clean except for pre-existing unrelated user changes.
Report the closeout as:
## Closeout — <PR / branch / task>
### Removed
- <worktree / branch / remote ref / artifact>
### Kept
- <dirty or ambiguous item intentionally preserved>
### Verification
- `<command>` — <result>
### Blocked
- <only if something could not be safely cleaned>
If nothing was removed because the PR is not merged yet, say that directly and include the merge status source.
Stop and ask or report status when:
gh auth is invalid and no other reliable PR status source is available,If sandbox permissions block cleanup, request approval for the exact command and target. Do not request broad approval for destructive command families. Never suggest a persistent prefix rule for rm, forced deletion, or arbitrary shell execution.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Add a new learning to the agent learnings file. Use when the user says /add-learning, asks to record a lesson, or when an implementation produced a reusable insight worth preserving for future agents.
日本語の概要は準備中です。原文の説明を表示しています。
Transition an Incan RFC from one status to the next. Use when the user asks to promote, advance, or finalize an RFC, or says /bump-rfc. Handles Draft → Planned, Planned → In Progress, and In Progress → Implemented transitions.
日本語の概要は準備中です。原文の説明を表示しています。
Drafts a GitHub issue title and body using the target repository's issue templates under .github/ISSUE_TEMPLATE. Use when the user asks to create, draft, or file a GitHub issue, bug report, feature request, chore, documentation issue, or RFC proposal, or wants issue text that matches the repo's template.
日本語の概要は準備中です。原文の説明を表示しています。
Drafts implementation plans with TDD, documentation updates, and repository verification commands before coding. Use when the user asks for an implementation plan, /create-plan, or structured pre-implementation design for work in encero workspaces (e.g. Incan, IncQL).
日本語の概要は準備中です。原文の説明を表示しています。
Generate a PR description following the repository's pull request template. Use when the user asks to create, draft, or generate a PR description for a pull request. The skill automatically locates the PR template in the target repository and fills it in based on the git diff.
日本語の概要は準備中です。原文の説明を表示しています。
Fix actionable in-scope findings in the current Incan worktree, usually after /review. Use when the user asks to fix review findings, clean up reported issues, apply in-scope review feedback, or says /fix.
日本語の概要は準備中です。原文の説明を表示しています。