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/juandoroteoflesiauni-lang/Market-options-stocks-ScannerWrote 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/juandoroteoflesiauni-lang/market-options-stocks-scanner/080-python-backend)<a href="https://agentmods.dev/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/080-python-backend"><img src="https://agentmods.dev/badge/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/080-python-backend/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/juandoroteoflesiauni-lang/market-options-stocks-scanner/080-python-backend"><img src="https://agentmods.dev/badge/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/080-python-backend.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.02089 |
| Opus 5 | $0.00000 | $0.01045 |
| Sonnet 5 | $0.00000 | $0.00418 |
| Haiku 4.5 | $0.00000 | $0.00209 |
Grade A, and why
080-python-backend 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 9d 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 — 311 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🐍 PYTHON/FASTAPI — TRADING TERMINAL BACKEND
CONFIGURACIÓN DEL PROYECTO PYTHON
Estructura de dependencias:
requirements.txt ← Producción
requirements-dev.txt ← Solo desarrollo
# requirements.txt
fastapi==0.111.0
uvicorn[standard]==0.29.0
sqlalchemy[asyncio]==2.0.29
asyncpg==0.29.0
alembic==1.13.1
pydantic==2.7.1
pydantic-settings==2.2.1
python-jose[cryptography]==3.3.0
passlib[bcrypt]==1.7.4
redis[asyncio]==5.0.4
httpx==0.27.0
structlog==24.1.0
python-binance==1.0.19
slowapi==0.1.9
# requirements-dev.txt
pytest==8.1.1
pytest-asyncio==0.23.6
pytest-cov==5.0.0
black==24.4.2
ruff==0.4.2
mypy==1.10.0
⚙️ CONFIGURACIÓN (Settings Pattern)
# core/config.py — PATRÓN OBLIGATORIO
from pydantic_settings import BaseSettings
from pydantic import validator
from typing import Optional
class Settings(BaseSettings):
"""
Todas las configuraciones vienen de variables de entorno.
Nunca valores hardcodeados aquí.
"""
# Base de datos
DATABASE_URL: str
REDIS_URL: str = "redis://localhost:6379/0"
# Seguridad
SECRET_KEY: str
JWT_ALGORITHM: str = "HS256"
JWT_EXPIRE_MINUTES: int = 60
# APIs de Trading
BINANCE_API_KEY: Optional[str] = None
BINANCE_API_SECRET: Optional[str] = None
MT5_LOGIN: Optional[str] = None
MT5_PASSWORD: Optional[str] = None
MT5_SERVER: Optional[str] = None
# App
ENVIRONMENT: str = "development"
DEBUG: bool = False
ALLOWED_ORIGINS: str = "http://localhost:5173"
@validator('SECRET_KEY')
def secret_key_must_be_strong(cls, v):
if len(v) < 32:
raise ValueError('SECRET_KEY debe tener al menos 32 caracteres')
return v
class Config:
env_file = ".env"
case_sensitive = True
settings = Settings() # Singleton — importar este objeto
🗄️ MODELOS DE BASE DE DATOS
# models/order.py — SQLAlchemy async
from sqlalchemy import Column, String, Numeric, Enum, DateTime, ForeignKey
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from datetime import datetime
import uuid
import enum
from core.database import Base
class OrderStatus(str, enum.Enum):
PENDING = "pending"
OPEN = "open"
FILLED = "filled"
CANCELLED = "cancelled"
REJECTED = "rejected"
class Order(Base):
__tablename__ = "orders"
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
user_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=False)
symbol = Column(String(20), nullable=False, index=True)
side = Column(String(4), nullable=False) # BUY / SELL
order_type = Column(String(20), nullable=False) # MARKET / LIMIT
status = Column(String(20), nullable=False, default=OrderStatus.PENDING)
quantity = Column(Numeric(precision=20, scale=8), nullable=False)
price = Column(Numeric(precision=20, scale=8), nullable=True)
fill_price = Column(Numeric(precision=20, scale=8), nullable=True)
created_at = Column(DateTime(timezone=True), default=datetime.utcnow)
updated_at = Column(DateTime(timezone=True), default=datetime.utcnow, onupdate=datetime.utcnow)
filled_at = Column(DateTime(timezone=True), nullable=True)
exchange_order_id = Column(String(100), nullable=True, unique=True)
# Relaciones
user = relationship("User", back_populates="orders")
def __repr__(self):
return f"<Order {self.id}: {self.side} {self.quantity} {self.symbol} @ {self.price}>"
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.
- 9d ago First seen · 311 lines · 0 tokens per session scan A 3575d850d75b
080-python-backend is a cursor rule published in the GitHub repository juandoroteoflesiauni-lang/Market-options-stocks-Scanner (11 stars, last pushed 2mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,089 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-30.
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.
py-fast-api
Cursor rules for Python FastAPI backend development and best practices.
python
Python best practices and patterns for modern software development with Flask and SQLite.
python--typescript-guide-cursorrules-prompt-file
Cursor rules for Python development with TypeScript guide integration.
django-python
Rules for writing Python services at PostHog (Python servers powered by the Django framework).
aiohttp
This guide defines definitive best practices for using aiohttp, focusing on efficient, robust, and maintainable asynchronous HTTP client code.