agentleFS
renathoazrenathoaz/arsyn/skills/finalizing/SKILL.md

finalizing

Skill2 starsChanged 8 months agoMITView on GitHub

Complete work with merge, PR, or cleanup options.

  • Commits and pushes

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
  1. Distinctive:

    Verify tests -> Resolve base branch -> Present options -> Execute -> Clean up worktree.

    line 12
  2. Distinctive:

    Run the project's test suite.

    line 16
  3. Distinctive:

    If ambiguous, confirm with the user: "This branch diverged from main — correct?"

    line 24
  4. Distinctive:

    No elaboration. Wait for selection.

    line 39
  5. Distinctive:

    If post-merge tests fail, abort the merge and report.

    line 53
  6. Distinctive:

    Wait for the exact word. Then:

    line 85

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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/null

If 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 entirely

No 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

OptionRemove Worktree?
1 — MergeYes
2 — PRYes
3 — KeepNo
4 — DiscardYes
# 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.