finalize-task
Skill45 starsChanged 4 days agoMITView on GitHub
Use when a task worktree has passed validation - manually commits, merges, and cleans up, or prepares runner-owned commits and publication
2 other projects use a version of this.
Adopted by
Most recently taken up by
- blockscout/frontendtheir own version, first seen Oct 8, 2026
- Ozgurx360/claude-skillstheir own version, first seen Jun 9, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- blockscout/frontend★ 310same name
- Ozgurx360/claude-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- build-unplannedSkill
- check-specs-alignmentSkill
- create-tasksSkill
- debugSkill
- design-architectureSkill
- design-it-twiceSkill
- design-productSkill
- domain-modelingSkill
- doubt-driven-developmentSkill
- groundwork-checkSkill
- groundwork-helpSkill
- handoffSkill
- implement-taskSkill
- instrument-observabilitySkill
- just-do-itSkill
- just-do-it-swarmingSkill
- plan-taskSkill
- review-prSkill
- select-projectSkill
- setup-repoSkill
- shipSkill
- skillsSkill
- source-architecture-from-codeSkill
- source-product-specs-from-codeSkill
- source-ux-design-from-codeSkill
- split-architectureSkill
- split-specsSkill
- staged-rolloutSkill
- statuslineSkill
- swarm-debugSkill
- swarm-design-architectureSkill
- task-validation-loopSkill
- test-driven-developmentSkill
- understanding-feature-requestsSkill
- use-git-worktreeSkill
- using-groundworkSkill
- ux-designSkill
- validateSkill
- vertical-sliceSkill
- work-on-next-taskSkill
- work-onSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 16
When invoked by the external runner, treat its exact project_root, worktree_path, branch, base_branch, base_head, and validated_head values …
- Distinctive: line 18
When invoked manually from the task worktree:
- Distinctive: line 37
Never reset, stash, rebase, force-delete, or silently switch either worktree to another branch.
- Distinctive: line 44
Update its status-table row when an index exists.
- Distinctive: line 45
Leave unrelated tasks unchanged.
- Distinctive: line 54
Do not create an empty commit.
- Distinctive: line 61
Check whether the current base head is an ancestor of the task branch.
- Distinctive: line 63
If it is not:
- Very specific: line 71
If resolution needs product, architecture, or ownership judgment, safely abort the integration when possible and return RESULT: NEEDS_INPUT.
- Very specific: line 81
When invoked manually, merge with --no-ff, then continue to cleanup below.
- Distinctive: line 85
After a successful manual merge:
- Distinctive: line 89
Remove exactly the verified task worktree.
- Distinctive: line 90
Delete exactly the verified task branch with safe deletion.
- Very specific: line 92
If the merge succeeded but cleanup fails, return RESULT: CLEANUP_REQUIRED.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Finalize Task
Finalize one validated task. Use judgment for commit and merge messages. Preserve the worktree and branch whenever state is ambiguous.
Inputs
Accept a task ID and optional --project <name>.
When invoked by the external runner, treat its exact project_root, worktree_path, branch, base_branch, base_head, and validated_head values as authoritative. Missing or inconsistent runner inputs are a failure.
When invoked manually from the task worktree:
- Resolve
--projectdirectly from the repository's.groundwork.yml; do not depend on or change persisted project selection. - Derive the current registered worktree and checked-out task branch.
- Derive the primary worktree and its checked-out base branch.
- Treat the current task HEAD as
validated_head. If validation did not just pass for this exact tree and working state, stop and ask the user to runvalidatefirst. Exception — resume entry: when a resume gate (node ${CLAUDE_PLUGIN_ROOT}/lib/task-resume.js check <task-id>) classified this task asresume_at: finalize, its terminal validated session already covers this exact tree; proceed (see${CLAUDE_PLUGIN_ROOT}/references/task-resume-protocol.md).
Workflow
1. Verify state
Before changing anything:
- Confirm the task path is a registered worktree for exactly the task branch.
- Confirm the primary worktree is on the base branch and clean.
- Confirm the task branch HEAD equals
validated_head. - Record the base branch's current head.
- Inspect staged, unstaged, and untracked task-worktree changes without discarding any.
Never reset, stash, rebase, force-delete, or silently switch either worktree to another branch.
2. Complete task bookkeeping
Within the selected project's task files:
- Change only this task's status to
Complete. - Update its status-table row when an index exists.
- Leave unrelated tasks unchanged.
3. Commit remaining validated work
Inspect the actual remaining diff. Include validation fixes and task bookkeeping belonging to this task.
- In runner mode, validation has already been sealed by the runner. Only task-status bookkeeping may remain; reject any other changed path. Do not stage or commit it. Return it to the runner with
action: "commit"and propose<task-id>: Mark task completeplus an explanatory body. Useaction: "none"only when no bookkeeping change remains. - Outside runner mode, commit bookkeeping changes on the task branch as
<task-id>: Mark task complete. - In manual mode, describe any validated remaining change in the subject.
- Do not create an empty commit.
- Require a clean task worktree afterward only in manual mode.
In runner mode, never ask a question. Return RESULT: FAILURE for missing information or unsafe state.
4. Integrate a moved base
Check whether the current base head is an ancestor of the task branch.
If it is not:
- Merge the current base head into the task branch with
--no-ff --no-commit. - Resolve conflicts only when the task definition and surrounding code make the resolution unambiguous.
- Record whether the merge command reported conflicts, even when every conflict was resolved unambiguously.
- In runner mode, do not run
git addor create the merge commit. Leave the prepared merge for the runner and propose an expressive task-prefixed commit subject and body. ReturnRESULT: BASE_INTEGRATED, bind it to the exact integrated base head, and reportconflicts_resolved: trueonly when the merge command reported conflicts. The runner owns the opt-in revalidation policy and invokes finalization again after sealing the integration. - Outside runner mode, commit the resolution and continue to prepare and merge the task into the base branch.
If resolution needs product, architecture, or ownership judgment, safely abort the integration when possible and return RESULT: NEEDS_INPUT.
5. Prepare the merge
In runner mode:
- Reconfirm the primary worktree is clean, the task worktree contains only the permitted bookkeeping change, and the base branch is still at the head recorded in step 1.
- Choose a concise merge message containing the task ID and actual title or outcome.
- Return the versioned JSON
RESULT: READY_TO_MERGEreceipt with the exact runner token, task identity, bookkeeping commit proposal when needed, and expressive outward merge subject/body. Do not merge outward, remove the worktree, or delete the branch; the runner verifies and commits the prepared tree before performing those operations.
When invoked manually, merge with --no-ff, then continue to cleanup below. If an unexpected conflict occurs, abort it when safe and return RESULT: NEEDS_INPUT. Do not resolve it on the base branch because the resolution would not have been validated.
6. Verify and clean up
After a successful manual merge:
- Confirm the task branch is an ancestor of the base branch.
- Confirm the primary worktree is clean and record its merge commit.
- Remove exactly the verified task worktree.
- Delete exactly the verified task branch with safe deletion.
If the merge succeeded but cleanup fails, return RESULT: CLEANUP_REQUIRED; do not undo the merge.
Result contract
Make the final line exactly one of:
RESULT: FINALIZED | task_id=<id> | task_head=<sha> | merge_commit=<sha> | base_branch=<branch>
RESULT: NEEDS_INPUT | reason=<one-line reason>
RESULT: CLEANUP_REQUIRED | merge_commit=<sha> | worktree_path=<path> | branch=<branch> | reason=<one-line reason>
RESULT: FAILURE | reason=<one-line reason> | worktree_path=<path> | branch=<branch>In runner mode, report only one of these compact JSON receipts or a failure result:
RESULT: READY_TO_MERGE | {"v":1,"token":"<exact-runner-token>","task_id":"TASK-NNN","phase":"finalize","action":"commit","commit":{"subject":"TASK-NNN: Mark task complete","body":"<bookkeeping summary>"},"merge":{"subject":"Merge TASK-NNN: <actual outcome>","body":"<publication summary>"}}
RESULT: BASE_INTEGRATED | {"v":1,"token":"<exact-runner-token>","task_id":"TASK-NNN","phase":"finalize","action":"commit","base_head":"<full-integrated-base-sha>","conflicts_resolved":true,"commit":{"subject":"TASK-NNN: Integrate updated base branch","body":"<resolution summary>"}}
RESULT: REVALIDATE | {"v":1,"token":"<exact-runner-token>","task_id":"TASK-NNN","phase":"finalize","action":"commit","base_head":"<full-integrated-base-sha>","reason":"<why revalidation is required>","commit":{"subject":"TASK-NNN: Integrate updated base branch","body":"<resolution summary>"}}For READY_TO_MERGE, use action: "none" and omit commit when the task worktree is clean. BASE_INTEGRATED always uses action: "commit"; REVALIDATE remains accepted only for compatibility with older skill exports. Report FINALIZED only after a manual merge is present, both remaining worktrees are clean, and cleanup succeeded.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

