setup-precommit-and-ci

Generate aligned pre-commit and CI templates with branch protection.

10|Updated Dec 15, 2014
One-click install
npx skills add https://github.com/baleen37/dotfiles --skill setup-precommit-and-ci
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-precommit-and-ci
Source: https://github.com/baleen37/dotfiles/tree/main/users/shared/.config/claude/skills/setup-precommit-and-ci
Command: npx skills add https://github.com/baleen37/dotfiles --skill setup-precommit-and-ci

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gh, jq, and includes scripts (resource) components.

What problem does it solve?

This Skill helps ensure local pre-commit configurations stay in sync with CI, preventing drift where local checks pass but CI fails.

Core Features & Use Cases

  • Template generation: Create and align pre-commit config and CI workflow templates.
  • Enforced protections: Provide a straightforward path to enable branch protection to require CI success.
  • Consistent workflow: Streamlines setup when adding or updating pre-commit hooks and CI.

Quick Start

Run the setup-precommit-and-ci skill from this directory to generate templates and then apply branch protection. For example, run the branch protection script with: bash scripts/setup-branch-protection.sh --yes --branch main

Frequently Asked Questions about setup-precommit-and-ci

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep pre-commit hooks and CI checks in sync?

Pre-commit hooks run locally before commits; CI runs the same checks on the server. Drift occurs when local checks pass but CI fails. This Skill generates aligned pre-commit and CI configurations from templates, then validates parity through local tests and CI verification to ensure consistency.

Why do my local pre-commit checks pass but CI still fails?

Local pre-commit and CI workflows often diverge over time, causing validation mismatches. This Skill detects your tech stack, generates matching pre-commit and CI templates, and applies them together so both environments enforce identical checks.

Can I automate branch protection to require CI success?

Yes. This Skill provides a straightforward path to enable branch protection rules that require CI to pass before merging. Use the included branch protection script to configure this on your main branch with a single command.

How do I set up pre-commit hooks and CI workflows together?

This Skill generates and applies pre-commit config and GitHub Actions CI templates tailored to your project, then optionally enables branch protection. Run the setup script to create aligned configurations in one workflow.

What dependencies do I need to set up pre-commit and CI?

This Skill requires gh (GitHub CLI) to manage branch protection and jq for JSON processing. Both are used to detect your tech stack, apply configurations, and validate parity between local and CI environments.

Does this work with GitHub repositories?

Yes. This Skill integrates with GitHub Actions for CI workflows and uses the GitHub CLI to configure branch protection rules on your repository.