<< All versions
Skill v1.0.0
currentAutomated scan100/100joelbrilliant/agentic-delivery-skills/dirty-worktree-discipline
──Details
PublishedNovember 6, 2026 at 02:56 AM
Content Hashsha256:6c7c54e9eee88604...
Git SHA09fd4761d99f
──Files
Files (1 file, 2.4 KB)
SKILL.md2.4 KBactive
SKILL.md · 98 lines · 2.4 KB
name: dirty-worktree-discipline description: Keeps agent work safe in messy repositories. Use when git status is dirty, unrelated files exist, generated artefacts are present, multiple agents share a repo, or you must commit only the intended slice without damaging someone else's work. metadata: version: "1.0.0"
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:
bash
git status --short --branchgit rev-parse --show-toplevelgit diff --name-onlygit 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:
text
Intended files:Staged files:Excluded dirty files:Validation run:
After commit:
text
Commit SHA:Files committed:Repo still dirty: yes/noUnrelated dirty state preserved:
Safe Commands
Good:
bash
git add specific/file another/filegit diff --cached --name-onlygit restore -- specific/generated-file
Risky, use only with explicit approval:
bash
git add .git reset --hardgit clean -fdgit 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."