Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/AMDResearch/ai4science-studioWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/amdresearch/ai4science-studio/preflight-scripts)<a href="https://agentmods.dev/rules/amdresearch/ai4science-studio/preflight-scripts"><img src="https://agentmods.dev/badge/rules/amdresearch/ai4science-studio/preflight-scripts/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/amdresearch/ai4science-studio/preflight-scripts"><img src="https://agentmods.dev/badge/rules/amdresearch/ai4science-studio/preflight-scripts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00428 |
| Opus 5.5 | $0.00000 | $0.00171 |
| Sonnet 5.5 | $0.00000 | $0.00086 |
| Haiku 4.5 | $0.00000 | $0.00043 |
Grade A, and why
preflight-scripts scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Preflight script conventions
When creating or editing preflight_<slug>.py under any model's examples/ directory:
Required pattern
Use the standard check() helper with colored PASS/FAIL output:
PASS = "\033[32mPASS\033[0m"
FAIL = "\033[31mFAIL\033[0m"
errors = 0
def check(label, fn):
global errors
try:
result = fn()
print(f"[{PASS}] {label}" + (f": {result}" if result else ""))
except Exception as exc:
print(f"[{FAIL}] {label}: {exc}")
errors += 1
Required checks (in order)
import torch— Report version- GPU accessible —
torch.cuda.is_available()must be True; report device name - GPU tensor ops — Create a tensor on GPU, do a matmul, report result
- Model-specific imports — Import the key packages the model needs
- Optional deps — Use try/except and report "not installed (optional)" rather than failing
--dry-run (required)
CPU CI and make check invoke python preflight_<slug>.py --dry-run. That flag must exit 0 without importing torch or touching a GPU. Use it to confirm the script is present and parseable; full GPU checks remain the default (no flag).
if "--dry-run" in sys.argv:
print("dry-run: skipping GPU and import checks")
raise SystemExit(0)
Exit code
Exit with code 1 if any required check failed; 0 if all passed. Print a summary line at the end.
Naming
File: preflight_<slug>.py where <slug> matches the model folder name (lowercase, hyphens to underscores).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · +10 lines 05f151bee9d0
- 1mo ago First seen · 45 lines · 0 tokens per session scan A d65524c70144
preflight-scripts is a cursor rule published in the GitHub repository AMDResearch/ai4science-studio (4 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 428 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
python_tests
We use the unit tests to cover internal behavior that can work without the web / backend counterpart. We aim for 95%+ unit test coverage of our Python code in lib/streamlit.
hypothesis
Definitive guidelines for writing robust, maintainable, and performant property-based tests using Hypothesis with Python and pytest.
mypy
This guide provides definitive, actionable best practices for using mypy to ensure robust static type checking in Python projects, focusing on modern patterns and common pitfalls.
python-general-coding-standards
A set of general standards for Python projects, including type hints, input checking, code style, security, web requests, background work, and tests. It also covers FastAPI-specific tasks such as CORS and authentication.
style
Cursor rule "style" from Ayanami1314/swe-pruner, covering style guide, bad, good, test style and bad.
hatch3r-python-patterns
Python 3.12+ conventions covering uv project management, Ruff lint+format, mypy strict typing, pytest parametrize, and the FastAPI/Django request-path + ORM N+1 floor.