archview AGENTS.md

archview AGENTS.md is an instructions file for Codex, OpenCode from LZZLHY/archview. It costs 1,400 tokens per session, scanned A, original, MIT.

A repository instruction file for ArchView, a tool that creates architecture diagrams showing how software modules depend on one another. It points coding agents to the documents and commands needed to install, use, or modify the project.

In plain words
What is it for?
Use it when working on ArchView, especially for installation, code changes, workspace summaries, and understanding its design limits.
Why use it?
It gives agents the project rules, design constraints, setup guidance, and validation commands they need before changing code.

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/lzzlhy/archview/agents-md
Clone the repo
git clone --depth 1 https://github.com/LZZLHY/archview

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 archview AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/lzzlhy/archview/agents-md.svg)](https://agentmods.dev/instructions/lzzlhy/archview/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/lzzlhy/archview/agents-md"><img src="https://agentmods.dev/badge/instructions/lzzlhy/archview/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,400 This file is loaded in full into every session.
When invoked 1,400 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.01400 $0.01400
Opus 5 $0.00700 $0.00700
Sonnet 5 $0.00280 $0.00280
Haiku 4.5 $0.00140 $0.00140

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

Security

Grade A, and why

archview 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 · 75 lines

How it starts

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

AGENTS.md

ArchView —— 给一个仓库画「模块之间怎么依赖」的架构图:拓扑全部来自 tree-sitter 静态分析(CodeGraph), LLM 只负责给每个节点写一句人话摘要。同一份图通过 MCP 暴露给 IDE 里的 agent。单机、只绑 127.0.0.1

这份文件只是路牌。按你被派来干的活挑一条:

你要干的事 去读
安装 / 使用 ArchView SETUP-FOR-AI.md —— 从 URL 到看见图的完整剧本,含决策点与失败对策
改这个仓库的代码 CONTRACT.md —— 硬约束地基,不是风格指南。四条铁律 + 冻结的节点 ID 方案 + 图 schema
给某个工作区写语义摘要 那个工作区里的 <你的仓库>/.archview/AGENT-GUIDE.md,不是这里。它带着那个工作区的实况,每次重建自动刷新
了解设计取舍与已知限制 README.md(第 3 节为什么值得存在、第 10 节谁不该用它)

改代码之前必须知道的

铁律 1:LLM 永远不写拓扑。 节点、边、模块划分只能由 CodeGraph 的 tree-sitter 输出派生。 agent 只能提供 summarytags。看到「模块总览少一条我确信存在的边」时,正确做法是接受它 (并去 README.md 第 10 节看解析边界),不是在 builder 里按包名猜补 —— 猜出来的拓扑就是 LLM 写拓扑的另一种形式。另外三条铁律(summary 非空 / layer 覆盖全部文件节点 / 文件级边必须上卷) 与它们的验收指标在 CONTRACT.md

节点 ID 方案是冻结的:摘要文件用节点 ID 做 key,改 ID 等于作废所有人已有的摘要资产。

关键命令

pnpm install                 # 首次会刷一串 ENOENT WARN(bin 指向还不存在的 dist/),正常,别重试
pnpm build                   # 六个包:五个 tsc + packages/web 的 Vite
pnpm -r run typecheck        # ⚠️ 必须在 build 之后,否则一定报 TS2307(跨包类型走 dist/*.d.ts,而 dist/ 是 gitignore 的)

验收(改完至少跑这几条;跑之前先清 ARCHVIEW_* 环境变量残留,否则你测的可能是另一个仓库):

pnpm --filter @archview/server run test                  # 基线 16/16
node packages/server/scripts/acceptance.mjs              # fixture 模式,基线 46 通过 / 0 失败
node packages/mcp/scripts/acceptance.mjs                 # fixture 模式,基线 37/37
node final-check.mjs                                     # fixture 模式,基线 14/14 + 1 跳过(ArkTS 那项不适用)
node packages/core/scripts/selfcheck.mjs --workspace <工作区目录>   # 9/9,**必须**是真实工作区

前三个不给 --workspace 就自建一次性 fixture 工作区os.tmpdir() 下的 4 包小仓库, 自己的临时注册表,跑完删)——默认路径一个字节都不碰用户数据,陌生克隆什么都不用准备就能跑。 想打自己的真仓库再显式给 --workspace <id>

node packages/server/scripts/acceptance.mjs --workspace <id>        # 基线 47/0(ArkTS 工作区;只读,除非 --rebuild)
node packages/mcp/scripts/acceptance.mjs --workspace <id>           # 它会**写**该工作区的 .archview/(有备份/还原护栏)
node final-check.mjs --workspace <id>                               # 基线 15/15(只读)

Read the full file on GitHub · 75 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. 2d ago First seen · 75 lines · 1,400 tokens per session scan A fa615c179617

Subscribe to this mod's changes

archview AGENTS.md is an instructions file published in the GitHub repository LZZLHY/archview (0 stars, last pushed 10d ago), licensed MIT. It adds 1,400 tokens to every session, about $0.0070 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-31.

Related

Other instructions, from other repositories

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

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

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.

github/spec-kit · 7,104 tokens

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.

openai/codex · 5,182 tokens

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.

langchain-ai/langchain · 4,345 tokens

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

microsoft/vscode · 5,001 tokens

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.

vercel/next.js · 7,296 tokens