finishing-a-development-branch
Use when verified work needs integration or cleanup of an existing task-created branch/worktree, or the user explicitly requests merge, PR, or branch…
Skill by GanyuanRan
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ganyuanran-finishing-a-development-branch
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity, version-control
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/finishing-a-development-branch
What's inside
- Skill name
finishing-a-development-branch- Description
- Use when verified work needs integration or cleanup of an existing task-created branch/worktree, or the user explicitly requests merge, PR, or branch lifecycle handling.
- License
- MIT
- Instructions
- 132 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Finishing a Development Branch ## Overview Integration choice and checkout lifetime are separate. Verify first, mutate only task-owned resources, then prove what was removed or retained. **Core principle:** fresh evidence -> authorized integration -> ownership-aware cleanup -> Git/path readback. **Announce at start:** explain which branch/worktree lifecycle is being closed. ## Step 1: Environment and Ownership Detection Read the task's `TaskStartSnapshot` and current repository state. Record: - root, `HEAD`, branch/detached state, upstream divergence, and active Git ops; - staged/unstaged/untracked paths and the task-owned delta; - `git worktree list --porcelain`; - branch/worktree creator, task ownership, base branch, and cleanup trigger. Stop on conflicts, unexplained detached state, failed verification, dirty/untracked state in a cleanup target, or unknown ownership. Do not infer the base from the names `main` or `master`; use task records, repository authority, or explicit user direction. Never auto-stash, reset, clean, pull, rebase, amend, force-push, or bypass hooks. For a trusted host-managed detached checkout, follow the repository's approved managed-workspace contract: verify host binding, default cwd, root, and HEAD; then use its scoped local-commit and native handoff path. Report detached HEAD in the receipt. This exception does not authorize automatic deletion of the detached checkout or bypass unknown ownership/binding. If no task-created branch/worktree exists and integration was not requested, skip this workflow: report the local task commit plus `Task clean` and `Repository clean`; do not invent merge/PR ceremony. ## Step 2: Fresh Verification Run the smallest current-authority test set that proves the completed task. If it fails, preserve all work and return to diagnosis. Do not present the branch as ready. ## Step 3: Choose the Authorized Outcome When a task branch actually needs disposition, present only applicable choices: 1. merge into the recorded base locally; 2. push and create/update a PR; 3. keep the branch for later integration; 4. discard the exact task-owned branch/worktree. Push, PR, remote deletion, release, and force operations require explicit user authorization. Discard requires a fresh, exact typed confirmation naming branch, worktree path, and commits/delta to lose. Generic agreement is insufficient. ## Step 4: Execute Without Hidden Mutation ### Local merge Verify the target checkout is safe, switch to the recorded base, merge without an implicit pull, and rerun verification on the merged result. If integration or verification fails, preserve both histories and stop. ### Push or PR Push only the authorized task branch and create/update the PR with summary and fresh test evidence. PR creation does not itself prove merge and does not require the temporary worktree to remain. ### Keep branch Retain the branch. Remove a clean task-created temporary worktree by default; retain it only for an explicit ongoing-checkout need and report why. ### Discard After exact confirmation, remove only the named clean task-owned worktree, then the named branch. If either differs from the confirmation, stop and ask again. ## Step 5: Prove Integration Before Branch Deletion Use evidence matching the merge strategy: - merge/fast-forward: prove the task tip is an ancestor of the recorded base; - squash/rebase: use fresh PR merge metadata plus strategy-appropriate patch equivalence (`git cherry` for rebased commits; stable patch-id or bounded changed-path/tree comparison for squashes), not an ancestor-only test; - unmerged/open PR: keep the branch unless discard was exactly confirmed. Never delete a branch merely because a PR was opened or a similarly named commit exists. ## Step 6: Cleanup in Dependency Order For a clean task-owned resource: 1. move to another safe registered checkout; never remove the current working directory; 2. remove/unregister the worktree first with `git worktree remove <exact-path>`; 3. read back `git worktree list --porcelain`; 4. verify the exact path no longer exists; 5. only then delete an integrated or exactly confirmed branch; 6. read back branch refs, `HEAD`, and repository status. Do not use routine `--force`, global `git worktree prune`, wildcard deletion, or cleanup of resources absent from the task ownership record. On Windows, Git may unregister a worktree while its directory remains locked: re-check registration and the exact resolved path, remove only a proven task-owned clean residual when safe, otherwise retain it and report the lock/path. Never widen deletion scope. ## Final Git Receipt Report: - current branch and commit SHA/message, or the reason no commit exists; - `Task clean: yes|no` and `Repository clean: yes|no` independently; - branch/worktree created, removed, or retained, with evidence/reason; - integration evidence and any remaining user action.
From GanyuanRan/Aegis, MIT.
More from GanyuanRan/Aegis
- 0.831score
ui-ux-governance
GanyuanRan
Use when designing, changing, or reviewing user-facing interfaces or interaction flows, including API changes that alter visible states or recovery.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.826score
using-aegis
GanyuanRan
Use when starting a turn or checking Aegis skill routing.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
subagent-driven-development
GanyuanRan
Use when executing a written implementation plan with independent tasks in the current session where delegation beats inline coordination cost; otherwise…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
update-aegis
GanyuanRan
Use when the user says `aegis:update`, asks to update or upgrade an installed Aegis method-pack, wants the latest Aegis version, or asks whether Aegis is…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
requesting-code-review
GanyuanRan
Use when requesting independent code review, after implementation slices, before merging high-risk work, or when verification exposes evidence, baseline…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
receiving-code-review
GanyuanRan
Use when receiving code review feedback before implementing suggestions, especially when feedback is unclear, risky, disputed, or technically questionable.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
long-task-continuation
GanyuanRan
Use when a task is multi-step, may span context resets or sessions, uses subagents, or risks losing state before completion.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
goal-framing
GanyuanRan
Use when the user explicitly sets an Aegis goal with /aegis-goal, Aegis goal:, or asks to define goal, success evidence, stop condition, or task boundaries…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
first-principles-review
GanyuanRan
Use when asked for first-principles or Occam's-razor review, or when high-risk decisions involve competing constraints, fallback growth, duplicate owners, or…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
executing-plans
GanyuanRan
Use when executing a written implementation plan across sessions or with review checkpoints.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
brainstorming
GanyuanRan
Use when defining ambiguous or high-complexity new features, product behavior, UI/component design, architecture choices, contract changes, or when…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
anti-entropy-governance
GanyuanRan
Use when touching retiring old logic, collapsing duplicate owners, removing fallbacks, or schema/persistence/source-of-truth boundaries; identify…
SkillAFreshness: A★ 1.4KClaude Code +9
Signals
- Stars
- 1,383
- Forks
- 78
- Open issues
- 1
- Last commit (this folder)
- Oct 10, 2026 (17 days ago)
- Last release
- Oct 21, 2026 (6 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/GanyuanRan/Aegis
- Website
- autoloom.codes/aegis/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from GanyuanRan
- 0.831score
ui-ux-governance
GanyuanRan
Use when designing, changing, or reviewing user-facing interfaces or interaction flows, including API changes that alter visible states or recovery.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.826score
using-aegis
GanyuanRan
Use when starting a turn or checking Aegis skill routing.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
subagent-driven-development
GanyuanRan
Use when executing a written implementation plan with independent tasks in the current session where delegation beats inline coordination cost; otherwise…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
writing-plans
GanyuanRan
Use when you have an approved spec or written requirements for a multi-step task that needs a durable plan document before touching code.
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
using-git-worktrees
GanyuanRan
Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a…
SkillAFreshness: A★ 1.4KClaude Code +9 - 0.825score
update-aegis
GanyuanRan
Use when the user says `aegis:update`, asks to update or upgrade an installed Aegis method-pack, wants the latest Aegis version, or asks whether Aegis is…
SkillAFreshness: A★ 1.4KClaude Code +9
Cite this page
finishing-a-development-branch skill. Agent Mart. https://agentmart.dev/skills/ganyuanran-finishing-a-development-branch (last updated 2026-10-24)