pre-commit
Pre-Commit Check
You are DeepRead's pre-commit gatekeeper. Run all quality checks in sequence and give a clear go/no-go verdict.
Steps
Run these in order. Stop early if Step 1 finds BLOCK-level violations that need fixing first.
Step 1: Code Standards (enforce)
Check all changed .py files against mandatory patterns:
-
Find changed files:
git diff --name-only HEAD && git diff --cached --name-onlyIf clean, compare to main:
git diff main --name-only -
On each changed
.pyfile, check:- No relative imports (search for
from \.) - All functions have return type annotations (
->) - No bare
except:without exception type logger = logging.getLogger(__name__)insrc/files- No
print()insrc/files - All imports at top of file
- No relative imports (search for
-
Fix any violations found using the Edit tool.
Step 2: Formatting & Linting
make quick-check
If it fails, fix the issues and re-run.
Step 3: Documentation Sync (doc-sync)
Check if changed code has corresponding docs that are now stale:
| Code Change | Doc to Check |
|---|---|
src/pipelines/nodes/ |
docs/architecture/pipelines.md |
src/pipelines/graphs/ |
docs/architecture/process-flow.md |
src/api/ |
docs/api/reference.md |
src/core/models.py |
docs/development/migrations.md |
src/services/ |
AGENTS.md |
.github/workflows/ |
docs/development/ci-cd.md |
Makefile |
AGENTS.md, CLAUDE.md |
Read each affected doc and flag sections that no longer match the code. Fix straightforward updates directly. Report anything that needs human judgment.
Step 4: Cross-Repo Impact (sync-repos)
Only if changed files include:
src/api/models.py→ portal needs type regenerationsrc/api/v1/routes.pyorsrc/api/dashboard/→ portal + gtmsrc/services/auth.py→ portal + previewsrc/core/models.py→ check migration exists
Skip this step if none of those files changed.
Step 5: Verdict
Summarize everything in this format:
## Pre-Commit Report
### Code Standards
✅ Passed / ❌ X violations found (fixed/needs attention)
### Formatting & Linting (make quick-check)
✅ Passed / ❌ Failed
### Documentation
✅ All docs current / ⚠️ X docs updated / ❌ X docs need manual review
### Cross-Repo Impact
✅ No impact / ⚠️ Action needed:
- [ ] portal: run `npm run generate:types`
- [ ] gtm: update API docs
---
**VERDICT: ✅ GOOD TO COMMIT / ❌ FIX REQUIRED**
More from deepread-tech/skills
api
Full DeepRead API reference. All endpoints, auth, request/response formats, blueprints, webhooks, error handling, and code examples.
9setup
Get started with DeepRead. Automatically obtains an API key via device authorization flow, then walks through first request, structured extraction, and blueprints.
8doc-sync
Detects when code changes have made documentation outdated and flags or updates the affected docs. Use after implementing features, changing APIs, or modifying architecture.
2enforce
Validates code changes against DeepRead's mandatory patterns and standards defined in AGENTS.md. Use this after writing or modifying code to catch violations before committing.
2prepare
Session opener. Analyzes a task description and creates a scoped plan with a checklist, affected files, and which skills to run. Use at the start of every coding session before writing any code.
2migrate
Helps create and manage Supabase database migrations. Use when adding or modifying database tables, columns, or constraints.
2