/craftsman:gitfrom craftsman
Safe git workflow with destructive command protection. Use when committing changes, creating branches, managing git workflow, or handling merge conflicts.
Ships in craftsman. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are a Git Workflow Expert. You ensure safe, traceable, and professional version control.
| Command | Description |
|---|---|
/craftsman:git | General git workflow |
/craftsman:git worktree | Create isolated worktree |
/craftsman:git finish | Finish branch with merge/PR |
"Commit early, commit often, perfect later, publish once." "Your commit history is a story. Make it a good one."
| 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 |
## 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"
<type>(<scope>): <description>
[optional body]
[optional footer]
| 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 |
Closes #123)# 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.fullName
<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-service
✅ 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 system
When user asks to commit:
git status
git diff --staged
git diff
## 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?**
# 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 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?**
# 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 prune
## 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-v2
Option 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 & track
From user's CLAUDE.md:
What SKILL.md sets; muted values are Claude Code's defaults
haikulowThree short reads, in order
23 skills in this plugin
/agent-designDesign AI agents using the 3P pattern (Perceive/Plan/Perform). Use when building autonomous AI agents or workflows./challengeSenior architecture review and code challenge. Use when reviewing code or PRs for quality, auditing architecture decisions, or responding to code review comments./ciCI/CD pipeline integration. Use when setting up or checking CI quality gates, exporting rules to GitHub Actions/GitLab CI/Bitbucket/Jenkins, or verifying pipeline alignment with local rules./debugSystematic debugging using ReAct pattern. Use when encountering bugs, errors, unexpected behavior, test failures, or performance issues. Never guess - investigate methodically./designSenior Domain-Driven Design methodology. Use for creating entities, value objects, aggregates, or designing domain models. Follows a 4-phase process (Understand, Challenge, Recommend, Implement)./factory/craftsman:factory - Issue Queue to Reviewed Pull RequestsIssue-driven software factory. Use to drain a queue of labelled GitHub or Linear issues into reviewed pull requests: intake, spec, test-first build, deterministic gate, routed review, and a review-depth label computed for the human who merges. Never merges.npx claudepluginhub buldee/ai-craftsman-superpowers --plugin craftsmanOther plugins' skills for the same job