architecture-copilot: Instructions file for Codex

AGENTS.md

architecture-copilot AGENTS.md is an instructions file for Codex, OpenCode from study8677/architecture-copilot. It costs 3,628 tokens per session, scanned A, original, MIT.

An instruction guide that turns Codex into a question-led architecture adviser for a software project. It covers system design, architecture reviews, technical choices, trade-offs, and common failure points.

In plain words
What is it for?
Use it to discuss system design, review an architecture diagram or proposal, compare technical options, and identify risks involving data, dependencies, security, operations, or cost.
Why use it?
It helps developers clarify requirements and constraints before committing to an architecture, especially when several designs could work.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; mentions AGENTS.md; mentions Codex.

This is study8677/architecture-copilot's own configuration. It tells Codex and OpenCode how to work on architecture-copilot itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything architecture-copilot configures →

Reuse

Borrowing it

Nothing to install: this file belongs to study8677/architecture-copilot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/study8677/architecture-copilot/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/study8677/architecture-copilot

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for architecture-copilot AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/study8677/architecture-copilot/agents-md/github.svg)](https://agentmods.dev/instructions/study8677/architecture-copilot/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/study8677/architecture-copilot/agents-md"><img src="https://agentmods.dev/badge/instructions/study8677/architecture-copilot/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.

agentmods 80×15 button for architecture-copilot AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/study8677/architecture-copilot/agents-md"><img src="https://agentmods.dev/badge/instructions/study8677/architecture-copilot/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,628 This file is loaded in full into every session.
When invoked 3,628 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03628 $0.03628
Opus 5.5 $0.01451 $0.01451
Sonnet 5.5 $0.00726 $0.00726
Haiku 4.5 $0.00363 $0.00363

Measured today against content hash ca80391a1302, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

architecture-copilot 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 today.

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 · 143 lines

How it starts

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

AGENTS.md · Architecture Copilot(Codex 形态)

这是「架构副驾」给 OpenAI Codex 用的形态。Codex 会自动读取项目根的 AGENTS.md。 用法:把本文件(或其内容)放进你自己项目的根目录 AGENTS.md,Codex 即会按下面的规范, 在你说「帮我设计/讨论这个系统的架构」时,以引导提问的方式陪你把架构想清楚; 在你说「了解当前项目 / 从代码还原架构」时,先检查真实仓库再给判断。 方法论与案例源自 awesome-architecture 的系统设计教程与数十个系统模板(数量以上游为准)。


何时进入 / 不进入「架构副驾」模式

进入:用户在做架构设计、系统设计练习、技术方案、架构评审/读图、现有仓库架构体检、技术选型取舍、"我想做一个 X 该怎么设计"、"这张架构图/方案有什么问题"。新系统以提问引导为主;现有仓库先取证、后判断。

不进入:用户明确要写代码、修 bug、改配置、跑测试、解释语法/API、补 README、生成脚本、实现某个已定方案。此时按普通工程任务推进;只有当实现暴露出重大架构取舍时,再短问确认。

边界:如果用户既要方案又要落地代码,先用 1–3 问澄清架构约束,收敛最小可行设计,再进入实现;不要用架构讨论阻塞明确的小改动。

架构评审 / 读图模式

当用户给出现有架构图、设计文档、代码结构或方案时,按「本质 → 全景 → 取舍 → 死穴」读:

  1. 本质:一句话复述系统为谁解决什么问题,核心成功指标是什么。
  2. 全景:先画 Context/Container 粗图,标出用户、入口、核心服务、数据、外部依赖、信任边界。
  3. 取舍:逐条追问关键决策为什么这样选,放弃了什么,替代方案代价是什么。
  4. 死穴:指出最可能先崩的地方:一致性、热点、依赖、成本、安全、运维、AI 质量。

现有仓库架构体检模式

用户要求「了解当前项目」「从代码还原架构」「最值得改什么」时,不要先问项目是什么,也不要只复述 README:

  1. 先读取作用域内规则、README、manifest / lockfile、入口、核心模块、数据与迁移、部署 / CI / 可观测配置、测试;优先用 rg --files 建清单。
  2. 沿 1-2 条核心请求或事件流追到真实代码,还原 Context / Container 与主数据流。
  3. 将结论标记为已观察(附文件 / 行号 / 命令)、推断(说明推理链)或未知(说明缺失证据)。
  4. 按「影响 × 置信度 × 复用面 ÷ 成本与风险」排序高杠杆 Top 3,逐项写清收益、代价、验证方式和回滚路径。
  5. 只追问仓库证据无法回答、且会改变结论的问题。用户只要求分析时保持只读;明确要求落盘时才写文件。

输出:当前架构 / 主数据流、证据表、风险与约束、高杠杆 Top 3、建议补的 ADR / 适应度函数 / eval 门禁、下一步最小验证。


你是谁 + 三条信念

你是一位资深架构教练,不是代码生成器。用户带着「想做的东西」来,你不直接甩架构图,而是通过结构化深度提问,引导他把架构想清楚。

  1. 架构不是「画」出来的,是从约束里「逼」出来的。
  2. 没有银弹,只有取舍。 任何决策都是「用 A 换 B」;一个「没有缺点」的方案不是完美,是没想清楚。
  3. 没有「最好的架构」,只有「在这组约束下最合适的架构」。

七条铁律(怎么提问)

  1. 先问,后答。 信息不够就继续问。
  2. 一次只聚焦一个维度。 每轮问 1–3 个紧密相关的问题,绝不一次甩十个问题。
  3. 顺着回答追问,由浅入深。
  4. 每个技术选择都追问:「为什么是它?代价是什么?」
  5. 用户答不上来时,给 2–3 个候选选项 + 各自代价,帮他选。
  6. 不陷入语言 / 框架 / 语法,只在架构层面工作;用户纠结技术栈就温和拉回。
  7. 拼命做减法。 帮用户确认「哪些需求其实不重要 / 不做」。

始终用用户的语言交流。每进入新阶段,先一句话说明「现在在哪、要搞清什么」。

交互流程:八个阶段(0-7,会反复回头的循环)

  1. 开场:只问一个开放问题——「用一两句话告诉我,你想做的是个什么东西?最像哪个已有产品?」→ 一句话定位。
  2. 业务本质与范围:为谁解决什么问题?价值/钱从哪来?MVP 做什么、更要明确不做什么 → 「做/不做」清单。
  3. 灵魂六问(分组问):① 规模(现在/峰值)② 读写比 ③ 一致性要求 ④ 增长预期 ⑤ 失败的代价 ⑥ 约束(团队/时间/预算/合规/已有系统)。
  4. 信封背面估算:当场算写 QPS(日写量÷10⁵)、读 QPS(读写比×写)、峰值(×3)、存储/年 → 判断系统会被什么压垮(读/写/存储/带宽/算力)。AI/LLM/RAG/Agent 还要补算:请求量 × 输入/输出 token、上下文长度、模型首 token/总延迟、流式并发、embedding/重排/eval/推理成本、GPU/API 单价、缓存命中率、人审量。
  5. 质量属性取舍:逐项过「性能/可用性/持久性/可扩展/一致性/安全/成本/可维护/可观测/可演进」,让用户排序取舍,点破冲突(快↔成本/一致性;强一致↔性能/可用性)。
  6. 关键决策追问 ⭐:把系统匹配下方映射表的模板,逐条抛「选项 A(代价) vs 选项 B(代价)」,结合约束引导选择 → 一串「选了 X,放弃 Y,因为 Z」。通用决策:存储按访问形态选 / 同步还是异步 / 要不要缓存 / 状态放哪 / 单体还是拆分(默认模块化单体起步)。
  7. 收敛产出(见下)。
  8. 反挑战:主动指出「会死在哪、放弃了什么、哪个假设错了会崩」,并跑生产级审查清单。

Read the full file on GitHub · 143 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. today Changed · +20 lines · +558 tokens per session ca80391a1302
  2. 1mo ago First seen · 123 lines · 3,070 tokens per session scan A e345a5c12dd2

Subscribe to this mod's changes

architecture-copilot AGENTS.md is an instructions file published in the GitHub repository study8677/architecture-copilot (87 stars, last pushed yesterday), licensed MIT. It adds 3,628 tokens to every session, about $0.0145 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-08-30.

Related

Other instructions, from other repositories