agentleFS
0x2E0x2E/dev-skills/skills/finishing-work/SKILL.md

finishing-work

Skill1 starsChanged 5 months agoMITView on GitHub

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work — presents structured options for merge, PR, or cleanup

  • Commits and pushes

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 11 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Before starting, you must have:

    line 12
  2. Distinctive:

    All implementation tasks complete (executing-plans has finished)

    line 13
  3. Distinctive:

    Run the project's test suite before offering options:

    line 20
  4. Distinctive:

    If tests fail: report failures.

    line 26
  5. Distinctive:

    If tests pass: continue to Step 2.

    line 28
  6. Distinctive:

    If neither works, ask: "Which branch did this split from?"

    line 50
  7. Very specific:

    Ask for confirmation first.

    line 95
  8. Very specific:

    Only if in a git worktree: return to main repo root, run git worktree remove <path> && git worktree prune.

    line 99
  9. Distinctive:

    Never proceed with failing tests.

    line 112
  10. Distinctive:

    Never merge without verifying tests on the merged result.

    line 113
  11. Distinctive:

    Never delete work without typed "discard" confirmation.

    line 114
  12. Distinctive:

    Never clean up worktree for Option 2 (user needs it for PR iteration).

    line 115
  13. Distinctive:

    Never run git worktree remove from inside the worktree being removed.

    line 116
  14. Very specific:

    gh pr create fails opaquely when unauthenticated: Run gh auth status first; an auth problem surfaces as a vague error rather than a clear …

    line 120

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Finishing Work

Guide completion of development work by verifying tests, presenting clear options, and executing the chosen workflow.

Preconditions

Before starting, you must have:

  1. All implementation tasks complete (executing-plans has finished)
  2. Final verification has passed (tests, lint, build)

Process

Step 1: Verify Tests

Run the project's test suite before offering options:

npm test / cargo test / pytest / go test ./...

If tests fail: report failures. Cannot proceed with merge/PR until tests pass. Stop.

If tests pass: continue to Step 2.

Step 2: Detect Environment

Determine the workspace state:

git rev-parse --git-dir 2>/dev/null && git branch --show-current
StateMenuCleanup needed
Normal repo, named branch4 optionsNo worktree to clean
Git worktree, named branch4 optionsClean up worktree after merge/discard
Detached HEAD3 options (no merge)Externally managed

Step 3: Determine Base Branch

git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null

If neither works, ask: "Which branch did this split from?"

Step 4: Present Options

For normal repo and named-branch worktree (4 options):

Implementation complete. What would you like to do?

1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work

Which option?

For detached HEAD (3 options — no local merge):

Implementation complete. You're on a detached HEAD.

1. Push as new branch and create a Pull Request
2. Keep as-is (I'll handle it later)
3. Discard this work

Which option?

Step 5: Execute Choice

Option 1: Merge Locally

Return to main repo root, checkout <base-branch>, pull, merge <feature-branch>. Verify tests on the merged result. Only after merge succeeds: clean up worktree (if applicable), then git branch -d <feature-branch>.

Option 2: Push and Create PR

git push -u origin <feature-branch> && gh pr create. Do NOT clean up worktree — the user needs it for PR iteration.

Option 3: Keep As-Is

Report: "Keeping branch <name>. No changes made."

Option 4: Discard

Ask for confirmation first. If confirmed: return to main repo root, checkout <base-branch>, git branch -D <feature-branch>, clean up worktree (if applicable).

Step 6: Clean Up Worktree (Options 1 & 4 only, if applicable)

Only if in a git worktree: return to main repo root, run git worktree remove <path> && git worktree prune. Do NOT run worktree remove from inside the worktree itself.

Quick Reference

OptionMergePushClean up worktree
1. Merge locallyyes-yes
2. Create PR-yesno
3. Keep as-is--no
4. Discard--yes

Red Flags

  • Never proceed with failing tests.
  • Never merge without verifying tests on the merged result.
  • Never delete work without typed "discard" confirmation.
  • Never clean up worktree for Option 2 (user needs it for PR iteration).
  • Never run git worktree remove from inside the worktree being removed.

Gotchas

  • gh pr create fails opaquely when unauthenticated. Run gh auth status first; an auth problem surfaces as a vague error rather than a clear "log in" prompt.
  • Base branch can be main or master. git merge-base HEAD main fails on older repos — fall back to master before asking the user.

This is the terminal phase of the workflow chain. After completion, report the outcome to the user. No further skill is invoked.

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.