Opptrix AGENTS.md

A set of project rules for coding agents working on the Opptrix codebase. It tells the agent how to understand requests, inspect the repository, plan architecture changes, and keep changes compatible.

In plain words
What is it for?
It helps with requirement checks, architecture planning, code exploration, API and schema changes, documentation updates, and cross-platform development.
Why use it?
It gives the agent consistent working rules before it edits code, reducing accidental rewrites, incompatible data changes, and platform-specific fixes.

Instructions file for CodexOpenCode

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

Made for: Codex, OpenCode.

Per session 4,561 This file is loaded in full into every session.
When invoked 4,561 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.04561 $0.04561
Opus 5 $0.02280 $0.02280
Sonnet 5 $0.00912 $0.00912
Haiku 4.5 $0.00456 $0.00456

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

Security

Grade A, and why

Opptrix AGENTS.md 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.

AGENTS.md · 300 lines

How it starts

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

Opptrix — Agent 工程规则

本文件由 MiMoCode 自动注入 system instructions,每次会话生效。 细则按场景在 ~/.projects-rules/Opptrix/.mimocode/skills/(动手前 Read 对应 skill);仓库内仅 .mimocode/index.mdc 索引。 .cursor/rules/*.mdc 完整版在 ~/.projects-rules/Opptrix/.cursor/rules/;仓库内仅 rules-index.mdc + index.mdc 指引。 Cursor 渐进式规则:仅 .cursor/rules/rules-index.mdc(L0)常驻;L1/L2 须 Read 本地 ~/.projects-rules/Opptrix/.cursor/rules/。每任务须先输出「规则加载计划」。 编码门禁:Read 本地 task-architecture-gate.mdc,完成 a–n 架构简报与 ≥3 方案并经用户选定后才写码。


核心信条

  1. 先规则计划,再动手(Cursor:见 rules-index.mdc;MiMoCode:见对应 skill)
  2. 编码类先架构门禁:a–n 简报 + ≥3 方案,用户选定后再改码(Cursor:task-architecture-gate.mdc
  3. 先理解,再动手:重要修改前必须向用户提问确认需求
  4. 先探索,再修改:CodeGraph 定位后才能改代码
  5. 代码即文档,文档即代码:架构/API/调用方式变更后必须同步文档
  6. 增量改动:按用户最新指示做最小 diff;不顺手重构
  7. 禁止断代:schema、用户数据、Hub/API 变更须兼容 + 幂等迁移
  8. 禁止半成品:新功能须技术/用户/产品三维完备,兼容现有架构与安全;交付前复审回炉直至达标(见 R11)
  9. 多平台默认可达:功能改动须兼顾 macOS / Linux / Windows,禁止本机单一依赖定制(见 R12)

硬性规则(全仓生效)

R1. 需求澄清

重要修改前必须向用户提问确认需求。

触发场景:

  • 新增功能 → 确认目标、场景、边界
  • 修改架构 → 确认范围、影响、方案
  • 修改 API → 确认兼容性、调用方影响
  • 修改 UI → 确认交互、视觉、响应式
  • 修改 Provider → 确认数据源、API 限制
  • 修改 Schema → 确认迁移策略、数据保留

提问模板:

## 需求确认

**目标**:{你理解的目标}

**影响范围**:
- {影响 1}
- {影响 2}

**需要澄清**:
- {问题 1}
- {问题 2}

**实现方案**:
- 方案 A:{描述}
- 方案 B:{描述}

请确认或补充。

R2. 探索再改

凡了解代码库 / 查实现 / 找符号 / 跟调用链 — 必须先 CodeGraph。

export PATH="$HOME/.local/bin:$PATH"
codegraph explore "<问题或符号>"

允许跳过:已定位只需改具体行;无索引;刚改未同步的单文件;非代码。

R3. 文档同步

架构/API/调用方式变更后必须同步更新对应文档。

改动类型 必须更新的文档
新增/修改 Hub feature docs/API.mdAGENT-GUIDE.md
新增/修改 Provider docs/PROVIDER-STANDARD-API.mddocs/DATA-LAYER.md
修改 queryInstrumentData docs/ARCHITECTURE.mddocs/DATA-LAYER.md
修改 UI 组件 docs/UI-DESIGN-SYSTEM.mddocs/UI-LAYOUT.md
修改 Schema docs/DATA-LAYER.md、迁移测试
修改 Electron docs/DESKTOP.mddocs/ARCHITECTURE-COMPREHENSIVE.md
修改 API 路由 docs/API.md
修改 Agent tool docs/AGENT-GUIDE.md;并遵循 mcp-tool-pack-routing.mdc

Read the full file on GitHub · 300 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 · 300 lines · 4,561 tokens per session scan A ed13d6a233c7

Subscribe to this mod's changes

Opptrix AGENTS.md is an instructions file published in the GitHub repository Travisun/Opptrix (224 stars, last pushed 4d ago), licensed Apache-2.0. It adds 4,561 tokens to every session, about $0.0228 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.