.claude/skills/ai-standardize-precommit/SKILL.md
Audit and fix pre-commit hook configuration. Ensures consistent developer-side quality gates for formatting, linting, type checking, and secret protection.
npx skillsauth add svange/tagmania ai-standardize-precommitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit and fix pre-commit hook configuration for this repository: $ARGUMENTS
Validates that pre-commit hooks (Python) or equivalent tooling (Node) are configured correctly with the right scope, flags, and hook set.
/ai-standardize-precommit — Full audit with recommendations/ai-standardize-precommit --validate — Report issues only/ai-standardize-precommit --generate — Generate config from template/ai-standardize-precommit --fix — Auto-fix detected issuesECOSYSTEM="unknown"
[ -f "pyproject.toml" ] && ECOSYSTEM="python"
[ -f "package.json" ] && ECOSYSTEM="node"
HAS_SAM=false
[ -f "template.yaml" ] || [ -f "infrastructure/template.yaml" ] && HAS_SAM=true
Read .pre-commit-config.yaml and check:
| Hook | Source | Purpose |
|------|--------|---------|
| check-yaml | pre-commit-hooks | YAML syntax validation |
| end-of-file-fixer | pre-commit-hooks | Files end with newline |
| trailing-whitespace | pre-commit-hooks | No trailing whitespace |
| forbid-env-commit | local | Block .env files from git |
| ruff-format | local | Code formatting |
| ruff-check | local | Linting with auto-fix |
| mypy | local | Type checking |
| uv-lock-check | local | Lock file matches pyproject.toml |
Flag missing hooks as ERROR.
Ruff format and ruff check must cover BOTH src/ AND tests/:
entry: uv run --no-sync ruff format src/ tests/entry: uv run ruff format src/ (missing tests/)All uv run entries should use --no-sync to avoid slow dependency resolution on every commit. Exception: uv-lock-check uses uv lock --check directly.
If template.yaml exists, check-yaml must exclude SAM templates (CloudFormation intrinsics are not valid YAML):
exclude: '(^templates/.*\.yaml$|.*template\.yaml$)'
If config is missing or --generate, read python-template.pre-commit-config.yaml from ${CLAUDE_SKILL_DIR} and adapt:
HAS_SAM=trueCheck for husky + lint-staged:
[ -d ".husky" ] && echo "husky found"
grep -q '"lint-staged"' package.json 2>/dev/null && echo "lint-staged found"
Verify:
eslint.config.js or .eslintrc.*).prettierrc or equivalent)If no pre-commit quality gates exist: flag as WARNING.
uv run pre-commit run --all-files), not via auto-installed .git/hooks/ (breaks across Windows/WSL)poetry run instead of uv run --no-sync=== Pre-commit Standardization Report ===
Ecosystem: Python | Config: .pre-commit-config.yaml
Action: [Generated | Validated | Fixed]
Required Hooks:
[PASS] check-yaml (with SAM exclusion)
[FAIL] ruff-format: scope missing tests/
[FAIL] uv-lock-check: MISSING
Flags:
[WARN] ruff-format: missing --no-sync flag
Next steps: /ai-standardize-pipeline | /ai-standardize-repo
development
Deploy or validate Renovate dependency update configuration. Detects repo type (library vs IaC), package ecosystem, and generates or fixes renovate.json5.
development
Deploy or validate semantic-release configuration. Handles Python (python-semantic-release) and Node (JS semantic-release) repos with correct Renovate prefix alignment.
testing
Audit and fix CI/CD GitHub Actions workflows. Checks security scanning, coverage enforcement, type checking, CVE ignores, and concurrency settings.
tools
Audit and fix project config files (.editorconfig, .gitignore, pyproject.toml tool sections). Ensures consistent development experience across repos.