/jig:finishfrom jig
Guides completion of development work by verifying tests, presenting structured integration options (merge, PR, keep, discard), executing the choice, and cleaning up worktrees.
Ships in jig. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
PURPOSE: Guide the completion of development work through a structured decision flow: verify tests pass, present clear integration options, execute the chosen option, and clean up.
GIT HOST: PR creation in Option 2 uses GitHub (gh) as the default. If git-host in jig.config.md is not github, read framework/GIT_HOST.md for the platform-specific command equivalents.
Core principle: Verify tests -> Present options -> Execute choice -> Clean up.
Announce at start: "I'm using the finish skill to complete this work."
Invoke this skill when:
sdd or team-dev reaches the end of executionDo NOT use when:
Before presenting options, verify tests pass.
Run the project's test suite:
<project-test-command>
REQUIRED: Use verify -- run the actual command, read the output, confirm zero failures before proceeding.
If tests fail:
Tests failing (N failures). Must fix before completing:
[Show failures]
Cannot proceed with merge/PR until tests pass.
Stop. Do not proceed to Step 2. Fix the failures first.
If tests pass: Continue to Step 2.
Read main-branch from jig.config.md (default: main).
git merge-base HEAD <main-branch>
Or ask: "This branch split from <main-branch> -- is that correct?"
Stacked branch? If this branch builds on another unmerged branch, that branch is the base. Read framework/STACKED_PRS.md before Option 1 or 2, and before merging, retargeting or dropping any PR in the chain: a stack merges into its own base, which may not be <main-branch>.
Present exactly these 4 options:
Implementation complete. All tests pass. 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?
Do not add explanation -- keep options concise. Wait for the user's choice.
# Switch to base branch
git checkout <base-branch>
# Pull latest
git pull
# Merge feature branch
git merge <feature-branch>
# Verify tests on merged result
<test-command>
# If tests pass, delete the feature branch
git branch -d <feature-branch>
If merge conflicts occur:
If tests fail after merge:
Then: Cleanup worktree (Step 5)
# Push branch
git push -u origin <feature-branch>
Then create the PR. Read jig.config.md for:
require-ticket-reference -- whether to include ticket referenceticket-system -- which system to referencebranching.format -- to extract ticket number from branch name# Create PR with structured description
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Test Plan
- [ ] <verification steps>
EOF
)"
If the project has the pr-create skill, defer to it for PR creation.
Then: Cleanup worktree (Step 5)
Report:
Keeping branch <name>. Worktree preserved at <path>.
Do not clean up the worktree.
Confirm first:
This will permanently delete:
- Branch: <name>
- All commits: <commit-list>
- Worktree at <path> (if applicable)
Type 'discard' to confirm.
Wait for exact confirmation. Do not proceed without it.
If confirmed:
git checkout <base-branch>
git branch -D <feature-branch>
With team memory on, record why this work was dropped, in the user's own
reason, as a decision note that links the work's ticket, or a spec or
plan that outlives the branch (on the base branch or a published page)
(the memory skill, Saving). If the user gave no reason, or there is
nothing to link, skip it.
Then: Cleanup worktree (Step 5)
For Options 1, 2, and 4:
Check if working in a worktree:
git worktree list
If the current directory is a worktree (not the main working tree):
Preferred: Use the worktree skill for safe removal — it handles
uncommitted change warnings and branch cleanup:
/jig:worktree remove <worktree-dir-name>
Fallback (if worktree skill is not available):
# Navigate out of the worktree first
cd <main-working-tree-path>
# Remove the worktree
git worktree remove <worktree-path>
For Option 3: Keep the worktree intact.
If the plan or spec header names a PRD (> **PRD:**), follow framework/LIVE_PRD.md:
ship entry with the branch and the PR link. Tick any milestone in the Milestone Map marked as completed by shipping, once the merge has actually happened.ship entry saying the branch was discarded and why, so the PRD's readers are not left waiting.Skip quietly if there is no PRD or the write is refused, and say so once.
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|---|---|---|---|---|
| 1. Merge locally | Yes | No | No | Yes (soft delete) |
| 2. Create PR | No | Yes | Yes (for PR updates) | No |
| 3. Keep as-is | No | No | Yes | No |
| 4. Discard | No | No | No | Yes (force delete) |
| Mistake | Consequence | Fix |
|---|---|---|
| Skipping test verification | Merge broken code, create failing PR | Always verify tests before offering options |
| Open-ended questions | "What should I do next?" is ambiguous | Present exactly 4 structured options |
| Automatic worktree cleanup | Remove worktree when user might need it | Only cleanup for Options 1 and 4 |
| No confirmation for discard | Accidentally delete work | Require typed "discard" confirmation |
| Merging without pulling latest | Merge conflicts discovered after merge | Always pull latest before merging |
| Not running tests after merge | Merge introduced regressions | Test the merged result before deleting branch |
Never:
Always:
Called by:
sdd (terminal state) -- after all tasks complete and final review passesteam-dev (terminal state) -- after all tasks complete and integration review passesRelated skills:
verify -- used in Step 1 to verify tests passpr-create -- can be used in Option 2 for more structured PR creationreview -- should have been completed before reaching this skillAfter the chosen option is executed and cleanup is done, suggest:
"Work complete. If this was a feature or complex improvement, consider running
/postmortemto capture lessons learned."
Do not auto-invoke the postmortem -- just suggest it.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub duronext/jig --plugin jig26 skills in this plugin
/brainstormUse when exploring ideas, comparing approaches, or refining an unclear problem — at any point in the workflow. A discovery-time tool, not a pipeline stage. Invokable directly via /brainstorm or offered by kickoff during DISCOVER. Produces understanding, not artifacts.
/buildUse when you have an implementation plan and want to execute it. Analyzes the plan's task graph, determines the best execution strategy (parallel via team-dev or serial via sdd), and orchestrates the full build with quality gates. The single entry point for plan execution — you don't need to choose between team-dev and sdd yourself.
/debugUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes. Enforces root cause investigation through four phases: investigation, pattern analysis, hypothesis testing, and implementation. Prevents guess-and-check thrashing.
/eng-copywritingUse when writing ANY user-facing text -- UI labels, button text, error messages, notifications, tooltips, placeholders, or application content./eng-loggingUse when implementing logging in application code. Covers log level selection, structured logging, error tracking integration, and avoiding noise./eng-testingUse when writing tests, designing test strategy, or reviewing test coverage. Covers test pyramid, naming, mocking, and flaky test policy.Other plugins' skills for the same job