Borrowing it
Nothing to install: this file belongs to Pretend-to/mio-chat-backend. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Pretend-to/mio-chat-backend/master/AGENTS.mdgit clone --depth 1 https://github.com/Pretend-to/mio-chat-backendWrote 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.
[](https://agentmods.dev/instructions/pretend-to/mio-chat-backend/agents-md)<a href="https://agentmods.dev/instructions/pretend-to/mio-chat-backend/agents-md"><img src="https://agentmods.dev/badge/instructions/pretend-to/mio-chat-backend/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/pretend-to/mio-chat-backend/agents-md"><img src="https://agentmods.dev/badge/instructions/pretend-to/mio-chat-backend/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.05949 | $0.05949 |
| Opus 5.5 | $0.02380 | $0.02380 |
| Sonnet 5.5 | $0.01190 | $0.01190 |
| Haiku 4.5 | $0.00595 | $0.00595 |
Grade A, and why
mio-chat-backend 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 281 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
本文件是
mio-chat-backend的唯一权威 Agent 指南(人类协作者同样适用)。CLAUDE.md是指向本文件的软链接 —— 读AGENTS.md或CLAUDE.md的工具都能命中同一份内容。 本仓库配套前端仓库mio-chat-frontend(本机通常在../mio-chat-frontend)。
项目定位
Mio-Chat 的后端,自称 "Agent OS":不只是 API 转发,而是带 Hook 拦截、三层插件体系、真实终端桥接的 Agent 运行环境。
作者自用的个人项目,仍在开发阶段,没有外部用户。由此推出三条工作原则:
- 数据结构可以直接改到对的形态,不必为兼容旧数据写迁移分支(真需要迁移时走
lib/migration/,启动时自动检测执行)。 - CI 只构建 Docker 镜像,不卡合并。主干是
dev;本地另有master/production作为发布分支,不主动合并。 - 有测试但覆盖不全,不要假设改动会被测试拦住。
红线(动手前先读这一节)
- 数据库路径唯一:
<cwd>/data/app.db,由lib/database/databasePath.js解析。不存在环境变量覆盖,也不要再加 —— 历史上"测试写进真库"就是路径不唯一造成的。 - 破坏性 schema 变更必须写成迁移,而不是靠
db push:放lib/migration/schema/*.js(幂等 + 事务 + 行数校验 + 记账_schema_migrations+ 自动备份)。启动流程会用findDestructiveSchemaChanges()拦停破坏性 diff,assertDatabaseIntact()拒绝在库缺失时静默建空库。纯增量(新表 / 可空列 / 索引)才允许自动 push。 - 热重载边界:
lib/**、channels/**、插件的index.js与lib/**不在插件热重载白名单里,改完必须重启进程(详见"插件与 Skill → 热重载范围")。 - 工具注册名 =
<name>_mid_<schemaHash>(lib/function.js)。hash 的输入包含description—— 改一句工具描述就会让存量配置里的该工具失效。详见"工具命名与权限"。 - OneBot 连接的唯一入口是
lib/chat/onebot/connectOnebot.js(启动 / 保存配置 / 手动重连都走它)。 - 不要提交
.env、data/*.db、凭据、运行期渠道数据。
命令
pnpm dev # node --watch app.js,日志打到 stdout
pnpm start # pm2 start ./config/pm2.json(生产)
pnpm lint / lint:fix # oxlint
pnpm format # prettier --write .
pnpm test:unit # 单测:隔离 cwd + 真库一致副本(最常用)
pnpm test # 完整套件(内部驱动 test:unit + 集成)
pnpm test:integration # 只跑集成用例,需要服务跑在 http://localhost:3080
pnpm test:all # 全部
pnpm db:push # prisma db push(纯增量字段才用;破坏性变更走 lib/migration/schema/)
pnpm db:studio # 可视化查看 data/app.db
pnpm docker:up / docker:down / docker:logs
- 单测用 Node 内置
node --test,无第三方框架。适配器测试最全(每个 provider 一个文件),业务逻辑覆盖较薄。 - 单测跑不到真库:
scripts/utils/testIsolation.js会换 cwd 并复制一份真库副本给测试进程。不要给单测进程注入ADMIN_CODE/USER_CODE/NODE_ENV。 - 已知失败:
tests/adapters/image-url.test.js的 2 个用例(GeminiAdapter base64、Image URL pre-processing),与你的改动无关时不要当回归信号。 - 单测每个用例默认 60s 死线(
TEST_TIMEOUT_MS=0可关掉),并带--test-force-exit:漏了 close 的定时器 / 长连接不会再让套件永生(曾见测试进程挂死 5 天;两个开关都在scripts/utils/run-unit-tests.js)。目标参数可以是文件或目录(目录递归展开),但仍应给带定时器 / 长连接的测试在t.after里显式 close。
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.
- 1mo ago Changed · +1 lines · +28 tokens per session 460dcb349cb1
- 1mo ago First seen · 280 lines · 5,921 tokens per session scan A 574e22615944
mio-chat-backend AGENTS.md is an instructions file published in the GitHub repository Pretend-to/mio-chat-backend (39 stars, last pushed 2d ago), licensed MIT. It adds 5,949 tokens to every session, about $0.0238 per session on Opus 5.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-09-24.
Other instructions, from other repositories
plan-forge caching.instructions.md
Caching patterns for .NET — IDistributedCache, Redis, in-memory, cache-aside, TTL strategies.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).