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/04-data-hub)<a href="https://agentmods.dev/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/04-data-hub"><img src="https://agentmods.dev/badge/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/04-data-hub/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/04-data-hub"><img src="https://agentmods.dev/badge/rules/juandoroteoflesiauni-lang/market-options-stocks-scanner/04-data-hub.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.00025 | $0.01370 |
| Opus 5 | $0.00013 | $0.00685 |
| Sonnet 5 | $0.00005 | $0.00274 |
| Haiku 4.5 | $0.00003 | $0.00137 |
Grade A, and why
04-data-hub 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 12d 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 — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🛡️ DATA HUB — ANTI-CORRUPTION LAYER v3.0
MISIÓN
MarketDataHub es el ÚNICO componente que toca APIs externas.
Fases B/C son motores de cálculo aislados de la red.
Si ves import httpx en backend/phases/phase_b/ → RECHAZAR inmediatamente.
PATRÓN DE LLAMADA — Los motores solo ven esto:
# Lo que el motor recibe — nada más:
snapshot: MarketSnapshot = await hub.get_market_snapshot(ticker="AAPL")
# Lo que el Hub hace internamente (invisible para el motor):
# 1. Selecciona proveedor (FMP / Massive)
# 2. Rota API keys
# 3. Aplica exponential backoff
# 4. Verifica circuit breaker
# 5. Normaliza respuesta → MarketSnapshot
# 6. Adjunta data_lineage
# 7. Retorna Result[MarketSnapshot]
GESTIÓN DE SECRETOS — REGLAS CRÍTICAS
# ✅ CORRECTO — pydantic-settings con SecretStr
from pydantic import SecretStr
from pydantic_settings import BaseSettings, SettingsConfigDict
class MarketDataSettings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
fmp_api_key: SecretStr # repr() muestra "**********"
massive_api_key: SecretStr
# Acceso al valor:
key = settings.fmp_api_key.get_secret_value()
# ❌ PROHIBIDO — hardcodeado
API_KEY = "sk-abc123"
# ❌ PROHIBIDO — sin validación
key = os.getenv("API_KEY") # Puede ser None, vacío, o formato incorrecto
RESILIENCIA — Backoff + Circuit Breaker
# Exponential backoff con jitter:
@exponential_backoff(
max_retries=3,
base_delay_seconds=1.0,
max_delay_seconds=30.0,
jitter=True,
)
async def _call_fmp_api(self, endpoint: str, params: dict[str, str]) -> dict:
...
# Circuit breaker:
# CLOSED → OPEN (5 fallos en 60s) → HALF-OPEN (probe) → CLOSED
# Cuando OPEN: retorna Result.failure() sin llamar la API
RESULTADO — NUNCA LANZAR EXCEPCIONES A CALLERS
# ✅ CORRECTO — Hub retorna Result, nunca lanza
async def get_market_snapshot(self, ticker: str) -> Result[MarketSnapshot]:
try:
raw = await self._call_fmp_api(f"/quote/{ticker}", {})
snapshot = self._fmp_normalizer.normalize(raw, time.time_ns())
return Result.success(snapshot)
except (httpx.TimeoutException, ValidationError) as exc:
logger.error("Hub falló para %s", ticker, exc_info=True)
return Result.failure(reason=str(exc))
# ❌ PROHIBIDO — excepción cruda al caller
raise Exception("API no disponible")
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.
- 12d ago First seen · 163 lines · 1,370 tokens per session scan A ac82a75c5920
04-data-hub 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 adds 25 tokens to every session and 1,370 once invoked, about $0.0001 per session on Opus 5. 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
viberaven-payments
Apply when editing Stripe, Polar, or payment webhook handlers.
payment-payment-idempotency
Apply when implementing idempotency logic in payment connector code or handling duplicate payment requests. Covers paymentId as idempotency key, payment state machine transitions, retry semantics for cancellation and refund operations, and requestId handling. Use for preventing duplicate charges and ensuring correct…
architecture
At the start of every response, say "APPLIED ARCHITECTURE RULE".
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.