From dev
This skill should be used when the user says "finish worktree", "close out worktree", "merge and close milestone", "finish this worktree", "done with worktree", "wrap up worktree", or when a worktree branch is complete and needs to be merged into main AND related documentation status, project plan, and next-milestone recommendations need updating. Combines local merge (via git-worktree:local-merge), doc status updates, project plan updates, and next-milestone recommendation into one workflow. Prefer this over plain local-merge when doc and plan updates are needed.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev:finish-work-on-local-worktreeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Complete a worktree lifecycle: squash-merge the branch into main, update all related documentation status, update the project plan, and recommend what to work on next.
Complete a worktree lifecycle: squash-merge the branch into main, update all related documentation status, update the project plan, and recommend what to work on next.
Accept an optional branch name argument. If not provided, detect from the current worktree or ask the user.
Execute these phases in order. Stop and report if any phase fails.
Invoke the git-worktree:local-merge skill via the Skill tool, passing the branch name if provided as an argument.
Wait for the merge to complete before proceeding. If the merge fails (conflicts, dirty worktree, not in a worktree), stop and help the user resolve the issue.
After the merge succeeds, note the BRANCH name — it drives doc discovery in Phase 2.
Find all docs related to the merged branch and update their status to completed.
Step 2a: Find related docs
Use the Grep tool to search docs/ for files whose YAML frontmatter contains work: <BRANCH> (substituting the actual branch name from Phase 1). Also check the related: frontmatter array in those docs to find transitively related docs.
Step 2b: Update frontmatter status
For each related doc found:
status: and stage: frontmatter fieldsstatus: is not already completed, update it to completedstage: exists, update it to impl (implementation is done)completed or archivedStep 2c: Report changes
List each doc updated with its old and new status:
Updated docs:
- docs/2026-04-04-feature-design.md: active → completed
- docs/2026-04-04-feature-impl-plan.md: active → completed
Find and update the project plan to reflect the completed milestone. If no project plan is found, skip this phase entirely and note in the final report that no project plan was updated.
Step 3a: Locate the project plan
Search for the project plan file. Common patterns:
docs/project-plan*.mdtype: impl-plan or type: project-plan in frontmatter and work: mainStep 3b: Identify the milestone
Extract the milestone identifier from the branch name (e.g., m5.7-tier1-conditions maps to milestone M5.7). Search the project plan for the corresponding section header.
Step 3c: Update milestone status
In the project plan:
— COMPLETE to the milestone section header if not already present**Status: COMPLETE (<today's date>)** line after the acceptance criteria~~criteria~~ Done formatting**What shipped:** summary block listing key deliverables (read from the squash commit message and the related design/impl docs)See [doc title](doc-path) linkThese formatting conventions assume the project plan follows the standard doc template. Adapt if the plan uses a different structure.
Step 3d: Handle partially complete milestones
If the branch only implemented part of a milestone (e.g., one stream of three):
Analyze the project plan to recommend what to work on next.
Step 4a: Scan for next milestones
Read the project plan and identify:
Step 4b: Present recommendation
Format the recommendation as:
## What's Next
**Next milestones in order:**
| Milestone | What it adds |
|-----------|-------------|
| **M_X** | Brief description |
| **M_Y** | Brief description |
**Recommended:** M_X — [reason why this is the natural next step]
Include:
Do NOT include effort estimates or size labels unless the user explicitly requests them.
Stage and commit all doc changes made in Phases 2-3. Adapt the commit message to reflect what was actually changed (doc statuses only, or doc statuses + project plan):
git add docs/
git commit -m "docs: mark <MILESTONE> complete, update project plan"
Do NOT add a Claude Code signature to the commit message.
git-worktree:local-merge rules during Phase 1 (no remote ops, no --no-verify, etc.)completed or archivednpx claudepluginhub mayank-io/mstack --plugin devGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.