create-agents-md

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create AGENTS.md

创建AGENTS.md

Create
AGENTS.md
as the agent's table of contents — a ~100-line map pointing to deeper sources of truth in
docs/
. Agents start here, then load only what they need (progressive disclosure).
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.
创建
AGENTS.md
作为Agent的目录页——一份约100行的导航图,指向
docs/
目录中更深度的可信数据源。Agent从该文件启动,仅按需加载所需内容(渐进式披露)。
设计理念: AGENTS.md是地图,不是百科全书。 单一庞大的指令文件会挤占任务空间,且内容会快速过时。 保持简短,指向更深层的文档即可。

When to Use

适用场景

  • The project has no
    AGENTS.md
    and you're about to run a swarm or any agent workflow.
  • 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.
  • 项目没有
    AGENTS.md
    ,且你即将运行swarm或任何Agent工作流。
  • 用户要求「创建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. 检查项目信息

CheckHow
Project name
package.json
name, or directory name
Package manager
bun.lockb
→ bun,
pnpm-lock.yaml
→ pnpm,
yarn.lock
→ yarn, else npm
Framework & stackRead
package.json
deps, config files (tsconfig, vitest, playwright, detox, stryker, etc.)
Source layoutScan top-level directories (
src/
,
app/
,
lib/
,
services/
,
db/
,
e2e/
, etc.)
Existing agent docsCheck for
AGENTS.md
,
CLAUDE.md
,
CODEX.md
,
spec/
,
docs/
Existing gitignoreCheck
.gitignore
for
.swarm/
,
.claude/
检查项检查方式
项目名称
package.json
的name字段,或目录名
包管理器存在
bun.lockb
→bun,存在
pnpm-lock.yaml
→pnpm,存在
yarn.lock
→yarn,否则为npm
框架与技术栈读取
package.json
的依赖项、配置文件(tsconfig、vitest、playwright、detox、stryker等)
源码结构扫描顶层目录(
src/
app/
lib/
services/
db/
e2e/
等)
现有Agent文档检查是否存在
AGENTS.md
CLAUDE.md
CODEX.md
spec/
docs/
现有gitignore配置检查
.gitignore
中是否包含
.swarm/
.claude/

2. Detect Feedback Commands

2. 检测反馈命令

Auto-detect from
package.json
scripts, then confirm with user:
CommandLook for in scripts
Typecheck
typecheck
,
tsc
,
type-check
Lint
lint
,
biome
,
eslint
Test
test
,
test:unit
,
vitest
,
jest
Coverage
test:coverage
Mutation
test:mutate
,
test:mutate:incremental
E2E
test:e2e
,
e2e
,
detox test
package.json
的scripts字段自动检测,然后向用户确认:
命令类型scripts中匹配的关键词
类型检查
typecheck
tsc
type-check
代码检查
lint
biome
eslint
测试
test
test:unit
vitest
jest
覆盖率
test:coverage
变异测试
test:mutate
test:mutate:incremental
端到端测试
test:e2e
e2e
detox test

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

1. 创建
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

2. 创建
AGENTS.md

Use the template below. Fill every placeholder with real values. Aim for 80–100 lines.
使用下方模板,将所有占位符替换为真实值,总长度控制在80-100行左右。

3. Update
.gitignore

3. 更新
.gitignore

Append if not already present:
undefined
如果不存在以下内容则追加:
undefined

Agent working files

Agent working files

.swarm/ .claude/
undefined
.swarm/ .claude/
undefined

Phase 3: Seed Content (Optional)

第三阶段:导入初始内容(可选)

If the project has existing docs that map to the new structure, offer to migrate content:
ExistingOffer to migrate to
spec/SPEC.md
or similar behavioral spec
docs/product-specs/
(prose) +
docs/acceptance/
(Gherkin distillation)
Inline architecture diagram in old AGENTS.md
docs/ARCHITECTURE.md
"Key Decisions" bullet listIndividual ADR files in
docs/adrs/
Platform gotchas, framework rules
docs/design-docs/platform-gotchas.md
Visual design / theme docs
docs/design-docs/visual-design.md
如果项目现有文档可以匹配新的结构,可向用户提出内容迁移建议:
现有文档建议迁移到
spec/SPEC.md
或类似的行为规范
docs/product-specs/
(文本内容) +
docs/acceptance/
(提炼的Gherkin用例)
旧AGENTS.md中的内嵌架构图
docs/ARCHITECTURE.md
「关键决策」列表
docs/adrs/
下的单独ADR文件
平台坑点、框架规则
docs/design-docs/platform-gotchas.md
视觉设计/主题文档
docs/design-docs/visual-design.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 disabled
The flow:
  1. Product specs capture the vision and requirements (prose)
  2. Acceptance tests distill the specs into precise, testable scenarios (Gherkin)
  3. E2E tests implement the scenarios as runnable code (Playwright/Detox)
When requirements change:
  1. Update the product spec first (the intent)
  2. Update or create acceptance test .feature files (the contract)
  3. 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
工作流:
  1. 产品规范记录愿景和需求(文本形式)
  2. 验收测试将规范提炼为精确的、可测试的场景(Gherkin格式)
  3. E2E测试将场景实现为可运行的代码(Playwright/Detox)
需求变更时:
  1. 先更新产品规范(明确意图)
  2. 更新或创建验收测试的.feature文件(明确契约)
  3. 失败的验收测试驱动代码实现变更

Product Spec File Naming

产品规范文件命名规则

Use domain-based names in
docs/product-specs/
:
  • overview.md
    — high-level product description, target user, core principles
  • data-model.md
    — schemas, entities, relationships
  • screens.md
    or individual screen files (e.g.,
    home-screen.md
    ,
    session-screen.md
    )
  • api-integration.md
    — external API contracts
  • visual-design.md
    — theme, typography, haptics (can also live in design-docs/)
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
audio-system.md
, not the entire product spec.
docs/product-specs/
下的文件按业务领域命名:
  • overview.md
    — 产品高层描述、目标用户、核心原则
  • data-model.md
    — schema、实体、关系
  • screens.md
    或单独的页面文件(例如
    home-screen.md
    session-screen.md
  • api-integration.md
    — 外部API契约
  • visual-design.md
    — 主题、排版、触感反馈(也可以放在design-docs/下)
如果是大型规范(比如400行的单体文件),迁移时拆分为不同领域的文件。每个文件应该可以独立使用:负责音频系统的Agent只需要加载
audio-system.md
,不需要读取整个产品规范。

Acceptance 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
[PLACEHOLDER]
values. Aim for 80–100 lines.
markdown
undefined
填充所有
[PLACEHOLDER]
占位符,总长度控制在80-100行左右。
markdown
undefined

AGENTS.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:
    • [dir]/
      — [purpose]
    • [dir]/
      — [purpose]
  • 名称: [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.
  1. [Typecheck command]
  2. [Lint command]
  3. [Unit test command]
  4. [Mutation command — only if detected]
  5. [E2E command — only if detected]
按以下顺序运行,提交前必须全部通过。
  1. [类型检查命令]
  2. [代码检查命令]
  3. [单元测试命令]
  4. [变异测试命令 — 仅检测到存在时添加]
  5. [E2E测试命令 — 仅检测到存在时添加]

Knowledge Base

知识库

Start here. Load deeper docs only when working on the relevant domain.
TopicLocation
Architecture overviewdocs/ARCHITECTURE.md
Product specsdocs/product-specs/index.md
Acceptance tests (Gherkin)docs/acceptance/index.md
Architectural decisionsdocs/adrs/index.md
Design docs & principlesdocs/design-docs/index.md
Active execution plansdocs/exec-plans/active/
Quality gradesdocs/QUALITY.md
Lessons learneddocs/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 behaviorProduct spec + acceptance test .feature file
Add a new featureProduct spec + new .feature file + docs/acceptance/index.md
Make a structural decisionCreate a new ADR in docs/adrs/ + update index
Change module boundaries / data flowdocs/ARCHITECTURE.md
Fix a platform gotcha or learn a ruledocs/design-docs/ (e.g. platform-gotchas.md)
Improve or degrade quality metricsdocs/QUALITY.md
Change the tech stackThis file (AGENTS.md Project section)
Learn from a mistake or failed approachdocs/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
    .feature
    file in
    docs/acceptance/
  • New features MUST have acceptance scenarios before implementation begins
  • Update
    docs/acceptance/index.md
    when adding/removing feature files
  • Use
    YYYY-MM-DD-feature-name.feature
    naming (sorted chronologically)
  • 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
    docs/adrs/index.md
    with the new entry
  • 做出结构决策时(新增依赖、模式变更、技术选型),创建
    docs/adrs/YYYY-MM-DD-decision-name.md
  • ADR是仅追加的:永远不要编辑旧决策,创建新决策覆盖旧决策即可
  • 更新
    docs/adrs/index.md
    添加新条目

Lessons

经验总结

Two levels of lessons, serving different purposes:
  • docs/lessons.md
    — 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.
  • .swarm/lessons.md
    — tactical swarm-specific lessons. Merge strategies, agent coordination tips, worktree issues. Managed by the swarm skill.
After any mistake or failed approach:
  1. 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
  2. Review
    docs/lessons.md
    at the start of each task
两层经验总结,服务不同目的:
  • docs/lessons.md
    — 持久化的项目知识,所有Agent都需要了解的内容:踩过的平台坑、需要避免的架构错误、经过验证的有效模式。这个文件是版本化的,所有运行过程中都有效。
  • .swarm/lessons.md
    — 针对swarm的战术经验:合并策略、Agent协调技巧、工作树问题。由swarm技能管理。
出现任何错误或失败方案后:
  1. 自问:「这个经验对未来任何做这个项目的Agent都有用吗?」
    • 是 → 添加到
      docs/lessons.md
    • 仅和swarm运营相关 → 添加到
      .swarm/lessons.md
  2. 每个任务开始前回顾
    docs/lessons.md

Off-Limits

禁止操作

  • [Project-specific: e.g. Don't modify CI without approval; don't change DB schema]
undefined
  • [项目特定规则:例如 未经批准不要修改CI;不要变更DB schema]
undefined

After Creating

创建完成后

  • Tell the user the structure is ready. Agents will read AGENTS.md as their entry point.
  • You can output
    <promise>AGENTS_CREATED</promise>
    when done so scripts know to continue.
  • 告知用户结构已就绪,Agent会将AGENTS.md作为入口点读取。
  • 完成后可以输出
    <promise>AGENTS_CREATED</promise>
    ,便于脚本识别后继续执行。

Starter File Templates

初始文件模板

docs/ARCHITECTURE.md

docs/ARCHITECTURE.md

markdown
undefined
markdown
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

模块边界

ModuleDirectoryResponsibility
.........
undefined
模块目录职责
.........
undefined

docs/product-specs/index.md

docs/product-specs/index.md

markdown
undefined
markdown
undefined

Product 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
docs/acceptance/
are the testable distillation of these specs.
Spec FileCovers
......
undefined
按领域组织的产品需求和愿景,是产品「做什么」和「为什么」的可信数据源。
产品愿景或需求变更时更新这些文件。
docs/acceptance/
中的验收测试是这些规范的可测试提炼版本。
规范文件覆盖范围
......
undefined

docs/acceptance/index.md

docs/acceptance/index.md

markdown
undefined
markdown
undefined

Acceptance Tests

验收测试

Gherkin scenarios defining the behavioral contract of the application. These are the testable distillation of product specs in
docs/product-specs/
.
Maintained as
.feature
files, date-named and sorted chronologically.
DateFeature FileCovers
.........
定义应用行为契约的Gherkin场景,是
docs/product-specs/
中产品规范的可测试提炼版本。
.feature
文件形式维护,按日期命名并按时间排序。
日期功能文件覆盖范围
.........

Relationship to Product Specs

和产品规范的关系

Product specs (prose) → Acceptance tests (Gherkin) → E2E tests (runnable)
When requirements change:
  1. Update the product spec (the intent)
  2. Update or create the .feature file (the contract)
  3. Failing acceptance tests drive the implementation change
undefined
产品规范(文本)→ 验收测试(Gherkin)→ E2E测试(可运行代码)
需求变更时:
  1. 更新产品规范(明确意图)
  2. 更新或创建.feature文件(明确契约)
  3. 失败的验收测试驱动代码实现变更
undefined

docs/adrs/index.md

docs/adrs/index.md

markdown
undefined
markdown
undefined

Architectural Decision Records

架构决策记录

Decisions are append-only. Never edit old ADRs — supersede with new ones. Named
YYYY-MM-DD-short-description.md
and sorted chronologically.
DateDecisionStatus
......Accepted
undefined
决策是仅追加的,永远不要编辑旧ADR — 创建新的ADR覆盖即可。 命名规则为
YYYY-MM-DD-short-description.md
,按时间排序。
日期决策状态
......已接受
undefined

docs/design-docs/core-beliefs.md

docs/design-docs/core-beliefs.md

markdown
undefined
markdown
undefined

Core Beliefs

核心理念

Operating principles for agent-first development in this project.
  1. Repository is the system of record — anything not in the repo doesn't exist for agents
  2. Progressive disclosure — start with AGENTS.md, load deeper docs only when needed
  3. Enforce mechanically — prefer linters and tests over documentation for enforcing rules
  4. Stale docs are actively harmful — keep docs current or delete them
  5. Docs are part of the change — updating docs is not a separate task, it's part of completing the work
undefined
本项目Agent优先开发的运行原则。
  1. 仓库是唯一可信数据源 — 任何不在仓库里的内容对Agent来说都不存在
  2. 渐进式披露 — 从AGENTS.md开始,仅按需加载更深层的文档
  3. 优先自动化执行 — 规则落地优先使用lint和测试,而不是文档
  4. 过时的文档有负向价值 — 要么保持文档最新,要么删除
  5. 文档是变更的一部分 — 更新文档不是单独的任务,是完成工作的一部分
undefined

docs/QUALITY.md

docs/QUALITY.md

markdown
undefined
markdown
undefined

Quality Grades

质量等级

Grade each domain/layer on a scale. Update after major changes.
DomainGradeNotes
.........
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 — 无测试,无文档,高风险
undefined

docs/lessons.md

docs/lessons.md

markdown
undefined
markdown
undefined

Lessons 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 in
.swarm/lessons.md
instead.
持久化的项目知识,所有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