osprey-pre-commit
在提交之前验证代码。运行 linting、格式化和测试以尽早发现问题。在准备提交、推送之前或用户要求运行检查、验证或验证其更改时使用。
📖 中文导读:在提交之前验证代码。运行 linting、格式化和测试以尽早发现问题。在准备提交、推送之前或用户要求运行检查、验证或验证其更改时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: osprey-pre-commit description: > Validates code before committing. Runs linting, formatting, and tests to catch issues early. Use when ready to commit, before pushing, or when the user asks to run checks, validate, or verify their changes. allowed-tools: Read, Glob, Grep, Bash, Edit
Pre-Commit Validation
This skill helps you validate your code changes before committing.
Instructions
Follow the validation workflow in instructions.md.
Quick Command Reference
Quick Check (Before Commits)
# Auto-fix code style
ruff check src/ tests/ --fix --quiet || true
ruff format src/ tests/ --quiet
# Run fast tests
pytest tests/ --ignore=tests/e2e -x --tb=line -q
Or use the script:
./scripts/quick_check.sh
Full CI Check (Before Pushing)
./scripts/ci_check.sh
Workflow
- Auto-fix formatting and simple lint issues
- Run tests to catch regressions
- Fix failures if any tests fail
- Re-run until all checks pass
- Commit with confidence
When to Use Each Check
| Situation | Command |
|---|---|
| Ready to commit | ./scripts/quick_check.sh |
| Ready to push | ./scripts/ci_check.sh |
| Creating PR | ./scripts/premerge_check.sh main |