rules-index

A routing layer that chooses which project rules to load before a task begins. The rules are written in Markdown files and can cover areas such as interface code, data access, or task architecture.

In plain words
What is it for?
Use it to plan rule loading for a task and apply matching instructions before exploring, reviewing, or changing project files.
Why use it?
It helps apply the relevant project instructions consistently instead of making the agent load rules manually or guess which ones matter.

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/travisun/opptrix/rules-index
Clone the repo
git clone --depth 1 https://github.com/Travisun/Opptrix

Made for: Cursor.

Per session 1,328 This file is loaded in full into every session.
When invoked 1,328 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.01328 $0.01328
Opus 5 $0.00664 $0.00664
Sonnet 5 $0.00266 $0.00266
Haiku 4.5 $0.00133 $0.00133

Measured yesterday against content hash 342f018e8106, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rules-index 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 yesterday.

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/rules-index.mdc · 88 lines

How it starts

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

规则路由引擎(L0 · 唯一常驻)

完整 .mdc 不在本仓库。 路径:~/.projects-rules/Opptrix/.cursor/rules/
MiMoCode skill:~/.projects-rules/Opptrix/.mimocode/skills/(见 AGENTS.md
目录索引:.cursor/rules/index.mdc.cursor/index.mdc

前置条件(硬性 · 每任务第一步)

收到任务后、调用工具或改代码之前,须先输出简短 规则加载计划

规则加载计划
- 任务类型:问答 | 探索 | 小改 | 功能 | 发版 | Git | 审查
- 将加载:{规则文件名}(L1 路径自动 | L2 Agent 拉取 | L2 Read 手动)
- 豁免:{若无,写「无」}

未输出计划不得进入实施。纯问答 / 单行 typo / 只读查文件 → 仅 L0,可跳过 L2。

编码 / 改码 / 功能 / 修复 / 重构(非豁免)→ 须 Read ~/.projects-rules/Opptrix/.cursor/rules/task-architecture-gate.mdc,完成 a–n 架构简报与 ≥3 套方案 并经用户选定后,才允许改业务代码。

三层加载模型

机制 加载方式
L0 本文件 alwaysApply 自动
L1 路径匹配(见下表) Read 本地 ~/.projects-rules/Opptrix/.cursor/rules/{文件}
L2 任务意图 Read 同上路径;禁止凭记忆

反模式:堆叠多个 alwaysApply: true;未 Read 本地文件就编造细则。

L1 路径 → 本地规则文件

场景 规则文件 触发路径摘要
client-ui client-ui-guidelines.mdc client-ui/**/*
UI 收尾验证 post-edit-verification.mdc client-ui/**/*
浮层组件 ui-overlay-components.mdc client-ui/**/*
UI 文案 ui-copy-standard.mdc client-ui/**/*, **/onboarding/**/*
数据层 data-layer-standard-api.mdc a-stock-layer, research-hub, apps/server
Provider provider-standard-api.mdc, data-provider-docs.mdc a-stock-layer/**/*
Agent 工具 mcp-tool-pack-routing.mdc packages/agent/**/*
Agent 沙盒 agent-shell-sandbox.mdc agent-workspace/shell, workspace-tools
外部 MCP external-mcp-servers.mdc mcp/external, mcp-servers 配置
SQLite / 兼容 backward-compatibility.mdc, schema-migration.mdc store/schema/market-data
桌面发版 desktop-release.mdc, onboarding.mdc apps/desktop/**, releases
macOS 签名 desktop-mac-signing.mdc after-pack/sign, mac-sign-checklist
代码质量 / 测试 / 性能 code-quality.mdc, testing.mdc, performance.mdc packages/**, apps/**, tests/**
写文档 documentation.mdc docs/**/*, **/*.md

Read the full file on GitHub · 88 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. yesterday First seen · 88 lines · 1,328 tokens per session scan A 342f018e8106

Subscribe to this mod's changes

rules-index is a cursor rule published in the GitHub repository Travisun/Opptrix (224 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,328 tokens to every session, about $0.0066 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.