git-hygiene-enforcer
БесплатноБез исполняемых скриптовНе проверенEstablishes git workflow guardrails including conventional commits, commit message hooks, branch naming conventions, PR templates, and code review processes…
от patricio0312rev★ 64 звезды на GitHubОб этом скилле
Git Hygiene Enforcer
Enforce consistent, high-quality git practices across your team.
Core Workflow
- Choose conventions: Select commit format (Conventional Commits, Angular, etc.)
- Setup commit hooks: Install commitlint with git hooks
- Configure branch rules: Define naming patterns and protection
- Create PR templates: Standardize pull request descriptions
- Add workflows: GitHub Actions or GitLab CI for automated checks
- Document process: Write CONTRIBUTING.md with git guidelines
- Provide bypasses: Document emergency override procedures
Conventional Commits
Format: <type>(<scope>): <description>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Test additions or changeschore: Build/tool changesperf: Performance improvementsci: CI/CD changes
Examples:
feat(auth): add OAuth2 login
fix(api): resolve race condition in user endpoint
docs(readme): update installation instructions
refactor(utils): simplify date formatting logic
Commit Hook Setup
Using Husky + Commitlint
- Install dependencies:
npm install --save-dev @commitlint/cli @commitlint/config-conventional husky
npx husky init
- Configure commitlint (commitlint.config.js):
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
2,
"always",
[
"feat",
"fix",
"docs",
"style",
"refactor",
"test",
"chore",
"perf",
"ci",
],
],
"subject-case": [2, "never", ["upper-case"]],
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", "."],
"header-max-length": [2, "always", 100],
},
};
- Add commit-msg hook (.husky/commit-msg):
#!/bin/sh
npx --no -- commitlint --edit $1
Using pre-commit (Python)
# .pre-commit-config.yaml
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.0.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
Branch Naming Conventions
Pattern: <type>/<ticket-id>-<description>
Examples:
feature/AUTH-123-oauth-login
bugfix/API-456-user-race-condition
hotfix/PROD-789-payment-error
refactor/DB-321-optimize-queries
Branch Protection Rules:
- Require PR reviews (1-2 reviewers)
- Require status checks to pass
- Require branches to be up to date
- Enforce linear history (no merge commits)
- Require signed commits (optional)
Pull Request Templates
.github/pull_request_template.md
## Description
<!-- Describe your changes in detail -->
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## Related Issue
Closes #<!-- issue number -->
## How Has This Been Tested?
<!-- Describe the tests you ran to verify your changes -->
- [ ] Unit tests
- [ ] Integration tests
- [ ] Manual testing
## Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published
## Screenshots (if applicable)
<!-- Add screenshots to help explain your changes -->
Alternative: Simple Template
## What
<!-- What does this PR do? -->
## Why
<!-- Why are we making this change? -->
## How
<!-- How did you implement it? -->
## Testing
<!-- How can reviewers verify this works? -->
GitHub Actions Workflow
.github/workflows/pr-checks.yml
name: PR Checks
on:
pull_request:
branches: [main, develop]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate PR title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check branch naming
run: |
BRANCH="${{ github.head_ref }}"
if ! $BRANCH =~ ^(feature|bugfix|hotfix|refactor|docs|chore)/.+; then
echo "Branch name doesn't follow convention: <type>/<description>"
exit 1
fi
- name: Lint commits
uses: wagoid/commitlint-github-action@v5
- name: Check for merge commits
run: |
if git log --merges origin/${{ github.base_ref }}.
Установить git-hygiene-enforcer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл git-hygiene-enforcer?
Establishes git workflow guardrails including conventional commits, commit message hooks, branch naming conventions, PR templates, and code review processes. Provides hook configurations, workflow templates, and emergency bypass instructions. Use when users request "setup git hooks", "enforce commit conventions", "add PR templates", or "standardize git workflow".
Как установить скилл git-hygiene-enforcer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл git-hygiene-enforcer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic