create-agents-md
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate AGENTS.md
创建AGENTS.md
Create as the agent's table of contents — a ~100-line map
pointing to deeper sources of truth in . Agents start here,
then load only what they need (progressive disclosure).
AGENTS.mddocs/Philosophy: AGENTS.md is a map, not an encyclopedia. A monolithic instruction file crowds out the task and rots instantly. Keep it short; point to deeper docs.
创建作为Agent的目录页——一份约100行的导航图,指向目录中更深度的可信数据源。Agent从该文件启动,仅按需加载所需内容(渐进式披露)。
AGENTS.mddocs/设计理念: AGENTS.md是地图,不是百科全书。 单一庞大的指令文件会挤占任务空间,且内容会快速过时。 保持简短,指向更深层的文档即可。
When to Use
适用场景
- The project has no and you're about to run a swarm or any agent workflow.
AGENTS.md - User asks to "create AGENTS.md", "set up this repo for agents", or "bootstrap agent context".
- The project has an existing AGENTS.md that is overly long or monolithic and needs restructuring.
- 项目没有,且你即将运行swarm或任何Agent工作流。
AGENTS.md - 用户要求「创建AGENTS.md」、「为Agent配置这个仓库」或「初始化Agent上下文」。
- 项目现有AGENTS.md过于冗长或单体化,需要重构。
What to Do
操作步骤
Phase 1: Pre-Flight Detection
第一阶段:启动前检测
Before generating anything, detect and report.
生成任何内容之前,先做检测并上报。
1. Inspect the Project
1. 检查项目信息
| Check | How |
|---|---|
| Project name | |
| Package manager | |
| Framework & stack | Read |
| Source layout | Scan top-level directories ( |
| Existing agent docs | Check for |
| Existing gitignore | Check |
| 检查项 | 检查方式 |
|---|---|
| 项目名称 | 取 |
| 包管理器 | 存在 |
| 框架与技术栈 | 读取 |
| 源码结构 | 扫描顶层目录( |
| 现有Agent文档 | 检查是否存在 |
| 现有gitignore配置 | 检查 |
2. Detect Feedback Commands
2. 检测反馈命令
Auto-detect from scripts, then confirm with user:
package.json| Command | Look for in scripts |
|---|---|
| Typecheck | |
| Lint | |
| Test | |
| Coverage | |
| Mutation | |
| E2E | |
从的scripts字段自动检测,然后向用户确认:
package.json| 命令类型 | scripts中匹配的关键词 |
|---|---|
| 类型检查 | |
| 代码检查 | |
| 测试 | |
| 覆盖率 | |
| 变异测试 | |
| 端到端测试 | |
3. Report and Confirm
3. 上报并确认
Show the user what you found and what will be generated:
Pre-Flight: create-agents-md
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project: my-app (pnpm, TypeScript, React, Vitest)
Feedback commands: typecheck, lint, test, test:mutate:incremental
Existing docs: CLAUDE.md found (will reference from Knowledge Base)
spec/SPEC.md found (will migrate to docs/product-specs/)
Will generate:
AGENTS.md (~100 lines, the TOC)
docs/ARCHITECTURE.md (system map)
docs/product-specs/index.md (product requirements catalog)
docs/acceptance/index.md (acceptance test catalog)
docs/adrs/index.md (ADR catalog)
docs/design-docs/index.md (design doc catalog)
docs/design-docs/core-beliefs.md (agent-first principles)
docs/exec-plans/active/ (active plans directory)
docs/exec-plans/completed/ (completed plans directory)
docs/QUALITY.md (quality grades)
Proceed? [Y/n]Only generate after user confirms.
向用户展示检测结果和即将生成的内容:
Pre-Flight: create-agents-md
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project: my-app (pnpm, TypeScript, React, Vitest)
Feedback commands: typecheck, lint, test, test:mutate:incremental
Existing docs: CLAUDE.md found (will reference from Knowledge Base)
spec/SPEC.md found (will migrate to docs/product-specs/)
Will generate:
AGENTS.md (~100 lines, the TOC)
docs/ARCHITECTURE.md (system map)
docs/product-specs/index.md (product requirements catalog)
docs/acceptance/index.md (acceptance test catalog)
docs/adrs/index.md (ADR catalog)
docs/design-docs/index.md (design doc catalog)
docs/design-docs/core-beliefs.md (agent-first principles)
docs/exec-plans/active/ (active plans directory)
docs/exec-plans/completed/ (completed plans directory)
docs/QUALITY.md (quality grades)
Proceed? [Y/n]仅在用户确认后再生成内容。
Phase 2: Generate
第二阶段:生成内容
1. Create docs/
directory structure
docs/1. 创建docs/
目录结构
docs/Always create the full structure:
docs/
├── ARCHITECTURE.md ← system map
├── QUALITY.md ← quality grades per domain/layer
├── lessons.md ← persistent project lessons (meta)
├── product-specs/
│ ├── index.md ← catalog of product spec files
│ └── (migrate existing spec files here, or create starters)
├── acceptance/
│ ├── index.md ← catalog of .feature files
│ └── (seed .feature files from existing specs if available)
├── adrs/
│ ├── index.md ← catalog of ADRs
│ └── (seed from existing "Key Decisions" sections)
├── design-docs/
│ ├── index.md ← design doc catalog
│ └── core-beliefs.md ← agent-first principles
└── exec-plans/
├── active/ ← plans being worked
└── completed/ ← finished plans (history)始终创建完整的结构:
docs/
├── ARCHITECTURE.md ← 系统架构图
├── QUALITY.md ← 各领域/层级的质量等级
├── lessons.md ← 持久化的项目经验总结(元信息)
├── product-specs/
│ ├── index.md ← 产品规范文件目录
│ └── (将现有规范文件迁移至此,或创建初始模板)
├── acceptance/
│ ├── index.md ← .feature文件目录
│ └── (如果有现有规范,可生成对应的.feature初始文件)
├── adrs/
│ ├── index.md ← ADR目录
│ └── (从现有「关键决策」章节导入初始内容)
├── design-docs/
│ ├── index.md ← 设计文档目录
│ └── core-beliefs.md ← Agent优先开发原则
└── exec-plans/
├── active/ ← 进行中的计划
└── completed/ ← 已完成的计划(历史记录)2. Create AGENTS.md
AGENTS.md2. 创建AGENTS.md
AGENTS.mdUse the template below. Fill every placeholder with real values.
Aim for 80–100 lines.
使用下方模板,将所有占位符替换为真实值,总长度控制在80-100行左右。
3. Update .gitignore
.gitignore3. 更新.gitignore
.gitignoreAppend if not already present:
undefined如果不存在以下内容则追加:
undefinedAgent working files
Agent working files
.swarm/
.claude/
undefined.swarm/
.claude/
undefinedPhase 3: Seed Content (Optional)
第三阶段:导入初始内容(可选)
If the project has existing docs that map to the new structure, offer to
migrate content:
| Existing | Offer to migrate to |
|---|---|
| |
| Inline architecture diagram in old AGENTS.md | |
| "Key Decisions" bullet list | Individual ADR files in |
| Platform gotchas, framework rules | |
| Visual design / theme docs | |
如果项目现有文档可以匹配新的结构,可向用户提出内容迁移建议:
| 现有文档 | 建议迁移到 |
|---|---|
| |
| 旧AGENTS.md中的内嵌架构图 | |
| 「关键决策」列表 | |
| 平台坑点、框架规则 | |
| 视觉设计/主题文档 | |
Product Specs vs. Acceptance Tests
产品规范 vs 验收测试
These are related but distinct:
Product Specs (docs/product-specs/) Acceptance Tests (docs/acceptance/)
───────────────────────────────────── ──────────────────────────────────────
Prose. Human intent. The "what & why." Gherkin. Testable contract. The "how to verify."
Organized by domain area. Organized by feature, date-named like migrations.
Evolves as the product vision changes. Updated when specific behaviors change.
Read by humans and agents for context. Read by agents to verify behavior, can generate
runnable tests (Playwright, Detox, Vitest).
Example: Example:
"Users hear audio chunks and self-grade Feature: Listening Session
their comprehension using an Anki-style Scenario: Grade gating — phrases tapped
rating system. Grade gating restricts Given the answer is revealed
higher grades when hints are used." And I have tapped 1 or more phrases
Then the "All" grade button should be disabledThe flow:
- Product specs capture the vision and requirements (prose)
- Acceptance tests distill the specs into precise, testable scenarios (Gherkin)
- E2E tests implement the scenarios as runnable code (Playwright/Detox)
When requirements change:
- Update the product spec first (the intent)
- Update or create acceptance test .feature files (the contract)
- The failing acceptance tests drive the implementation change
二者相关但定位不同:
产品规范 (docs/product-specs/) 验收测试 (docs/acceptance/)
───────────────────────────────────── ──────────────────────────────────────
文本形式,表达人类的诉求,是「是什么&为什么」 Gherkin格式,可测试的契约,是「怎么验证」
按业务领域组织 按功能组织,像迁移文件一样按日期命名
随产品愿景变化迭代 仅当具体行为变更时更新
供人类和Agent读取获取上下文 供Agent读取验证行为,可生成可运行测试(Playwright、Detox、Vitest)
示例: 示例:
"用户收听音频片段,并使用类似Anki的评级 Feature: Listening Session
系统自行评估理解程度。使用提示时会限制高 Scenario: Grade gating — phrases tapped
等级的评分。" Given the answer is revealed
And I have tapped 1 or more phrases
Then the "All" grade button should be disabled工作流:
- 产品规范记录愿景和需求(文本形式)
- 验收测试将规范提炼为精确的、可测试的场景(Gherkin格式)
- E2E测试将场景实现为可运行的代码(Playwright/Detox)
需求变更时:
- 先更新产品规范(明确意图)
- 更新或创建验收测试的.feature文件(明确契约)
- 失败的验收测试驱动代码实现变更
Product Spec File Naming
产品规范文件命名规则
Use domain-based names in :
docs/product-specs/- — high-level product description, target user, core principles
overview.md - — schemas, entities, relationships
data-model.md - or individual screen files (e.g.,
screens.md,home-screen.md)session-screen.md - — external API contracts
api-integration.md - — theme, typography, haptics (can also live in design-docs/)
visual-design.md
For large specs (like a 400-line monolith), break them into domain files
during migration. Each file should be independently useful — an agent working
on the audio system should only need to load , not the
entire product spec.
audio-system.mddocs/product-specs/- — 产品高层描述、目标用户、核心原则
overview.md - — schema、实体、关系
data-model.md - 或单独的页面文件(例如
screens.md、home-screen.md)session-screen.md - — 外部API契约
api-integration.md - — 主题、排版、触感反馈(也可以放在design-docs/下)
visual-design.md
如果是大型规范(比如400行的单体文件),迁移时拆分为不同领域的文件。每个文件应该可以独立使用:负责音频系统的Agent只需要加载,不需要读取整个产品规范。
audio-system.mdAcceptance Test File Naming
验收测试文件命名规则
Use date-prefixed names in :
docs/acceptance/YYYY-MM-DD-feature-name.feature- e.g.,
2026-03-07-listening-session.feature
New features get new files with today's date. When requirements change,
either update the existing file or create a new dated file (if the
change is significant enough to track chronologically).
docs/acceptance/YYYY-MM-DD-feature-name.feature- 例如
2026-03-07-listening-session.feature
新功能对应新建当天日期的文件。需求变更时,如果改动足够大需要按时间追踪,就新建日期文件,否则更新现有文件即可。
AGENTS.md Template
AGENTS.md模板
Fill all values. Aim for 80–100 lines.
[PLACEHOLDER]markdown
undefined填充所有占位符,总长度控制在80-100行左右。
[PLACEHOLDER]markdown
undefinedAGENTS.md
AGENTS.md
Project
项目信息
- Name: [PROJECT NAME]
- Description: [One-line description]
- Tech stack: [e.g. TypeScript, React, Vite, Vitest, Playwright, Stryker]
- Package manager: [pnpm/npm/yarn/bun]
- Source layout:
- — [purpose]
[dir]/ - — [purpose]
[dir]/
- 名称: [PROJECT NAME]
- 描述: [一行描述]
- 技术栈: [例如 TypeScript, React, Vite, Vitest, Playwright, Stryker]
- 包管理器: [pnpm/npm/yarn/bun]
- 源码结构:
- — [用途]
[dir]/ - — [用途]
[dir]/
Feedback Commands
反馈命令
Run in this order. All must pass before committing.
[Typecheck command][Lint command][Unit test command][Mutation command — only if detected][E2E command — only if detected]
按以下顺序运行,提交前必须全部通过。
[类型检查命令][代码检查命令][单元测试命令][变异测试命令 — 仅检测到存在时添加][E2E测试命令 — 仅检测到存在时添加]
Knowledge Base
知识库
Start here. Load deeper docs only when working on the relevant domain.
| Topic | Location |
|---|---|
| Architecture overview | docs/ARCHITECTURE.md |
| Product specs | docs/product-specs/index.md |
| Acceptance tests (Gherkin) | docs/acceptance/index.md |
| Architectural decisions | docs/adrs/index.md |
| Design docs & principles | docs/design-docs/index.md |
| Active execution plans | docs/exec-plans/active/ |
| Quality grades | docs/QUALITY.md |
| Lessons learned | docs/lessons.md |
Progressive disclosure: Do NOT load all docs upfront. Read this file, then load the specific doc relevant to your current task.
从这里开始,仅在处理相关领域时加载更深层的文档。
| 主题 | 位置 |
|---|---|
| 架构概览 | docs/ARCHITECTURE.md |
| 产品规范 | docs/product-specs/index.md |
| 验收测试(Gherkin) | docs/acceptance/index.md |
| 架构决策记录 | docs/adrs/index.md |
| 设计文档与原则 | docs/design-docs/index.md |
| 进行中的执行计划 | docs/exec-plans/active/ |
| 质量等级 | docs/QUALITY.md |
| 经验总结 | docs/lessons.md |
渐进式披露: 不要预先加载所有文档。先阅读本文件,再加载与当前任务相关的特定文档。
Core Principles
核心原则
- Simplicity First: Make every change as simple as possible. Impact minimal code.
- No Laziness: Find root causes. No temporary fixes. Senior developer standards.
- Verify Before Done: Run tests. Ask: "Would a staff engineer approve this?"
- Spec Traceability: Every behavior should trace to an acceptance test in docs/acceptance/.
- Architecture First: Consult docs/adrs/ before making structural decisions.
- 简约优先: 所有变更尽可能简单,影响最小范围的代码。
- 杜绝偷懒: 找到根因,不使用临时修复方案,符合高级开发人员标准。
- 完工前验证: 运行测试,自问:「资深工程师会批准这个改动吗?」
- 规范可追溯: 所有行为都可以追溯到docs/acceptance/中的验收测试。
- 架构优先: 做结构决策前先参考docs/adrs/中的记录。
Keeping Docs Current
保持文档最新
Stale docs are worse than no docs. Updating docs is part of completing any task.
When your work affects any of these, update them as part of the same change:
| If you... | Then update... |
|---|---|
| Change a feature's behavior | Product spec + acceptance test .feature file |
| Add a new feature | Product spec + new .feature file + docs/acceptance/index.md |
| Make a structural decision | Create a new ADR in docs/adrs/ + update index |
| Change module boundaries / data flow | docs/ARCHITECTURE.md |
| Fix a platform gotcha or learn a rule | docs/design-docs/ (e.g. platform-gotchas.md) |
| Improve or degrade quality metrics | docs/QUALITY.md |
| Change the tech stack | This file (AGENTS.md Project section) |
| Learn from a mistake or failed approach | docs/lessons.md |
Do NOT defer doc updates to a separate task. The agent (or human) who makes
the change is the one who knows the context — capture it now.
过时的文档比没有文档更糟,更新文档是完成任何任务的一部分。
当你的工作影响以下内容时,在同一变更中同步更新:
| 如果你... | 则需要更新... |
|---|---|
| 变更功能行为 | 产品规范 + 对应验收测试.feature文件 |
| 添加新功能 | 产品规范 + 新的.feature文件 + docs/acceptance/index.md |
| 做出结构决策 | 在docs/adrs/中创建新ADR + 更新目录 |
| 变更模块边界/数据流 | docs/ARCHITECTURE.md |
| 修复平台坑点或总结出新规则 | docs/design-docs/(例如platform-gotchas.md) |
| 提升或降低质量指标 | docs/QUALITY.md |
| 变更技术栈 | 本文件(AGENTS.md的项目信息章节) |
| 从错误或失败方案中总结经验 | docs/lessons.md |
不要将文档更新推迟到单独的任务。做出变更的Agent(或人类)是最了解上下文的人,应该当场记录。
Maintaining Acceptance Tests
维护验收测试
- When requirements change, update the relevant file in
.featuredocs/acceptance/ - New features MUST have acceptance scenarios before implementation begins
- Update when adding/removing feature files
docs/acceptance/index.md - Use naming (sorted chronologically)
YYYY-MM-DD-feature-name.feature - Acceptance tests are the contract — if the code doesn't match the .feature file, the code is wrong (unless the spec changed, in which case update the spec first)
- 需求变更时,更新中对应的
docs/acceptance/文件.feature - 新功能在开发开始前必须有验收场景
- 新增/删除功能文件时更新
docs/acceptance/index.md - 使用命名规则(按时间排序)
YYYY-MM-DD-feature-name.feature - 验收测试是契约:如果代码不符合.feature文件,代码是错误的(除非规范先变更了,这种情况先更新规范)
Maintaining Product Specs
维护产品规范
- Product specs capture the vision and requirements in prose
- When the product evolves, update the relevant spec file in
docs/product-specs/ - Break large specs into domain files — each independently loadable
- Specs should be readable without loading the entire knowledge base
- 产品规范以文本形式记录愿景和需求
- 产品迭代时,更新中对应的规范文件
docs/product-specs/ - 将大型规范拆分为领域文件,每个都可以独立加载
- 规范应该不需要加载整个知识库就可以阅读
Maintaining Architectural Decisions
维护架构决策记录
- When making structural decisions (new deps, pattern changes, tech choices),
create
docs/adrs/YYYY-MM-DD-decision-name.md - ADRs are append-only — never edit old decisions, create new ones that supersede
- Update with the new entry
docs/adrs/index.md
- 做出结构决策时(新增依赖、模式变更、技术选型),创建
docs/adrs/YYYY-MM-DD-decision-name.md - ADR是仅追加的:永远不要编辑旧决策,创建新决策覆盖旧决策即可
- 更新添加新条目
docs/adrs/index.md
Lessons
经验总结
Two levels of lessons, serving different purposes:
- — persistent project knowledge. Things any agent needs to know: platform gotchas discovered the hard way, architectural mistakes to avoid, patterns that work well. This file is versioned and survives across all runs.
docs/lessons.md - — tactical swarm-specific lessons. Merge strategies, agent coordination tips, worktree issues. Managed by the swarm skill.
.swarm/lessons.md
After any mistake or failed approach:
- Ask: "Would this lesson help ANY future agent working on this project?"
- Yes → add to
docs/lessons.md - Only relevant to swarm operations → add to
.swarm/lessons.md
- Yes → add to
- Review at the start of each task
docs/lessons.md
两层经验总结,服务不同目的:
- — 持久化的项目知识,所有Agent都需要了解的内容:踩过的平台坑、需要避免的架构错误、经过验证的有效模式。这个文件是版本化的,所有运行过程中都有效。
docs/lessons.md - — 针对swarm的战术经验:合并策略、Agent协调技巧、工作树问题。由swarm技能管理。
.swarm/lessons.md
出现任何错误或失败方案后:
- 自问:「这个经验对未来任何做这个项目的Agent都有用吗?」
- 是 → 添加到
docs/lessons.md - 仅和swarm运营相关 → 添加到
.swarm/lessons.md
- 是 → 添加到
- 每个任务开始前回顾
docs/lessons.md
Off-Limits
禁止操作
- [Project-specific: e.g. Don't modify CI without approval; don't change DB schema]
undefined- [项目特定规则:例如 未经批准不要修改CI;不要变更DB schema]
undefinedAfter Creating
创建完成后
- Tell the user the structure is ready. Agents will read AGENTS.md as their entry point.
- You can output when done so scripts know to continue.
<promise>AGENTS_CREATED</promise>
- 告知用户结构已就绪,Agent会将AGENTS.md作为入口点读取。
- 完成后可以输出,便于脚本识别后继续执行。
<promise>AGENTS_CREATED</promise>
Starter File Templates
初始文件模板
docs/ARCHITECTURE.md
docs/ARCHITECTURE.mddocs/ARCHITECTURE.md
docs/ARCHITECTURE.mdmarkdown
undefinedmarkdown
undefined[PROJECT NAME] — Architecture
[PROJECT NAME] — 架构
System Map
系统地图
[Describe the high-level architecture. Include module boundaries,
data flow, and external dependencies. Keep this current.]
[描述高层架构,包含模块边界、数据流和外部依赖,保持更新。]
Module Boundaries
模块边界
| Module | Directory | Responsibility |
|---|---|---|
| ... | ... | ... |
undefined| 模块 | 目录 | 职责 |
|---|---|---|
| ... | ... | ... |
undefineddocs/product-specs/index.md
docs/product-specs/index.mddocs/product-specs/index.md
docs/product-specs/index.mdmarkdown
undefinedmarkdown
undefinedProduct Specs
产品规范
Product requirements and vision, organized by domain.
These are the source of truth for WHAT the product does and WHY.
Update these when the product vision or requirements change.
Acceptance tests in are the testable distillation
of these specs.
docs/acceptance/| Spec File | Covers |
|---|---|
| ... | ... |
undefined按领域组织的产品需求和愿景,是产品「做什么」和「为什么」的可信数据源。
产品愿景或需求变更时更新这些文件。中的验收测试是这些规范的可测试提炼版本。
docs/acceptance/| 规范文件 | 覆盖范围 |
|---|---|
| ... | ... |
undefineddocs/acceptance/index.md
docs/acceptance/index.mddocs/acceptance/index.md
docs/acceptance/index.mdmarkdown
undefinedmarkdown
undefinedAcceptance Tests
验收测试
Gherkin scenarios defining the behavioral contract of the application.
These are the testable distillation of product specs in .
docs/product-specs/Maintained as files, date-named and sorted chronologically.
.feature| Date | Feature File | Covers |
|---|---|---|
| ... | ... | ... |
定义应用行为契约的Gherkin场景,是中产品规范的可测试提炼版本。
docs/product-specs/以文件形式维护,按日期命名并按时间排序。
.feature| 日期 | 功能文件 | 覆盖范围 |
|---|---|---|
| ... | ... | ... |
Relationship to Product Specs
和产品规范的关系
Product specs (prose) → Acceptance tests (Gherkin) → E2E tests (runnable)
When requirements change:
- Update the product spec (the intent)
- Update or create the .feature file (the contract)
- Failing acceptance tests drive the implementation change
undefined产品规范(文本)→ 验收测试(Gherkin)→ E2E测试(可运行代码)
需求变更时:
- 更新产品规范(明确意图)
- 更新或创建.feature文件(明确契约)
- 失败的验收测试驱动代码实现变更
undefineddocs/adrs/index.md
docs/adrs/index.mddocs/adrs/index.md
docs/adrs/index.mdmarkdown
undefinedmarkdown
undefinedArchitectural Decision Records
架构决策记录
Decisions are append-only. Never edit old ADRs — supersede with new ones.
Named and sorted chronologically.
YYYY-MM-DD-short-description.md| Date | Decision | Status |
|---|---|---|
| ... | ... | Accepted |
undefined决策是仅追加的,永远不要编辑旧ADR — 创建新的ADR覆盖即可。
命名规则为,按时间排序。
YYYY-MM-DD-short-description.md| 日期 | 决策 | 状态 |
|---|---|---|
| ... | ... | 已接受 |
undefineddocs/design-docs/core-beliefs.md
docs/design-docs/core-beliefs.mddocs/design-docs/core-beliefs.md
docs/design-docs/core-beliefs.mdmarkdown
undefinedmarkdown
undefinedCore Beliefs
核心理念
Operating principles for agent-first development in this project.
- Repository is the system of record — anything not in the repo doesn't exist for agents
- Progressive disclosure — start with AGENTS.md, load deeper docs only when needed
- Enforce mechanically — prefer linters and tests over documentation for enforcing rules
- Stale docs are actively harmful — keep docs current or delete them
- Docs are part of the change — updating docs is not a separate task, it's part of completing the work
undefined本项目Agent优先开发的运行原则。
- 仓库是唯一可信数据源 — 任何不在仓库里的内容对Agent来说都不存在
- 渐进式披露 — 从AGENTS.md开始,仅按需加载更深层的文档
- 优先自动化执行 — 规则落地优先使用lint和测试,而不是文档
- 过时的文档有负向价值 — 要么保持文档最新,要么删除
- 文档是变更的一部分 — 更新文档不是单独的任务,是完成工作的一部分
undefineddocs/QUALITY.md
docs/QUALITY.mddocs/QUALITY.md
docs/QUALITY.mdmarkdown
undefinedmarkdown
undefinedQuality Grades
质量等级
Grade each domain/layer on a scale. Update after major changes.
| Domain | Grade | Notes |
|---|---|---|
| ... | ... | ... |
Grading scale:
- A — Well tested, clean architecture, documented
- B — Adequate tests, minor debt, mostly documented
- C — Gaps in coverage, some debt, docs may be stale
- D — Significant gaps, needs attention
- F — Untested, undocumented, high risk
undefined对每个领域/层级打分,重大变更后更新。
| 领域 | 等级 | 备注 |
|---|---|---|
| ... | ... | ... |
评分标准:
- A — 测试覆盖完善,架构简洁,文档齐全
- B — 测试足够,少量技术债务,基本有文档
- C — 覆盖有缺口,存在部分债务,文档可能过时
- D — 缺口明显,需要重点优化
- F — 无测试,无文档,高风险
undefineddocs/lessons.md
docs/lessons.mddocs/lessons.md
docs/lessons.mdmarkdown
undefinedmarkdown
undefinedLessons Learned
经验总结
Persistent project knowledge. Things any agent (or human) needs to know.
Updated whenever a mistake is made, a gotcha is discovered, or a pattern proves
effective. Review this file at the start of each task.
Rule of thumb: If this lesson would save a future agent from making the same mistake, it belongs here. If it's only about swarm coordination or merge strategy, it goes ininstead..swarm/lessons.md
持久化的项目知识,所有Agent(或人类)都需要了解的内容。
每当出现错误、发现坑点、或验证了有效模式时更新。每个任务开始前回顾本文件。
经验法则: 如果这个经验能避免未来的Agent犯同样的错误,就放在这里。如果只和swarm协调或合并策略相关,就放在。.swarm/lessons.md
Platform & Framework
平台与框架
- [e.g. "NativeWind v4: never use @tailwind base — it breaks Pressable styles"]
- [e.g. "Detox on Fabric: testID alone doesn't work, must add nativeID too"]
- [例如:「NativeWind v4:永远不要使用@tailwind base — 会破坏Pressable样式」]
- [例如:「Fabric架构上的Detox:仅testID不生效,必须同时添加nativeID」]
Architecture
架构
- [e.g. "Keep all Gemini calls in a single service file — spreading them causes inconsistent error handling"]
- [例如:「所有Gemini调用都放在单个服务文件里 — 分散会导致错误处理不一致」]
Testing
测试
- [e.g. "Always disable Detox synchronization for async operations"]
- [例如:「异步操作必须禁用Detox同步」]
Process
流程
- [e.g. "When breaking up a monolith, move tests first — they tell you what's actually coupled"]
undefined- [例如:「拆分单体代码时先迁移测试 — 测试会告诉你实际的耦合关系」]
undefined