Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

git-hygiene-enforcer

БесплатноБез исполняемых скриптовНе проверен

Establishes git workflow guardrails including conventional commits, commit message hooks, branch naming conventions, PR templates, and code review processes…

patricio0312revот patricio0312rev★ 64 звезды на GitHub

Об этом скилле

Git Hygiene Enforcer

Enforce consistent, high-quality git practices across your team.

Core Workflow

  1. Choose conventions: Select commit format (Conventional Commits, Angular, etc.)
  2. Setup commit hooks: Install commitlint with git hooks
  3. Configure branch rules: Define naming patterns and protection
  4. Create PR templates: Standardize pull request descriptions
  5. Add workflows: GitHub Actions or GitLab CI for automated checks
  6. Document process: Write CONTRIBUTING.md with git guidelines
  7. Provide bypasses: Document emergency override procedures

Conventional Commits

Format: <type>(<scope>): <description>

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, etc.)
  • refactor: Code refactoring
  • test: Test additions or changes
  • chore: Build/tool changes
  • perf: Performance improvements
  • ci: 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

  1. Install dependencies:
npm install --save-dev @commitlint/cli @commitlint/config-conventional husky
npx husky init
  1. 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],
  },
};
  1. 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 }}.
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить git-hygiene-enforcer с