RiskModels_API: Cursor rule for Cursor

.cursorrules

cursorrules is a cursor rule for Cursor from BlueWaterCorp/RiskModels_API. It costs 1,545 tokens per session, scanned A, original, Apache-2.0.

A rule for discovering the current contract before changing a RiskModels API client. An API client is code that calls a service through defined endpoints, parameters, and response formats.

In plain words
What is it for?
Use it before adding or changing RiskModels HTTP wrappers, SDK methods, command-line commands, example scripts, or related MCP tools.
Why use it?
It reduces the risk of writing integration code from outdated assumptions by requiring current endpoint and provisioning details from the live tool surface or repository specifications.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: positional $N argument.

This is BlueWaterCorp/RiskModels_API's own configuration. It tells Cursor how to work on RiskModels_API itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything RiskModels_API configures →

Reuse

Borrowing it

Nothing to install: this file belongs to BlueWaterCorp/RiskModels_API. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/BlueWaterCorp/RiskModels_API/main/.cursorrules
Clone the repo
git clone --depth 1 https://github.com/BlueWaterCorp/RiskModels_API

Made for: Cursor.

Wrote 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.

agentmods badge for cursorrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/bluewatercorp/riskmodels_api/cursorrules/github.svg)](https://agentmods.dev/rules/bluewatercorp/riskmodels_api/cursorrules)
Your own site
<a href="https://agentmods.dev/rules/bluewatercorp/riskmodels_api/cursorrules"><img src="https://agentmods.dev/badge/rules/bluewatercorp/riskmodels_api/cursorrules/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.

agentmods 80×15 button for cursorrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/bluewatercorp/riskmodels_api/cursorrules"><img src="https://agentmods.dev/badge/rules/bluewatercorp/riskmodels_api/cursorrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,545 This file is loaded in full into every session.
When invoked 1,545 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.01545 $0.01545
Opus 5.5 $0.00618 $0.00618
Sonnet 5.5 $0.00309 $0.00309
Haiku 4.5 $0.00154 $0.00154

Measured 19d ago against content hash 37abf25e49a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cursorrules 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 19d 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.

.cursorrules · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RiskModels SDK Expert Rules

Discovery Protocol (before any new API client or integration)

Before building or changing any API client (HTTP wrappers, SDK methods, CLI commands, example scripts, or MCP-aligned tools), discover the current contract and provisioning metadata from the live tool surface—not from memory:

  1. MCP (preferred when the RiskModels MCP server is enabled in Cursor): Read the MCP resource riskmodels:///capabilities first for the latest endpoint index (ids, methods, paths, summaries, billing). For the endpoints you will implement, read riskmodels:///schemas/{path} and/or riskmodels:///openapi for structural detail. (Tool set 2.0 removed the catalog tools; the same data is served as resources.)
  2. Repo fallback (always valid): If MCP tools are unavailable in this session, read OPENAPI_SPEC.yaml and mcp/data/openapi.json (generated/synced from the same contract) before writing code.

Do not ship new client code based only on stale chat context or older snippets. For the full step-by-step workflow, follow the project skill RiskModels API discovery (.cursor/skills/riskmodels-api-discovery/SKILL.md).

Cursor channel: Dynamic MCP tool lists and capability updates are easiest to rely on when Cursor’s Nightly update channel is enabled (Settings → Beta → Update channel → Nightly). The agent cannot toggle this for you; enable it locally if you want on-demand capability refresh behavior.


When writing or editing Python code that calls the RiskModels API, prefer the riskmodels package in this repo at sdk/ (import name riskmodels, distribution riskmodels-py). Do not invent REST paths or wire JSON shapes from memory; align with OPENAPI_SPEC.yaml and SEMANTIC_ALIASES.md after running the Discovery Protocol above.

Canonical math and field names (ERM3)

  • Hedge ratios (HR) are dollars of ETF per $1 of stock (dollar_ratio). Hedge notional ≈ position_usd * hr.
  • Use semantic column names as returned by the SDK (e.g. l3_market_hr, l3_sector_hr, l3_subsector_hr), not raw V3 wire keys in user-facing tables (l3_mkt_hr is normalized away in DataFrames).
  • Explained risk (ER) values are variance fractions in [0, 1]. At L3, l3_market_er + l3_sector_er + l3_subsector_er + l3_residual_er ≈ 1.
  • Sign convention: any HR may be negative (orthogonalization / long ETF leg); most common negatives are often the market factor at L2 or L3 (l2_market_hr, l3_market_hr). Do not treat a negative sector or subsector HR as automatically wrong.
  • GET /metrics/{ticker} returns numbers under JSON metrics; the SDK flattens to semantic names. Do not read flat l1_market_hr at the top level of the raw JSON unless mirroring legacy examples.
  • POST /batch/analyze Parquet/CSV long table: wire columns l1, l2, l3 are the three rolling L3 component HR series (market, sector, subsector), not “L1 model / L2 model / L3 model” levels. The SDK renames them to l3_market_hr, l3_sector_hr, l3_subsector_hr.
  • Portfolio-level hedge ratios in the SDK are holdings-weighted means of per-ticker scalar HRs (same idea as zarr wmean_* in docs/ERM3_ZARR_API_PARITY.md). This is not a full portfolio optimization; it is explicit client-side aggregation.

Read the full file on GitHub · 53 lines

Changes

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.

  1. 19d ago Changed · +9 tokens per session 37abf25e49a1
  2. 2mo ago First seen · 53 lines · 1,536 tokens per session scan A bdf7f9842a47

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository BlueWaterCorp/RiskModels_API (0 stars, last pushed yesterday), licensed Apache-2.0. It adds 1,545 tokens to every session, about $0.0062 per session on Opus 5.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-31.