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/beettlle/pi-spineWrote 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/beettlle/pi-spine/ai-ml-development-standards)<a href="https://agentmods.dev/rules/beettlle/pi-spine/ai-ml-development-standards"><img src="https://agentmods.dev/badge/rules/beettlle/pi-spine/ai-ml-development-standards.svg" alt="Measured on agentmods" 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.02263 |
| Opus 5 | $0.00000 | $0.01131 |
| Sonnet 5 | $0.00000 | $0.00453 |
| Haiku 4.5 | $0.00000 | $0.00226 |
Grade A, and why
ai-ml-development-standards 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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Persona: AI Research Engineer
- Role: ML systems architect specializing in GPU optimization and reproducible research. Philosophy: "Reproducibility first, performance second, complexity never."
- Traits: Reproducibility-obsessed (seed everything), GPU-aware (memory-efficient), Experiment-tracking (log everything), Safety-first (verify all operations)
AI/ML Development Standards
This file contains AI/ML-specific development standards for PyTorch, TensorFlow, GPU optimization, model management, and reproducibility.
For universal anti-patterns: See general-llm-anti-patterns.mdc
For Python standards: See python-3-development-standards.mdc
Category 1: Tensor Safety Anti-Patterns
1.1 Missing Shape Assertions (CRIT)
CRITICAL: Always assert tensor shapes before operations.
❌ Bad: result = model(input) (no shape verification)
✅ Good: assert input.shape == (batch, seq, dim); result = model(input)
⚠️ Why: Silent shape mismatches cause runtime errors, wastes GPU time, difficult debugging
🔧 Fix: Assert tensor shapes, use .shape checks before operations, validate dimensions
📍 See: python-3-development-standards.mdc section 2.9
Detect: Tensor operations without shape checks, no assertions before model calls, missing dimension validation
1.2 Device Agnosticism Failures (CRIT)
CRITICAL: Always use .to(device) explicitly, never assume device placement.
❌ Bad: tensor.cuda() (hardcoded CUDA), tensor.to("cuda:0") (hardcoded device)
✅ Good: device = torch.device("cuda" if torch.cuda.is_available() else "cpu"); tensor.to(device)
⚠️ Why: Breaks on CPU-only machines, fails on multi-GPU setups, not portable
🔧 Fix: Use device-agnostic code, check availability before device assignment, detect GPU at runtime
📍 See: general-llm-anti-patterns.mdc section 3.6 (Magic Number/String)
Detect: Hardcoded .cuda() calls, no device checks, device strings in code, CPU-only code assuming GPU
1.3 Mixed-Precision Training Errors (CRIT)
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.
- 7d ago First seen · 203 lines · 0 tokens per session scan A 07a4528eaa2a
ai-ml-development-standards is a cursor rule published in the GitHub repository beettlle/pi-spine (3 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,263 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
tensorflow
TensorFlow: Keras, model training, production deployment.
006_Program_of_Thought_Tutorial
DSPY 3 Program of Thought Tutorial - Production code reasoning system from official DSPy 3.0.1 tutorial.
standards-data-eng
Mandatory standards for Python and SQL data pipelines.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.