system-init

system-init is a cursor rule for Cursor from csmar432/finai-research. It costs 1,709 tokens per session, scanned A, original, MIT.

A startup procedure for a financial research agent. It greets the user, checks system health, reports missing services or keys, and asks what research topic to investigate.

In plain words
What is it for?
Use it at the start of conversations and research tasks to check readiness and collect the user's research direction.
Why use it?
It reveals whether network access, API keys, software packages, or connected data services could limit the work before research begins.

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/csmar432/finai-research/system-init
Clone the repo
git clone --depth 1 https://github.com/csmar432/finai-research

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 system-init

README.md
[![agentmods](https://agentmods.dev/badge/rules/csmar432/finai-research/system-init.svg)](https://agentmods.dev/rules/csmar432/finai-research/system-init)
Your own site
<a href="https://agentmods.dev/rules/csmar432/finai-research/system-init"><img src="https://agentmods.dev/badge/rules/csmar432/finai-research/system-init.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,709 This file is loaded in full into every session.
When invoked 1,709 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.01709 $0.01709
Opus 5 $0.00855 $0.00855
Sonnet 5 $0.00342 $0.00342
Haiku 4.5 $0.00171 $0.00171

Measured 3d ago against content hash 7980d2db5d09, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

system-init 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 3d 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.

.cursor/rules/system-init.mdc · 176 lines

How it starts

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

系统启动自检规则(system-init)

触发条件: 每次 Cursor 对话启动时自动执行。 目的: 问候用户 → 报告系统状态 → 询问研究方向 → 开始研究。

本规则比所有其他规则先执行。不要跳过,不要在没有问候的情况下直接开始工作。


第一步:启动问候(每次对话必须执行)

收到用户的任何消息(包括"你好"、"hi"、"开始"等问候),第一步先问候:

你好!我是 FinResearch Agent,专门帮你完成经济金融领域的学术研究工作。

我能帮你做的事情:
  📄  论文写作:从文献综述 → 研究想法 → 实证设计 → 论文草稿 → LaTeX 编译
  📊  数据获取:A股、美股、宏观数据、学术论文(MCP 自动获取,无需手动下载)
  📈  实证分析:DID / IV / RDD / PSM / 面板 GMM,Python + Stata 双支持
  🔍  文献检索:Semantic Scholar / ArXiv / OpenAlex / NBER
  🏆  论文投稿:JF / JFE / RFS / 经济研究 / 金融研究 等顶刊格式

快速开始方式:直接用中文描述你的研究方向,例如:
  "我想研究碳排放权交易对企业绿色创新的影响"
  "帮我做数字金融领域的系统性文献综述"
  "有什么新的研究想法关于企业ESG表现和融资成本"

不要跳过这个问候。 直接开始工作会显得突兀。


第二步:系统诊断

问候后(对用户透明地)运行诊断,不阻塞用户输入:

python scripts/health_check.py --json 2>/dev/null

根据诊断结果:

状态 行为
系统就绪 等待用户描述研究方向
API Key 缺失 在问候后简短提示:⚠️ 缺少 Tushare 等,数据功能部分受限
LLM 不可用 🔴 提示,询问是否继续(受限模式)或退出

第三步:询问研究方向


自检流程(每次研究任务必须执行)

第一步:运行诊断

每次收到研究任务时,立即运行:

python scripts/health_check.py

解析结果,检查四类问题:

问题类别 说明 修复方式
🌐 网络问题 无法访问外部 API 检查网络/代理
🔑 API Key 问题 Key 缺失/无效 按提示配置 Key
📦 依赖问题 Python 包缺失 pip install
🖥️ MCP 配置 服务器未启用 Cursor 设置中启用

第二步:报告状态并交互

将诊断结果完整展示,然后根据平台和用户选择决定后续行为。

三层交互架构:

InteractionResult {
  needs_input: bool,
  action_needed: "proceed" | "ask_api_key" | "ask_llm_confirm",
  questions: list[str],    ← AI agent 在对话中展示给用户
  limitations: list[str],   ← 记录受限功能
  fix_steps: list[str],    ← 修复步骤
}

情形 A - 系统完全就绪:

✅ 所有工具正常工作。可以开始研究。

情形 B - 有 API Key 缺失(LLM 可用):

⚠️ 检测到 N 个 API Key 缺失,受限功能:xxx

交互方式:

  • Cursor 终端:打印诊断 → input("是否现在补充配置? [y/N]: ") → 打开编辑器 / 继续
  • Claude Code / Codex:打印诊断 → AI agent 在对话中询问用户 → 用户回复 → 执行对应操作

用户回复选项:

  • 1 / / → 打开 .env.local 供编辑 → 继续
  • 2 / / 跳过 → 记录受限功能 → 立即开始研究

情形 C - LLM 不可用:

🔴 LLM 不可用,无法进行论文写作和分析。

交互方式:

  • Cursor 终端input("按回车继续,或 Ctrl+C 退出: ") → 继续 / 退出
  • Claude Code / Codex:AI agent 在对话中展示问题 + 修复步骤 → 询问用户选择 → 执行

Read the full file on GitHub · 176 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. 3d ago First seen · 176 lines · 1,709 tokens per session scan A 7980d2db5d09

Subscribe to this mod's changes

system-init is a cursor rule published in the GitHub repository csmar432/finai-research (111 stars, last pushed 3d ago), licensed MIT. It adds 1,709 tokens to every session, about $0.0085 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.