pre-commit-check

Validates Go and frontend code with formatting, linting, tests, and builds before git commits.

1.6k|221|Updated Oct 28, 2025
One-click install
npx skills add https://github.com/ZeroDeng01/sublinkPro --skill pre-commit-check-zerodeng01
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-commit-check
Source: https://github.com/ZeroDeng01/sublinkPro/tree/main/.agents/skills/pre-commit-check
Command: npx skills add https://github.com/ZeroDeng01/sublinkPro --skill pre-commit-check-zerodeng01

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents broken code from entering the repository by enforcing a mandatory validation sequence before any git add, commit, or pull request, catching formatting, lint, test, and build failures locally instead of in CI. ## Core Features & Use Cases - Backend Validation: Runs gofmt, golangci-lint, and go test on changed Go files, blocking commits until all checks pass. - Frontend Validation: Executes ESLint and conditional Vite builds for changes under webs/, with auto-fix attempts via lint:fix and prettier. - Cross-Layer and Documentation Sync: Verifies that API changes are reflected in frontend clients and that bilingual documentation stays updated. - Use Case: Before committing a change that touches both a Go API handler and its React frontend consumer, run this skill to confirm formatting, linting, tests, build, staging hygiene, and a prepared semantic commit message. ## Quick Start Run the pre-commit validation on my current changes and report whether the working tree is ready to commit.

Frequently Asked Questions about pre-commit-check

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

FAQPage Schema
How do I validate Go code before committing?

Run gofmt to check formatting, golangci-lint for static analysis, and go test ./... to execute the test suite. All three must pass with zero errors before staging and committing your changes.

How do I run lint and build checks on a Vite React frontend?

Run yarn run lint inside the frontend directory, using yarn run lint:fix and prettier for auto-fixable issues. Run yarn run build when changes affect routing, assets, or build configuration.

What files should never be staged in a git commit?

Never stage .env files, credential files, database directories, logs, cache, build output, or AI agent temporary files like summary and report artifacts. Use git reset HEAD to unstage unintended files before committing.

Can pre-commit validation be skipped for small changes?

No, even small changes can break tests, introduce lint errors, or fail builds. Running the applicable validation locally catches issues faster than waiting for CI to reject the commit.

Why does a commit get blocked when documentation is out of sync?

User-facing changes require updated documentation in both language versions to keep the project consistent. The validation checks that API, configuration, and deployment docs match the code changes before allowing the commit.