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 skills add joelbrilliant/agentic-delivery-skills --skill dirty-worktree-disciplinegit clone --depth 1 https://github.com/joelbrilliant/agentic-delivery-skillsWrote 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/joelbrilliant/agentic-delivery-skills/dirty-worktree-discipline)<a href="https://agentmods.dev/skills/joelbrilliant/agentic-delivery-skills/dirty-worktree-discipline"><img src="https://agentmods.dev/badge/skills/joelbrilliant/agentic-delivery-skills/dirty-worktree-discipline/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/joelbrilliant/agentic-delivery-skills/dirty-worktree-discipline"><img src="https://agentmods.dev/badge/skills/joelbrilliant/agentic-delivery-skills/dirty-worktree-discipline.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00052 | $0.00567 |
| Opus 5 | $0.00026 | $0.00283 |
| Sonnet 5 | $0.00010 | $0.00113 |
| Haiku 4.5 | $0.00005 | $0.00057 |
Grade A, and why
dirty-worktree-discipline 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 11d 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 — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Dirty Worktree Discipline
Overview
Use this skill before editing, staging, committing, or reverting in a repository that already has unrelated changes.
A dirty worktree is not an excuse to stop. It is a reason to be precise.
When to Use
git statusis not clean.- Generated files are present.
- Multiple agents or humans are working in the same repo.
- You need to commit only your slice.
- You are tempted to run broad cleanup or reset commands.
- A deploy or review requires exact source state.
Preflight
Capture:
git status --short --branch
git rev-parse --show-toplevel
git diff --name-only
git diff --cached --name-only
Classify files:
- yours;
- pre-existing unrelated;
- generated artefacts;
- unknown and risky;
- ignored/cache/temp.
Rules
- Never run broad reset/clean by default. No
git reset --hard, nogit clean -fd, no mass restore without explicit scope. - Stage by path. Use
git add path1 path2, notgit add .. - Inspect staged diff. Run
git diff --cached --statandgit diff --cached --name-onlybefore commit. - Preserve unrelated work. Do not format, revert, or move files outside your slice.
- Generated artefacts need intent. If build output is required for deploy, say so. Otherwise leave it uncommitted.
- Dirty state is part of evidence. Report what remains dirty and why.
Commit Protocol
Before commit:
Intended files:
Staged files:
Excluded dirty files:
Validation run:
After commit:
Commit SHA:
Files committed:
Repo still dirty: yes/no
Unrelated dirty state preserved:
Safe Commands
Good:
git add specific/file another/file
git diff --cached --name-only
git restore -- specific/generated-file
Risky, use only with explicit approval:
git add .
git reset --hard
git clean -fd
git checkout .
Anti-patterns
- "Workspace was messy so I committed everything."
- "I cleaned generated files and accidentally deleted someone else's artefacts."
- "I deployed from a dirty tree but did not report it."
- "I used broad restore because the diff was noisy."
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.
- 11d ago First seen · 96 lines · 52 tokens per session scan A 6c7c54e9eee8
dirty-worktree-discipline is a skill published in the GitHub repository joelbrilliant/agentic-delivery-skills (2 stars, last pushed 3mo ago), licensed MIT. It adds 52 tokens to every session and 567 once invoked, about $0.0003 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
mcore-split-pr
Split a PR into multiple PRs to reduce the number of required CODEOWNERS reviewer groups.
stacked-prs
Manages dependent branch stacks and stacked pull requests using safe Git topology rules. Triggers on: "create stacked PRs", "publish this stack", "sync my PR stack", "rebase this stack", "merge the stack", "retarget child PRs", "split this branch into stacked PRs", "validate this stack", "cleanup stacked branches", or…
pr-swarm
Parallelizes two or more independent "own PR to green" loops for a single repository using isolated git worktrees and separate headless Claude Code sessions per PR — resolving merge conflicts, clearing review feedback, and watching CI to completion without one PR's diff or feedback leaking into another's context.…
changelog-composer
Generates structured changelogs and release notes from git history and PRs, classifying breaking changes, features, fixes, performance, docs. Triggers on: "generate changelog", "write release notes", "what changed since", "prepare release", "release notes for", "diff since tag".
engineering-retro
Git-based engineering retrospective analyzing commits, PRs, and velocity over configurable windows with monorepo path scoping. Triggers on: "retrospective", "sprint retro", "weekly review", "what did we ship", "engineering retro", "dev summary", "commit analysis".
repo-sentinel
Full security audit for public repositories across 12 attack surfaces: git history, secrets, CI/CD, containers, dependencies, licenses. Triggers on: "push to GitHub", "make repo public", "open source this", "is this safe to push", "release audit", "secret leaks".