Skip to content
Back to skills

Git Workflow Policy

ASecurity

Git workflow policies including commit rules and worktree cleanup sequence. Use when managing git operations, commits, or merges.

  • 666 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 8, 2026
developmentpythongojavabashnodeexpressdjangoflaskspringdocker

Security analysis

A93/100
  • highPerforms destructive filesystem operations

Pro shows the line behind each finding and how to fix it

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill git-workflow-policy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Git Workflow Policy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Git Workflow Policy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-git-workflow-policy/badge)](https://www.skillsdirectory.com/skills/majiayu000-git-workflow-policy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: git-workflow-policy
description: Git workflow policies including commit rules and worktree cleanup sequence. Use when managing git operations, commits, or merges.
---

# Git Workflow Policy

## Instructions

### Core policies

1. Never commit without explicit user approval
2. Phase commits at Step 9 only
3. No direct commits to main
4. Worktree → merge pattern
5. 4-step cleanup in order (plan → services → worktree → branch)

### Commit policy

**Before committing:**
- Present changes with rationale
- Show affected code/logs
- Get explicit user approval
- Focus minimal scope

### Worktree 4-step cleanup

**CRITICAL ORDER:**

```bash
1. rm .plan/{{feature_name}}_plan.md
2. cd .worktree/{{feature-name}} && {{cleanup_command}}
3. git worktree remove .worktree/{{feature-name}}
4. git branch -d feature/{{feature-name}}
```

**Why:** Plan first (project cleanup) → Services (prevent orphans) → Worktree (directory) → Branch (git)

<!-- CUSTOMIZE: Replace {{cleanup_command}} with project-specific commands -->
**Note:** `{{cleanup_command}}` = project-specific cleanup

**Common Cleanup Commands by Stack:**

**Python/Flask/Django:**
```bash
# Stop services
pkill -f "python.*{{app_name}}"
# Or docker-based:
docker-compose down
# Clean artifacts
rm -rf __pycache__ *.pyc .pytest_cache
```

**Node.js/Express:**
```bash
# Stop services
pm2 stop {{app_name}}
# Or kill process:
pkill -f "node.*{{app_name}}"
# Clean artifacts
rm -rf node_modules/.cache dist build
```

**Go:**
```bash
# Stop services
pkill -f "{{binary_name}}"
# Clean artifacts
rm -rf {{binary_name}} *.test
```

**Java/Spring:**
```bash
# Stop services
pkill -f "java.*{{app_name}}"
# Clean artifacts
./gradlew clean  # or: mvn clean
```

**Docker-based (Any stack):**
```bash
# Stop and remove containers
docker-compose -f docker-compose.{{env}}.yml down
docker rm -f {{container_name}}
# Clean volumes (optional)
docker volume prune -f
```

## Example

```bash
# ❌ Wrong
git worktree remove .worktree/feature-x  # Services orphaned!

# ✅ Correct
rm .plan/feature-x_plan.md
cd .worktree/feature-x && {{project_cleanup_command}}
git worktree remove .worktree/feature-x
git branch -d feature/feature-x
```

## Workflow

```
Code complete
    ↓
Present to user
    ↓
User approves
    ↓
Commit at Step 9
    ↓
All phases done
    ↓
Merge to main
    ↓
4-step cleanup
```

---

**For detailed policies, see [reference.md](reference.md)**
**For more examples, see [examples.md](examples.md)**

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.