AGENT SKILL

finish-worktree

Finish a git worktree cleanly. Use when Codex needs to merge a finished worktree branch, push the integration branch, remove the worktree, delete the branch, and prune stale worktrees.

License 许可
MIT
最近更新
2026-11-06
Stars
★ 0
Forks
0

01 前言 Front Matter

name
finish-worktree
description
Finish a git worktree cleanly. Use when Codex needs to merge a finished worktree branch, push the integration branch, remove the worktree, delete the branch, and prune stale worktrees.

02 资源文件 1

03 SKILL.md 正文

Finish Worktree

Overview

Use this skill to close out a finished git worktree cleanly.

Workflow

  1. Inspect the current git state first: current branch, worktree list, remotes, and whether the working tree is clean.
  2. Use explicit user arguments as hints for the worktree path, feature branch, remote, or target branch. Otherwise infer them from the repo state.
  3. Read repo-specific guidance before acting. Prefer AGENTS.md, setup docs, branch protections, and current git configuration over generic defaults.
  4. Stop and explain the blocker if the tree is dirty, the target branch is ambiguous, the merge is not safe to fast-forward, or the intended cleanup target is unclear.
  5. Merge the finished branch into the repo's actual integration branch using safe non-interactive git commands, then push that branch to the intended remote.
  6. After a successful push, remove the merged worktree, delete the merged feature branch, and run git worktree prune.
  7. Summarize exactly what was merged, pushed, removed, and pruned.

Constraints

  • Do not use destructive commands such as git reset --hard.
  • Do not bypass hooks or use --no-verify.
  • Prefer the repo's documented integration branch instead of assuming dev or main.
  • Prefer origin unless the repo state clearly indicates a different intended remote.
  • Keep the workflow non-interactive whenever possible.

Output

Report blockers before changing branches. After success, report the integration branch, remote, merged branch, removed worktree path, deleted branch, and prune result.

04 同仓库更多 Skills

betabitplus
betabitplus/ternforge-template-py-library

git-finish

Finish Git work cleanly with commit, push, PR, or ship steps. Use when Codex needs to write a proper commit message, make one final real commit, let hooks run, push without bypassing checks, open or merge a PR, and verify release or CI completion.

★ 0
betabitplus
betabitplus/ternforge-template-py-library

warmup

Research a codebase deeply before working in it. Use when Codex needs to inspect how a project works, read code and docs, build solid project knowledge first, or answer focused research questions about a local folder, another path, or a repo URL.

★ 0
betabitplus
betabitplus/ternforge-template-py-library

handoff

Write a strong HANDOFF.md for the current project state. Use when Codex needs to capture progress for the next agent, including what was tried, what worked, what failed, current blockers, and the best next steps. Default target is the current workspace, but a path can be provided.

★ 0
betabitplus
betabitplus/ternforge-template-py-library

code-guardrails

Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.

★ 0
betabitplus
betabitplus/ternforge-template-py-library

changed

Reconcile with intentional local user changes before continuing. Use when the user signals that the workspace changed since Codex last worked and Codex should inspect the current repo state, refresh its assumptions, and preserve those changes instead of undoing or "fixing" them.

★ 0
betabitplus
betabitplus/ternforge-template-py-library

warmup

暂无简介

★ 0