git
Skill35 starsChanged 52 days agoApache-2.0View on GitHub
Safe git workflow with destructive command protection. Use when committing changes, creating branches, managing git workflow, or handling merge conflicts.
- Deletes or force-pushes
- Commits and pushes
57 other projects use a version of this.
Adopted by
Most recently taken up by
- bmcszk/agent-skillstheir own version, first seen Nov 8, 2026
- BridgLabs/opencodereviewtheir own version, first seen Nov 8, 2026
- Conceptual-Machines/magda-coretheir own version, first seen Nov 7, 2026
- tsukhani/jclawtheir own version, first seen Nov 5, 2026
- cekrauseee/harnesstheir own version, first seen Nov 1, 2026
- jmlrt/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use sql, databases and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
thechandanbhagatSkillsql
Write SQL queries, optimize database performance, design schemas, and debug SQL issues. Use for database operations, query optimization, and schema design.
Also in 4 projects that use this
mrgoonieSkilldatabases
Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin). Use when designing database schemas, writing queries and aggregations, optimizing indexes for performance, performing database migrations, configuring replication and sharding, implementing backup and restore strategies, managing database users and permissions, analyzing query performance, or administering production databases.
Also in 3 projects that use this
mrgoonieSkilldevops
Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.
Also in 4 projects that use this
MicrosoftSkilltypescript
TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.
Also in 4 projects that use this
VercelSkillreact
React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.
Also in 3 projects that use this
NVIDIASkillgithub
Interact with GitHub using the gh CLI restricted to REST API only (no GraphQL). Use when the user wants to work with GitHub issues, pull requests, repos, releases, or Actions — especially in sandboxed environments where the GraphQL endpoint may be blocked. Trigger keywords - github, gh, pull request, PR, github issue, github actions, workflow, release, gh api.
Also in 6 projects that use this
Other versions57 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 57
- macro-inc/macro★ 6ksame name
- epicenter-md/epicenter★ 4.8ksame name
- EpicenterHQ/epicenter★ 4.8ksame name
- carapace-sh/carapace-bin★ 2ksame name
- LuisaGroup/LuisaCompute★ 1.1ksame name
- kagenti/kagenti★ 303same name
- Conceptual-Machines/magda-core★ 258same name
- typv/nest-turbo-starter★ 224same name
- BridgLabs/opencodereview★ 79same name
- matteing/opal★ 59same name
47 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 repository23 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 51 edited versions we read keep these.
4
Distinctive
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 153
When user asks to commit:
- Distinctive: line 290
Before each commit, verify:
- Distinctive: line 334
No AI attribution: Never add Co-Authored-By
- Distinctive: line 335
No "Generated by": No AI mentions in commits
“Common” is measured: kept by at least 6 in 10 of the 51 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
/craftsman:git - Safe Git Workflow
Outcome Contract
- Outcome: a clean conventional commit or branch operation, with destructive commands blocked or confirmed.
- Done when: the working tree state is known before acting, the commit follows Conventional Commits, and no destructive command ran without explicit confirmation.
- Evidence: git status before, the command run, and git log after.
You are a Git Workflow Expert. You ensure safe, traceable, and professional version control.
Subcommands
| Command | Description |
/craftsman:git | General git workflow |
/craftsman:git worktree | Create isolated worktree |
/craftsman:git finish | Finish branch with merge/PR |
Philosophy
"Commit early, commit often, perfect later, publish once." "Your commit history is a story. Make it a good one."
Safety First: Destructive Commands
NEVER Execute Without Explicit Confirmation
| Command | Risk | What It Does |
git reset --hard | CRITICAL | Destroys uncommitted changes |
git clean -fd | CRITICAL | Deletes untracked files |
git push --force | CRITICAL | Rewrites remote history |
git branch -D | HIGH | Force-deletes unmerged branch |
git checkout . | HIGH | Discards all changes |
git stash drop | HIGH | Permanently deletes stash |
When User Requests Destructive Command
## DESTRUCTIVE COMMAND DETECTED
**Command:** `git reset --hard HEAD~3`
**What this will do:**
- Permanently delete the last 3 commits
- Discard ALL uncommitted changes
- This action is IRREVERSIBLE
**Safer alternatives:**
1. `git revert HEAD~3..HEAD` - Undo with new commits (reversible)
2. `git stash` - Save uncommitted changes first
3. `git reset --soft HEAD~3` - Undo commits, keep changes staged
**To proceed:** Type exactly: "I understand, proceed with reset --hard"Conventional Commits
Format
<type>(<scope>): <description>
[optional body]
[optional footer]Types
| Type | When to Use |
feat | New feature |
fix | Bug fix |
refactor | Code restructuring (no behavior change) |
test | Adding/fixing tests |
docs | Documentation only |
chore | Maintenance, dependencies |
perf | Performance improvement |
style | Formatting (no logic change) |
ci | CI/CD changes |
Rules
- Subject: Imperative mood, <72 chars, no period
- Body: Explain "why", not "what"
- Footer: Reference issues (
Closes #123)
Examples
# Simple fix
fix(auth): prevent duplicate session creation on login
# Feature with body
feat(gamification): implement weekly check-in system
Add point calculation with caps per category.
Users can submit once per week with streak bonus.
Closes #234
# Breaking change
feat(api)!: change user endpoint response format
BREAKING CHANGE: user.name is now user.fullNameBranch Naming
<type>/<ticket>-<short-description>
feature/MET-123-user-authentication
fix/MET-456-login-redirect-loop
hotfix/MET-789-payment-crash
refactor/MET-101-extract-email-serviceAtomic Commits
✅ GOOD - Each commit is atomic:
├── feat(user): add UserId value object
├── feat(user): add User entity with factory
├── test(user): add User unit tests
├── feat(user): add UserRepository interface
└── infra(user): implement Doctrine repository
❌ BAD - One giant commit:
└── feat: add entire User management systemCommit Workflow
When user asks to commit:
Step 1: Analyze Changes
git status
git diff --staged
git diffStep 2: Suggest Atomic Commits
## Proposed Commits
### Commit 1: `feat(user): add Email value object`
Files:
- src/Domain/ValueObject/Email.php
- tests/Unit/Domain/ValueObject/EmailTest.php
### Commit 2: `feat(user): add User entity`
Files:
- src/Domain/Entity/User.php
- tests/Unit/Domain/Entity/UserTest.php
### Alternative: Single Commit
`feat(user): implement User domain model with Email VO`
**Which approach?**Step 3: Execute (after confirmation)
# Stage specific files
git add src/Domain/ValueObject/Email.php tests/Unit/Domain/ValueObject/EmailTest.php
# Commit with message
git commit -m "feat(user): add Email value object"Worktree Mode
When to Use
- Isolated workspace for feature development
- Parallel work on multiple branches
- Safe experimentation
Process
## Worktree Setup
**Current repo:** /path/to/project
**Feature branch:** feature/payment-v2
**Base branch:** main
**Proposed location:** ../project-worktrees/payment-v2
### Safety Checks
- [ ] Target directory doesn't exist
- [ ] No uncommitted changes
- [ ] Base branch is up to date
**Proceed?**Commands
# Create worktree with new branch
git worktree add -b feature/payment-v2 ../project-worktrees/payment-v2 origin/main
# List worktrees
git worktree list
# Remove worktree (safe)
git worktree remove ../project-worktrees/payment-v2
# Prune stale
git worktree pruneFinish Mode
When to Use
- Implementation complete
- Tests pass
- Ready to integrate
Process
## Branch Finish: feature/payment-v2
### Pre-Finish Checks
- [ ] All tests pass
- [ ] No uncommitted changes
- [ ] Branch up to date with main
- [ ] Code reviewed (if required)
### Integration Options
**Option 1: Merge (preserves history)**
```bash
git checkout main
git merge --no-ff feature/payment-v2
git push origin main
git branch -d feature/payment-v2Option 2: Create PR (team review)
git push -u origin feature/payment-v2
gh pr create --title "feat: payment system v2" --body "..."Option 3: Squash (clean history)
git checkout main
git merge --squash feature/payment-v2
git commit -m "feat(payment): implement payment system v2"Which option?
---
## Pre-Commit Checklist
Before each commit, verify:
- [ ] Changes are ONE logical unit
- [ ] Tests pass locally
- [ ] No debug code (`console.log`, `var_dump`, `dd()`)
- [ ] No credentials or secrets
- [ ] Commit message follows convention
---
## Quick Reference
```bash
# Status
git status # Working tree
git log --oneline -10 # Recent commits
git diff # Unstaged changes
git diff --staged # Staged changes
# Branching
git checkout -b <branch> # Create & switch
git branch -d <branch> # Delete (safe)
# Staging
git add -p # Interactive staging
git reset HEAD <file> # Unstage file
# Commits
git commit --amend # Modify last commit
git reset --soft HEAD~1 # Undo commit, keep changes
# Remote
git fetch origin # Download changes
git pull --rebase origin main # Update with rebase
git push -u origin <branch> # Push & trackConfig Rules
From user's CLAUDE.md:
- Conventional Commits: Enforce format
- No AI attribution: Never add Co-Authored-By
- No "Generated by": No AI mentions in commits
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.

