finalizing
Skill2 starsChanged 8 months agoMITView on GitHub
Complete work with merge, PR, or cleanup options.
- Commits and pushes
In this repository18 other files it gives its agents.
- auditingSkill
- bootstrappingSkill
- debuggingSkill
- executingSkill
- guardingSkill
- handling-reviewSkill
- ideatingSkill
- isolatingSkill
- orchestratingSkill
- parallelizingSkill
- planningSkill
- precisionSkill
- requesting-reviewSkill
- runbookSkill
- scaffoldingSkill
- skill-craftingSkill
- tddSkill
- verifyingSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Verify tests -> Resolve base branch -> Present options -> Execute -> Clean up worktree.
- Distinctive: line 16
Run the project's test suite.
- Distinctive: line 24
If ambiguous, confirm with the user: "This branch diverged from main — correct?"
- Distinctive: line 39
No elaboration. Wait for selection.
- Distinctive: line 53
If post-merge tests fail, abort the merge and report.
- Distinctive: line 85
Wait for the exact word. Then:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Finalizing
Announce at start: "I'm applying the finalizing skill to wrap up this branch."
Sequence
Verify tests -> Resolve base branch -> Present options -> Execute -> Clean up worktree.
Step 1: Verify Tests
Run the project's test suite. If tests fail, stop. Report failures and do not offer completion options until they pass.
Step 2: Resolve Base Branch
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/nullIf ambiguous, confirm with the user: "This branch diverged from main — correct?"
Step 3: Present Options
Show exactly these four choices:
Implementation complete. How should this land?
1. Merge into <base-branch> locally
2. Push and open a Pull Request
3. Leave the branch as-is (I'll handle it)
4. Discard this work entirelyNo elaboration. Wait for selection.
Step 4: Execute
Option 1 — Local Merge
git checkout <base-branch>
git pull
git merge <feature-branch>
# Run tests on merged result
git branch -d <feature-branch>If post-merge tests fail, abort the merge and report.
Option 2 — Push + PR
git push -u origin <feature-branch>
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets>
## Test Plan
- [ ] <verification steps>
EOF
)"Option 3 — Keep As-Is
Report the branch name and worktree path. Do not clean up anything.
Option 4 — Discard
Require explicit confirmation before destroying work:
This permanently deletes:
- Branch <name> and all its commits
- Worktree at <path>
Type 'discard' to confirm.Wait for the exact word. Then:
git checkout <base-branch>
git branch -D <feature-branch>Step 5: Worktree Cleanup
| Option | Remove Worktree? |
| 1 — Merge | Yes |
| 2 — PR | Yes |
| 3 — Keep | No |
| 4 — Discard | Yes |
# Check if current work is in a worktree
git worktree list
# Remove if applicable
git worktree remove <worktree-path>For Option 2, remove the worktree after pushing — the branch lives on the remote now.
Gotchas
- Merging without re-testing — The merge commit can introduce failures even if both branches passed independently. Always run tests on the merged result before considering it done.
- Auto-cleaning Option 3 worktrees — If the user chose "keep," they want it preserved. Do not remove the worktree.
- Discarding without confirmation — Deleted branches with unpushed commits are unrecoverable (absent reflog diving). The typed confirmation exists for a reason.
- Force-pushing during PR creation — Never force-push unless the user explicitly requests it. A regular push is always the default.
- Forgetting to pull before merge — Merging into a stale base branch creates unnecessary merge commits or conflicts. Always pull first.
Integration
Called by:
- orchestrating (Step 7) — after all subagent tasks complete
- executing (Step 5) — after all plan batches complete
Pairs with:
- isolating — this skill cleans up what isolating created
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

