Decision Drivers
【免费下载链接】aiThe AI Toolkit for TypeScript. From the creators of Next.js, the AI SDK is a free open-source library for building AI-powered applications and agents项目地址: https://gitcode.com/GitHub_Trending/ai/ai
- CI speed: current 3+ minute DB setup is the bottleneck in our 5-minute pipeline
- Test isolation: zero shared state between parallel test runs
- Production parity: must catch SQL dialect issues before they hit production
驱动因素的作用是给后续"选 A 不选 B"提供可引用的依据,使权衡过程可追溯。它服务于模板定位中的一条硬性要求:**必须引用具体驱动因素和权衡来论证所选方案**。 ### 4.3 Considered Options(候选方案) 列出至少两个真实考虑的方案(不能只写"做某事 vs 不做某事"这种稻草人对比)。该节只放标题,每个方案的详细论证放到后面的 Pros and Cons 节。审查清单([review-checklist.md](https://link.gitcode.com/i/09db4f32660f2f8fa38b77a6676097b2))明确要求:每个被否决的方案必须解释**为什么被否决**,而不只是罗列它是什么。 ### 4.4 Decision Outcome 与 Consequences(决策结论与后果) ```markdown ## Decision Outcome Chosen option: "{title of option 1}", because {justification — reference drivers and tradeoffs}. ### Consequences - Good, because {positive consequence} - Bad, because {negative consequence} - Neutral, because {consequence that is neither positive nor negative}结论部分直接点名所选方案,并用一句"because ..."串联驱动因素与权衡。后果部分使用Good / Bad / Neutral三分法——这是本模板相对传统 ADR 的一个显著扩展:Neutral 用于记录"既不好也不坏"但确实存在的后果(例如"抽象层增加了约 200 行代码,但也让未来的数据库迁移更容易")。审查清单特别警告:如果后果全是正面的,很可能是选择性粉饰,应追问"什么变得更难了?维护成本是什么?"。
4.5 Implementation Plan:Agent 优先的核心章节
这是模板中最重要的章节,它决定了一份 ADR 是否真正"可执行"。模板给出的结构为:
- Affected paths:需要改动的文件与目录(如
src/db/、src/config/database.ts、tests/integration/); - Dependencies:需要增删改的依赖包,带版本约束(如 "add
better-sqlite3@11.x, removepg-mem"); - Patterns to follow:引用仓库中已有的代码模式(如 "follow the repository pattern in
src/db/repositories/"); - Patterns to avoid:明确"不要做什么"(如 "do not use raw SQL outside the>// ADR: Using better-sqlite3 for test database // See: docs/decisions/2025-06-15-use-sqlite-for-test-database.md import Database from 'better-sqlite3';
4.6 Verification:复选框式验证标准
### Verification - [ ] {verification criterion 1, e.g., "`npm test` passes with SQLite as the test database"} - [ ] {verification criterion 2, e.g., "no direct `pg` imports outside `src/db/client.ts`"} - [ ] {verification criterion 3, e.g., "CI pipeline completes in under 60 seconds"}【免费下载链接】aiThe AI Toolkit for TypeScript. From the creators of Next.js, the AI SDK is a free open-source library for building AI-powered applications and agents
项目地址: https://gitcode.com/GitHub_Trending/ai/ai
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考