Git Hooks Manager

v1.0.0

Manage Git hooks with easy installation, configuration, and sharing, supporting lint, test, commit message, and branch name validations.

0· 76·0 current·0 all-time
byLv Lancer@kaiyuelv

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for kaiyuelv/git-hooks-manager.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Git Hooks Manager" (kaiyuelv/git-hooks-manager) from ClawHub.
Skill page: https://clawhub.ai/kaiyuelv/git-hooks-manager
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install git-hooks-manager

ClawHub CLI

Package manager switcher

npx clawhub@latest install git-hooks-manager
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the included Python implementation, examples, and tests. The code modifies .git/hooks, installs templates (lint/test/branch/commit checks), exports/imports hook JSON—these align with the stated purpose.
Instruction Scope
SKILL.md and the script instruct only repository-local operations: installing hooks, validating messages/branches, exporting/importing hook configs, and running local tooling (flake8, pytest, bandit). There are no instructions to read unrelated system files, transmit data to external endpoints, or access secrets.
Install Mechanism
No install spec or remote downloads are present; this is an instruction-and-source bundle that runs from local Python files. No archives or external URLs are fetched during install.
Credentials
The skill does not declare required environment variables or credentials. SKILL.md lists optional example env vars (HOOKS_MANAGER_STRICT, HOOKS_MANAGER_SKIP_LINT) but they are not required. No unrelated credentials or config paths are requested.
Persistence & Privilege
The skill does not request always:true or system-wide privileges. Its persistence is limited to writing hook scripts inside the repository's .git/hooks directory and reading/writing local JSON config files, which is expected for a hooks manager.
Assessment
This package appears to be what it says: a repo-local Git hooks manager. Before installing or running hooks, review the hook templates and any imported config because hooks are shell scripts that will execute local commands (e.g., flake8, pytest, bandit). Those commands can run arbitrary code in your repo, so ensure you trust the templates/configs and have the expected dev tools installed. Note minor inconsistencies (SKILL.md lists a homepage URL that is not present in registry metadata, and requirements.txt lists click/colorama though the core script uses argparse); these are bookkeeping issues, not security problems. If you plan to use import/export from untrusted sources, vet the JSON contents first because imported hook scripts will be written and made executable in .git/hooks.

Like a lobster shell, security has layers — review code before you run it.

automationvk97cme0sakqhqw80cdnkx5rftx85d0bpdevopsvk97cme0sakqhqw80cdnkx5rftx85d0bpgitvk97cme0sakqhqw80cdnkx5rftx85d0bphooksvk97cme0sakqhqw80cdnkx5rftx85d0bplatestvk97cme0sakqhqw80cdnkx5rftx85d0bplintvk97cme0sakqhqw80cdnkx5rftx85d0bppre-commitvk97cme0sakqhqw80cdnkx5rftx85d0bp
76downloads
0stars
1versions
Updated 5d ago
v1.0.0
MIT-0

git-hooks-manager - Git Hooks管理器

Metadata

FieldValue
Namegit-hooks-manager
Sluggit-hooks-manager
Version1.0.0
Homepagehttps://github.com/openclaw/git-hooks-manager
Categorydevelopment
Tagsgit, hooks, pre-commit, pre-push, lint, test, automation, devops

Description

English

A Git hooks manager that simplifies installing, configuring, and sharing Git hooks across teams. Includes pre-built templates for linting, testing, branch naming validation, commit message validation, and custom hook orchestration.

中文

Git Hooks管理器,简化团队间Git钩子的安装、配置和共享。包含预置模板:代码检查、测试运行、分支名验证、提交信息验证和自定义钩子编排。

Requirements

  • Python 3.8+
  • Git >= 2.30
  • click >= 8.0.0
  • colorama >= 0.4.6

Configuration

Environment Variables

HOOKS_MANAGER_STRICT=true
HOOKS_MANAGER_SKIP_LINT=false

Usage

Install Hooks

# Install all recommended hooks
python scripts/hooks_manager.py install --all

# Install specific hook
python scripts/hooks_manager.py install pre-commit

# Install from template
python scripts/hooks_manager.py install pre-commit --template lint-and-test

Create Custom Hook

from git_hooks_manager import HookManager

manager = HookManager()

# Define a custom pre-commit hook
@manager.hook("pre-commit")
def my_pre_commit():
    # Run custom checks
    result = manager.run_command("pytest", ["tests/smoke/"])
    if result.returncode != 0:
        print("Smoke tests failed!")
        return False
    return True

manager.install()

Validate Commit Messages

python scripts/hooks_manager.py validate-message "feat: add user login"

API Reference

HookManager

  • install(hook_name, template=None) - Install a hook
  • uninstall(hook_name) - Remove a hook
  • list_hooks() - List installed hooks
  • validate_commit_message(msg) - Validate conventional commits format
  • validate_branch_name(name) - Validate branch naming convention
  • run_command(cmd, args) - Run a shell command and return result

Built-in Templates

  • lint-and-test - Run linters and unit tests
  • conventional-commits - Validate commit messages
  • branch-guard - Enforce branch naming rules
  • security-scan - Run basic security checks
  • ci-simulation - Simulate CI pipeline locally

Examples

See examples/ directory for complete examples.

Testing

cd /root/.openclaw/workspace/skills/git-hooks-manager
python -m pytest tests/ -v

License

MIT License

Comments

Loading comments...