gitrules
Skill628 starsChanged 7 months agoMITView on GitHub
Critical Git safety rules to prevent destructive operations. Use whenever performing git operations, reverting changes, or managing commits. Prevents accidental loss of work.
- Deletes or force-pushes
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- public/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/convex2.mdcCursor rule
- .cursor/rules/convex-doctor.mdcCursor rule
- .cursor/rules/convex-write-conflicts.mdcCursor rule
- .cursor/rules/dev2.mdcCursor rule
- .cursor/rules/gitruels.mdcCursor rule
- .cursor/rules/help.mdcCursor rule
- .cursor/rules/rulesforconvex.mdcCursor rule
- .cursor/rules/sec-check.mdcCursor rule
- .cursor/rules/task.mdcCursor rule
- .cursor/rules/workflow.mdcCursor rule
- .cursor/rules/write.mdcCursor rule
- public/llms.txtllms.txt
- convex-create-componentSkill
- convex-migration-helperSkill
- convex-performance-auditSkill
- convex-quickstartSkill
- convex-setup-authSkill
- convexSkill
- impeccableSkill
- convex-quickstartSkill
- convex-setup-authSkill
- devSkill
- function-creatorSkill
- helpSkill
- migration-helperSkill
- react-effect-decisionSkill
- real-time-backendSkill
- schema-builderSkill
- sec-checkSkill
- workflowSkill
- writeSkill
- convex-doctorSkill
- convex-return-validatorsSkill
- convex-self-hostingSkill
- create-prdSkill
- robel-authSkill
- update-project-docsSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
NEVER USE git checkout TO REVERT CHANGES.
- Distinctive: line 15
Preserve valuable work: if user says changes are bad, ask which specific parts to revert
- Distinctive: line 17
When user asks to "undo" changes: Read the current file, identify problematic sections, and manually edit to fix them
- Distinctive: line 32
Run git status first to check for uncommitted changes
- Distinctive: line 33
If there are uncommitted changes, STOP and ASK the user before proceeding
- Distinctive: line 35
Never create a commit unless the user explicitly asked for one
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Critical Git Safety Protocol
NEVER USE git checkout TO REVERT CHANGES.
MANDATORY GIT SAFETY RULES:
- NEVER run
git checkout -- <file>without first examining what you're about to destroy - ALWAYS use
git diff <file>to see exactly what changes will be lost - MANUALLY undo changes by editing files to revert specific problematic sections
- Preserve valuable work: if user says changes are bad, ask which specific parts to revert
git checkoutdestroys ALL changes: this can eliminate hours of valuable progress- When user asks to "undo" changes: Read the current file, identify problematic sections, and manually edit to fix them
Why this matters: Using git checkout blindly can destroy sophisticated implementations, complex prompts, provider-specific logic, and other valuable work that took significant time to develop.
Git Safety Rules
NEVER run these commands without explicit user approval:
git reset --hard: Destroys uncommitted changes permanentlygit checkout -- .: Discards all working directory changesgit clean -fd: Deletes untracked files permanentlygit stash drop: Deletes stashed changes
ALWAYS before any git operation:
- Run
git statusfirst to check for uncommitted changes - If there are uncommitted changes, STOP and ASK the user before proceeding
- Suggest
git stashto preserve changes if needed - Never create a commit unless the user explicitly asked for one
If user asks to "revert" something:
- First clarify: revert committed changes or uncommitted changes?
- Show what will be affected before doing anything
- Get explicit confirmation for destructive operations
This rule exists because careless git operations destroyed 2 days of work.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

