pre-commit
npx skills add https://github.com/deepread-tech/skills --skill pre-commit
Agent 安装分布
Skill 文档
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**