
Precommit Setup
Mirror local pre-commit hooks in GitHub Actions or GitLab CI so PRs fail on the same checks developers run before push.
Install
npx skills add https://github.com/athola/claude-night-market --skill precommit-setupWhat is this skill?
- GitHub Actions workflow pattern calling the same comprehensive check script as pre-commit
- Documents drift between local hooks and CI as the root cause of “works on my machine” PRs
- Complete Python monorepo example wiring pre-commit-hooks, Ruff fix/format, and uv sync
- Codecov upload step for coverage.xml after unified quality script
- Child module (ci-integration) loads when configuring CI to match pre-commit
Adoption & trust: 1 installs on skills.sh; 304 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Azure Kubernetesmicrosoft/azure-skills
Github Actions Docsxixu-me/skills
Deploy To Vercelvercel-labs/agent-skills
Vercel Cli With Tokensvercel-labs/agent-skills
Turborepovercel/turborepo
Docker Expertsickn33/antigravity-awesome-skills
Journey fit
Common Questions / FAQ
Is Precommit Setup safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Precommit Setup
# CI Integration Verify CI runs the same thorough checks that pre-commit runs locally. Drift between local hooks and CI is the most common cause of "works on my machine" PRs. ## GitHub Actions \`\`\`yaml # .github/workflows/quality.yml name: Code Quality on: [push, pull_request] jobs: quality: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install uv run: pip install uv - name: Install dependencies run: uv sync - name: Run Comprehensive Quality Checks run: ./scripts/check-all-quality.sh - name: Upload Coverage uses: codecov/codecov-action@v4 with: files: ./coverage.xml \`\`\` ## Complete Example: Python Monorepo \`\`\`yaml # .pre-commit-config.yaml repos: # Layer 1: Fast Global Checks - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-toml - id: check-json - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.2 hooks: - id: ruff args: [--fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.13.0 hooks: - id: mypy args: [--ignore-missing-imports] - repo: https://github.com/PyCQA/bandit rev: 1.8.3 hooks: - id: bandit args: [-c, pyproject.toml] # Layer 2: Component-Specific Checks - repo: local hooks: - id: run-component-lint name: Lint Changed Components entry: ./scripts/run-component-lint.sh language: system pass_filenames: false files: ^plugins/.*\\.py\$ - id: run-component-typecheck name: Type Check Changed Components entry: ./scripts/run-component-typecheck.sh language: system pass_filenames: false files: ^plugins/.*\\.py\$ - id: run-component-tests name: Test Changed Components entry: ./scripts/run-component-tests.sh language: system pass_filenames: false files: ^plugins/.*\\.(py|md)\$ # Layer 3: Validation Hooks - repo: local hooks: - id: validate-plugin-structure name: Validate Plugin Structure entry: python3 scripts/validate_plugins.py language: system pass_filenames: false files: ^plugins/.*\$ \`\`\` --- name: component-level-hooks description: Layer 2 per-component pre-commit checks for monorepos and plugin architectures. parent: precommit-setup load_when: project has multiple components or plugins --- # Component-Specific Checks (Layer 2) For monorepos, plugin architectures, or projects with multiple components, add per-component quality checks. Each script detects changed components from staged files and runs lint / typecheck / test only against the affected components. ## Python Monorepo or Plugin Architecture Create three quality-check scripts under `scripts/`. All three share the same change-detection pattern. ### 1. Lint Changed Components (`scripts/run-component-lint.sh`) \`\`\`bash #!/bin/bash # Lint only changed components based on staged files set -euo pipefail # Detect changed components from staged files CHANGED_COMPONENTS=\$(git diff --cached --name-only | grep -E '^(plugins|components)/' | cut -d/ -f2 | sort -u) || true if [ -z "\$CHANGED_COMPONENTS" ]; then echo "No components changed" exit 0 fi echo "Linting changed components: \$CHANGED_COMPONENTS" FAILED=() for component in \$CHANGED_COMPONENTS; do if [ -d "plugins/\$component" ]; then echo "Linting \$component..."