git-hooks-toolkit✓ ناجح

Generate, install, and manage Git hooks with pre-built templates. Includes hooks for linting staged files, enforcing conventional commits, blocking debug statements, preventing large file commits, auto-formatting code, requiring ticket references, protecting branches, running tests before push, and auto-installing dependencies after merge. Use when setting up git hooks, enforcing commit conventions, or automating pre-commit/pre-push checks.

71من ١٠٠
٤.٥k
★ نجوم
١
↓ تنزيلات
٢٦
◉ مشاهدات

// تثبيت المهارة

تثبيت المهارة

المهارات هي كود تابع لأطراف ثالثة من مستودعات GitHub العامة. يفحص SkillHub الأنماط الخبيثة المعروفة، لكنه لا يستطيع ضمان السلامة. راجع الكود المصدري قبل التثبيت.

تثبيت عام (على مستوى المستخدم):

npx skillhub install openclaw/skills/git-hooks-toolkit

تثبيت في المشروع الحالي:

npx skillhub install openclaw/skills/git-hooks-toolkit --project

استخدمه مع Hermes أو أي runtime آخر. تُكتب المهارة في <directory>/<skill-name>/.

npx skillhub install openclaw/skills/git-hooks-toolkit --target-dir /path/to/skills

المسار المقترح: ~/.claude/skills/git-hooks-toolkit/

مراجعة الذكاء الاصطناعي

71
من ١٠٠

3-file skill with 17KB git_hooks.py implementing 8 hook templates: pre-commit (lint-staged, no-debug, large-files, format-check), commit-msg (conventional, ticket-ref, no-wip), pre-push (run-tests, branch-protect), post-merge (install-deps). Commands: list, install, show, status, remove. Full template scripts in the Python file. Practical workflow improvement tool. Loses points for: SKILL.md is brief (2KB); Python script approach adds abstraction over direct .git/hooks — some developers prefer native hooks; _meta.json doesn't match owner pattern.

Development teams wanting automated git workflow enforcement.(1) Install a conventional commit message validator hook; (2) Add a pre-commit linting hook that checks staged files only; (3) Protect main branch from accidental direct pushes.
تمت المراجعة بواسطة claude-code في 14‏/4‏/2026

محتوى SKILL.md

---
name: git-hooks-toolkit
description: Generate, install, and manage Git hooks with pre-built templates. Includes hooks for linting staged files, enforcing conventional commits, blocking debug statements, preventing large file commits, auto-formatting code, requiring ticket references, protecting branches, running tests before push, and auto-installing dependencies after merge. Use when setting up git hooks, enforcing commit conventions, or automating pre-commit/pre-push checks.
---

# Git Hooks Toolkit

Install production-ready Git hooks in seconds with pre-built templates.

## Quick Start

```bash
# List all available templates
python3 scripts/git_hooks.py list

# Install a hook
python3 scripts/git_hooks.py install pre-commit lint-staged
python3 scripts/git_hooks.py install commit-msg conventional

# Preview before installing
python3 scripts/git_hooks.py show pre-commit no-debug

# Check what's installed
python3 scripts/git_hooks.py status

# Remove a hook
python3 scripts/git_hooks.py remove pre-commit
```

## Available Templates

### pre-commit
- **lint-staged** — Run ESLint/Ruff/Flake8 on staged files only
- **no-debug** — Block console.log, debugger, pdb, breakpoint()
- **large-files** — Prevent files over 500KB from being committed
- **format-check** — Auto-run Prettier, Black, gofmt on staged files

### commit-msg
- **conventional** — Enforce Conventional Commits (feat/fix/docs/etc.)
- **ticket-ref** — Require ticket reference (#123, PROJ-456)
- **no-wip** — Block WIP commits on main/master/release branches

### pre-push
- **run-tests** — Auto-detect project type and run test suite
- **branch-protect** — Prevent direct push to main/master

### post-merge
- **install-deps** — Auto-install deps when lockfiles change

## Commands

- `list` — Show all templates
- `install <hook> <template> [--repo path] [--force]` — Install a hook
- `show <hook> <template>` — Preview template content
- `status [--repo path]` — Show installed hooks
- `remove <hook> [--repo path]` — Delete a hook

الترخيص

الترخيص المُعلن: MIT

MIT License

Copyright (c) 2026 openclaw

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

عرض الترخيص في المستودع المصدري — النسخة المنشورة هناك هي المرجع.