From canon
Complete a development branch: verify specs, update statuses, and merge/PR/cleanup. Use when done with a feature branch or after canon-implement finishes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/canon:canon-branchThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are guiding the user through completing a development branch — verifying spec
You are guiding the user through completing a development branch — verifying spec compliance, updating spec statuses, and merging or creating a PR.
Determine which spec sections were addressed on this branch:
# What specs were touched?
git log --oneline main..HEAD
git diff --name-only main..HEAD | grep -E '(docs/specs/|\.md$)'
If commit messages include [spec:<slug>:<section>] references, use those.
Otherwise, ask the user which spec sections this branch addresses.
Run canon verify (gate mode) for all spec sections touched on this branch.
canon verify --gate --section <id>
Or invoke the canon-verify skill in gate mode.
If verification passes, proceed to Step 3.
If verification fails, present the gaps:
Verification failed:
- Section 2.1: 2/4 ACs lack realization evidence
- Section 3.1: tests failing
Fix these before completing the branch, or proceed anyway (not recommended).
Ask the user how to proceed: fix now, proceed anyway, or abort.
For sections where all ACs are realized, update status to done:
Via MCP:
mcp__canon__update_section_status(
section_id="2.1",
status="done"
)
Or edit the spec file directly:
<!-- canon:system:2.1 status:done -->
Commit the spec status changes so they're included in the merge/PR:
git add docs/specs/*.md
git commit -m "docs: update spec statuses for <spec-slug>"
Present options to the user:
Branch work complete. Choose an option:
1. Merge to base branch
2. Push and create PR
3. Keep branch as-is (resume later)
4. Discard branch and worktree
# Try fast-forward first
git checkout <base-branch>
git merge --ff-only <feature-branch> || git merge <feature-branch>
Clean up:
git worktree remove <worktree-path> 2>/dev/null # if in a worktree
git branch -d <feature-branch>
git push -u origin <feature-branch>
Generate PR description from spec context:
## Summary
<Brief description of changes>
## Spec Coverage
Addresses acceptance criteria from `docs/specs/<spec>.md`:
| Section | AC | Status |
|---------|-----|--------|
| 2.1 | Rate limiting | Realized — `src/auth/rate_limit.py:42-60` |
| 2.1 | Token expiry | Realized — `src/auth/tokens.py:15-25` |
| ... | ... | ... |
## Changes
<Git log summary>
Create the PR:
gh pr create --title "<title>" --body "<body>"
Report the PR URL to the user.
Branch preserved:
Branch: <branch-name>
Worktree: <path> (if applicable)
Resume later with: cd <path> && /canon:implement
Confirm with the user — this is destructive:
This will delete the branch and worktree. Changes will be lost.
Are you sure? (yes/no)
If confirmed:
git worktree remove <worktree-path> 2>/dev/null
git branch -D <feature-branch>
npx claudepluginhub canonhq/canon --plugin canonVerifies implementation then offers options to merge locally, create PR with verification steps, keep, or discard Git branches at development completion.
Verifies tests pass, determines base branch, then guides integration via local git merge, GitHub PR creation, keeping branch, or discard with execution and cleanup.
Runs verification checks, reviews the diff, picks the integration path (merge, PR, squash, stacked PR), writes the PR/merge message, pushes, and cleans up branches and worktrees.