Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/hon454/grimoire/git-workspace-cleanupnpx skills add hon454/grimoire --skill git-workspace-cleanupgit clone --depth 1 https://github.com/hon454/grimoireWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hon454/grimoire/git-workspace-cleanup)<a href="https://agentmods.dev/skills/hon454/grimoire/git-workspace-cleanup"><img src="https://agentmods.dev/badge/skills/hon454/grimoire/git-workspace-cleanup.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00041 | $0.00804 |
| Opus 5 | $0.00020 | $0.00402 |
| Sonnet 5 | $0.00008 | $0.00161 |
| Haiku 4.5 | $0.00004 | $0.00080 |
Grade A, and why
git-workspace-cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Git Workspace Cleanup
Return a Git repository to a single clean main worktree: remove every non-main worktree, delete every local branch except main, and fast-forward main from its remote.
This is destructive. Never run it implicitly.
Invocation
Use this skill only when the user explicitly invokes it as $git-workspace-cleanup.
Required Flow
-
State that the workflow can delete local worktrees and branches.
-
Resolve the bundled script relative to this
SKILL.md:scripts/git_workspace_cleanup.py -
Choose the Python 3 launcher available in the user's shell and call it
<python>in the commands below:- POSIX shells commonly use
python3. - Windows PowerShell or
cmd.execommonly usepy -3orpython.
- POSIX shells commonly use
-
Run the bundled script in dry-run mode from any path inside the repository. The dry run fetches the remote and verifies the preserved branch can fast-forward before reporting the destructive plan:
<python> <skill-dir>/scripts/git_workspace_cleanup.py --repo . --dry-run -
Show the user the main worktree path and the worktrees and branches that would be removed.
-
Ask for explicit approval before mutating the repository. Use the host's native user-input or approval UI when it is available; in Codex, use
request_user_inputwhen the current mode exposes it. Offer a destructive approval choice and a cancel choice. If no native choice UI is available, ask for a short typed approval phrase instead. -
After approval, run:
<python> <skill-dir>/scripts/git_workspace_cleanup.py --repo . --yes -
Continue subsequent repository work from the printed main worktree path.
-
Verify the final state with:
git worktree list git branch --format="%(refname:short)" git status --short --branch git pull --ff-only
Use --repo <path> when the current shell is not inside the target repository.
Safety Rules
- Do not remove the worktree checked out on
main. - Do not delete the local
mainbranch. - Do not mutate anything unless the user approves the dry-run result.
- Stop if the main worktree is dirty.
- Stop if an extra worktree is dirty. Use
--force-worktreesonly when the user explicitly approves discarding files in those dirty extra worktrees. Prefer the host's native user-input or approval UI for this approval when available; otherwise require a typed approval phrase. - Treat fast-forward failure as a blocker before removing worktrees or deleting branches. Do not merge, rebase, reset, or force-push as part of this skill.
- If the repository uses a preserved branch other than
main, rerun the script with--main-branch <branch>only after the user confirms that branch name.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 78 lines · 41 tokens per session scan A d15e2a7a7e25
git-workspace-cleanup is a skill published in the GitHub repository hon454/grimoire (2 stars, last pushed 16d ago), licensed MIT. It adds 41 tokens to every session and 804 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
flutter-ui
Build Flutter UI from Figma MCP or image input. Scans src for design tokens (colors, sizes, text styles), existing components, and naming conventions before writing a single line of code. Never hard-codes values.
review
Plan-aware graph-enhanced code review before merge. CRITICAL issues block merge. Use after fix/verify.
serena
Serena code intelligence — LSP-powered symbol navigation, diagnostics, and targeted code surgery. Activate before complex refactors, cross-file analysis, or when graph tools need symbol-level depth.
database-migrations
Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Kysely, Django, TypeORM, golang-migrate).
diagnose
Structured 6-phase debugging. Build feedback loop first, reproduce deterministically, hypothesize with ranked falsifiable theories, instrument one variable at a time, fix with regression test, cleanup. Use when a bug exists, tests fail unexpectedly, or behavior is wrong and cause is unknown.
execute
Dispatch and execute implementation plans with TDD and checkpoints. Use when plan is ready. Parallel by default for independent tasks.