git-discipline
Skill4 starsChanged 8 months agoUnlicenseView on GitHub
Use when running any git operation — committing, pushing, branching, merging, rebasing — or when a command could touch uncommitted or untracked work. Enforces conventional-commit messages, a commit per execution wave, and hard guards on destructive commands. Triggers on: git clean, git reset --hard, force push, rebasing a published branch, rm on user files, deleting untracked files.
- Deletes or force-pushes
We split this skill into the rules it gives an agent
8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Before ANY operation that could affect them:
- Distinctive: line 21
Run git status and understand what is untracked and why.
- Distinctive: line 22
Never assume untracked files are garbage, generated artifacts, or safe to delete.
- Very specific: line 36
Worktree location: when the user requests a Git worktree, create it under the project's root-level, Git-ignored .worktrees/ directory.
- Distinctive: line 42
When executing a plan with parallel waves, commit all results after each wave completes — before starting the next wave.
- Distinctive: line 45
Do not accumulate changes across multiple waves into a single commit
- Very specific: line 50
Use conventional format: type(scope): description
- Distinctive: line 64
Before making changes to unfamiliar code, check git log and git blame to understand how it evolved.
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Discipline
Git is mostly reversible — except when it isn't. The guards against irreversible loss of the user's work come first; commit conventions follow.
Protect Uncommitted and Untracked Work
Untracked files are the user's property. They may be hours of work with no other copy — a legitimate workflow, e.g. cleaning files before the first commit to keep secrets out of history. Treat them as sacred.
Before ANY operation that could affect them:
- Run
git statusand understand what is untracked and why. - Never assume untracked files are garbage, generated artifacts, or safe to delete.
These commands require the user to explicitly request them — running any without that request is a catastrophic, possibly unrecoverable bug:
git clean(any flags) — destroys untracked files irreversiblygit checkout -- .orgit restore .— discards all uncommitted changesgit reset --hard— destroys uncommitted workrm -rf/rm -ron directories containing user files- Any glob-pattern command (
rm *.md,git checkout -- *.py) that could hit user files
Never rewrite shared history without explicit permission — no --force push, no rebasing published branches.
Rogue files from a subagent: list them to the user first, then delete them individually by exact path — never with a blanket command.
Worktree location: when the user requests a Git worktree, create it under the project's root-level, Git-ignored .worktrees/ directory. Verify that .worktrees/ is ignored first, then use a descriptive name such as <task-id>-<short-handle>.
Commit Behavior
Commit After Every Execution Wave
When executing a plan with parallel waves, commit all results after each wave completes — before starting the next wave.
- Each wave commit captures a coherent, working state of the codebase
- Do not accumulate changes across multiple waves into a single commit
- Starting a new wave without committing the previous wave's results = bug
Conventional Commits
Use conventional format: type(scope): description
feat(auth): add JWT refresh token rotation
fix(cart): prevent negative quantities in checkout
docs(api): update OpenAPI spec for /users endpointThe description should explain what changed, not what you did:
- ✅ "add JWT refresh token rotation"
- ❌ "I added JWT refresh token rotation"
Git History as Context Source
Before making changes to unfamiliar code, check git log and git blame to understand how it evolved. Previous commit messages explain past decisions — use them before asking the user to re-explain.
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- Sapere-IA/sdd-onboarding-kit★ 18same name
- annatchijova/SKILLS★ 9same name
- curvedinf/dev-skills★ 8same name
- radif-ru/ai-multi-agent-system★ 6same name
- AL-JANEF/janef-forge★ 1same name
- AL-JANEF/janefskills★ 1same name
- Confidence-huang/agent-git-discipline★ 0same name
- devpilotX/skills★ 0same name
- edrethardo/werkbank-board★ 0same name
- Nadav011/apex-skills★ 0same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository73 other files it gives its agents.
- agent/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- git-guardrails-claude-codeSkill
- setup-project-skillsSkill
- skill-creatorSkill
- websearchSkill
- writing-great-skillsSkill
- codebase-designSkill
- construction-craftSkill
- critical-partnerSkill
- data-intensiveSkill
- diagnosing-bugsSkill
- django-disciplineSkill
- docker-disciplineSkill
- documentation-lifecycleSkill
- domain-driven-designSkill
- enterprise-patternsSkill
- legacy-codeSkill
- production-readinessSkill
- refactoring-passSkill
- resolving-merge-conflictsSkill
- tddSkill
- testing-workflowSkill
- ui-design-directionSkill
- webapp-testingSkill
- writing-for-agentsSkill
- django-allauthSkill
- djangoSkill
- dockerSkill
- drfSkill
- full-calendarSkill
- giteaSkill
- htmxSkill
- http-status-codesSkill
- hyperscriptSkill
- langchainSkill
- litestarSkill
- prestashopSkill
- prSkill
- pykeSkill
- python-asyncSkill
- tablerSkill
- cleanroom-rewriteSkill
- councilSkill
- court-jesterSkill
- domain-modelingSkill
- fix-prSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- humanifySkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- ponytail-auditSkill
- ponytail-debtSkill
- prototypeSkill
- qaSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

