clean
End-of-work cleanup sweep for a multi-agent repo — safely land genuine unpushed commits, squash open PRs, prune merged branches and worktrees, clean the…
Skill by thunter009
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/thunter009-clean
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: agent-building
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
- Runs as
- Shell scripts
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/clean
What's inside
- Skill name
clean- Description
- End-of-work cleanup sweep for a multi-agent repo — safely land genuine unpushed commits, squash open PRs, prune merged branches and worktrees, clean the remote dev box, and dedup session follow-ups. A /clean wrapper that orchestrates the squash-pr, prune-branches, devbox-cleanup, and followup-dedup skills.
- License
- MIT
- Instructions
- 214 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Instructions read files in your home folder (~/.ssh, ~/.aws…)
Files (2)
- SKILL.md
- check-dirty-beads.sh · scripts/
SKILL.md (first lines)
# /clean — repo hygiene sweep
A five-phase end-of-work sweep. Each phase is a checkpoint: run it, report, move on.
`/clean` is the wrapper — the heavy lifting is delegated to focused skills.
## Before you start
- Identify the repo's integration branch (`dev` / `main`) from the contributor docs
(CLAUDE.md, AGENTS.md).
- **Shared-checkout check.** Are other Claude sessions sharing this working tree? This
changes Phase 1's path.
```bash
pgrep -fa claude | awk '{print $1}' | sort -u | while read pid; do
lsof -p "$pid" 2>/dev/null | awk '/cwd/{print $NF}' | grep -qx "$(pwd)" \
&& echo "sister Claude shares this checkout: PID $pid"
done
```
If sisters are present, never move a shared branch pointer and never run
`checkout` / `reset` / `rebase` in the canonical checkout — do branch-mutating
work in a `git worktree`.
- Register with Agent Mail if the repo uses it — mutating ops follow.
## Phase 0 — Bead state, in every repo this session touched
A `br close` reaches origin only if the resulting `.beads/issues.jsonl` change is both
committed and pushed. Two ways it silently is not (bd-1x5s, 3+ occurrences): it is never
committed — sitting in `git status` beside foreign modified files while closeout attention
goes to a different repo — or it is committed onto a local integration branch that has
diverged from its upstream and never leaves the machine.
```bash
bash ~/.claude/skills/clean/scripts/check-dirty-beads.sh <repo> [<repo> ...]
```
Pass every repo the session touched, not only the current one — the 2026-08-05 loss was in
the second repo. Non-zero exit names the repo and the reason. **Never `br close` and commit
onto a stale local `dev`** — close in a fresh worktree off the integration branch instead:
```bash
git worktree add .ntm/worktrees/close-beads -b chore/close-beads origin/dev
cd .ntm/worktrees/close-beads && br close <ids> && br sync --flush-only
git diff -- .beads/ # ONLY the intended beads
git add .beads/ && git commit -m 'chore(beads): close <ids>'
git push -u origin HEAD && gh pr create --base dev # then merge
```
## Phase 1 — Land genuine unpushed work
The path depends on the shared-checkout check above.
### Single-agent repo (no sisters)
A dirty working tree IS unlanded work; an "ahead" branch IS your unpushed commits.
Stage, commit, and `git push`. Skip the classifier below — it is just friction here.
### Multi-agent shared checkout (sisters present)
Do **not** assume a dirty working tree or an "ahead" branch is unlanded work. A sister
may have already committed your "modification" and pushed it; your "ahead" commits may
be content-equivalent duplicates of commits already on `origin`. Classify first:
1. **Working-tree changes.** For each modified file, compare its blob to the integration
branch on the remote:
```bash
git fetch origin <branch> --quiet
git hash-object <file> # working-tree blob
git rev-parse origin/<branch>:<file> # remote blob
```
A file whose blob equals `origin/<branch>`'s is already shipped — a sister committed
it. It is stale residue, not new work. Do not re-commit it.
2. **"Ahead" commits.** For each commit in `origin/<branch>..<branch>`, classify:
- **Duplicate** — same `git patch-id` as a commit already on `origin`. Drop it.
- **Already-shipped** — `git cherry origin/<branch> <commit>` prints a `-` prefix,
meaning its patch-id matches one on the upstream. Drop it.
- **Genuinely unpushed** — real work not on `origin`. Land it.
3. **Land genuine commits without disturbing a shared branch.** Create an isolated
worktree at the remote tip, cherry-pick the genuine commits oldest-first, and
fast-forward push. Never force-push a shared branch; never move the local branch
pointer that sister sessions share:
```bash
git worktree add --detach <tmp-worktree> origin/<branch>
git -C <tmp-worktree> cherry-pick <genuine-commit> ...
git -C <tmp-worktree> push origin HEAD:<branch>
git worktree remove <tmp-worktree>
```
Resolve `.beads/issues.jsonl` conflicts as positional only — keep both sides' beads,
never drop a bead another commit added.
If there is genuinely nothing to land, say so and move on — do not manufacture a commit.
## Phase 2 — Squash open PRs
Invoke the **`squash-pr`** skill. It lists open PRs, presents them for triage, and
squash-merges the approved ones through GitHub's merge path. No open PRs → no-op; report
and continue.
## Phase 3 — Prune branches and worktrees
Two passes — remote first, then local. They use different tools because their skills do.
### Remote branches
Invoke the **`prune-branches`** skill. It cross-references GitHub PR state to find
merged and squash-merged branches on `origin`, categorizes the rest, and proposes an
explicit delete command for approval. `prune-branches` is remote-only — it does not
touch local refs.
### Local branches and worktrees
`prune-branches` does not handle these; inline the logic here. Enumerate candidates:From thunter009/skills, MIT.
More from thunter009/skills
- 0.570score
decision-canvas
thunter009
Present batched user decisions as an interactive atrium canvas with inline grounding — code snippets with real line numbers, click-to-open file links, and…
SkillAFreshness: AClaude Code +9 - 0.526score
autoreview
thunter009
Run a structured code review (Codex default, Claude optional) as a closeout check on a local or PR branch before commit or ship.
SkillBFreshness: BClaude Code +9 - 0.520score
bug-hunt
thunter009
Run a multi-phase bug hunt with Codex, Gemini, or Claude.
SkillBFreshness: BClaude Code +9 - 0.518score
create-pull-request
thunter009
Open a GitHub pull request with repo-specific PR conventions.
SkillBFreshness: BClaude Code +9 - 0.514score
agents-md
thunter009
Create repo-specific AGENTS.md guardrails from the codebase.
SkillBFreshness: BClaude Code +9 - 0.479score
enrich-ticket-detail
thunter009
Flesh out thin or empty beads/Todoist items by mining git history, code-at-HEAD, closed tickets, and the session journal, then verify every drafted claim…
SkillCFreshness: CClaude Code +9 - 0.476score
codebase-knowledge-graph
thunter009
Build an interactive knowledge graph of any codebase via the Understand-Anything pipeline, with a batch-integrity guard the raw plugin lacks.
SkillCFreshness: CClaude Code +9 - 0.476score
docs-organize
thunter009
Reorganize loose files already in a folder into its subfolder taxonomy, with hash-based dedup, dry-run preview, and collision-safe moves.
SkillCFreshness: CClaude Code +9 - 0.474score
devbox-cleanup
thunter009
Clean up a project checkout on a remote dev box — tear down a stale agent swarm, verify unpushed work is superseded, reset the checkout to origin, and restart…
SkillCFreshness: CClaude Code +9 - 0.470score
domain-modeling
thunter009
Build and sharpen a project's ubiquitous language — a CONTEXT.md glossary plus sparse ADRs — challenging terms against the glossary and cross-referencing code…
SkillCFreshness: CClaude Code +9 - 0.469score
beads-linear-sync
thunter009
Sync beads and Linear so agent state and human tracker stay aligned.
SkillCFreshness: CClaude Code +9 - 0.469score
check-tasks-completion-status
thunter009
Audit whether a ticket is actually complete without changing files.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 19, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/thunter009/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from thunter009
- 0.570score
decision-canvas
thunter009
Present batched user decisions as an interactive atrium canvas with inline grounding — code snippets with real line numbers, click-to-open file links, and…
SkillAFreshness: AClaude Code +9 - 0.526score
autoreview
thunter009
Run a structured code review (Codex default, Claude optional) as a closeout check on a local or PR branch before commit or ship.
SkillBFreshness: BClaude Code +9 - 0.520score
bug-hunt
thunter009
Run a multi-phase bug hunt with Codex, Gemini, or Claude.
SkillBFreshness: BClaude Code +9 - 0.518score
create-pull-request
thunter009
Open a GitHub pull request with repo-specific PR conventions.
SkillBFreshness: BClaude Code +9 - 0.514score
agents-md
thunter009
Create repo-specific AGENTS.md guardrails from the codebase.
SkillBFreshness: BClaude Code +9 - 0.479score
enrich-ticket-detail
thunter009
Flesh out thin or empty beads/Todoist items by mining git history, code-at-HEAD, closed tickets, and the session journal, then verify every drafted claim…
SkillCFreshness: CClaude Code +9
Cite this page
clean skill. Agent Mart. https://agentmart.dev/skills/thunter009-clean (last updated 2026-10-24)