Pre Commit
Run all required checks before committing code changes.
Claude CodeGeneric
# Pre-Commit Check Command
Run all required checks before committing code changes.
## Usage
Use this command before making any commit to ensure all CI checks will pass.
## Steps
1. **Run Lint Check**
```bash
npm run lint
- Fix any ESLint errors before proceeding
- Use
npm run lint -- --fixfor auto-fixable issues
Run TypeScript Check
npm run typecheck- Fix any type errors before proceeding
Run Unit Tests
npm run test:run- Ensure all tests pass
- If tests fail, fix the code or update tests as appropriate
Run Build
npm run build- Ensure the production build succeeds
Quick Check
Run all checks in sequence:
npm run lint && npm run typecheck && npm run test:run && npm run build
If Checks Fail
- Do not commit until all checks pass
- Fix the issues identified by each check
- Re-run the failing check to verify the fix
- Then proceed with the commit
Required Checks Summary
| Check | Command | Must Pass |
|---|---|---|
| Lint | npm run lint |
Yes |
| TypeCheck | npm run typecheck |
Yes |
| Unit Tests | npm run test:run |
Yes |
| Build | npm run build |
Yes |
| ``` |
Maintain Pre Commit?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Pre Commit on getagentictools](https://getagentictools.com/loops/kevinreber-pre-commit-check-command?ref=badge)