source-reading-methodology AGENTS.md

A set of instructions for using and maintaining a source-reading methodology: a process for studying large open-source codebases and writing explanations that can be traced back to exact source lines.

In plain words
What is it for?
Use it to read a module, write an architecture analysis, or create a technical book or course from source code. It also guides updates to the methodology repository and checks published material.
Why use it?
It reduces unsupported claims, copied-code mistakes, and unclear research scope when an AI explains a codebase. It also keeps the methodology and its supporting files consistent when the repository changes.

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/itshen/source-reading-methodology/agents-md
Clone the repo
git clone --depth 1 https://github.com/itshen/source-reading-methodology

Made for: Codex, OpenCode.

Per session 539 This file is loaded in full into every session.
When invoked 539 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.00539 $0.00539
Opus 5 $0.00269 $0.00269
Sonnet 5 $0.00108 $0.00108
Haiku 4.5 $0.00054 $0.00054

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

Security

Grade A, and why

source-reading-methodology 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 · 25 lines

What it actually says

给 AI 的入口

这个仓库是一套源码精读方法论:带 AI 精读大型开源仓库,产出每句话都能回溯到源码具体行的书稿、课程或技术文档。

要用这套方法论干活

动手之前先完整读 SKILL.md 它是唯一入口,一份文件讲完整套流程:四阶段工作流、零幻觉铁律、引用格式、文风约束、机器校验、并行生产。需要细节时再去读 templates/PITFALLS.mdbook/README.md,不要凭印象补。

一条不可妥协:每一个技术论断都可回溯到源码的具体行。 代码块必须与源文件逐字节一致,行号动笔前用读文件工具实读核实,中间跳过内容要写显式省略标记,查不到就写明「未找到对应实现,检索关键词为 X、Y」。编一个看起来合理的,整份产出的可信度就是零。

接到任务先问清产出形态和规模再动手。读懂一个模块、写一篇架构分析、做一门几十节的课,该走的阶段数完全不同,四阶段全流程很重,小任务不需要。

要改这个仓库本身

  • 方法论正文改 METHODOLOGY.md,改完确认 SKILL.md 里的对应段落没跟它矛盾。两份都是入口,漂移了后来的人会按错的那份做
  • 新踩的坑加进 PITFALLS.md,写清现象、原因、怎么防。不写抽象教训
  • 动过 book/ 的主题或 sample/chapters/,重建样张并确认产物正常:
python3 book/build_book.py --config sample/book.config.json   # 产物在 docs/,提交后 Pages 自动发布
python3 book/shot_book.py docs -c ch-02.html                  # 截图校对,同时报告页面 JS 报错
  • 面向读者的正文交付前跑 python3 templates/style_scan.py <路径>,句式禁忌必须清零。不要用同义替换绕过正则,禁的是那种表达方式,不是那几个字
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 · 25 lines · 539 tokens per session scan A 3ce4d045aaa2

Subscribe to this mod's changes

source-reading-methodology AGENTS.md is an instructions file published in the GitHub repository itshen/source-reading-methodology (127 stars, last pushed 8d ago), licensed MIT. It adds 539 tokens to every session, about $0.0027 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.