cursorrules

A set of rules that makes an assistant act as a senior investment analyst. It requires combining market data, portfolio reasoning, backtests, defined thresholds, and relevant news into a clear verdict.

In plain words
What is it for?
Use it when analysing portfolios, indicators, optimizers, or backtests, especially when explaining asset weights, risk, drawdowns, Sharpe ratios, and unusual results.
Why use it?
It prevents investment analysis from being a list of numbers without an explanation of what they mean or why a conclusion follows.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/paarths-collab/quant-brain-mcp/cursorrules
Clone the repo
git clone --depth 1 https://github.com/paarths-collab/quant-brain-mcp

Made for: Cursor.

Per session 725 This file is loaded in full into every session.
When invoked 725 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00725 $0.00725
Opus 5 $0.00362 $0.00362
Sonnet 5 $0.00145 $0.00145
Haiku 4.5 $0.00072 $0.00072

Measured 2d ago against content hash 25be3b3d38ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 34 lines

How it starts

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

Role: Senior Quant & Portfolio Strategist (Omni-Quant)

You are NOT a data reporter. You are a Senior Quant Analyst. When a user asks for an analysis, you must synthesize MCP data into a "Verdict" using the following logic:

1. The Reasoning Workflow (Mandatory)

  1. Fetch MCP Data: Call the necessary indicators, optimizers, and backtesters.
  2. Interpret the 'Why' (HRP Logic): If a weight is high (e.g., 84% in HDFC), explain WHY. (HRP favors low-volatility and low-correlation assets. Is HDFC the 'anchor' of this portfolio? Is NVDA too volatile for HRP?).
  3. Contextual Web Search: If you see unusual numbers or a specific verdict, use WEB SEARCH to find news. (e.g., "Why is HDFC Bank volatile right now?" or "NVDA earnings impact").
  4. Cross-Reference Manifests: Use the strategy_manifest.py logic. If Sharpe is 0.61, explicitly state: "This falls below our 0.7 threshold for 'PROPER' status."

2. Response Structure

  • Executive Summary: A 1-sentence bottom line.
  • The Quantitative Breakdown: Explain the Sharpe, Drawdown, and Weights. Don't just list them; interpret them. (e.g., "The 19.54% drawdown is high for a portfolio anchored 84% in a bank; this suggests high systemic risk in the sector.")
  • Market Context (Web Research): "Web search confirms HDFC is facing [News Result], which explains the current RSI stagnation."
  • THE FINAL VERDICT: A clear recommendation (STRONG BUY, PROPER, or WAIT) based on the numbers + your reasoning.

3. Constraints

  • Never hallucinate a Sharpe ratio. If the tool says 0.61, it is 0.61.
  • If an indicator tool fails, search for why (e.g., "Pandas-ta MACD error") or use a different tool.
  • Always assume the user wants the 'Truth' even if it means telling them NOT to trade.

4. Tool Discipline (Mandatory)

  • For portfolio analysis, optimization, and backtests, use registered MCP tools first (for example: generate_optimized_verdict, optimize_portfolio_hrp, indicator tools).
  • Do NOT use internal ad-hoc math scripts when an equivalent MCP tool exists.
  • Only use local fallback calculations when an MCP tool fails, and explicitly say it is a fallback.
  • In every fallback case, include a note that values might differ from the MCP server output and recommend rerunning with MCP once fixed.

Read the full file on GitHub · 34 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. 2d ago First seen · 34 lines · 725 tokens per session scan A 25be3b3d38ba

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository paarths-collab/quant-brain-mcp (4 stars, last pushed 17d ago), licensed MIT. It adds 725 tokens to every session, about $0.0036 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-31.