git-workflow-enforcer

Ensures commits follow conventional commits, branch naming conventions, and PR templates. Use when creating commits, branches, or PRs, or when user mentions git workflow.

242 stars

Best use case

git-workflow-enforcer is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Ensures commits follow conventional commits, branch naming conventions, and PR templates. Use when creating commits, branches, or PRs, or when user mentions git workflow.

Ensures commits follow conventional commits, branch naming conventions, and PR templates. Use when creating commits, branches, or PRs, or when user mentions git workflow.

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "git-workflow-enforcer" skill to help with this workflow task. Context: Ensures commits follow conventional commits, branch naming conventions, and PR templates. Use when creating commits, branches, or PRs, or when user mentions git workflow.

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/git-workflow-enforcer/SKILL.md --create-dirs "https://raw.githubusercontent.com/aiskillstore/marketplace/main/skills/crazydubya/git-workflow-enforcer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/git-workflow-enforcer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How git-workflow-enforcer Compares

Feature / Agentgit-workflow-enforcerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Ensures commits follow conventional commits, branch naming conventions, and PR templates. Use when creating commits, branches, or PRs, or when user mentions git workflow.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Git Workflow Enforcer

Enforces consistent Git workflows including commit messages, branch naming, and PR processes.

## When to Use
- Creating commits or branches
- Code review or PR creation
- User mentions "git workflow", "commit message", "branch naming", or "pull request"

## Instructions

### 1. Detect Existing Conventions

Check for:
- `.github/` or `.gitlab/` templates
- `CONTRIBUTING.md`
- Existing commit message patterns
- Branch naming patterns

### 2. Conventional Commits

**Format:** `type(scope): description`

**Types:**
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation
- `style`: Formatting, missing semicolons
- `refactor`: Code restructuring
- `perf`: Performance improvement
- `test`: Adding tests
- `chore`: Maintenance, dependencies

**Examples:**
```
feat(auth): add OAuth2 login support
fix(api): handle null response in user endpoint
docs(readme): update installation instructions
refactor(utils): simplify date formatting logic
```

### 3. Branch Naming

**Common patterns:**
```
feature/user-authentication
bugfix/login-error-handling
hotfix/critical-security-patch
release/v1.2.0
chore/update-dependencies
```

**Validate:**
- Lowercase with hyphens
- Prefixed with type
- Descriptive name
- Issue number if applicable: `feature/123-add-dark-mode`

### 4. Commit Message Validation

**Good commit:**
```
feat(payments): integrate Stripe payment gateway

- Add Stripe SDK configuration
- Implement payment intent creation
- Add webhook handler for payment events
- Update tests for payment flow

Closes #456
```

**Check for:**
- Subject line ≤50 characters
- Body wrapped at 72 characters
- Blank line between subject and body
- Imperative mood ("add" not "added")
- Reference to issue/ticket

### 5. PR Template

Create `.github/PULL_REQUEST_TEMPLATE.md`:

```markdown
## Description
<!-- What does this PR do? -->

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update

## Testing
<!-- How was this tested? -->

## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated
- [ ] Tests added/updated
- [ ] All tests passing
- [ ] No new warnings

## Related Issues
Closes #
```

### 6. Commit Hooks

**Pre-commit:**
```bash
#!/bin/sh
# .git/hooks/pre-commit

# Run linter
npm run lint

# Run tests
npm test

# Check for sensitive data
if git diff --cached | grep -i "password\|api_key\|secret"; then
  echo "Error: Possible sensitive data detected"
  exit 1
fi
```

**Commit-msg:**
```bash
#!/bin/sh
# .git/hooks/commit-msg

commit_msg=$(cat "$1")

# Check conventional commit format
if ! echo "$commit_msg" | grep -qE "^(feat|fix|docs|style|refactor|perf|test|chore)(\(.+\))?: .+"; then
  echo "Error: Commit message must follow Conventional Commits format"
  echo "Example: feat(auth): add login feature"
  exit 1
fi
```

### 7. Validate Existing Commits

Check recent commits for pattern adherence:

```bash
git log --oneline -20 | grep -v "^[a-f0-9]\{7\} (feat|fix|docs|style|refactor|perf|test|chore)"
```

### 8. Generate Changelog

From conventional commits:

```bash
# Using standard-version
npx standard-version

# Or manually group by type
git log --pretty=format:"%s" | grep "^feat" > features.txt
git log --pretty=format:"%s" | grep "^fix" > fixes.txt
```

### 9. Protected Branches

**GitHub settings:**
- Require PR reviews
- Require status checks
- Require signed commits
- Restrict who can push
- Require linear history

### 10. Best Practices

- **Atomic commits**: One logical change per commit
- **Descriptive messages**: Explain why, not what
- **Frequent commits**: Small, frequent over large, rare
- **Clean history**: Squash/rebase before merge
- **Sign commits**: GPG signature for security
- **Reference issues**: Link to tracking system

## Git Commit Template

Create `.gitmessage`:
```
<type>(<scope>): <subject>

<body>

<footer>

# Type: feat, fix, docs, style, refactor, perf, test, chore
# Scope: component or file affected
# Subject: imperative, lowercase, no period, ≤50 chars
# Body: explain what and why, not how, wrapped at 72 chars
# Footer: breaking changes, issue references
```

Set as template:
```bash
git config --global commit.template ~/.gitmessage
```

## Supporting Files
- `templates/PULL_REQUEST_TEMPLATE.md`
- `templates/commit-msg-hook.sh`
- `templates/.gitmessage`

Related Skills

req-change-workflow

242
from aiskillstore/marketplace

Standardize requirement/feature changes in an existing codebase (especially Chrome extensions) by turning "改需求/需求变更/调整交互/改功能/重构流程" into a repeatable loop: clarify acceptance criteria, confirm current behavior from code, assess impact/risk, design the new logic, implement with small diffs, run a fixed regression checklist, and update docs/decision log. Use when the user feels the change process is chaotic, when edits tend to sprawl across files, or when changes touch manifest/service worker/OAuth/storage/UI and need reliable verification + rollback planning.

defou-workflow

242
from aiskillstore/marketplace

将原始想法转化为结构清晰、判断明确、具有长期价值的“得否”风格内容报告。

defou-stanley-workflow

242
from aiskillstore/marketplace

Defou x Stanley 融合工作流:结合深度结构化思考与人性弱点洞察,生成极简、犀利且具有长期价值的爆款内容。

agentic-workflow

242
from aiskillstore/marketplace

Practical AI agent workflows and productivity techniques. Provides optimized patterns for daily development tasks such as commands, shortcuts, Git integration, MCP usage, and session management.

workflow-patterns

242
from aiskillstore/marketplace

Use this skill when implementing tasks according to Conductor's TDD workflow, handling phase checkpoints, managing git commits for tasks, or understanding the verification protocol.

workflow-orchestration-patterns

242
from aiskillstore/marketplace

Design durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism constraints. Use when building long-running processes, distributed transactions, or microservice orchestration.

workflow-automation

242
from aiskillstore/marketplace

Workflow automation is the infrastructure that makes AI agents reliable. Without durable execution, a network hiccup during a 10-step payment flow means lost money and angry customers. With it, workflows resume exactly where they left off. This skill covers the platforms (n8n, Temporal, Inngest) and patterns (sequential, parallel, orchestrator-worker) that turn brittle scripts into production-grade automation. Key insight: The platforms make different tradeoffs. n8n optimizes for accessibility

tdd-workflows-tdd-refactor

242
from aiskillstore/marketplace

Use when working with tdd workflows tdd refactor

tdd-workflows-tdd-red

242
from aiskillstore/marketplace

Generate failing tests for the TDD red phase to define expected behavior and edge cases.

tdd-workflows-tdd-green

242
from aiskillstore/marketplace

Implement the minimal code needed to make failing tests pass in the TDD green phase.

tdd-workflows-tdd-cycle

242
from aiskillstore/marketplace

Use when working with tdd workflows tdd cycle

ml-pipeline-workflow

242
from aiskillstore/marketplace

Build end-to-end MLOps pipelines from data preparation through model training, validation, and production deployment. Use when creating ML pipelines, implementing MLOps practices, or automating model training and deployment workflows.