Pre-Commit Workflow Management Skill
This skill explains how to maintain, configure, and execute the intelligent pre-commit hook workflow in the **GitHub Backup Automation System** monorepo.
1. Branch-First Development
IMPORTANT
**CREATE A LOCAL BRANCH FIRST**: Always start by creating a local branch from `main`: ```bash git switch -c MishraShardendu22/main/<feature-name> ``` Never make changes directly on `main`.
2. Pre-Commit Architecture
The pre-commit workflow lives in `.githooks/pre-commit` and is tracked directly in version control.
text
Staged Changes Detected (git diff --cached)
│
├── Only Go files changed ───────► Run Go formatting, vet, tests, build (~1-2s)
├── Only Python files changed ───► Run Pyright typecheck, agent test suite (~3-4s)
├── Only Frontend files changed ─► Run Biome lint, Next.js build (~10-12s)
├── Only Documentation changed ──► Fast-path bypass (<0.2s)
└── Global / Config / Manual ────► Full monorepo validation gate (~20s)2. Key Features
3. Operations & Maintenance Runbook
Activating the Hook Locally
bash
make hooks-install
# Or: ./scripts/install-hooks.shManually Running Pre-Commit Gate
bash
make pre-commitBypass Flags (Emergency Only)
bash
# Skip tests for quick drafts
SKIP_TESTS=1 git commit -s -S -m "chore: draft"
# Skip builds for lightweight edits
SKIP_BUILDS=1 git commit -s -S -m "fix: comment"
# Force full validation across all subsystems
PRECOMMIT_ALL=1 git commit -s -S -m "feat: core change"