Ship the work. Leave a clean desk.
Agent skill for end-to-end git closeout: status → verify → commit → push → PR → merge gate → prune — with authorization boundaries, squash-merge awareness, and an evidence report you can re-check.
中文说明 · Changelog · Install · Auth matrix · Promote kit
| Risk with unguarded agents | What closeout does |
|---|---|
Blind git add -A |
Intentional stage; skip secrets / bulk raw data |
| Pushing red verify | Fail stops push unless you re-authorize |
| Squash merge → “nothing to prune” | SAFE when PR head SHA == branch tip |
Treating origin/HEAD as a branch |
Structured for-each-ref (skip symrefs) |
| “I showed the list” = delete remote | List ≠ authorize |
| “done” after a failed delete | Exit codes + post-delete recheck |
| Upgrade wipes preferences | USER.example.md ships; USER.md stays |
Say 收工, ship, or /closeout to a compatible agent (Grok / Codex).
| Phase | Action | Gate |
|---|---|---|
| 0 | status.ps1 one-pager |
report only |
| 0b | will / will-not plan | user OK or USER default |
| 2 | verify + exit codes | green, or explicit fail policy |
| 3–5 | commit · push · PR | SHA + PR head checks |
| 6 | merge | ask first by default |
| 7 | prune | list → confirm; remote separate |
Scripts alone (no agent required):
$Skill = Join-Path $env:USERPROFILE ".grok\skills\closeout\scripts"
$Repo = "D:\path\to\your\repo"
pwsh -File "$Skill\status.ps1" -RepoRoot $Repo
pwsh -File "$Skill\prune_merged.ps1" -RepoRoot $Repo # dry-run
# pwsh -File "$Skill\prune_merged.ps1" -RepoRoot $Repo -Apply
# pwsh -File "$Skill\prune_merged.ps1" -RepoRoot $Repo -Apply -DeleteRemotegit clone https://github.com/D-sudoasd/closeout.git "$env:USERPROFILE\.grok\skills\closeout"
# upgrade later:
# git -C "$env:USERPROFILE\.grok\skills\closeout" pullgit clone https://github.com/D-sudoasd/closeout.git "$env:USERPROFILE\.codex\skills\closeout"pwsh -File .\install.ps1 -Source .Needs: git, pwsh 7+, and gh for PR/merge + squash detection.
Restart the agent session, then say 收工.
tip is ancestor of default → SAFE (classic merge)
merged PR + headOid == tip → SAFE (squash / rebase)
merged PR but tip moved → HOLD (new commits after merge)
no gh / no PR → report only
origin/HEAD · current · default → never delete
| You say | Default scope |
|---|---|
收工 / /closeout |
Status + verify + plan; push/PR per USER.md |
| 提交并推 | Verify + commit + push |
| 合并 | Merge after checks |
| 清分支 | List only |
| Explicit remote delete | Remote prune |
Details: references/auth-matrix.md.
closeout/
SKILL.md agent entry
USER.example.md shipped defaults (copy → USER.md locally)
assets/readme/ hero · workflow · before-after
references/ phases · auth · clean desk · report
scripts/ status · prune · self_check · common
docs/PROMOTE.md shareable posts
Issues and PRs welcome — especially cross-platform path edges, extra prune evidence sources, and Pester fixtures.
Please do not commit a real USER.md.
MIT © 2026 D-sudoasd