Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Finalize code changes for production readiness by removing duplicate logic, auditing hardcoded values, verifying branch/worktree intent, verifying build integrity, structuring clean commits with Conventional Commits format, and forcing a post-publish branch/worktree cleanup decision.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 170% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 152% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 60% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 151% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 287% | 0% |
Type: Execution
Finalize current changes for production readiness.
Tasks:
Do not run this skill without:
Optional but recommended:
Run branch-context-check before validating the working set. If that skill is not installed, run the check inline: inspect git status --short --branch, git branch --show-current, git log --oneline --decorate -5, and the staged/dirty file lists, then classify the branch/worktree against the current task intent using the same four verdicts below.
Required outcome:
are inspected.
match, ambiguous, mismatch, orblocked.
Proceed to Gate 0 only when:
match, orambiguous and the user explicitly confirms the branch/worktreeis correct for the current task.
Stop before staging or committing when:
mismatch or blocked.In a stopped state, recommend a concrete recovery path: create/switch to a task-appropriate branch, create a separate worktree from the correct base, or finish/commit the previous-session work first. Do not move, stash, reset, or discard changes without explicit user approval.
> CRITICAL: The working tree may contain changes from other agent sessions > or manual edits. This gate must isolate only the current session's changes > without disturbing anything else.
Step 0-1: Identify current session scope
by this session.
authoritative source.
Step 0-2: Inspect full working tree state
git status and git diff --name-only to enumerate all uncommittedchanges in the working tree.
Step 0-3: Classify changes
and the working tree (Step 0-2).
modified by this session. These may belong to other agent sessions, manual edits, or background tooling.
Step 0-4: Protect out-of-scope changes
git add).Step 0-5: Confirm with the user
> SCOPING RULE: Focus analysis on in-scope files only (from > Gate 0). When checking for duplicates, search for similar patterns > in the immediate module/directory first, then expand to adjacent > modules only if duplication signals are found.
> SCOPE ADJUSTMENT: If all in-scope changes are limited to test > files, documentation, or type definitions, perform a quick scan > (search for numeric literals and string constants in the diff) > instead of a full classification audit. The full audit is required > when production logic files are in scope.
Classify hardcoded values into:
A) Algorithmic constants → Extract to named constant + documentation B) Operational policies → Move to config/env + default fallback C) Test-only values → Restrict to test scope
Ensure:
Verify:
Run relevant project checks:
If failures occur:
Staging rule: Stage only in-scope files confirmed in Gate 0. Use git add <specific-file> for each file individually. Never use git add ., git add -A, or git add --all.
Separate commits logically:
Use Conventional Commits:
Each commit must explain:
After any commit, push, PR creation, or PR merge performed as part of this workflow, run Gate 6 of branch-context-check.
Required behavior:
branch remains checked out.
switch back to base, or leave cleanup for after merge.
fast-forward pull, delete the local task branch, delete the remote task branch, prune remote refs, and prune stale worktree metadata.
only after confirming that worktree is clean.
Do not end the workflow after push or merge without reporting the cleanup decision. Deletion still requires the safety checks from branch-context-check Gate 6 (inline fallback: delete only when the working tree is clean, the PR is merged or the user confirms the branch is obsolete, the branch is not the current checkout, and no other branch or worktree depends on it).
branch-context-checkor the user has explicitly accepted an ambiguous verdict.
handoff.
git checkout -- <file>, git restore, git stash, git reset --hard,or any other command that discards or reverts uncommitted changes to files outside the current session's scope. Other sessions or agents may own those changes.
git add ., git add -A, or git add --all. Always stage filesindividually with git add <specific-file> to avoid accidentally including out-of-scope changes.
left completely untouched.
Common bad outputs:
git add . or git add -A which accidentally stages out-of-scope changesfiles can be staged individually
worktrees without offering cleanup choices
merged/obsolete status
Input:
3 files changed: a utility function was refactored, an unused import was found, and a debug console.log was left in.
Output:
utils/parse.ts, debug log in api/handler.tsmatch — current branch and dirty files align withthe cleanup task
refactor(utils): clean up unused import and debug logor PR cleanup will be decided after publish
Input:
12 files changed across 3 modules. Includes a retry timeout hardcoded as 3000, duplicated validation logic in 4 handlers, and a new API endpoint.
Output:
services/retry.ts, duplicated input validation in 4 route handlers, unused helper formatLegacy in utils/format.tsmatch — branch name, recent commits, and in-scopefiles align with the API work
RETRY_TIMEOUT_MS), created shared validateInput() helper, removed formatLegacyrefactor(validation): extract shared validateInput helper from route handlersrefactor(retry): move hardcoded timeout to config as RETRY_TIMEOUT_MSfeat(api): add POST /items endpoint with input validationlocal/remote branch deletion, remote prune, and worktree prune; do not delete while the PR is still open
FAST MODE (only if explicitly requested):
Other measured skills in the registry, with their headline benchmark lift.