enforce-precommit

Install and maintain pre-commit framework configs aligned with Octopus guardrails.

4|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/leocosta/octopus --skill enforce-precommit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: enforce-precommit
Source: https://github.com/leocosta/octopus/tree/main/skills/enforce-precommit
Command: npx skills add https://github.com/leocosta/octopus --skill enforce-precommit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Install and maintain a pre-commit framework config (.pre-commit-config.yaml by default, or lefthook/husky) aligned with the project's Octopus rules — the git-level enforcement loop hooks can't cover for Copilot or direct human commits. Detects the stack, infers checks from rules/common, merges idempotently by hook id. Guardrails bundle.

Core Features & Use Cases

  • Detects active stacks and maps them to appropriate hooks (formatting, linting, and policy checks) to ensure consistency across repositories.
  • Merges new guardrails configurations with existing user configs without overwriting customized rules, preserving user intent.
  • Provides drift detection and guidance to reconcile differences between declared rules and actual hooks in the repository.

Quick Start

Install and configure the pre-commit framework in your repository to enforce project-wide guardrails.

Frequently Asked Questions about enforce-precommit

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

FAQPage Schema
How do I enforce pre-commit hooks without overwriting my existing configuration?

To enforce pre-commit hooks safely, this skill merges new guardrails configurations into existing files like .pre-commit-config.yaml idempotently by hook id, preserving your customized rules without overwriting user intent.

Can I use lefthook or husky instead of .pre-commit-config.yaml for git hooks?

Yes, lefthook and husky are supported. The skill installs and maintains a standard guardrails configuration across lefthook.yml, .husky, or .pre-commit-config.yaml based on your project's active framework.

How does stack detection work when setting up pre-commit guardrails?

Stack detection identifies your project's active stacks and automatically maps them to appropriate pre-commit checks, including formatting, linting, and policy rules, to ensure repository consistency.

What is the best way to handle configuration drift between declared rules and active git hooks?

Handling configuration drift involves detecting differences between declared guardrails rules and actual hooks in your repository, then providing guidance to reconcile and document any local overrides.

Why do I need pre-commit guardrails if I already use Copilot for code generation?

Pre-commit guardrails are needed because they enforce project-wide rules at the git level, catching policy violations from Copilot suggestions or direct human commits that standard generation loops cannot cover.