Mandatory pre-push gates for all three language stacks with exact commands, common pitfalls, and architecture rules. CLAUDE.md updated with quick-reference section linking to the new files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.5 KiB
Pre-Push Checks (MANDATORY)
Rule
NEVER push to any remote without first running and confirming ALL checks pass for every changed language stack.
This rule exists because CI failures break the deploy pipeline for everyone and waste ~5 minutes per failed build. A 60-second local check prevents that.
Quick Reference by Stack
Python (backend-compliance, ai-compliance-sdk, compliance-tts-service)
cd <service-dir>
ruff check . && mypy . --ignore-missing-imports --no-error-summary && pytest tests/ -x -q --no-header
Blocks on: syntax errors, type errors, failing tests.
Go (ai-compliance-sdk Go path)
cd <service-dir>
gofmt -l . | grep -q . && exit 1; go vet ./... && golangci-lint run --timeout=5m && go test -race ./... && go build ./...
Blocks on: formatting, vet findings, lint violations, test failures, build errors.
TypeScript/Next.js (admin-compliance, developer-portal)
cd <nextjs-app-dir>
npx tsc --noEmit && npm run lint && npm run build
Blocks on: type errors, lint violations, build failures.
npm run buildis mandatory —tscpasses butnext buildfails more often than you'd expect (server/client boundary violations, env var issues, JSX syntax errors).
What Claude Must Do Before Every Push
- Identify which services/apps were changed in this task
- Run the appropriate gate command(s) from the table above
- If any check fails: fix it, re-run, confirm green
- Only then run
git push origin main
No exceptions. A push that skips pre-push checks and breaks CI is worse than a delayed push.
CI vs Local Checks
| Stage | Where | What |
|---|---|---|
| Pre-push (local) | Claude runs | Lint + type check + unit tests + build |
| CI (Gitea Actions) | Automatic on push | Same + integration tests + contract tests |
| Deploy (Coolify) | Automatic after CI | Docker build + health check |
Local checks catch 90% of CI failures in seconds. CI is the safety net, not the first line of defense.
Failures That Were Caused by Skipping Pre-Push Checks
ChatFAB.tsx:const textLanginside fetch object literal — caught bytsc --noEmitandnpm run buildnodemailerwebpack error: server-only import in client component — caught bynpm run buildjoseEdge Runtime error: full package import — caught bynpm run buildmain.py<en>tags spoken: missingimport re— caught bypython -c "import main"
These all caused a broken deploy. Each would have been caught in <60 seconds locally.