audit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOutput style (plain words, no dashes, no hyphens)
输出风格(平实表述,不要使用破折号、连字符)
<!-- OUTPUT-STYLE:START -->
Write everything this skill produces, files and messages alike, in plain simple language. Keep technical terms that carry real meaning; explain each in plain words. Never use a dash or a hyphen as punctuation: no em dash, no en dash, and no hyphenated compounds. Write , not . Say it in simple words, or reword the sentence. Code, file paths, command flags, and values other skills match on keep their hyphens. Use short sentences, commas, or parentheses. Clear beats clever.
<!-- OUTPUT-STYLE:END -->read onlyread-only<!-- OUTPUT-STYLE:START -->
本skill生成的所有内容,包括文件和消息,都要用简单平实的语言撰写。保留具有实际意义的技术术语,并用平实语言解释每个术语。绝对不要将破折号或连字符用作标点:不要使用长破折号、短破折号,也不要使用连字符构成的复合词。请写,不要写。用简单的语言表述,或改写句子。代码、文件路径、命令标志以及其他skill需要匹配的值可保留连字符。使用短句、逗号或括号表述。清晰比巧妙更重要。
<!-- OUTPUT-STYLE:END -->read onlyread-onlyWhat this skill does
本skill的功能
The context bootstrapper: writes the files every later skill and AI tool reads.
AGENTS.md- Greenfield (no code yet): ask for coding standards, seed root from the answers plus the build approach (name and one line principle) from the scope header if
AGENTS.mdset one. Runs after the project is scaffolded with its chosen stack (/scope→/scopedecides the stack → scaffold →/architect); earlier is premature./audit - Brownfield, undocumented (code, no ): scan the whole project, write root
AGENTS.mdand nestedAGENTS.mdfiles, judging what is global (root) vs area specific (nested).<area>/AGENTS.md - Brownfield, partially documented: check existing root and nested docs against the whole codebase; add only what is missing (new global facts, nested docs for undocumented areas); never clobber curated content.
Does not create specs (/architect owns those), maintain files after changes (/sync owns that), or write the feature scope (/scope owns ).
docs/scope/上下文引导工具:生成后续所有skill和AI工具都会读取的文件。
AGENTS.md- 全新项目(暂无代码):询问编码标准,根据回答加上范围头中设置的构建方案(名称和一行原则,若已设置)生成根目录
/scope。需在项目通过选定技术栈完成脚手架搭建后运行(流程为AGENTS.md→/scope确定技术栈 → 脚手架搭建 →/architect);过早运行无意义。/audit - 已有项目、无文档(有代码但无):扫描整个项目,生成根目录
AGENTS.md和嵌套的AGENTS.md文件,区分全局内容(根目录)和区域特定内容(嵌套文件)。<area>/AGENTS.md - 已有项目、部分文档:对照整个代码库检查现有根目录和嵌套文档;仅补充缺失内容(新的全局信息、无文档区域的嵌套文档);绝不会覆盖人工整理的内容。
本skill不生成规格文档(由/architect负责)、不维护变更后的文件(由/sync负责)、不编写功能范围文档(由/scope负责目录)。
docs/scope/Context file convention (AGENTS.md is canonical)
上下文文件规范(AGENTS.md为权威文件)
Durable context lives in the tool agnostic (root and nested); every agent (Codex, Cursor, Claude Code, and others) reads it. is only a one line pointer whose entire body imports the sibling via Claude Code's import (exact pointer body in ); content is never duplicated across the two.
AGENTS.mdCLAUDE.mdAGENTS.md@agent-prompt.md- Write knowledge into . Create it when missing. Never overwrite an existing
AGENTS.md(it may be user or tool authored); gap fill conservatively, with permission.AGENTS.md - Migrate legacy content: a with content but no
CLAUDE.md→ ask permission, move its content into a newAGENTS.md, replaceAGENTS.mdwith the pointer. Never silently discard curated content.CLAUDE.md - Root stays short and global; nested only for meaningful areas with real conventions (same root/nested rules as previously applied to
AGENTS.md).CLAUDE.md
持久化上下文存储在与工具无关的(根目录和嵌套目录)中;所有Agent(Codex、Cursor、Claude Code等)都会读取该文件。仅为一行指针文件,其内容通过Claude Code的导入语法导入同级的(指针具体内容见);两类文件绝不会重复存储内容。
AGENTS.mdCLAUDE.md@AGENTS.mdagent-prompt.md- 将知识写入。若文件缺失则创建。绝不要覆盖现有
AGENTS.md(可能由用户或其他工具创建);需谨慎补充内容,且需获得许可。AGENTS.md - 迁移旧版内容:若存在有内容的但无
CLAUDE.md→ 询问用户许可,将AGENTS.md的内容迁移至新创建的CLAUDE.md,并将AGENTS.md替换为指针文件。绝不要静默丢弃人工整理的内容。CLAUDE.md - 根目录文件应简洁且包含全局内容;仅当有实际规范的重要区域才创建嵌套(根目录/嵌套目录规则与之前
AGENTS.md的规则一致)。CLAUDE.md
Scope
范围
An area path argument (e.g. , ) triggers Phase 3. With no argument, the signals below route to Phase 0 (ambiguous: ask new vs existing), Phase 1 (greenfield: ask standards, seed root), Phase 2 (established, no root AGENTS.md: whole-repo scan), or Phase 4 (root AGENTS.md exists: gap-fill). A legacy with content but no is migrated, then treated as Phase 4.
authsrc/paymentsPre-flightCLAUDE.mdAGENTS.md若传入区域路径参数(如、),则触发第三阶段。若无参数,以下预检信号将引导至不同阶段:阶段0(模糊状态:询问是新项目还是已有项目)、阶段1(全新项目:询问标准,生成根目录文件)、阶段2(已有项目但无根目录AGENTS.md:全仓库扫描)或阶段4(根目录AGENTS.md已存在:补充缺失内容)。若存在有内容的旧版但无,则先完成迁移,再按阶段4处理。
authsrc/paymentsCLAUDE.mdAGENTS.mdActs vs asks
主动操作与询问
Phase 1 asks coding standards questions via MCQ before creating root AGENTS.md. Phase 2 acts immediately, no questions; it writes root and the nested docs it judges warranted. Phases 3 and 4 act to explore but ask permission before modifying an existing root AGENTS.md or migrating a legacy CLAUDE.md; Phase 4 reports nested doc creation for undocumented areas first, then applies on confirmation.
阶段1在创建根目录AGENTS.md前,会通过多选题询问编码标准。阶段2直接执行操作,无需询问;生成根目录文件及判断所需的嵌套文档。阶段3和阶段4会先探索,但在修改现有根目录AGENTS.md或迁移旧版CLAUDE.md前需询问许可;阶段4会先报告为无文档区域创建嵌套文档的计划,确认后再执行。
Artifact ownership
产物归属
The files hold the content: create root if missing (Phase 1, 2) and if missing and warranted, by judgment (Phase 2, 3, 4); when one exists, gap-fill or propose additions with permission; never overwrite. The files are pointers only (root and area), created if missing; a legacy one with content is migrated into with permission. When creating a nested , add exactly one pointer line to root under : . Never one per subfolder, only where distinct conventions exist.
AGENTS.md<area>/AGENTS.mdCLAUDE.mdAGENTS.mdAGENTS.mdAGENTS.md## Context files- [<area>/AGENTS.md](<area>/AGENTS.md) (<one-line description>)AGENTS.md<area>/AGENTS.mdCLAUDE.mdCLAUDE.mdAGENTS.mdAGENTS.mdAGENTS.md## Context files- [<area>/AGENTS.md](<area>/AGENTS.md) (<一行描述>)Portability (any OS, any agent)
可移植性(支持任意操作系统、任意Agent)
- Commands: is the only required CLI, same on every OS. Other shell snippets (file counts,
git,find) are POSIX reference, not literal scripts; use your agent's cross platform file tools (search/glob, read, write) to list, count, and check existence.[ -f ] - Bundled files live in this skill's folder: , the phase mode files (
agent-prompt.md), and the pattern presets (modes/*.md). Resolve the folder to an absolute path. Read the matching phase mode file when routing, thenpatterns/*.mdplus the SELECTED pattern preset at write time. Its ALL_CAPS placeholders (PHASE, AREA, ADDITIONAL_STANDARDS, MONOREPO_OR_NO, INSTALLED_SKILLS, DECLINED_TOOLS, and so on) are the inputs you gathered in pre-flight and the question rounds; apply each as you read.agent-prompt.md - No interactive question support? Ask any multiple choice question as plain text with the same options.
- 命令:是唯一要求的CLI工具,各操作系统通用。其他Shell代码片段(文件计数、
git、find)为POSIX参考,并非字面脚本;请使用Agent的跨平台文件工具(搜索/通配符、读取、写入)来列出、计数和检查文件是否存在。[ -f ] - 捆绑文件存储在本skill的文件夹中:、阶段模式文件(
agent-prompt.md)和模式预设文件(modes/*.md)。需将文件夹解析为绝对路径。路由时读取匹配的阶段模式文件,写入时读取patterns/*.md加上选定的模式预设文件。文件中的全大写占位符(PHASE、AREA、ADDITIONAL_STANDARDS、MONOREPO_OR_NO、INSTALLED_SKILLS、DECLINED_TOOLS等)为预检和问答环节收集的输入信息;读取时需替换为对应内容。agent-prompt.md - 不支持交互式提问?请将多选题以纯文本形式列出相同选项。
Execution
执行流程
The main thread does the writing itself in every phase; it never hands the writing to a subagent. The only subagent this skill spawns reads the codebase, and only when the scan is large: a read only on the cheapest model (Claude Code: , never inheriting the session model) that returns a compact map, from which the main thread writes. A small greenfield scaffold or a single area needs no scout; the main thread reads it directly. Right before writing, the main thread reads (its persona, per phase instructions, and the templates) plus, in Phase 1, the one selected pattern preset file; it then writes following that guide. Read only at write time, not during .
AGENTS.mdscouthaikuagent-prompt.mdAGENTS.mdagent-prompt.mdpre-flight每个阶段的写入操作均由主线程自行完成;绝不会将的写入任务交给子Agent。本skill仅在扫描内容较大时生成一个子Agent:一个只读的,使用最便宜的模型(Claude Code:,绝不继承会话模型),返回紧凑的代码库映射,主线程基于该映射完成写入。小型全新项目脚手架或单个区域无需scout;主线程可直接读取内容。写入前,主线程需读取(包含角色设定、各阶段说明和模板),阶段1还需读取选定的模式预设文件;随后按照指南完成写入。仅在写入时读取,预检阶段无需读取。
AGENTS.mdscouthaikuagent-prompt.mdAGENTS.mdagent-prompt.mdPre-flight
(main thread does this before anything else)
Pre-flight预检(主线程在所有操作前执行)
Gather several signals (a file count alone misleads: a scaffold inflates it, an unfamiliar language zeroes it):
- Context files: root AGENTS.md present → ; a CLAUDE.md with content only →
ROOT_EXISTS; neither →ROOT_LEGACY.ROOT_MISSING - Source count across common ecosystems (extensions like ), excluding vendored/generated dirs (
.ts/.tsx/.js/.jsx/.py/.go/.rs/.java/.rb/.swift/.kt/.php/.cs/.dart/.ex/.exs/.scala/.c/.cpp/.h/.lua/.clj,node_modules,.git,dist) and config files (build).*.config.* - Established signals: for commit history depth; a real manifest (
git log --oneline,package.json,pyproject.toml,go.mod,Cargo.toml,composer.json,*.csproj,pubspec.yaml,mix.exs).Gemfile - Monorepo signal: workspace markers (,
pnpm-workspace.yaml, aturbo.jsonfield in"workspaces") or anypackage.json/apps/*/package.jsonnear the root.packages/*/package.json - Workflow setup signal (): root AGENTS.md is MISSING while the workflow has already decided the stack, i.e. a
WORKFLOW_SETUParchitecture spec exists (a file with adocs/specs/section), and/or## Proposed stackhas a "Stack and architecture" (or similar foundational scaffold) feature. This is the intended greenfield order (docs/scope/→/scopedecides the stack →/architectscaffolds it →/develop): the project is freshly scaffolded from its chosen stack and still needs its coding standards captured. When this signal fires, the manifest and scaffold source that now exist are the scaffold, not a codebase that already existed./audit
Pick the phase. The order of checks matters: the workflow setup signal outranks the raw code count, because a fresh scaffold has a manifest and source files yet is still greenfield.
| Condition | Phase |
|---|---|
| Area path given as argument | Phase 3 |
| Phase 4 |
| Phase 1, even though a manifest and scaffold source now exist. Ask the coding standards; seed root from the spec's stack. Never treat a just scaffolded workflow project as brownfield. |
| Phase 1 |
| Phase 2, any language |
| Phase 0, ask |
Why this order: the workflow scaffolds a greenfield project (manifest + starter files) BEFORE runs, so a raw code count alone would wrongly read a fresh scaffold as an existing codebase and skip the coding standards questions. The workflow setup signal (a stack spec with no root AGENTS.md) catches exactly that case and routes it to greenfield. Only when there is real feature code, real history, and no in-progress workflow setup is it truly brownfield (Phase 2). Anything ambiguous falls to Phase 0 and asks; never default a maybe greenfield project to brownfield.
/auditMonorepo (): root plus a light stub per workspace, deepen on demand. Each workspace (, ) is a first class area; its primary doc lives at the workspace root (), never buried deeper. A whole-repo run does not deep scan every workspace (too expensive, premature); write the repo root (monorepo wide tooling, shared conventions) plus a light stub per workspace from its manifest, no code scan, with root pointers. The full conventions/gotchas/key files scan happens when the engineer runs (Phase 3) or first builds there, never all upfront. A spot inside a workspace that warrants its own doc () gets one in addition to the workspace root doc, linked from it. A doc already there, buried in a workspace with no workspace root doc: ask: " has a context file at but none at its root. Move it up to , or keep it as a nested doc under a new ?" On move: relocate it to the workspace root. On keep nested: create the workspace root AND keep the deep one, linking it from the root doc. Migrate legacy content per the convention above. Apply plus the workspace list as you write.
MONOREPO=yesapps/*packages/*packages/api/AGENTS.mdAGENTS.mdAGENTS.md/audit packages/apipackages/ui/src/mdx/packages/uisrc/mdx/packages/ui/AGENTS.mdpackages/ui/AGENTS.mdAGENTS.mdCLAUDE.mdMONOREPO=yesLegacy migration (any phase): on , before proceeding ask permission: "I found a with project context but no . I'll move its content into a new (so all tools read it) and replace with a pointer. Proceed?" On yes: copy the content verbatim into , then replace with the pointer; now exists, so continue as Phase 4 (gap-fill). On no: leave both untouched and continue without migrating. Same for any nested .
ROOT_LEGACYCLAUDE.mdAGENTS.mdAGENTS.mdCLAUDE.mdAGENTS.mdCLAUDE.mdAGENTS.md<area>/CLAUDE.md收集多个信号(仅文件计数会产生误导:脚手架会增加文件数,不熟悉的语言会使文件数为0):
- 上下文文件:根目录AGENTS.md存在 → ;仅存在有内容的CLAUDE.md →
ROOT_EXISTS;两者都不存在 →ROOT_LEGACY。ROOT_MISSING - 常见生态系统的源代码文件计数(扩展名如),排除第三方依赖/生成目录(
.ts/.tsx/.js/.jsx/.py/.go/.rs/.java/.rb/.swift/.kt/.php/.cs/.dart/.ex/.exs/.scala/.c/.cpp/.h/.lua/.clj、node_modules、.git、dist)和配置文件(build)。*.config.* - 项目成熟度信号:查看提交历史深度;是否存在真实的清单文件(
git log --oneline、package.json、pyproject.toml、go.mod、Cargo.toml、composer.json、*.csproj、pubspec.yaml、mix.exs)。Gemfile - 单体仓库信号:是否存在工作区标记(、
pnpm-workspace.yaml、turbo.json中的package.json字段)或根目录附近存在"workspaces"/apps/*/package.json。packages/*/package.json - 工作流设置信号():根目录AGENTS.md缺失,但工作流已确定技术栈,即存在
WORKFLOW_SETUP架构规格文件(包含docs/specs/章节),和/或## Proposed stack中有“技术栈与架构”(或类似基础脚手架)功能。这是全新项目的预期流程(docs/scope/→/scope确定技术栈 →/architect搭建脚手架 →/develop):项目刚通过选定技术栈完成脚手架搭建,仍需记录编码标准。触发该信号时,现有清单和脚手架源代码仅为脚手架文件,并非已存在的代码库。/audit
选择阶段。检查顺序至关重要:工作流设置信号优先级高于原始文件计数,因为全新脚手架已有清单和源文件,但仍属于全新项目。
| 条件 | 阶段 |
|---|---|
| 传入区域路径参数 | 阶段3 |
| 阶段4 |
| 阶段1,即使已有清单和脚手架源文件。询问编码标准;基于规格中的技术栈生成根目录文件。绝不要将刚完成脚手架搭建的工作流项目视为已有项目。 |
| 阶段1 |
| 阶段2,支持任意语言 |
| 阶段0,询问用户 |
为何采用此顺序:工作流会在运行前搭建全新项目的脚手架(清单+启动文件),因此仅通过原始文件计数会错误地将全新脚手架判定为已有代码库,从而跳过编码标准询问。工作流设置信号(存在技术栈规格但无AGENTS.md)正好能捕获这种情况,并引导至全新项目阶段。只有当存在真实功能代码、真实提交历史且无正在进行的工作流设置时,才属于真正的已有项目(阶段2)。任何模糊情况都进入阶段0并询问;绝不要将可能为全新项目的情况默认判定为已有项目。
/audit单体仓库():根目录文件加上每个工作区的轻量级存根,按需深化。每个工作区(、)为一级区域;其主文档存储在工作区根目录(),绝不深埋。全仓库扫描不会深度扫描每个工作区(成本过高、为时过早);生成仓库根目录(单体仓库级工具、共享规范)加上每个工作区基于清单生成的轻量级存根,无需代码扫描,并在根目录文件中添加指针。完整的规范/注意事项/关键文件扫描需在工程师运行(阶段3)或首次构建该工作区时进行,绝不会提前全量扫描。工作区内需要独立文档的特定位置(如)可额外创建文档,并链接至工作区根目录文档。若工作区内已有文档但无工作区根目录文档(如的有上下文文件但根目录无),需询问用户:“的存在上下文文件,但工作区根目录无。是否将其移至,或在新创建的下保留为嵌套文档?”若选择移动:将文档移至工作区根目录。若选择保留嵌套:创建工作区根目录并保留深层文档,在根目录文档中添加链接。按照上述规范迁移旧版内容。写入时需应用及工作区列表。
MONOREPO=yesapps/*packages/*packages/api/AGENTS.mdAGENTS.mdAGENTS.md/audit packages/apipackages/ui/src/mdx/packages/uisrc/mdx/packages/uisrc/mdx/packages/ui/AGENTS.mdpackages/ui/AGENTS.mdAGENTS.mdCLAUDE.mdMONOREPO=yes旧版迁移(任意阶段):若检测到,需在继续前询问用户许可:“我发现存在包含项目上下文的但无。我会将其内容迁移至新创建的(以便所有工具读取),并将替换为指针文件。是否继续?”若同意:将内容原封不动复制到,然后将替换为指针文件;此时已存在,后续按阶段4(补充缺失内容)处理。若不同意:保持两者不变,不进行迁移继续执行。嵌套的处理方式相同。
ROOT_LEGACYCLAUDE.mdAGENTS.mdAGENTS.mdCLAUDE.mdAGENTS.mdCLAUDE.mdAGENTS.md<area>/CLAUDE.mdRoute to the selected phase
路由至选定阶段
Phase 0 (ambiguous) is handled inline below. For Phases 1 to 4, read only the matching mode file, then follow it:
- Phase 1 (greenfield setup) →
modes/greenfield.md - Phase 2 (whole-repo scan) →
modes/whole-repo.md - Phase 3 (area scan) →
modes/area.md - Phase 4 (gap-fill) →
modes/gapfill.md
Do not read the other mode files. The greenfield and whole-repo modes additionally read for the Agent Skills / MCP sweep (skip it for area and gap-fill runs).
modes/tool-skills.md阶段0(模糊状态)的处理如下文所示。对于阶段1至4,仅读取匹配的模式文件并遵循其指引:
- 阶段1(全新项目设置)→
modes/greenfield.md - 阶段2(全仓库扫描)→
modes/whole-repo.md - 阶段3(区域扫描)→
modes/area.md - 阶段4(补充缺失内容)→
modes/gapfill.md
不要读取其他模式文件。全新项目和全仓库模式还需读取以完成Agent Skills / MCP扫描(区域扫描和补充缺失内容阶段可跳过)。
modes/tool-skills.mdPhase 0: Classify (only when pre-flight
is ambiguous)
pre-flight阶段0:分类(仅当预检结果模糊时执行)
Don't guess. Ask once via your agent's interactive option picker ( on Claude Code), or plain text with the same options. Mark one option by whichever signal is stronger (a scaffold like tree with a manifest but little history leans New; real feature code and deep history leans Existing), and the picker adds a free text custom slot last:
AskUserQuestion(recommended)- question: "I can't tell if this is a new project or an existing codebase (<state why: e.g. 'a manifest exists but I see no source in a language I recognise', or 'files look like untouched scaffolding'>). Which is it?"
- header: "Project state"
- options: 1. , "I'll ask for your coding standards and seed the context." → Phase 1 (read the manifest/scaffold for the stack; still ask standards). 2.
New project, "I'll scan what's here and document it." → Phase 2.Existing codebase
不要猜测。通过Agent的交互式选项选择器(Claude Code的)询问一次,或以纯文本形式列出相同选项。根据较强的信号标记一个推荐选项(如具有清单但提交历史少的脚手架结构倾向于“新项目”;有真实功能代码且提交历史丰富倾向于“已有项目”),选择器最后添加一个自由文本自定义选项:
AskUserQuestion- 问题:“我无法判断这是新项目还是已有代码库(原因:如‘存在清单但未识别到源代码’,或‘文件看起来是未修改的脚手架’)。请确认项目状态?”
- 标题:“项目状态”
- 选项:1. ,“我会询问您的编码标准并生成上下文文件。” → 阶段1(读取清单/脚手架获取技术栈;仍需询问编码标准)。2.
新项目,“我会扫描现有内容并生成文档。” → 阶段2。已有代码库
After all phases
所有阶段完成后
If no was written when it should have been (the file is missing/empty), report the failure and do it again; don't relay success it didn't produce. Otherwise relay the report: what was discovered (2 to 4 bullets), what was written (file paths), what was proposed or skipped (if existing files were found).
AGENTS.md若应生成但未成功(文件缺失/为空),需报告失败并重新执行;不要错误报告成功。否则需提交报告:发现的内容(2-4条要点)、生成的文件(文件路径)、提出的建议或跳过的内容(若发现现有文件)。
AGENTS.mdPattern presets
模式预设
See for the four coding style presets used in Phase 1 (greenfield mode).
patterns/阶段1(全新项目模式)使用的四种编码风格预设见目录。
patterns/Writing guide
撰写指南
See (the main thread reads it at write time; its per phase instructions and templates).
agent-prompt.mdAGENTS.md见(主线程在写入时读取;包含各阶段说明和模板)。
agent-prompt.mdAGENTS.md