skills/finishing-a-development-branch/SKILL.md
Use when implementation is complete, tests pass, and you need to decide the integration path. Triggers: 'done with this branch', 'ready to merge', 'ship it', 'wrap this up', 'how should I integrate this', 'what next after implementation'. NOT for: PR creation mechanics (use creating-issues-and-pull-requests).
npx skillsauth add axiomantic/spellbook finishing-a-development-branchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Announce: "Using finishing-a-development-branch skill to complete this work."
| Input | Required | Description |
|-------|----------|-------------|
| Passing test suite | Yes | Tests must pass before this skill can proceed |
| Feature branch | Yes | Current branch with completed implementation |
| Base branch | No | Branch to merge into (auto-detected if unset) |
| post_impl setting | No | Autonomous mode directive (auto_pr, offer_options, stop) |
| Output | Type | Description | |--------|------|-------------| | Integration result | Action | Merge, PR, preserved branch, or discarded branch | | PR URL | Inline | GitHub PR URL (Option 2 only) | | Worktree state | State | Removed (Options 1, 4) or preserved (Options 2, 3) |
Check context for autonomous mode indicators: "Mode: AUTONOMOUS", "autonomous mode", or post_impl preference.
| post_impl value | Behavior |
|-------------------|----------|
| auto_pr | Skip Step 3, execute Option 2 directly |
| offer_options | Present options normally |
| stop | Skip Step 3, report completion without action |
| (unset in autonomous) | Default to Option 2. Log: "Autonomous mode: defaulting to PR creation" |
Required behavior:
The rare exception: A comment may reference external historical facts that explain non-obvious constraints (e.g., "SQLite < 3.35 doesn't support RETURNING"). Reframe as a present-tense constraint, not a change narrative.
# Run project's test suite
npm test / cargo test / pytest / go test ./...
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.
If tests pass: Continue to Step 2.
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
If the command fails or is ambiguous, ask: "This branch split from main - is that correct?"
Present exactly these 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?
Don't add explanation - keep options concise.
Dispatch subagent with command: finish-branch-execute
Provide context: chosen option number, feature branch name, base branch name, worktree path (if applicable).
Dispatch subagent with command: finish-branch-cleanup
Provide context: chosen option number, worktree path. Note: Option 3 skips cleanup entirely.
| Option | Merge | Push | Keep Worktree | Cleanup Branch | |--------|-------|------|---------------|----------------| | 1. Merge locally | Yes | - | - | Yes | | 2. Create PR | - | Yes | Yes | - | | 3. Keep as-is | - | - | Yes | - | | 4. Discard | - | - | - | Yes (force) |
IF ANY unchecked: STOP and fix. </reflection>
Called by:
Pairs with:
<FINAL_EMPHASIS> You are a Release Engineer. Clean integrations that never break main and never lose work without confirmation are your entire reputation. A test-gated, confirmation-gated, option-structured handoff is the only acceptable delivery. Anything less is negligence. </FINAL_EMPHASIS>
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment. Triggers: 'write a skill', 'new skill', 'create a skill', 'skill doesn't work', 'skill isn't firing', 'edit skill', 'skill quality'. NOT for: general prompt improvement (use instruction-engineering) or command creation (use writing-commands).
development
Use when you have a spec, design doc, or requirements and need a detailed implementation plan before coding. Triggers: 'write a plan', 'create implementation plan', 'plan this out', 'break this down into steps', 'convert design to tasks', 'implementation order'. Also invoked by develop during planning. NOT for: reviewing existing plans (use reviewing-impl-plans).
testing
Use when creating new commands, editing existing commands, or reviewing command quality. Triggers: 'write command', 'new command', 'create a command', 'review command', 'fix command', 'command doesn't work', 'add a slash command'. NOT for: skill creation (use writing-skills).
development
Use when about to claim discovery during debugging. Triggers: "I found", "this is the issue", "I think I see", "looks like the problem", "that's why", "the bug is", "root cause", "culprit", "smoking gun", "aha", "got it", "here's what's happening", "the reason is", "causing the", "explains why", "mystery solved", "figured it out", "the fix is", "should fix", "this will fix". Also invoked by debugging, scientific-debugging, systematic-debugging before any root cause claim.