About pre-commit-manager
This skill installs and manages pre-commit hooks in a repository for development teams standardizing checks before commits. It can generate configuration from language templates and remember auto-install preferences.
Key features
- 01Install and check pre-commit hooks
- 02Generate config from Python, JavaScript, TypeScript, or generic templates
- 03Set auto-install preferences
- 04Check repository, config, and installation status
- 05Generate a detect-secrets baseline
Use cases
- 01Set up pre-commit checks in a new repository
- 02Install hooks in an existing project
- 03Check whether hooks and configuration are ready
- 04Create a baseline for detect-secrets
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ rysweet/ amplihack --skill pre-commit-managerAfter installing, type/pre-commit-managerin Claude Code to confirm it loaded.
Bundled filesREADME.mdprecommit_manager.py
Details
From the project READMEPre-Commit Manager Skill
Manage pre-commit hooks with preference memory and template-based configuration.
Operations
1. Install
Install pre-commit hooks in current repository.
Usage:
Install pre-commit hooks now
What it does:
- Checks if
.pre-commit-config.yamlexists - Verifies pre-commit binary is available
- Runs
pre-commit install - Reports success/failure
2. Configure
Generate .pre-commit-config.yaml from templates.
Usage:
Configure pre-commit with python template
Configure pre-commit with javascript template
Configure pre-commit with generic template
Templates:
python- Python projects (black, ruff, mypy)javascript- JS/TS projects (prettier, eslint)typescript- TypeScript projectsgeneric- Language-agnostic (trailing whitespace, file size, detect-secrets)
3. Enable
Set preference to "always" auto-install.
Usage:
Enable pre-commit auto-install
4. Disable
Set preference to "never" auto-install.
Usage:
Disable pre-commit auto-install
5. Status
Show current pre-commit status.
Usage:
Show pre-commit status
Check pre-commit status
Shows:
- Git repository status
- Config file existence
- Hooks installation status
- Current preference setting
- Pre-commit binary availability
6. Baseline
Generate .secrets.baseline for detect-secrets.
Usage:
Generate secrets baseline
Create detect-secrets baseline
Implementation
This skill interfaces with:
.claude/tools/amplihack/hooks/precommit_prefs.py- Preference management.claude/tools/amplihack/hooks/precommit_installer.py- Hook installation- Templates in
templates/directory
Security
- Path traversal prevention
- Template whitelist validation
- No
shell=Truein subprocess calls - Subprocess timeouts enforced