compose:merge

Guides completion of development branches through structured merge, PR, or discard workflows.

Updated Jun 27, 2026
One-click install
npx skills add https://github.com/HKUST-QUANT-SOCIETY/quantcode --skill compose-merge-hkust-quant-society
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose:merge
Source: https://github.com/HKUST-QUANT-SOCIETY/quantcode/tree/main/.opencode/meta-skills/merge
Command: npx skills add https://github.com/HKUST-QUANT-SOCIETY/quantcode --skill compose-merge-hkust-quant-society

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementation work is finished, developers often face an ambiguous decision point: should the branch be merged locally, pushed as a pull request, kept for later, or discarded? This Skill removes that ambiguity by verifying tests first, detecting the git environment, and presenting a fixed set of structured options with safe execution and cleanup. ## Core Features & Use Cases - Test-Gated Completion: Runs the project's test suite before offering any completion option and refuses to proceed if tests fail. - Environment-Aware Menus: Detects normal repos, named-branch worktrees, and detached HEAD states to present the correct option set and cleanup behavior. - Safe Cleanup with Provenance Checks: Only removes worktrees it created (under .worktrees/, worktrees/, or ~/.config/compose/worktrees/), requires explicit confirmation before discarding work, and never auto-approves destructive actions. - Use Case: After finishing a feature branch in a git worktree, invoke this Skill to verify tests pass, choose "Create PR" to push the branch and open a pull request via gh, while the worktree is preserved for review iteration. ## Quick Start Ask the assistant to finish the current development branch using the compose:merge skill after all tests pass.

Frequently Asked Questions about compose:merge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely merge a feature branch after development is complete?

Verify the test suite passes first, then checkout the base branch, pull latest changes, merge the feature branch, and re-run tests on the merged result. Only delete the branch after the merge succeeds and any worktree is removed.

How do I create a pull request from a git worktree branch?

Push the branch with git push -u origin, then create the PR using gh pr create with a summary and test plan. Do not remove the worktree afterward, since you need it to iterate on PR review feedback.

Why does git branch -d fail when a worktree uses the branch?

Git refuses to delete a branch that is checked out in a worktree. Remove the worktree first with git worktree remove from the main repository root, then delete the branch.

Can I remove a git worktree from inside the worktree directory?

No, git worktree remove fails silently when the current working directory is inside the worktree being removed. Always cd to the main repository root before running the removal command.

When should a worktree not be cleaned up after merging?

Do not remove worktrees created by an external harness or those outside .worktrees/, worktrees/, or ~/.config/compose/worktrees/. Also preserve the worktree when creating a PR, since it is needed for review iterations.