> For the complete documentation index, see [llms.txt](https://zhouhao4221.gitbook.io/haiqing-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zhouhao4221.gitbook.io/haiqing-docs/02-design/design-decisions.md).

# 设计决策日志

## 为什么需要这个文档

设计决策有记忆损耗。几个月后，没有人记得"为什么按钮是直角而不是圆角"，新来的设计师或 AI 会觉得这是个疏漏，悄悄改掉它。

这个文档的目的是让每一个重要的设计取舍有据可查——不只记录"做了什么"，更记录"为什么这样做"。

***

## 什么值得记录

符合以下任意一条就记下来：

* **做了取舍**：有明确的备选方案被放弃，未来可能有人质疑
* **违反直觉**：选了不常见的方案，不写原因会被当 bug 改掉
* **影响范围广**：多个页面或组件都受这个决策约束
* **有时效背景**：当时的约束将来可能消失，届时决策应重新评估

不需要记录：显而易见的选择、纯实现细节、能从代码直接读出意图的决定。

***

## 记录格式

```markdown
## [编号] 标题
**日期**：YYYY-MM
**状态**：有效 / 已推翻 / 待评审

**背景**：面临什么问题，为什么需要做这个决策。

**考虑的方案**：
- 方案 A：优点是什么，缺点是什么
- 方案 B：优点是什么，缺点是什么

**决策**：选了哪个，核心理由是什么。

**影响**：会影响哪些组件或场景，有哪些已知权衡。
```

决策被推翻时，不删除原条目，在原条目末尾追加推翻说明和日期，再新建一条。

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://zhouhao4221.gitbook.io/haiqing-docs/02-design/design-decisions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
