tercel/code-forge/finish
Claude Code and agent skill by tercel/code-forge
- community
Checking that the SKILL.md file is still in the repository.
Use when implementation is complete and you need to merge, create a PR, or clean up — verifies tests pass, presents 4 structured integration options, executes chosen workflow, and cleans up worktrees. Pairs with code-forge:worktree.
Install
npx vskill@latest install tercel/code-forge/finishSKILL.md
Code Forge — Finish
⚡ Execution Entry Point
@../shared/execution-entrypoint.md
For this skill: start at Step 1 (Verify Tests), then Step 1.5. If you catch yourself about to say "falling back to manual finish", STOP and go to the indicated step.
Complete a development branch by verifying tests, choosing an integration strategy, and cleaning up.
When to Use
- Implementation is complete and all tasks are done
- After code-forge:impl finishes all tasks for a feature
- When you need to integrate a feature branch back to main
- When you want to discard experimental work cleanly
Workflow
Step 1: Verify Tests
Run the full test suite before proceeding (following the code-forge:verify discipline — run fresh, read full output, confirm zero failures).
- All pass: Proceed to Step 1.5
- Any fail: STOP. Do not proceed. Report failures and suggest fixes.
Step 1.5: Simplification Gate (Mandatory Pre-Merge Cleanup)
This step is mandatory and runs on every `/code-forge:finish` invocation. It is the last line of defense against merging bloated, redundant, or dead code that slipped past the planner and the reviewer. Skill-driven feature work has a strong additive bias — this gate is what keeps the codebase from growing unbounded across feature cycles.
The gate is fully self-contained — it does not depend on any external skill. The detection criteria, fix rules, and safety constraints are all defined inline below.
1.5.1 Compute Diff Scope
If the changed file list is empty (nothing to merge), skip the gate and proceed to Step 2.
1.5.2 Pre-Gate Safety Check
Before running the gate, capture the working-tree state so we can distinguish simplification changes from any other uncommitted changes the user may have:
If /tmp/code-forge-finish-pre-gate-status.txt is non-empty (the user already has uncommitted work before the gate runs), display a warning and use AskUserQuestion:
- "Stash them and run the gate" → run
git stash push -u -m "code-forge-finish-pre-gate", then proceed; pop the stash before exiting Step 1.5 - "Commit them first, then run the gate" → STOP, let the user commit, ask the user to re-run
/code-forge:finish - "Proceed without stashing (risky — gate fixes will mix with your changes)" → proceed; the cleanup logic in 1.5.3 will then refuse the destructive options and only allow "review and decide manually"
1.5.3 Run the Simplification Sub-agent
Offload to a sub-agent so the full diff, grep output, and file reads stay out of the main context.
Spawn an Agent tool call with:
subagent_type:"general-purpose"description:"Pre-merge simplification gate"
Sub-agent prompt must include all of the following, verbatim, plus the base branch name and the changed-file list from 1.5.1:
Sub-agent return format:
1.5.4 Decision
Read the report from the sub-agent and act. The set of files the sub-agent touched comes ONLY from `FIXES_APPLIED.file` in the report — never from `git status`, never from a wildcard. This isolation is what makes the gate safe to run on a working tree that may also contain unrelated user changes.
Build GATE_FILES = the deduplicated list of file paths from FIXES_APPLIED.file.
- No findings, no fixes applied (`FIXES_APPLIED` is empty): Display
Simplification gate: clean. No bloat detected.If we stashed in 1.5.2,git stash pop. Proceed to Step 2.
- Fixes applied, all tests still pass: Display the
FIXES_APPLIEDlist and the newNET_LOC_DELTA. UseAskUserQuestionto ask: - "Review the simplification changes" → run
git diff -- $GATE_FILES(only the gate files), display the summary, then re-ask the same question. - "Commit the simplifications, then proceed to merge options" → stage ONLY the gate files explicitly:
git add -- $GATE_FILES. Then commit:git commit -m "chore: pre-merge simplification gate". If the gate was preceded by a stash (1.5.2),git stash popAFTER the commit so the user's prior work returns to the working tree unmixed with the gate commit. Proceed to Step 2. - "Discard the simplifications and proceed anyway" → use
AskUserQuestionto confirm with a separate "Yes, discard" / "Cancel" choice. On confirmation, revert ONLY the gate files:git checkout HEAD -- $GATE_FILES. Never rungit checkout -- .orgit reset --hard— those would destroy unrelated user changes. If we stashed in 1.5.2,git stash pop. Proceed to Step 2. - If the user chose "Proceed without stashing" in 1.5.2: omit the "Discard the simplifications" option entirely — the working tree contains mixed changes and a surgical revert is unsafe without the user picking files manually. Only offer "Review", "Commit", and "Stop and resolve manually".
- Tests broke after fixes (sub-agent should have already reverted the offending fix): Display the failing test name, the reverted fix, and the remaining
FIXES_APPLIEDentries. STOP. Do not proceed to Step 2. The user must verify the working tree manually and re-run/code-forge:finish.
- `REMAINING_ISSUES` is non-empty (unfixable bloat that needs human judgment): Display them with
file:linereferences. UseAskUserQuestion: - "Address remaining issues now (recommended)" → STOP. If we stashed in 1.5.2, leave the stash in place and tell the user the stash name so they can pop it after resolving.
- "Proceed to merge options anyway (issues will land in main)" → continue with the "Fixes applied" flow above for any fixes the gate did apply, then proceed to Step 2 with a warning.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/finish/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Mar 2026, 7 months ago.
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/tercel/code-forge/finish)