imperialautomation/claude-code-toolkit/finish
Claude Code and agent skill by imperialautomation/claude-code-toolkit
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Complete issue workflow - commit, close issue, merge to base branch, cleanup
Install
npx vskill@latest install imperialautomation/claude-code-toolkit/finishSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as imperialautomation/claude-code-toolkit/finish.
Finish - INTERACTIVE COMMAND
MUST wait for user confirmation at Step 4. MUST use ~/.claude/bin/git-find-base-branch for base branch detection.
Complete the workflow for a finished issue: commit changes (including pre-commit hook modifications), close the issue, merge to base branch, and clean up.
Input
The user provides: $ARGUMENTS
Parameters (all optional):
- issue_number: Issue number to complete
- Empty/omitted → auto-detects from current branch name (e.g., 'issue-33-user-login' → issue 33)
- 'auto' → explicitly auto-detect from current branch name (same as empty)
- Provided number → uses that specific issue number
- base_branch: Target branch for merging
- Empty/omitted → uses 'auto' algorithm to detect base branch (DEFAULT)
- 'auto' → auto-detects base branch using ~/.claude/bin/git-find-base-branch script
- Any other value → uses that specific branch name
Examples
Implementation Steps
Step 1: Get current branch name using git branch --show-current
Toolkit repository: do not use `/finish`. Ask whether this repository is the live toolkit checkout's:
Exit 0 (it prints the live checkout's path) means yes: stop here and tell the user: toolkit changes go live only through a reviewed PR to main, so open a PR (/implement does) and run /cleanup after the merge; that fast-forwards the live checkout and removes the linked worktree. Steps 9 to 12 below would merge locally, and from a linked worktree git checkout main fails because the live checkout holds main. Exit 1 means another repository: continue with Step 2.
Step 2: Determine issue number:
- If issue_number parameter is provided (not 'auto'), use that value
- If issue_number parameter is empty/omitted OR 'auto':
- Extract from current branch name using regex pattern
issue-(\d+)-.* - Example: 'issue-33-user-login' → issue number 33
- If no match found, exit with error "Cannot detect issue number from branch name"
Step 3: Determine base branch:
- CRITICAL: ALWAYS use
~/.claude/bin/git-find-base-branchscript for auto-detection - If base_branch parameter is empty/omitted → Run
~/.claude/bin/git-find-base-branch - If base_branch parameter is 'auto' → Run
~/.claude/bin/git-find-base-branch - If base_branch parameter is provided (not 'auto') → Use that specific value
- NEVER use fallback to 'master' - always use the script result
Step 4: STOP — Ask for confirmation
- Display: current branch, issue number, base branch
- Ask: "Proceed with finishing issue #[issue_number]? (y/N)"
- Wait for user response. Exit if not confirmed.
Step 5: Verification gate (MANDATORY — no shortcuts):
- Run the full test suite fresh — do not rely on earlier runs
- Show actual test output — no "tests pass" claims without evidence
- Check for validation command:
npm run validate:all,make validate, etc. - Execute if available and show output
- If ANY test or validation fails: fix at root cause, re-run, show output again
- Exit with error if verification fails — do not proceed to commit
Step 6: Stage and commit with pre-commit hook handling:
- Run
git add . - Commit using:
~/.claude/bin/git-commit.sh "feat: complete issue #[issue_number] implementation" "" "🤖 Generated with [Claude Code](https://claude.ai/code)" "" "Co-Authored-By: Claude <noreply@anthropic.com>"
(each argument becomes a line in the commit message)
- If commit fails due to pre-commit hooks:
- Detect that hooks modified files
- Run
git add .again to stage hook modifications - Amend the commit with
~/.claude/bin/git-commit.sh --amend "feat: complete issue #[issue_number] implementation" "" "🤖 Generated with [Claude Code](https://claude.ai/code)" "" "Co-Authored-By: Claude <noreply@anthropic.com>" - Verify all changes are committed with
git diff-index --quiet HEAD --
Step 7: Push current branch:
- Try
git push origin [current_branch] - If fails, use
git push -u origin [current_branch]to create upstream
Step 8: Close GitHub issue:
- Run
gh issue close [issue_number] --comment "✅ Implementation complete and tested. All validation passed. Merging to [base_branch]."
Step 9: Switch to base branch:
- Run
git checkout [base_branch] - Run
git pull origin [base_branch]
Step 10: Merge issue branch:
- Run
git merge --no-ff [issue_branch] -m "Merge branch '[issue_branch]' - closes #[issue_number]"
Step 11: Push merged changes:
- Run
git push origin [base_branch]
Step 12: Delete branches:
- Delete local:
git branch -d [issue_branch] - Delete remote:
git push origin --delete [issue_branch]
Step 13: Show success message with summary
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/finish/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/imperialautomation/claude-code-toolkit/finish)