src/osprey/templates/skills/osprey-pre-commit/SKILL.md
Validates code before committing using OSPREY's three-tier check scripts. Runs linting, formatting, and tests to catch issues early. Use when ready to commit, before pushing, before opening a PR, or when the user asks to run checks, validate, or verify their changes. For the full contribution journey (branching, commits, push, PR, merge), use `osprey-contribute` instead — this skill is the focused validation step.
npx skillsauth add als-apg/osprey osprey-pre-commitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill runs OSPREY's three-tier check scripts at the right moment in the
journey. It is a focused validation tool — not a full contribution workflow.
For the end-to-end journey (branching, committing, pushing, opening a PR,
merging) use the osprey-contribute skill, which invokes these checks at
each gate.
| Tier | Script | Time | Use Before |
| --- | --- | --- | --- |
| Quick | ./scripts/quick_check.sh | ~30 s | every commit |
| Full | ./scripts/ci_check.sh | ~2-3 min | every push |
| Pre-merge | ./scripts/premerge_check.sh main | ~1-2 min | every PR |
Each tier expands the surface area of what is verified. Running them in order saves time: catch the cheap things cheaply, escalate only when the cheap checks pass.
Runs formatting auto-fix and the fast unit tests. Catches most accidents
that would clutter git log.
./scripts/quick_check.sh
If you want to do this manually:
ruff check src/ tests/ --fix --quiet
ruff format src/ tests/ --quiet
pytest tests/ --ignore=tests/e2e -x --tb=line -q
Replicates the GitHub Actions CI matrix locally, including type checking and the full unit-test suite. Pushing only what would have passed CI respects shared CI minutes and keeps PR dashboards clean.
./scripts/ci_check.sh
Compares the branch against the PR target (main), catches drift that
surfaces only at merge time, and runs the full check suite once more
against the rebased state.
./scripts/premerge_check.sh main
Read the output, fix the smallest thing that would make it pass, and re-run the same script. Don't escalate to a higher tier until the lower tier is green — escalating early just hides the cheaper failure under a slower one.
If the failure is in ruff, the auto-fix flag (--fix) usually resolves it.
If the failure is in tests, the most useful next step is to run that single
test verbosely:
pytest tests/path/to/test_file.py::test_function_name -v
osprey-contribute — the full journey. Calls these checks at each
gate (commit, push, PR). If you find yourself running these checks while
also juggling branching, committing, and PR creation, switch to
osprey-contribute instead.commit-organize — when a working tree spans unrelated concerns,
split it into atomic commits before running the checks.osprey-release — release-cutting flow that includes a clean-venv
pre-release test pass on top of these tiers.data-ai
List, inspect, and switch the simulated machine scenarios that drive the mock control system and mock archiver. Use when the user asks which scenarios are available, which scenario is active, or wants to switch the simulated machine into a different state (e.g. a fault demo or back to nominal).
development
Interactive interview to create a custom OSPREY build profile for a new accelerator, detector, or beamline application. Use when someone says "interview me", "create a build profile", "set up my agent", "configure my detector", "onboard me", or needs to create an OSPREY project tailored to their specific control system. Also handles migration from existing OSPREY projects (including LangGraph-era projects) — trigger on "migrate my project", "I have an existing project", "upgrade from old OSPREY", "upgrade from langgraph", "legacy migration", "bring my project forward", "convert my project", "extract profile from existing project", "reverse-engineer build profile". Also use for /osprey-build-interview feedback to collect post-use feedback. Also trigger when onboarding a new colleague or when anyone needs help figuring out what their OSPREY agent should look like.
testing
Guides a maintainer through cutting an OSPREY release on the GitHub Flow workflow: open a version-bump PR, merge it to main, tag the merge commit, push the tag, verify the automated PyPI publish. Use when someone says "create a release", "bump the version", "cut v2026.X.Y", "publish to PyPI", "tag a release", or asks about the release process. Composes with `osprey-contribute` for the bump PR. Versions follow CalVer (vYYYY.M.P) and the source of truth is `src/osprey/__init__.py` — Hatch derives the pyproject.toml version dynamically.
development
Guides a contributor through the OSPREY GitHub Flow contribution journey from a working-tree change to a merged PR on main. Use when someone says "I want to contribute X to osprey", "help me commit/push this", "prep this branch for a PR", "open a PR", "my CI is failing on this branch", "rebase onto main", or wants help following the contributing workflow. Auto-detects whether they have push access to als-apg/osprey or are contributing from a fork. Composes with the osprey-pre-commit, commit-organize, and osprey-release skills — invoke this whenever someone is contributing code to OSPREY, even if they haven't named the workflow explicitly.