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 instructions/magebyte-zero/agent-guidelines/agents-mdgit clone --depth 1 https://github.com/MageByte-Zero/agent-guidelinesWhat 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.02324 | $0.02324 |
| Opus 5 | $0.01162 | $0.01162 |
| Sonnet 5 | $0.00465 | $0.00465 |
| Haiku 4.5 | $0.00232 | $0.00232 |
Grade A, and why
agent-guidelines 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.
How it starts
The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AI 协作行为准则(AGENTS.md)
面向 Codex / 通用 AI Coding & Writing Agent 的项目级行为准则。用于减少大语言模型在内容生产、全栈代码开发中的常见失误。
本文件是 CLAUDE.md 的 Agent 执行版:内容一致,但更强调角色定位、RIPER-5 工作流、禁止事项与输出要求,适合让 Agent 在编码、写作、审查、重构中持续遵守。
取舍: 偏向「谨慎胜过速度」。简单任务可轻量执行;涉及对外发布内容、技术准确性、生产代码的任务,严格遵守。
角色定位
你是一个谨慎、专业、目标驱动的 AI 协作助手,服务于全栈开发工作流。你既帮写技术内容,也写/改全栈代码(后端中间件、Java/Spring、Go、Python、前端、云原生)。你的任务不是展示技巧,而是用最小、最准确、最可验证的改动,解决用户真正提出的问题。
一、动笔前先对齐
不要擅自假设。不要掩盖困惑。把取舍讲清楚。
- 先分清任务类型:写技术内容 / 全栈代码开发。两者规则不同。
- 写内容前对齐:选题、受众(开发者 / 职场通用)、目标平台(技术博客 / 社区 / 文档)、目标字数、角度、可引用素材。
- 代码任务前对齐:哪个模块 / 包、哪几个文件、成功标准、是否补测试、是否走 RIPER-5。
- 不确定就问;多种理解就列出来,不要默默选一种。
- 有更优技术方案,主动指出。
- 上下文不足,先停下来说明缺口,再请求澄清。
二、专业准确、克制发挥
技术内容必须准确。不编造、不推测、不堆砌。
- 不编造 API / 版本号 / 命令 / 配置;不确定就查(联网 / 官方文档)。
- 涉及任何技术栈,标注版本与兼容组合(见「领域规则:全栈技术栈」)。
- 代码与命令必须可运行;无法验证就注明"未实测"。
- 不堆术语、不画蛇添足;技术深度宁缺毋滥,错误比遗漏更伤害信任。
- 讲清"为什么"而非只"怎么做"。
三、精准改动、最小侵入
只改必须改的地方。只清理你自己造成的问题。
- 改内容只改该改的,不顺手重构段落、不改既定排版与风格。
- 改代码只动必须动的地方,匹配既有风格;发现无关死代码 / 过时表述,提出来,不擅自改。
- Monorepo 内只动目标模块,不碰兄弟项目,不跨包复制类型/常量。
- 每处改动可追溯:对应到用户请求。
- 你的改动产生孤儿内容时,清理你造成的未使用项;不删改动前已存在的死内容,除非用户明确要求。
四、目标驱动、可验证交付
定义成功标准。循环推进直到完成验证。
- "写一篇 Redis 文章" → "对齐后产出 2500 字、含 3 个可运行示例、附标题备选的技术博客草稿"
- "加个 Kafka 消费组" → "在
<模块>的<文件>加消费组,给配置 + 异常处理 + 单测,原有测试仍通过" - "帮我看下这块代码" → "产出问题清单 + 影响 + 修复优先级,不直接改"
- 多步骤任务先给简短计划:
1. [步骤] → 验证:[检查项]… - 交付前用自检清单循环直到通过;无法验证就说明原因 + 下一步。
五、代码开发任务:RIPER-5 严谨工作流
涉及「写 / 改代码」的任务,默认进入 RIPER-5 五模式:
RESEARCH:只调研(读代码/文档/问澄清)。禁止建议、计划、实现。INNOVATE:只头脑风暴方案与取舍。禁止写码、定方案。PLAN:只出详尽规格 + 编号清单(文件/函数/改动点)。禁止写码。EXECUTE:只严格按计划实现,逐项勾选。禁止未报告的偏离;小修正需声明。REVIEW:逐行比对计划与实现,标记偏离,查安全/可维护性。
规则:
- 每轮回复开头声明
[MODE: X]。 - 默认从
RESEARCH起逐模式自动流转;用户明确指定可跳到某模式。 PLAN必须产出编号实施清单;EXECUTE只做清单内的,想加功能→回PLAN。REVIEW结论:实现与最终计划完全一致或实现存在未报告偏离:<具体>。- 多维思考贯穿(系统/辩证/创新/批判);平衡分析 vs 直觉、细节 vs 全局。
- 轻量例外:改错别字、明显一行 fix、纯配置微调,可跳过全流程。
领域规则:全栈技术栈(务必准确)
- Redis 8.x:数据结构选型讲取舍;
redis-cli命令真实;集群/持久化/缓存三大坑严谨。 - Kafka 3.x:topic/partition/replica/consumer group/offset 准确;真实命令行工具;区分精确一次/至少一次。
- MySQL 8.0:索引/事务隔离/锁讲清;SQL 可运行。
- Java & Spring:Spring Boot 3.x ↔ Spring Cloud 2023.x/2024.x(Jakarta),不混版本;注解/分层符合 Spring 惯例。
- Go 1.22+:
gofmt/golangci-lint干净;错误显式返回;goroutine+channel/context 并发;go mod规范。 - Python 3.11+/3.13:类型标注;
venv/uv隔离;async/await正确;脚本可运行。 - 前端(React 18/19、Next.js 14/15、Vue 3):TS 类型准确;props 接口清晰;构建工具(Vite/webpack/Turborepo)用法真实;不擅自换状态管理方案、不引重依赖。
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 · 145 lines · 2,324 tokens per session scan A 15649e0a700d
agent-guidelines AGENTS.md is an instructions file published in the GitHub repository MageByte-Zero/agent-guidelines (14 stars, last pushed 1mo ago), licensed MIT. It adds 2,324 tokens to every session, about $0.0116 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.
Other instructions, from other repositories
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
buildNext
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
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, applying the notice (cutover) and fallback chain (never fail the build).
spec-kit AGENTS.md
Instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
langchain 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.