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.
npx agentmods add rules/nongjun/awesome-harness-engineering/aigit clone --depth 1 https://github.com/nongjun/awesome-harness-engineeringWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00606 |
| Opus 5 | $0.00000 | $0.00303 |
| Sonnet 5 | $0.00000 | $0.00121 |
| Haiku 4.5 | $0.00000 | $0.00061 |
Grade A, and why
AI接入规范 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.
What it actually says
瑞小美 AI 接入规范
核心原则
| 原则 | 要求 |
|---|---|
| 优先最强 | 默认使用 Claude Opus 4.5,失败后自动降级 |
| 智能降级 | Claude → Gemini Pro → Gemini Flash(每级重试 2 次) |
| 统一配置 | 从门户系统统一获取 Key,各模块禁止独立配置 |
| 统一服务 | 通过 shared_backend.AIService 调用,禁止直接请求 API |
服务商降级策略
4sapi.com (首选): Claude → Gemini Pro → Gemini Flash
↓ 全部失败
OpenRouter (备选): Gemini Pro → Gemini Flash
降级触发:首字超时 10 秒、请求失败、每模型最多 2 次重试。
模型配置
| 等级 | 模型 | 说明 |
|---|---|---|
| 首选 | claude-opus-4-5-20251101-thinking | 所有任务首先尝试 |
| 标准 | gemini-3-pro-preview | Claude 失败后降级 |
| 快速 | gemini-3-flash-preview | 最终保底 |
| 生图 | gemini-2.5-flash-image-preview | 图像生成专用 |
| 视频 | veo3.1-pro | 视频生成专用 |
强制要求
- 使用
shared_backend.services.ai_service.AIService,禁止直接调 API - 禁止硬编码 API Key
- 初始化时必须传入
db_session(记录调用日志) - 调用时必须传入
prompt_name(用于统计)
提示词规范
- 文件位置:
{模块}/后端服务/prompts/{功能名}_prompts.py - 必须包含
PROMPT_META(name、display_name、module、variables) - 模块启动时通过
scan_and_register_prompts自动注册到数据库
AI 响应解析
必须使用公共函数:parse_ai_json_response 或 safe_parse_ai_json,禁止自行编写解析逻辑。
配置入口
- 门户系统 AI 配置页面管理 Key 和模型
- 各模块通过
GET /api/ai/internal/config获取配置(5 分钟缓存) - 调用统计:门户系统 → AI 配置 → 调用统计
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.
- 2d ago First seen · 67 lines · 0 tokens per session scan A be13251ce5a8
AI接入规范 is a cursor rule published in the GitHub repository nongjun/awesome-harness-engineering (2 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 606 tokens. 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.
Other cursor rules, from other repositories
baml
A set of rules for setting up BAML and help with syntax guidance.
json-prompt-design
Protects MOTO prompt wording and defines cross-cutting JSON response invariants.
token-efficiency
Token efficiency rules - eliminate waste in AI output, enforce read-before-write, prevent iteration cycles.
langchain
LangChain: chains, agents, memory, tools.
prompt-routing
Route tasks to the correct Universal AI Engineering Prompt.
llm-zod-jsonschema
Best Practice for LLM Output Parsing with Zod and JSON Schema.