Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/juandoroteoflesiauni-lang/Market-options-stocks-Scannernpx agentmods add rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/050-testingWrote 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/050-testing)<a href="https://agentmods.dev/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/050-testing"><img src="https://agentmods.dev/badge/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/050-testing/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/050-testing"><img src="https://agentmods.dev/badge/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/050-testing.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.02398 |
| Opus 5 | $0.00000 | $0.01199 |
| Sonnet 5 | $0.00000 | $0.00480 |
| Haiku 4.5 | $0.00000 | $0.00240 |
Grade A, and why
050-testing 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 11d 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 — 324 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🧪 TESTING — TRADING TERMINAL
FILOSOFÍA: CÓDIGO SIN TEST = CÓDIGO ROTO
En una terminal de trading, un bug puede significar pérdida de dinero. Cada función de lógica de negocio DEBE tener al menos un test.
🐍 TESTS BACKEND (Python/Pytest)
Estructura de tests:
tests/
├── unit/ ← Tests de funciones individuales (rápidos)
│ ├── test_risk_service.py
│ ├── test_order_service.py
│ └── test_calculators.py
├── integration/ ← Tests de flujos completos (más lentos)
│ ├── test_order_flow.py
│ └── test_auth_flow.py
├── fixtures/ ← Datos de prueba compartidos
│ └── trading_fixtures.py
└── conftest.py ← Configuración global de pytest
Template de test unitario:
# tests/unit/test_risk_service.py
import pytest
from decimal import Decimal
from unittest.mock import AsyncMock, patch
from app.services.risk_service import RiskService
from app.schemas.order_schema import OrderCreate
from app.core.exceptions import RiskViolationError, InsufficientFundsError
class TestRiskService:
"""Tests del servicio de gestión de riesgo."""
@pytest.fixture
def risk_service(self):
return RiskService()
@pytest.fixture
def mock_portfolio(self):
return {
"available_usd": Decimal("5000"),
"total_value": Decimal("10000")
}
# ========== HAPPY PATH ==========
async def test_valid_order_passes_validation(self, risk_service, mock_portfolio):
"""Orden válida dentro de límites debe pasar."""
order = OrderCreate(
symbol="BTCUSDT",
side="BUY",
order_type="MARKET",
quantity=Decimal("0.01")
)
current_price = Decimal("40000")
# No debe lanzar excepción
await risk_service.validate_order(order, mock_portfolio, current_price)
# ========== CASOS BORDE ==========
async def test_order_exceeding_max_size_raises_error(self, risk_service, mock_portfolio):
"""Orden > $10,000 debe ser rechazada."""
order = OrderCreate(
symbol="BTCUSDT",
side="BUY",
order_type="MARKET",
quantity=Decimal("1.0") # 1 BTC a $40k = $40,000
)
with pytest.raises(RiskViolationError) as exc_info:
await risk_service.validate_order(order, mock_portfolio, Decimal("40000"))
assert "excede límite" in str(exc_info.value)
async def test_insufficient_funds_raises_error(self, risk_service):
"""Orden sin fondos suficientes debe ser rechazada."""
poor_portfolio = {
"available_usd": Decimal("100"),
"total_value": Decimal("100")
}
order = OrderCreate(
symbol="BTCUSDT",
side="BUY",
order_type="MARKET",
quantity=Decimal("0.1") # $4,000
)
with pytest.raises(InsufficientFundsError):
await risk_service.validate_order(order, poor_portfolio, Decimal("40000"))
async def test_negative_quantity_raises_error(self, risk_service, mock_portfolio):
"""Cantidad negativa debe ser rechazada por Pydantic."""
with pytest.raises(ValueError):
OrderCreate(
symbol="BTCUSDT",
side="BUY",
order_type="MARKET",
quantity=Decimal("-1.0")
)
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.
- 11d ago First seen · 324 lines · 0 tokens per session scan A 1ccf8557d268
050-testing 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,398 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
300-testing
Comprehensive testing guide covering unit, integration, E2E, test frameworks, patterns, and CI/CD integration.
hatch3r-testing
Coverage thresholds, mocking strategy, property-based testing, mutation-score targets, flaky test quarantine, and snapshot test discipline.
testing
Cursor rule "testing" from andersonlemesc/Oryntra, covering testes oryntra, laravel (pest), python (pytest), contract tests (laravel ↔ python) and browser/e2e.
go-test
Rules for writing and modifying test files (test.go) in go-crypto-wallet.
issues-tests
Backend test conventions — QuarkusTest, REST Assured, Given, ArchUnit.
tester
Tester role - Unit, E2E, and visual regression testing.