Skip to content

Commit 1a75665

Browse files
committed
Refactor AI documentation structure and workflows
- Deleted obsolete ADR-002: Thin Tool Adapters document. - Updated naming-and-paths.md to clarify root entry file rules. - Revised project-structure.md to reflect current repository shape and usage rules. - Removed tool-entrypoints.md as it was redundant. - Enhanced verification.md to include CI gate details and usage rules. - Updated design-system.md and documentation.md for clarity on frontend constraints. - Removed outdated workflows for adding backend, frontend, fullstack features, fixing bugs, and releasing. - Updated pyproject.toml to include maintainer email. - Deleted scripts for checking AI docs and syncing adapters as they are no longer needed.
1 parent 0008429 commit 1a75665

32 files changed

Lines changed: 272 additions & 1164 deletions

AGENTS.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Project Agent Entrypoint
22

3-
<!-- Generated by scripts/sync_ai_adapters.py -->
4-
53
This file is the cross-tool entrypoint for this repository.
64

75
## Read order
@@ -13,6 +11,46 @@ This file is the cross-tool entrypoint for this repository.
1311
## Working rules
1412

1513
- Treat `ai_docs/` as the only detailed source of truth
16-
- Read `current/` before `standards/` and `workflows/`
14+
- Read `current/` before `standards/`, and use `reference/` for shared commands or paths
1715
- Keep changes minimal, typed, and explicit
1816
- Update docs whenever behavior, structure, scripts, adapters, or public APIs change
17+
18+
## Execution style
19+
20+
### Think before editing
21+
22+
- State assumptions when they affect the implementation
23+
- If multiple interpretations exist, surface them instead of choosing silently
24+
- Prefer clarifying uncertainty before editing files
25+
- If a simpler approach exists, say so before implementing
26+
- Push back when warranted instead of mechanically following a weak approach
27+
- If something is unclear, stop, name the confusion, and ask
28+
29+
### Simplicity first
30+
31+
- Choose the smallest change that fully solves the task
32+
- Do not add speculative flexibility, configuration, or abstraction
33+
- Prefer direct fixes over framework-like restructuring
34+
- Do not add features beyond what was asked
35+
- Do not create abstractions for single-use code
36+
- Do not add error handling for impossible scenarios
37+
- If a change grows large but could be much smaller, simplify it before shipping
38+
39+
### Surgical diffs
40+
41+
- Touch only files and lines that relate to the request
42+
- Match existing project style and terminology
43+
- Do not improve adjacent code, comments, or formatting unless required by the task
44+
- Do not refactor things that are not broken
45+
- If you notice unrelated dead code, mention it instead of deleting it
46+
- Remove only the imports, variables, functions, or docs made obsolete by your own change
47+
- Every changed line should trace directly to the user's request
48+
49+
### Goal-driven verification
50+
51+
- Turn each task into a verifiable outcome
52+
- For non-trivial work, keep a short plan and verification path in mind before editing
53+
- Use `ai_docs/reference/verification.md` before claiming completion
54+
- Translate vague requests into concrete checks whenever possible
55+
- Prefer testable targets such as reproducing a bug, proving invalid input fails, or confirming behavior before and after a refactor
56+
- Keep looping until the requested outcome is verified, not just implemented

CLAUDE.md

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,55 @@
11
# Claude Code Project Instructions
22

3-
<!-- Generated by scripts/sync_ai_adapters.py -->
4-
53
## Read order
64

75
1. Start at [AGENTS.md](AGENTS.md)
8-
2. Check tool entrypoints in [ai_docs/reference/tool-entrypoints.md](ai_docs/reference/tool-entrypoints.md)
9-
3. Use [ai_docs/workflows/start-task.md](ai_docs/workflows/start-task.md) to route the task
6+
2. Use [ai_docs/START_HERE.md](ai_docs/START_HERE.md) for the current documentation layout
7+
3. Use [ai_docs/INDEX.md](ai_docs/INDEX.md) to route the task
108
4. Run the relevant section in [ai_docs/reference/verification.md](ai_docs/reference/verification.md)
119

1210
## Claude-specific notes
1311

1412
- Use [AGENTS.md](AGENTS.md) as the shared project entrypoint
15-
- Route task-specific work through `ai_docs/INDEX.md` and `ai_docs/workflows/`
13+
- Route task-specific work through `ai_docs/INDEX.md`
1614
- Keep this file thin; detailed rules live in `ai_docs/`
15+
16+
## Claude execution style
17+
18+
### Think before coding
19+
20+
- State assumptions explicitly when they shape the solution
21+
- If multiple valid interpretations exist, surface the tradeoff instead of guessing
22+
- If something is unclear, stop and clarify before editing
23+
- If a simpler approach exists, say so before implementing
24+
- Push back when warranted instead of following a weak approach blindly
25+
- Name confusion directly rather than hiding it behind implementation
26+
27+
### Simplicity first
28+
29+
- Implement the minimum change that solves the requested problem
30+
- Do not add extra features, configuration, or abstraction that was not requested
31+
- If a simpler solution exists, prefer it
32+
- Do not add abstractions for single-use code
33+
- Do not add speculative flexibility
34+
- Do not add error handling for impossible scenarios
35+
- If a large solution could clearly be much smaller, rewrite it before shipping
36+
37+
### Surgical changes
38+
39+
- Keep diffs tightly scoped to the task
40+
- Do not refactor adjacent code, comments, or formatting unless the request requires it
41+
- Clean up only the fallout caused by your own changes
42+
- Match existing style even when you would normally choose differently
43+
- If you notice unrelated dead code, mention it instead of deleting it
44+
- Remove only imports, variables, functions, or docs that your own changes made obsolete
45+
- Every changed line should trace directly to the user's request
46+
47+
### Goal-driven execution
48+
49+
- For multi-step tasks, keep a brief plan with a verification step for each major change
50+
- Prefer tests or direct checks that prove the requested outcome
51+
- Before declaring success, run the relevant commands in [ai_docs/reference/verification.md](ai_docs/reference/verification.md)
52+
- Translate vague requests into concrete, verifiable goals before implementing
53+
- Treat bug fixes as reproduction plus proof of fix
54+
- Treat refactors as behavior-preserving changes that must verify before and after
55+
- Keep iterating until the success criteria are verified, not merely approximated

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ python scripts/rename_package.py my_new_project
131131
脚本会同时处理:
132132

133133
- `src/python_template/` 目录重命名
134-
- 文档、配置、前端文件、AI 配置中的模板名称替换
134+
- 文档、配置和前端文本文件中的模板名称替换
135135
- `frontend/package.json``name`
136136
- `frontend/index.html``<title>`
137137

@@ -265,7 +265,7 @@ frontend/src/
265265
3. 在项目根目录运行 `npx getdesign@latest add linear.app`,安装对应的 `DESIGN.md`
266266
4. 然后要求你的 AI assistant 在后续 UI 工作中使用项目根目录的 `DESIGN.md`
267267

268-
更详细的前端设计流程和约束请看 `ai_docs/standards/design-system.md``ai_docs/workflows/add-frontend-feature.md`
268+
更详细的前端设计约束请看 `ai_docs/standards/design-system.md``ai_docs/standards/frontend.md`
269269

270270
常用命令:
271271

@@ -335,21 +335,19 @@ pnpm --prefix frontend build
335335
2. `ai_docs/INDEX.md`
336336
3. `ai_docs/current/architecture.md`
337337
4. `ai_docs/reference/verification.md`
338-
5. 按任务进入 `ai_docs/current/*``ai_docs/standards/*``ai_docs/workflows/*`
338+
5. 按任务进入 `ai_docs/current/*``ai_docs/standards/*``ai_docs/reference/*`
339339

340340
如果任务涉及前端 UI:
341341

342342
- 先看 `ai_docs/standards/design-system.md`
343-
- 再看 `ai_docs/workflows/add-frontend-feature.md`
343+
- 再看 `ai_docs/standards/frontend.md`
344344
- 如果项目根目录已经有 `DESIGN.md`,把它和上面两份文档一起作为 UI 工作输入
345345

346346
当前文档覆盖:
347347

348348
- `current/`:当前真实实现
349349
- `standards/`:工程准则和默认约束
350-
- `workflows/`:任务执行流程
351-
- `reference/`:共享事实,例如验证命令、目录结构、工具入口
352-
- `decisions/`:设计决策与架构原因
350+
- `reference/`:共享事实,例如验证命令、目录结构和命名规则
353351

354352
## Release
355353

ai_adapter_config.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

ai_docs/INDEX.md

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## How to use this index
44

55
- 按任务场景找文档,不按文件名猜。
6-
- 先看 `current/` 确认当前实现,再看 `standards/` `workflows/`
7-
- 涉及命令、目录、工具入口时,只引用 `reference/`
6+
- 先看 `current/` 确认仓库今天真实长什么样,再看 `standards/` 确认默认做法
7+
- 涉及命令、目录结构、命名规则时,只引用 `reference/`
88

99
## I want to understand the repository
1010

@@ -16,45 +16,43 @@
1616

1717
- 当前 backend 实现:[backend.md](current/backend.md)
1818
- backend 约束:[backend.md](standards/backend.md)
19-
- 推荐执行流程:[add-backend-feature.md](workflows/add-backend-feature.md)
19+
- 验证命令:[verification.md](reference/verification.md)
2020

2121
## I want to change frontend code
2222

2323
- 当前 frontend starter:[frontend.md](current/frontend.md)
2424
- frontend 约束:[frontend.md](standards/frontend.md)
25-
- 当前设计系统[design-system.md](standards/design-system.md)
26-
- 推荐执行流程:[add-frontend-feature.md](workflows/add-frontend-feature.md)
25+
- 视觉和交互基线[design-system.md](standards/design-system.md)
26+
- 验证命令:[verification.md](reference/verification.md)
2727

28-
## I want to change full-stack behavior
28+
## I want to fix a bug or review a change
2929

30-
- 当前系统边界:[architecture.md](current/architecture.md)
31-
- backend 现状:[backend.md](current/backend.md)
32-
- frontend 现状:[frontend.md](current/frontend.md)
33-
- 推荐执行流程:[add-fullstack-feature.md](workflows/add-fullstack-feature.md)
30+
- 工程准则:[engineering.md](standards/engineering.md)
31+
- 文档准则:[documentation.md](standards/documentation.md)
32+
- 验证命令:[verification.md](reference/verification.md)
3433

35-
## I want to fix a bug
34+
## I want to update scripts or docs
3635

37-
- 统一 bug 修复流程:[fix-bug.md](workflows/fix-bug.md)
38-
- 验证命令:[verification.md](reference/verification.md)
36+
- 当前脚本现状:[scripts.md](current/scripts.md)
37+
- 文档写作准则:[documentation.md](standards/documentation.md)
38+
- 命名与路径规则:[naming-and-paths.md](reference/naming-and-paths.md)
3939

40-
## I want to review or polish a change
40+
## I want to initialize or maintain the template
4141

42-
- 工程准则:[engineering.md](standards/engineering.md)
43-
- 文档准则:[documentation.md](standards/documentation.md)
44-
- 评审流程:[review-change.md](workflows/review-change.md)
42+
- 包名重命名与项目名替换:[scripts.md](current/scripts.md)
43+
- 版本更新:[scripts.md](current/scripts.md)
44+
- pre-commit 初始化:[scripts.md](current/scripts.md)
45+
- release notes 生成:[scripts.md](current/scripts.md)
46+
- 无用代码扫描:[scripts.md](current/scripts.md)
47+
- 相关验证命令:[verification.md](reference/verification.md)
4548

4649
## I want to release
4750

4851
- 当前发版方式:[release.md](current/release.md)
49-
- 发版流程:[release.md](workflows/release.md)
50-
51-
## I want to update AI adapters
52-
53-
- 工具入口清单:[tool-entrypoints.md](reference/tool-entrypoints.md)
54-
- 工程与文档准则:[engineering.md](standards/engineering.md)
55-
- 设计决策:[adr-002-tool-adapter-strategy.md](decisions/adr-002-tool-adapter-strategy.md)
52+
- 验证命令:[verification.md](reference/verification.md)
5653

57-
## I want the design rationale
54+
## I want to update AI entry docs
5855

59-
- 为什么 `ai_docs/` 是唯一详细事实源:[adr-001-ai-docs-source-of-truth.md](decisions/adr-001-ai-docs-source-of-truth.md)
60-
- 为什么 adapter 要保持轻量:[adr-002-tool-adapter-strategy.md](decisions/adr-002-tool-adapter-strategy.md)
56+
- 仓库结构与入口位置:[project-structure.md](reference/project-structure.md)
57+
- 路径与命名规则:[naming-and-paths.md](reference/naming-and-paths.md)
58+
- 文档准则:[documentation.md](standards/documentation.md)

ai_docs/START_HERE.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,29 @@
33
## When to read
44

55
- 第一次进入这个仓库时先读这里。
6-
- 当你不确定某个任务该看哪份文档时,先回到这里。
6+
- 当你不确定某个任务应该看哪份文档时,先回到这里。
77

88
## What this folder is
99

1010
`ai_docs/` 是这个仓库给 AI 助手、自动化工具和协作者共用的唯一详细事实源。
1111

12-
规则
12+
目录
1313

14-
- 共享事实只在 `ai_docs/` 维护一次。
15-
- 任务入口文件只做路由,不重复维护完整正文。
16-
- 当前实现、工程准则、任务流程、共享参考、设计决策分别落在不同层。
14+
- `current/`:当前真实实现
15+
- `standards/`:默认约束、工程规则和写作准则
16+
- `reference/`:共享事实,例如目录结构、命名规则和验证命令
1717

1818
## Fast path by task
1919

2020
- 想快速理解仓库:先读 [INDEX.md](INDEX.md),再读 [architecture.md](current/architecture.md)
21-
- 想做 backend 改动:先读 [backend.md](current/backend.md),再到 [INDEX.md](INDEX.md) 选择 backend workflow。
22-
- 想做 frontend 改动:先读 [frontend.md](current/frontend.md),再到 [INDEX.md](INDEX.md) 选择 frontend workflow。
23-
- 想做 full-stack 改动:先读 [architecture.md](current/architecture.md),再到 [INDEX.md](INDEX.md) 选择 full-stack workflow。
24-
- 想修 bug:先到 [INDEX.md](INDEX.md) 选择 bugfix workflow。
25-
- 想发版:先读 [release.md](current/release.md),再到 [INDEX.md](INDEX.md) 选择 release workflow。
26-
- 想更新 AI 入口文件或规则:先读 [tool-entrypoints.md](reference/tool-entrypoints.md),再到 [INDEX.md](INDEX.md) 找 adapter 入口。
21+
- 想改 backend:先读 [backend.md](current/backend.md),再读 [backend.md](standards/backend.md)
22+
- 想改 frontend:先读 [frontend.md](current/frontend.md),再读 [frontend.md](standards/frontend.md)[design-system.md](standards/design-system.md)
23+
- 想初始化或维护模板:先读 [scripts.md](current/scripts.md),再到 [INDEX.md](INDEX.md) 里的模板维护入口找对应任务。
24+
- 想改脚本、README 或协作文档:先读 [scripts.md](current/scripts.md),再读 [documentation.md](standards/documentation.md)
25+
- 想发版:先读 [release.md](current/release.md),再看 [verification.md](reference/verification.md)
2726

2827
## Shared references
2928

3029
- 验证命令唯一来源:[verification.md](reference/verification.md)
3130
- 项目结构唯一来源:[project-structure.md](reference/project-structure.md)
3231
- 命名与路径约定唯一来源:[naming-and-paths.md](reference/naming-and-paths.md)
33-
- 工具入口与适配层说明唯一来源:[tool-entrypoints.md](reference/tool-entrypoints.md)
34-
35-
## Notes on legacy docs
36-
37-
- 旧路径文档仍保留为兼容入口,但正文已经迁到新结构。
38-
- 如果看到旧文档,请按文档里的跳转说明进入新路径,不要继续在旧文档上扩写。

ai_docs/current/architecture.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,36 @@
33
## When to read
44

55
- 想快速理解仓库现在已经落地了什么时先读这里。
6-
- 想判断某项能力是“当前实现”还是“未来推荐扩展”时先读这里。
6+
- 想判断某项描述属于“当前实现”还是“后续扩展方向”时先读这里。
77

88
## Current truth
99

10-
这个仓库当前是一个面向 AI 协作的前后端模板,不是已经内建完整业务系统的脚手架
10+
这个仓库当前是一个面向 AI 协作的前后端模板,而不是已经内建完整业务系统的脚手架
1111

1212
它已经提供:
1313

1414
- Python 包基础设施:配置、日志、上下文、协议、模型、工具模块
1515
- React + Vite 前端 starter
16-
- 一组维护脚本和 release 流程
17-
- 一套给多家 AI 工具消费的入口文件和规则 adapter
18-
- 一套分层的 `ai_docs/` 文档系统
16+
- 一组仓库维护脚本和 release 流程
17+
- 根目录 AI 入口文件:`AGENTS.md``CLAUDE.md`
18+
- 一套精简后的 `ai_docs/` 文档系统
1919

2020
它当前没有内建:
2121

22-
- 完整的 API / service / repository / domain 目录实现
23-
- 完整业务数据库层
24-
- 真实 full-stack demo 业务流
25-
- 多页面前端应用或复杂状态管理
22+
- 完整的 HTTP API / service / repository / domain 分层实现
23+
- 数据库 schema、迁移或持久化层
24+
- 真实业务 full-stack demo
25+
- 多页面前端应用或复杂前端状态架构
2626

2727
## Subsystems
2828

29-
- backend、frontend、scripts 和 release 的进一步阅读路径请从 `ai_docs/INDEX.md` 进入。
29+
- backend 的真实实现见 [backend.md](backend.md)
30+
- frontend 的真实实现见 [frontend.md](frontend.md)
31+
- scripts 的真实实现见 [scripts.md](scripts.md)
32+
- release 的真实实现见 [release.md](release.md)
3033

3134
## Shared references
3235

3336
- 项目结构见 [project-structure.md](../reference/project-structure.md)
34-
- 工具入口见 [tool-entrypoints.md](../reference/tool-entrypoints.md)
37+
- 命名与路径规则见 [naming-and-paths.md](../reference/naming-and-paths.md)
3538
- 验证命令见 [verification.md](../reference/verification.md)

ai_docs/current/backend.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
- 当前模型位于 `python_template.models`
3232
- 对外公共导出在 `python_template.models.__init__`
33-
- 模板当前提供 `BaseModel``TimestampMixin` 和几个示例模型
33+
- 当前公开导出包括 `BaseModel``TimestampMixin``User``ApiResponse``PaginatedResponse``ConfigModel`
3434

3535
## Public imports and SDK usage
3636

@@ -50,9 +50,10 @@
5050
- 当前还没有内建持久化层
5151
- 当前还没有按业务领域拆开的 service / repository / domain 结构
5252

53-
这些属于后续项目扩展方向,具体约束请从 `ai_docs/INDEX.md` 进入对应 standards 和 workflows
53+
这些属于后续项目扩展方向,具体做法以 standards 文档和当前代码现状为准
5454

5555
## Shared references
5656

57+
- backend 约束见 [backend.md](../standards/backend.md)
5758
- 项目结构见 [project-structure.md](../reference/project-structure.md)
5859
- 验证命令见 [verification.md](../reference/verification.md)

0 commit comments

Comments
 (0)