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
- 参考文档agents/openai.yaml247 B
03 SKILL.md 正文
Finish Worktree
Overview
Use this skill to close out a finished git worktree cleanly.
Workflow
- Inspect the current git state first: current branch, worktree list, remotes, and whether the working tree is clean.
- Use explicit user arguments as hints for the worktree path, feature branch, remote, or target branch. Otherwise infer them from the repo state.
- Read repo-specific guidance before acting. Prefer
AGENTS.md, setup docs, branch protections, and current git configuration over generic defaults. - 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.
- 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.
- After a successful push, remove the merged worktree, delete the merged
feature branch, and run
git worktree prune. - 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
devormain. - Prefer
originunless 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
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.
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.
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.
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.
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.
warmup
暂无简介