agentleFS
leonsong09leonsong09/worktree-closeout/SKILL.md

worktree-closeout

Skill6 starsChanged 8 months agoMITView on GitHub

Use when the user asks for worktree closeout, branch closeout, parallel closeout, worktree janitor, 工作树收口, 分支收口, or 并行收口, especially when work spans multiple Codex sessions and you need a date-based scan of open worktrees, closeout status, suggested merge/prune order, and prompt-ready handoff instructions.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 1

    1. borgesme/fastapi-general-template★ 1100% same

    Edited · 0

    None found.

    Wrote their own version · 2

    1. tedix-hq/tedix★ 40same name
    2. gerivdb/SKILLS★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. About 0 are common, 17 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read-only closeout triage for Codex work that spans multiple sessions, branches, or worktrees.

    line 10
  2. Very specific:

    Single current session wrap-up: use session-wrap

    line 23
  3. Very specific:

    Same-day project report: use project-daily-summary

    line 24
  4. Very specific:

    Single branch is already chosen for final handling: use finishing-a-development-branch

    line 25
  5. Distinctive:

    Dangerous branch actions: do not use this skill as permission to merge, delete, prune, or push automatically

    line 26
  6. Distinctive:

    Always resolve the date before asking anything else.

    line 34
  7. Distinctive:

    If the user already supplied a clear date, confirm it instead of inventing a different one

    line 38
  8. Distinctive:

    Ask whether to scan:

    line 42
  9. Distinctive:

    Do not assume the scope.

    line 47
  10. Very specific:

    If scope is repo, pass the absolute repo root with --repo.

    line 49
  11. Distinctive:

    Run the command from the skill root directory, or adapt the script path to your local install path

    line 60
  12. Very specific:

    Read the artifact path from the script output (Wrote closeout artifact: ...)

    line 61
  13. Distinctive:

    Keep the run read-only; do not chain cleanup commands after the scan

    line 62
  14. Distinctive:

    If the artifact is effectively empty, say so explicitly instead of pretending there is work to close out.

    line 85
  15. Distinctive:

    Use the artifact’s closeout phases directly:

    line 89
  16. Very specific:

    Do not promote blocked or orphaned items into a broad parallel merge wave.

    line 95
  17. Distinctive:

    When presenting per-item prompts, preserve the artifact’s label context:

    line 104
  18. Distinctive:

    Do not hide uncertainty. If the artifact and current chat context disagree, call that out.

    line 150
  19. Very specific:

    Use worktree-closeout only when the user also needs a date-based branch/worktree closeout appendix

    line 162
  20. Distinctive:

    No automatic branch deletion

    line 173
  21. Distinctive:

    No automatic worktree removal

    line 174
  22. Distinctive:

    No automatic push or PR creation

    line 175
  23. Distinctive:

    No fabricated status if the scan comes back empty or ambiguous

    line 176
  24. Distinctive:

    Use this skill to organize closeout work, not to silently execute risky git actions.

    line 178

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

worktree-closeout

Overview

Read-only closeout triage for Codex work that spans multiple sessions, branches, or worktrees.

This skill does not auto-merge, auto-delete, auto-push, or auto-prune. It asks for a date and scope, runs the scanner, reads the generated artifact, then turns that artifact into a chat summary, a suggested closeout order, and prompt-ready handoff instructions.

When to Use

  • User wants to know which worktrees or branches still need 收口
  • Work was split across multiple sessions and the current status is unclear
  • You need a date-based scan before deciding merge / keep / prune actions
  • You want a controller prompt plus per-item prompts for closeout follow-up

When Not to Use

  • Single current session wrap-up: use session-wrap
  • Same-day project report: use project-daily-summary
  • Single branch is already chosen for final handling: use finishing-a-development-branch
  • Dangerous branch actions: do not use this skill as permission to merge, delete, prune, or push automatically

project-daily-summary may optionally call this skill when the user wants a same-day all-repo summary with a closeout appendix.

Required Flow

1. Ask for the date first

Always resolve the date before asking anything else.

  • Accept YYYY-MM-DD or a relative day such as “昨天”
  • Restate the resolved exact date
  • If the user already supplied a clear date, confirm it instead of inventing a different one

2. Ask for the scope second

Ask whether to scan:

  • 当前 repo / current repo → scanner scope repo
  • 所有 repo / all repos touched that day → scanner scope all

Do not assume the scope.

If scope is repo, pass the absolute repo root with --repo.

3. Run the scanner

python -X utf8 ./scripts/scan_closeout.py --date <YYYY-MM-DD> --scope <repo|all> [--repo <ABSOLUTE_REPO_PATH>]

Notes:

  • scan_closeout.py is the source of truth for classification and artifact rendering
  • Run the command from the skill root directory, or adapt the script path to your local install path
  • Read the artifact path from the script output (Wrote closeout artifact: ...)
  • Keep the run read-only; do not chain cleanup commands after the scan

4. Read the artifact

Open the generated Markdown artifact and use references/artifact-format.md if you need a quick schema reminder.

Pay attention to:

  • frontmatter counts and status
  • ## 建议收口顺序
  • per-repo category sections
  • ## 建议总控 Prompt
  • ## 建议子 Prompt

5. Output the chat summary

Summarize the artifact in chat, in Chinese by default:

  • scan date and scope
  • repo/worktree totals
  • which repos or branches need attention first
  • any uncertain or orphaned items that need manual re-triage

If the artifact is effectively empty, say so explicitly instead of pretending there is work to close out.

6. Output the suggested parallel order

Use the artifact’s closeout phases directly:

  • Phase 1: 可并行 -> safe_prune
  • Phase 2: 条件并行 -> ready_to_merge
  • Phase 3: 串行收尾 -> blocked, orphaned

Do not promote blocked or orphaned items into a broad parallel merge wave.

7. Output the prompts

Always output:

  1. the controller prompt
  2. each closeout item prompt

When presenting per-item prompts, preserve the artifact’s label context:

  • classification
  • repo
  • branch or fallback worktree label

Classification Guide

safe_prune

  • Branch is already merged into the base branch
  • Worktree is clean
  • Suitable for manual cleanup confirmation

ready_to_merge

  • Branch is not merged
  • Worktree is clean
  • Branch is ahead of base
  • Recent session evidence suggests it is an active, real candidate

Hand these to finishing-a-development-branch when the user wants to actually complete one branch.

blocked

  • Dirty worktree, behind-base state, base-branch worktree with active changes, or another signal that the item is not ready for final closeout

These need the smallest safe unblock step first.

orphaned

  • Missing or weak git/session evidence
  • Cannot justify merge/prune confidently from current facts

These need re-triage, not aggressive cleanup.

Output Contract

Your final closeout response should contain, in this order:

  1. short chat summary
  2. suggested parallel order
  3. controller prompt
  4. per-item prompts
  5. artifact path

Do not hide uncertainty. If the artifact and current chat context disagree, call that out.

Relationship to Other Skills

session-wrap

  • session-wrap closes one current session
  • worktree-closeout scans across sessions/worktrees for a chosen date

project-daily-summary

  • project-daily-summary is still the primary same-day, by-project summary skill
  • Use worktree-closeout only when the user also needs a date-based branch/worktree closeout appendix
  • For “当天所有 repo closeout appendix” scenarios, project-daily-summary may choose to call this skill

finishing-a-development-branch

  • worktree-closeout identifies which items are candidates
  • finishing-a-development-branch performs the single-branch finish flow after a candidate is chosen

Guardrails

  • No automatic merge
  • No automatic branch deletion
  • No automatic worktree removal
  • No automatic push or PR creation
  • No fabricated status if the scan comes back empty or ambiguous

Use this skill to organize closeout work, not to silently execute risky git actions.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.