reasonweave 0.0.0-stage → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/AGENTS.md +105 -0
  2. package/INSTALL.md +258 -0
  3. package/README.md +284 -2
  4. package/bin/lab.mjs +888 -0
  5. package/constitution.md +55 -0
  6. package/docs/CONSUMER-PROMPTS.md +501 -0
  7. package/docs/backlogs/01-forward-wait-self-detach.md +18 -0
  8. package/docs/backlogs/02-decouple-wait-and-daemon-for-agent-hosts.md +35 -0
  9. package/docs/backlogs/03-baton-wait-multi-id-lightweight-pubsub.md +34 -0
  10. package/docs/backlogs/04-adr-cross-repo-automated-dispatch-boundary.md +19 -0
  11. package/docs/backlogs/05-feat-units-worktree-isolation-engine.md +23 -0
  12. package/docs/backlogs/06-feat-blind-audit-automated-clean-runner.md +22 -0
  13. package/docs/backlogs/07-feat-attention-throttle-silent-pipe.md +23 -0
  14. package/docs/backlogs/08-future-units-shadow-ledger.md +22 -0
  15. package/docs/backlogs/09-feat-agent-baton-core-convergence-and-resilience.md +42 -0
  16. package/docs/backlogs/10-feat-anti-orphan-deterministic-wiring-governance.md +35 -0
  17. package/docs/backlogs/11-perf-orphan-index-fs-read.md +16 -0
  18. package/docs/backlogs/12-feat-vibe-security-anti-suppression-and-orphan-deps.md +43 -0
  19. package/docs/backlogs/13-feat-sdd-reppit-tiered-guardrails.md +40 -0
  20. package/docs/backlogs/14-feat-universal-cli-contract-and-hermetic-test-fixtures.md +48 -0
  21. package/docs/backlogs/15-feat-reasonweave-rebranding-and-doc-code-synchronization-invariant.md +44 -0
  22. package/docs/backlogs/16-feat-micro-engineering-skills-and-sdd-baton-fusion.md +52 -0
  23. package/docs/codegraph-readiness-check.md +49 -0
  24. package/group/architecture/adr/0001-handoff-async-wait-and-reactive-wakeup.md +87 -0
  25. package/group/architecture/adr/0002-de-ritualize-handoff-prompt-for-intra-repo.md +53 -0
  26. package/group/architecture/adr/0003-attention-throttle-and-workspace-driver.md +65 -0
  27. package/group/architecture/adr/0004-spec-guard-and-drift-prevention.md +90 -0
  28. package/group/architecture/adr/0005-global-orphan-scavenger-and-read-only-invariants.md +94 -0
  29. package/group/architecture/adr/0006-triad-engineering-defense-and-mutation-sensitivity.md +68 -0
  30. package/group/architecture/adr/0007-agent-baton-state-machine-defense-and-workspace-jail-spec.md +86 -0
  31. package/group/architecture/adr/0008-agent-baton-core-convergence-and-heterogeneous-session-resilience.md +133 -0
  32. package/group/architecture/adr/0009-anti-orphan-deterministic-wiring-governance-and-federated-guardrails.md +108 -0
  33. package/group/architecture/adr/0010-agent-baton-identity-security-cryptographic-credentials-and-prompt-anti-confusion.md +119 -0
  34. package/group/architecture/adr/0011-vibe-security-anti-suppression-and-dependency-reachability.md +161 -0
  35. package/group/architecture/adr/0012-spec-driven-development-reppit-and-tiered-guardrails.md +130 -0
  36. package/group/architecture/adr/0013-universal-cli-contract-hermetic-testing-and-defensive-probes.md +110 -0
  37. package/group/architecture/adr/0014-reasonweave-rebranding-and-doc-code-synchronization-invariant.md +108 -0
  38. package/group/architecture/adr/0015-micro-engineering-skills-and-dual-core-gate-invariant.md +127 -0
  39. package/group/architecture/adr/INDEX.md +29 -0
  40. package/group/architecture/adr/templates/adr-template.md +33 -0
  41. package/group/architecture/dependency-graph.md +60 -0
  42. package/group/contracts/npm-packaging.md +69 -0
  43. package/group/product/intent.md +24 -0
  44. package/package.json +93 -4
  45. package/scripts/sync-all-consumers.mjs +174 -0
  46. package/specs/RFC-20261110-SPEC-GUARD-UNIT.md +353 -0
  47. package/specs/templates/01-research.md.template +23 -0
  48. package/specs/templates/02-proposals.md.template +22 -0
  49. package/specs/templates/03-spec.md.template +33 -0
  50. package/specs/templates/04-tasks.md.template +29 -0
  51. package/specs/templates/05-evidence.md.template +29 -0
  52. package/specs/templates/README.md +26 -0
  53. package/units/adr/AGENTS.md +85 -0
  54. package/units/adr/CHANGELOG.md +20 -0
  55. package/units/adr/README.md +88 -0
  56. package/units/adr/VERSION.md +10 -0
  57. package/units/adr/docs/existing-project-prompt.md +24 -0
  58. package/units/adr/docs/new-project-prompt.md +36 -0
  59. package/units/adr/scripts/adr-init.sh +101 -0
  60. package/units/adr/templates/INDEX.md +19 -0
  61. package/units/adr/templates/adr-frozen.md +33 -0
  62. package/units/adr/templates/adr-light.md +56 -0
  63. package/units/adr/templates/adr-standard.md +61 -0
  64. package/units/backlog/AGENTS.md +53 -0
  65. package/units/backlog/AUTONOMOUS-GOVERNANCE.md +98 -0
  66. package/units/backlog/CHANGELOG.md +37 -0
  67. package/units/backlog/README.md +124 -0
  68. package/units/backlog/VERSION.md +11 -0
  69. package/units/backlog/docs/existing-project-ironrules-prompt.md +31 -0
  70. package/units/backlog/docs/existing-project-prompt.md +24 -0
  71. package/units/backlog/docs/new-project-prompt.md +19 -0
  72. package/units/backlog/templates/entry.md +39 -0
  73. package/units/backlog/templates/project-ironrules.md +36 -0
  74. package/units/handoffs/AGENT-GUIDE.md +154 -0
  75. package/units/handoffs/AGENTS.md +28 -0
  76. package/units/handoffs/CHANGELOG.md +522 -0
  77. package/units/handoffs/CLAUDE.md +28 -0
  78. package/units/handoffs/COMMANDS.md +187 -0
  79. package/units/handoffs/DESIGN.md +74 -0
  80. package/units/handoffs/README.md +458 -0
  81. package/units/handoffs/RESPONSE-TEMPLATE.md +140 -0
  82. package/units/handoffs/VERSION.md +1 -0
  83. package/units/handoffs/handoff-status.mjs +1017 -0
  84. package/units/handoffs/handoff.mjs +5689 -0
  85. package/units/orphan/CHANGELOG.md +118 -0
  86. package/units/orphan/DESIGN.md +484 -0
  87. package/units/orphan/README.md +143 -0
  88. package/units/orphan/VERSION.md +1 -0
  89. package/units/orphan/adapters/android/index.mjs +140 -0
  90. package/units/orphan/adapters/python/index.mjs +232 -0
  91. package/units/orphan/adapters/web/index.mjs +280 -0
  92. package/units/orphan/bin/lab-orphan.mjs +298 -0
  93. package/units/orphan/core/blob-reader.mjs +142 -0
  94. package/units/orphan/core/classifier.mjs +261 -0
  95. package/units/orphan/core/cleaner.mjs +166 -0
  96. package/units/orphan/core/diff-checker.mjs +341 -0
  97. package/units/orphan/core/inverted-index.mjs +124 -0
  98. package/units/orphan/core/orphan-deps.mjs +192 -0
  99. package/units/orphan/core/protocol-s1-s3.mjs +194 -0
  100. package/units/orphan/core/solver.mjs +217 -0
  101. package/units/orphan/index.mjs +105 -0
  102. package/units/orphan/templates/ci/orphan-guard.yml +36 -0
  103. package/units/orphan/templates/pre-commit.d/30-orphan-guard +34 -0
  104. package/units/orphan/templates/wiring/README.md +51 -0
  105. package/units/orphan/templates/wiring/miniprogram-route-guard.js.template +80 -0
  106. package/units/orphan/templates/wiring/pre-commit-node.sh.template +73 -0
  107. package/units/orphan/templates/wiring/project-agents-gemini-templates.md +60 -0
  108. package/units/orphan/templates/wiring/python-parity-test.py.template +100 -0
  109. package/units/orphan/templates/wiring/rust-exhaustive-match.md +65 -0
  110. package/units/orphan/templates/wiring/swift-periphery.md +56 -0
  111. package/units/orphan/tests/adapters.test.mjs +243 -0
  112. package/units/orphan/tests/orphan-deps.test.mjs +131 -0
  113. package/units/orphan/tests/phase3-gates.test.mjs +135 -0
  114. package/units/playbook/README.md +106 -0
  115. package/units/playbook/ZSPEC-AGENT-GUIDE.md +99 -0
  116. package/units/playbook/docs/01-architecture.md +99 -0
  117. package/units/playbook/docs/02-bootstrap.md +126 -0
  118. package/units/playbook/docs/03-units.md +91 -0
  119. package/units/playbook/docs/04-constitution.md +113 -0
  120. package/units/playbook/docs/05-adr.md +33 -0
  121. package/units/playbook/docs/06-spec-kit.md +76 -0
  122. package/units/playbook/docs/07-backlog.md +30 -0
  123. package/units/playbook/docs/08-codegraph.md +79 -0
  124. package/units/playbook/docs/09-skills.md +101 -0
  125. package/units/playbook/docs/10-handoff.md +72 -0
  126. package/units/playbook/docs/11-evidence.md +163 -0
  127. package/units/playbook/docs/12-gates.md +124 -0
  128. package/units/playbook/docs/13-parallel.md +115 -0
  129. package/units/playbook/docs/14-dependency-graph.md +86 -0
  130. package/units/playbook/docs/15-memory.md +153 -0
  131. package/units/playbook/docs/16-change-control.md +121 -0
  132. package/units/playbook/docs/17-prompts.md +121 -0
  133. package/units/playbook/docs/18-shift-left.md +97 -0
  134. package/units/playbook/docs/19-anti-orphan-vertical-slicing.md +102 -0
  135. package/units/playbook/docs/20-vibe-security-and-anti-suppression.md +88 -0
  136. package/units/playbook/docs/21-spec-driven-reppit-closed-loop.md +88 -0
  137. package/units/playbook/examples/owisel.md +80 -0
  138. package/units/playbook/references/Agent-Engineering-Framework-AEF-v1.0.md +2033 -0
  139. package/units/playbook/references/links.md +103 -0
  140. package/units/playbook/templates/AGENTS.root.md +44 -0
  141. package/units/playbook/templates/AGENTS.unit.md +52 -0
  142. package/units/playbook/templates/adr/INDEX.md +17 -0
  143. package/units/playbook/templates/adr/NNNN-template.md +56 -0
  144. package/units/playbook/templates/backlogs/entry.md +30 -0
  145. package/units/playbook/templates/constitution.md +93 -0
  146. package/units/playbook/templates/evidence/README.md +36 -0
  147. package/units/playbook/templates/group/architecture/dependency-graph.md +48 -0
  148. package/units/playbook/templates/group/architecture/system.md +59 -0
  149. package/units/playbook/templates/group/contracts/api.md +67 -0
  150. package/units/playbook/templates/group/product/intent.md +30 -0
  151. package/units/playbook/templates/group/product/requirements.md +48 -0
  152. package/units/playbook/templates/unit-skeleton/README.md +35 -0
  153. package/units/preflight/AGENTS.md +45 -0
  154. package/units/preflight/CHANGELOG.md +55 -0
  155. package/units/preflight/INSTALL.md +65 -0
  156. package/units/preflight/README.md +104 -0
  157. package/units/preflight/VERSION.md +3 -0
  158. package/units/preflight/docs/audit-requirements.md +114 -0
  159. package/units/preflight/docs/existing-project-prompt.md +25 -0
  160. package/units/preflight/docs/new-project-prompt.md +25 -0
  161. package/units/preflight/docs/transfers/CONSUMER-INSTALL.md +40 -0
  162. package/units/preflight/docs/transfers/CONSUMER-SELFCHECK.md +51 -0
  163. package/units/preflight/docs/transfers/README.md +39 -0
  164. package/units/preflight/docs/transfers/prospero.md +26 -0
  165. package/units/preflight/templates/check.sh +43 -0
  166. package/units/preflight/templates/pre-commit +55 -0
  167. package/units/preflight/templates/pre-commit.d/20-preflight +15 -0
  168. package/units/preflight/templates/preflight.conf.example +21 -0
  169. package/units/preflight/templates/preflight.sh +189 -0
  170. package/units/preflight/templates/wrap-up.md +9 -0
  171. package/units/review-gate/AGENTS.md +42 -0
  172. package/units/review-gate/CHANGELOG.md +58 -0
  173. package/units/review-gate/README.md +118 -0
  174. package/units/review-gate/VERSION.md +3 -0
  175. package/units/review-gate/clean-runner.mjs +350 -0
  176. package/units/review-gate/docs/existing-project-prompt.md +28 -0
  177. package/units/review-gate/docs/new-project-prompt.md +38 -0
  178. package/units/review-gate/docs/transfers/iggle.md +34 -0
  179. package/units/review-gate/docs/transfers/prospero.md +35 -0
  180. package/units/review-gate/docs/transfers/swoop.md +36 -0
  181. package/units/review-gate/docs/transfers/yiqiyihuihua.md +35 -0
  182. package/units/review-gate/templates/.semgrepignore +37 -0
  183. package/units/review-gate/templates/pre-commit +130 -0
  184. package/units/review-gate/templates/scan.sh +158 -0
  185. package/units/skills/AGENTS.md +17 -0
  186. package/units/skills/CHANGELOG.md +18 -0
  187. package/units/skills/README.md +63 -0
  188. package/units/skills/VERSION.md +1 -0
  189. package/units/skills/bin/review-package.mjs +99 -0
  190. package/units/skills/bin/task-brief.mjs +102 -0
  191. package/units/skills/catalog/brainstorming/SKILL.md +75 -0
  192. package/units/skills/catalog/brainstorming/references/design-doc-template.md +28 -0
  193. package/units/skills/catalog/systematic-debugging/SKILL.md +101 -0
  194. package/units/skills/catalog/systematic-debugging/references/root-cause-tracing.md +23 -0
  195. package/units/skills/catalog/test-driven-development/SKILL.md +88 -0
  196. package/units/skills/catalog/test-driven-development/references/writing-good-tests.md +13 -0
  197. package/units/skills/catalog/verification-before-completion/SKILL.md +73 -0
  198. package/units/skills/skills.mjs +181 -0
  199. package/units/skills/tests/pipeline.test.mjs +131 -0
  200. package/units/skills/tests/skill-contract.test.mjs +67 -0
  201. package/units/skills/tests/skills-cli.test.mjs +107 -0
  202. package/units/spec-guard/AGENTS.md +43 -0
  203. package/units/spec-guard/CHANGELOG.md +88 -0
  204. package/units/spec-guard/README.md +148 -0
  205. package/units/spec-guard/VERSION.md +1 -0
  206. package/units/spec-guard/bin/spec-guard.mjs +431 -0
  207. package/units/spec-guard/core/adr-parser.mjs +540 -0
  208. package/units/spec-guard/core/matrix-checker.mjs +587 -0
  209. package/units/spec-guard/core/mutation-runner.mjs +267 -0
  210. package/units/spec-guard/core/scanner.mjs +333 -0
  211. package/units/spec-guard/core/telemetry_authenticator.mjs +484 -0
  212. package/units/spec-guard/core/wiring_tracer.mjs +306 -0
  213. package/units/spec-guard/templates/annotations/ContractOnly.kt +19 -0
  214. package/units/spec-guard/templates/annotations/Invariant.kt +16 -0
  215. package/units/spec-guard/templates/annotations/invariant.go +19 -0
  216. package/units/spec-guard/templates/annotations/invariant.py +38 -0
  217. package/units/spec-guard/templates/annotations/invariant.ts +39 -0
  218. package/units/spec-guard/templates/ci/spec-guard-audit.yml +23 -0
  219. package/units/spec-guard/templates/pre-commit.d/15-spec-guard +72 -0
  220. package/units/spec-guard/templates/spec-matrix.overlay.yml +70 -0
  221. package/units/spec-guard/tests/spec-guard.test.mjs +716 -0
  222. package/units/spec-guard/tests/telemetry_authenticator.test.mjs +633 -0
  223. package/units/worktree/AGENTS.md +22 -0
  224. package/units/worktree/CHANGELOG.md +14 -0
  225. package/units/worktree/README.md +65 -0
  226. package/units/worktree/VERSION.md +1 -0
  227. package/units/worktree/worktree.mjs +352 -0
  228. package//344/275/277/347/224/250/350/257/264/346/230/216.md +322 -0
@@ -0,0 +1,103 @@
1
+ # References — 外部链接索引
2
+
3
+ 本手册每条原则的英文互联网出处,以及各工具的权威文档。
4
+
5
+ ## 框架与规范
6
+
7
+ | 资源 | 链接 | 用途 |
8
+ |---|---|---|
9
+ | **AEF 原文** | `Agent-Engineering-Framework-AEF-v1.0.md`(本目录) | 本手册的权威框架 |
10
+ | **GitHub Spec Kit** | https://github.com/github/spec-kit | SDD 流程;命令参考 `docs/reference/agentic-sdd.md` |
11
+ | Spec Kit Docs | https://github.github.com/spec-kit/ | 安装、extension、preset、workflow |
12
+ | **AGENTS.md 标准** | https://agents.md/ | 指令文件规范;冲突规则"最近优先" |
13
+ | **Handoff 契约** | `~/Documents/lab/handoffs/README.md`(本地) | 跨仓交接契约 + `handoff.mjs` CLI |
14
+
15
+ ## 关键文章(按主题)
16
+
17
+ ### 多 Agent 协作与并行
18
+ | 主题 | 出处 |
19
+ |---|---|
20
+ | 写操作单线程 / swarm 是干扰项 / map-reduce-and-manage | [Cognition — Multi-Agents: What's Actually Working](https://cognition.com/blog/multi-agents-working) |
21
+ | 一 Agent 一分支的黄金法则、任务-Agent 匹配表 | [Sal's 2026 AI Coding Stack(git worktrees)](https://gist.github.com/selcukcift/32868c0746f5fe5e14a35c1f5a89e634) |
22
+ | 容器隔离 + 文件锁抢任务 | [Anthropic — Building a C compiler with a team of parallel Claudes](https://www.anthropic.com/engineering/building-c-compiler) |
23
+ | 结构化 JSON + git commit 通信(misalignment 是头号失败原因) | [CAID, arxiv 2603.21489](https://arxiv.org/html/2603.21489v2) |
24
+ | subagent 不能 spawn subagent → 编排器必须是主会话 | [One Agent Per Repo](https://dev.to/just_an_electron/one-agent-per-repo-an-orchestration-pattern-for-multi-repo-ai-coding-49ba) |
25
+ | 并行 Agent 共享一次索引(省 token) | [Tempest](https://github.com/tempestai-dev/tempest) |
26
+ | 多 Agent 编排模式(Router / Pipeline / Swarm) | [Agentic Roadmap — subagents orchestration](https://isfhan.github.io/learn-agentic-coding/read.html?path=steps%2F12-subagents-orchestration.md) |
27
+
28
+ ### 多仓 / 跨端依赖
29
+ | 主题 | 出处 |
30
+ |---|---|
31
+ | Repo Coordination Graph(依赖图 + 合并顺序)、per-repo operating manual | [mabl — shipping code across 75+ repos](https://www.mabl.com/blog/how-we-built-a-system-for-ai-agents-to-ship-real-code-across-75-repos) |
32
+ | System Agent + Repo Agent + 人类门 | [AgoraIO ai-devkit — multi-repo orchestration](https://github.com/AgoraIO-Community/ai-devkit/blob/main/docs/multi-repo-orchestration.md) |
33
+ | 跨仓 IssueOps / 中央跟踪仓 | [GitHub Agentic Workflows — MultiRepoOps](https://github.github.com/gh-aw/patterns/multi-repo-ops) |
34
+ | API contract + 前后端 mismatch 检测 + handoff ticket | [AppHandoff MCP](https://github.com/TeamK2K/apphandoff-mcp) |
35
+
36
+ ### 上下文工程 / 记忆 / Harness
37
+ | 主题 | 出处 |
38
+ |---|---|
39
+ | compaction / 结构化笔记 / 多 Agent 架构 | [Anthropic — Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) |
40
+ | context reset + 结构化交接件 vs compaction;自评估问题 | [Anthropic — Harness design for long-running application development](https://www.anthropic.com/engineering/harness-design-long-running-apps) |
41
+ | Agent 自称完成 → 必须给 e2e 验证工具;起步序列(pwd/git log/progress file) | [Anthropic — Effective harnesses for long-running agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents) |
42
+ | CLAUDE.md 不做中央仓库;skills + references 懒加载;Rubric | [Anthropic — The new rules of context engineering](https://claude.com/blog/the-new-rules-of-context-engineering-for-claude-5-generation-models) |
43
+ | Skill = 渐进披露;SKILL.md + references 结构 | [Anthropic — Equipping agents for the real world with Agent Skills](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills) |
44
+ | CLAUDE.md 当项目计划书;CHANGELOG.md 当实验室笔记;Ralph loop | [Anthropic — Long-running Claude for scientific computing](https://www.anthropic.com/research/long-running-Claude) |
45
+
46
+ ### ADR
47
+ | 主题 | 出处 |
48
+ |---|---|
49
+ | **最近 3–5 条 ADR 效果最佳;仅 accepted 入索引;context > 模型规模** | [arxiv 2604.03826 — Context Matters](https://arxiv.org/abs/2604.03826) |
50
+ | append-only + supersede;模板十一选一;带 Claude Code skill | [architecture-decision-record](https://github.com/architecture-decision-record/architecture-decision-record) |
51
+ | ADR 启动即写、不改原文、记录 Confidence | [Microsoft Well-Architected — Maintain an ADR](https://github.com/MicrosoftDocs/well-architected/blob/main/well-architected/architect-role/architecture-decision-record.md) |
52
+ | ADR 作为 per-repo 架构记忆(hook 注入、依赖变更提示) | [adr-agent (PyPI)](https://pypi.org/project/adr-agent) |
53
+ | Agent 治理视角的 ADR 集合与状态机 | [Microsoft Agent Governance Toolkit — ADR](https://microsoft.github.io/agent-governance-toolkit/adr) |
54
+ | PR 改代码无 ADR 则 CI 失败 | 见 architecture-decision-record README 的 "ADR Guard" |
55
+
56
+ ### Spec-driven development 选型
57
+ | 主题 | 出处 |
58
+ |---|---|
59
+ | 6 框架对比(Spec-Kit / Spec Kitty / BMad / OpenSpec / Kiro / Tessl) | [cameronsjo/spec-compare](https://github.com/cameronsjo/spec-compare) |
60
+ | 4 方法对比(BMAD / OpenSpec / Spec-Kit / AI-DLC) | [whatevergeek/sdd_review](https://github.com/whatevergeek/sdd_review) |
61
+ | Spec Kit vs Kiro vs OpenSpec 工程视角(2026) | [tunicyberlabs comparison](https://tunicyberlabs.com/en/blog/spec-driven-development-tooling-2026-spec-kit-kiro-openspec) |
62
+ | BMAD Method | https://github.com/bmad-code-org/BMAD-METHOD |
63
+
64
+ ### 中途需求变更 / spec 漂移
65
+ | 主题 | 出处 |
66
+ |---|---|
67
+ | **spec 单独成文必漂移;代码 + spec 同 commit + 漂移校验器** | [Spec Growth Engine, arxiv 2606.27045](https://arxiv.org/abs/2606.27045) |
68
+ | 中途变更 → 跨 PRD/epics/架构/UX 影响评估 → 变更提案 → 人批准 | [BMAD `correct-course` skill](https://github.com/bmad-code-org/BMAD-METHOD) |
69
+ | Acknowledge → Assess(挤掉什么)→ Options(带代价)→ Approve 的变更流程 | [GitScrum — Handling Scope Changes Mid-Sprint](https://docs.gitscrum.com/en/best-practices/handling-scope-changes-mid-sprint) |
70
+ | 变更 ≠ 问题;CR 模板(effort/timeline/cost/risk/options) | [company-in-a-box — scope-change playbook](https://github.com/fom-dev/company-in-a-box/blob/main/playbooks/scope-change.md) |
71
+
72
+ ### 任务状态纪律 / 防遗忘
73
+ | 主题 | 出处 |
74
+ |---|---|
75
+ | **先建任务再动手 / 永不删除 / 单 in-progress / 偏离协议 / 压缩前检查点** | [oryanmoshe — tracking-tasks skill](https://github.com/oryanmoshe/agent-skills/blob/main/skills/tracking-tasks/SKILL.md) |
76
+ | 任务必须落盘成 git 版本化的 TODO.md,会话内列表是封闭系统 | [ai-todo](https://github.com/fxstein/ai-todo) |
77
+ | 事实 / 任务 / 执行三层记忆分离,扛住 context compaction | [mneme](https://github.com/CVPaul/mneme) |
78
+ | 15–50 次调用后目标漂移(lost in the middle)→ 重读计划/todo 当锚 | [coding-agents — memory-and-continuity](https://github.com/enea-scaccabarozzi/coding-agents/blob/main/docs/synthesis/memory-and-continuity.md) |
79
+ | 跨会话任务丢失 → `.tasks/` 目录 + Review→Work→Update 循环 | [agent-backlog](https://github.com/mdziedzi/agent-backlog) |
80
+
81
+ ### 回归防护 / 影响面分析
82
+ | 主题 | 出处 |
83
+ |---|---|
84
+ | **改动前依赖图影响分析:测试回归 6.08% → 1.82%** | [TDAD, arxiv 2603.17973](https://arxiv.org/abs/2603.17973) |
85
+ | 改前影响分析 skill:直接/传递依赖 + 受影响测试 + 风险评分 | [ripple](https://github.com/simota/agent-skills/blob/main/ripple/SKILL.md)、[impact-analyzer](https://github.com/biyer/impact-analyzer) |
86
+ | LSP 驱动的爆炸半径:breaking/ripple/tests/git co-change | [blast-radius (br)](https://github.com/buddyh/blast-radius) |
87
+ | **characterization / golden master / approval test 是同一个东西** | [understandlegacycode — Approval Tests](https://understandlegacycode.com/approval-tests)、[Wikipedia — Characterization test](https://en.wikipedia.org/wiki/Characterization_test) |
88
+ | 固定 seed 轰炸 + 录输出的 golden master 做法 | [Codurance — Testing Legacy Code with Golden Master](https://www.codurance.com/publications/2012/11/11/testing-legacy-code-with-golden-master) |
89
+ | **golden 诚实四律**:确定性先行 / 刻意 bless / 看 diff / 钉输入 | [test-oracle — golden-master reference](https://github.com/PSthelyBlog/test-oracle/blob/main/skills/mutation-testing/reference/golden-master.md) |
90
+ | 按改动选测试(build 依赖图 → 预测式选测) | [Predictive Test Selection, arxiv 1810.05286](https://arxiv.org/html/1810.05286v2) |
91
+
92
+ ## 工具
93
+
94
+ | 工具 | 用途 | 手册章节 |
95
+ |---|---|---|
96
+ | `specify-cli`(Spec Kit) | SDD 流程 | [06](../docs/06-spec-kit.md) |
97
+ | `codegraph` | 符号索引与调用链 | [08](../docs/08-codegraph.md) |
98
+ | `handoff.mjs` | 跨仓交接 | [10](../docs/10-handoff.md) |
99
+ | `backlog-capture` skill | 待办捕获 | [07](../docs/07-backlog.md) |
100
+
101
+ ---
102
+
103
+ *维护约定:本文件只放链接和一句话用途,不放正文摘录——正文会过期,链接不会。*
@@ -0,0 +1,44 @@
1
+ # <项目名>
2
+
3
+ ## Overview
4
+ <两三行说清这个项目是什么、给谁用。>
5
+
6
+ ## Repository Layout
7
+ ```
8
+ group/ 单一事实源:product / architecture / contracts
9
+ units/<x>/ 各端独立工程上下文
10
+ specs/ Spec Kit feature 产物(spec → plan → tasks → converge)
11
+ adr/ 架构决策记录 + INDEX.md
12
+ docs/ PROGRESS.md · backlogs/
13
+ evidence/ 收尾证据
14
+ ```
15
+
16
+ ## Isolation(两种隔离,都不可省)
17
+
18
+ 1. **Unit 隔离**:各 Unit 只读自己的目录 + `group/contracts/`。禁止直接读改其他 Unit 的实现。
19
+ 2. **执行隔离**:一个 Agent 一个 worktree/分支;Agent 永不直接 push 主干;只有 Implementation Agent 可写,Reviewer/QA 只读。
20
+
21
+ ## Key Documents
22
+ - `constitution.md` — 项目宪法(最高原则,改动须人 review)
23
+ - `group/product/intent.md` — 产品意图
24
+ - `group/architecture/dependency-graph.md` — 谁依赖谁、合并顺序
25
+ - `adr/INDEX.md` — 架构决策索引
26
+
27
+ ## Agent Guidelines
28
+ - 上下文读取顺序:**本文件 → `units/<当前端>/AGENTS.md` → `constitution.md`**
29
+ - feature 流程必须走 `/speckit.specify → … → /speckit.converge`,Converged 才能进收尾门禁
30
+ - 架构级改动必须先有 Accepted ADR,编号写进收尾报告
31
+ - 跨 Unit 改动前先查 `group/architecture/dependency-graph.md` 确认合并顺序
32
+ - 涉外部仓库的改动只走 handoff CLI,禁止聊天交接
33
+ - 识别到越界/待拍板/未来功能信号时,记入 `docs/backlogs/`,不要打断当前任务,也不要静默丢弃
34
+ - 实现细节有多种合理方案时默认动手(宪法 D5):选最贴合现状的 + `// ASSUMPTION` 留痕;只有高 stake 决策(架构/CR/不可逆/花钱/改公共 API/难替换依赖)才停下来问
35
+ - **禁止以"已完成"结尾而不附门禁表。收到"已完成"时,必须追问证据路径与失败项。**
36
+
37
+ ## CodeGraph
38
+ 各 Unit 有自己的 `.codegraph/` 索引;代码检索约定见各 Unit AGENTS.md。改完代码 `codegraph sync`。
39
+
40
+ ## 收尾门禁
41
+ 每次任务收尾必须逐条输出门禁表(Intent / Architecture / Isolation / Evidence / Convergence / 交接与记忆六组),不许写"已通过所有检查"。见 playbook `docs/12-gates.md`。
42
+
43
+ ## Context Budget
44
+ 本文件 < 150 行。长规范走 Skill 懒加载,不要往这里堆。
@@ -0,0 +1,52 @@
1
+ # <Unit 名> Unit
2
+
3
+ ## Overview
4
+ <两三行:这一端是什么、在整体里承担什么角色。>
5
+
6
+ ## Tech Stack
7
+ - <语言/框架 + 版本基线,例:Swift 6 / iOS 27 / SwiftUI>
8
+ - <构建工具>
9
+
10
+ ## Responsibilities
11
+ - <这端负责什么>
12
+ - **不负责**:<明确排除,防止越界>
13
+
14
+ ## Dependencies
15
+ - 契约:`group/contracts/api.md`(只读;变更须走 ADR + 依赖协调图)
16
+ - 依赖顺序:见 `group/architecture/dependency-graph.md` 表 3
17
+
18
+ ## Design System / 样式权威
19
+ - <如适用:主题 token 文件路径,禁止硬编码>
20
+ - <设计源:Figma 链接 / ADR 编号>
21
+
22
+ ## Verification
23
+ **这是"完成"的定义,必须是可直接执行的命令。**
24
+
25
+ | 级别 | 命令 |
26
+ |---|---|
27
+ | E2 Build | `<build command>` |
28
+ | E3 Test | `<test command>` |
29
+ | E4 Run | `<运行 + 截图/e2e 取证方式>` |
30
+
31
+ ## CodeGraph
32
+ 本 Unit 已建 `.codegraph/` 索引。理解/定位代码时先跑
33
+ `codegraph explore "<符号/问题>"` 取源码+调用链,再考虑 grep/Read;
34
+ 改完代码跑 `codegraph sync`。**没有 `.codegraph/` 就不要替它 init。**
35
+
36
+ ## Project Skills
37
+ 本端强制读的项目级 Skill:
38
+ - `<skill-name>`(路径 `.agents/skills/<skill-name>/`)
39
+ - 硬约束:<一句话>
40
+ - 冻结区:<ADR 编号> —— 细节读 ADR 原文,此处不复制
41
+
42
+ ## Forbidden
43
+ - ❌ <硬禁令一>(ADR-NNN)
44
+ - ❌ <硬禁令二>(ADR-NNN)
45
+ - ❌ 直接读改其他 Unit 的实现代码
46
+
47
+ > 写 ADR 编号 + 一句话,细节让 Agent 读 ADR 原文,避免多处同步。
48
+
49
+ ## Agent Guidelines
50
+ - 修改前先理解现有架构,优先改现有代码,避免过度抽象
51
+ - 改动后必须跑 Verification 并贴证据
52
+ - 本 Unit 的约束 > 第三方 Skill 的默认建议
@@ -0,0 +1,17 @@
1
+ # ADR INDEX
2
+
3
+ > 唯一索引表。**只有 Accepted 的条目才应被注入 Agent 上下文**(见 playbook docs/05 §4)。
4
+ > 会话启动可注入本表全量(一行一条,成本低);具体任务只带最近 3–5 条的 Decision 段。
5
+
6
+ | ADR | 标题 | 状态 | 日期 | Unit | 文件 |
7
+ |-----|------|------|------|------|------|
8
+ | 0001 | 记录架构决策本身 | Accepted | YYYY-MM-DD | group | `0001-record-decisions.md` |
9
+ | 0002 | | | | | |
10
+ | 0003 | | | | | |
11
+
12
+ ## 状态说明
13
+
14
+ - **Proposed** — 已起草,等人 review。不入 Agent 上下文。
15
+ - **Accepted** — 生效,代码须反映它。入索引。
16
+ - **Rejected** — 留档(含否掉的理由),不入索引。
17
+ - **Superseded by NNNN** — 被新决策取代,保留历史,链接到继任者。
@@ -0,0 +1,56 @@
1
+ # ADR-NNNN: <决策标题>
2
+
3
+ **Status:** Proposed | Accepted | Rejected | Superseded by ADR-NNNN
4
+ **Date:** YYYY-MM-DD
5
+ **Unit:** <group | ios | backend | mcp | …>
6
+ **Confidence:** High | Medium | Low
7
+
8
+ > 规则:append-only。决策变更时**不要改本文件**,写新 ADR 并把本条标为 Superseded by ADR-NNNN,互相链接。
9
+
10
+ ---
11
+
12
+ ## Context
13
+
14
+ <什么问题、什么约束、什么压力。包含:>
15
+ - 触发这次决策的事件(需求 / 事故 / 依赖变更)
16
+ - 相关约束(性能、隐私、平台限制、合规)
17
+ - 与哪些需求/契约相关:`specs/NNN-*`、`group/contracts/*`
18
+
19
+ ## Options
20
+
21
+ ### 方案 A:<名称>
22
+ - 优点:
23
+ - 缺点:
24
+
25
+ ### 方案 B:<名称>
26
+ - 优点:
27
+ - 缺点:
28
+
29
+ (至少两个。只有一个方案说明没想清楚。)
30
+
31
+ ## Decision
32
+
33
+ 选择 **方案 X**。
34
+
35
+ <为什么,针对上面的权衡。一句话说清"我们接受什么代价换什么好处"。>
36
+
37
+ ## Consequences
38
+
39
+ **正面**
40
+ - …
41
+
42
+ **负面 / 接受的代价**
43
+ - …
44
+
45
+ **风险**
46
+ - <风险 + 触发时怎么办>
47
+
48
+ **需要跟进的**
49
+ - [ ] <需要改的其它文件 / 需要通知的 Unit>
50
+
51
+ ## Related
52
+
53
+ - Requirements: `group/product/requirements.md` / `specs/NNN-*/spec.md`
54
+ - Contracts: `group/contracts/api.md`
55
+ - ADRs: ADR-NNNN(前置)、ADR-NNNN(被本条取代)
56
+ - Backlog: B-NNN(如有)
@@ -0,0 +1,30 @@
1
+ # Backlog Entry — 单条模板
2
+
3
+ ```markdown
4
+ ## B-NNN <一句话标题>
5
+ - **类型**: 待拍板 | 未来功能 | 临时绕行 | 越界发现
6
+ - **涉及 Unit**: <unit-a>, <unit-b>
7
+ - **现状**: <当前是什么情况、为什么是问题(没这两句三个月后没人看得懂)>
8
+ - **需要什么**: <要人决定什么 / 要做什么>
9
+ - **拍板人**: (留空 = 待定)
10
+ - **来源**: <specs/NNN-* / 任务 / 代码位置,可写 FIXME(B-NNN) 反向引用>
11
+ - **日期**: YYYY-MM-DD
12
+ - **状态**: Open | Rejected(+一句理由)| Done(+去向)
13
+ ```
14
+
15
+ ## 使用约定
16
+
17
+ - 文件放 `docs/backlogs/`,**按主题聚合**(`1-content-storage.md`),不按日期
18
+ - 编号 `B-NNN` 全项目递增,**不复用**
19
+ - 代码里反向引用:`// FIXME(B-007)`
20
+ - 拍板去向只有三个:变成 feature(走 `/speckit.specify`)/ Rejected 留档 / 继续挂着
21
+ - **append-only**:已处理的条目改状态,不删除
22
+
23
+ ## 边界
24
+
25
+ | 场景 | 去哪(不要进 backlog) |
26
+ |---|---|
27
+ | 跨仓 / 依赖方要改 | handoff |
28
+ | 架构级决策 | ADR |
29
+ | 本次 feature 未完成任务 | `/speckit.converge` 回写的 tasks.md |
30
+ | 产品需求本身 | `group/product/requirements.md` |
@@ -0,0 +1,93 @@
1
+ # <PROJECT> Constitution
2
+
3
+ **Version:** 1.0
4
+ **Project:** <项目名>
5
+ **Last Updated:** <日期>
6
+
7
+ > 本文件是项目长期原则,所有 Agent 和 Unit 必须遵守。
8
+ > 改宪法是独立流程,须人 review,不得在 `/speckit.analyze` 中顺手稀释。
9
+ > 同步一份到 `.specify/memory/constitution.md`(Spec Kit 的 Constitution Check 读它)。
10
+
11
+ ---
12
+
13
+ ## 1. 产品原则
14
+
15
+ ### P1 — <名词>
16
+ <一句话约束。写否定式更好判定:"X 而不是 Y">
17
+
18
+ ### P2 — <名词>
19
+ <...>
20
+
21
+ ## 2. 技术原则
22
+
23
+ ### T1 — Agent 协作优先
24
+ 项目天然由 Agent 开发,所有设计必须考虑多 Agent 协作场景。
25
+
26
+ ### T2 — Shared Contracts
27
+ 跨 Unit 信息必须结构化,禁止依赖聊天记录或口头约定。
28
+
29
+ ### T3 — Evidence Based
30
+ 完成必须有证据,不能只由 Agent 声称完成。
31
+
32
+ ### T4 — Artifact-based Handoff
33
+ Unit 之间交接使用 Artifact,而不是自然语言对话。
34
+
35
+ ## 3. 架构原则
36
+
37
+ ### A1 — 单一事实源
38
+ 每个事实只有一个权威来源:
39
+ - 产品行为 → Requirements
40
+ - 架构决策 → ADR
41
+ - API 定义 → Contracts
42
+ - 实现 → Code
43
+
44
+ ### A2 — 显式依赖
45
+ Unit 之间的依赖必须明确声明(`group/architecture/dependency-graph.md`),禁止隐式耦合。
46
+
47
+ ### A3 — 平台隔离
48
+ 各端拥有独立工程上下文,通过 Contracts 协作,禁止直接读改其他 Unit 的实现。
49
+
50
+ ## 4. 开发原则
51
+
52
+ ### D1 — Intent before Implementation
53
+ 先明确意图,再决定实现。
54
+
55
+ ### D2 — 最小必要文档
56
+ 文档只记录必要信息,避免 Spec Theater。
57
+
58
+ ### D3 — 增量变更
59
+ 小改动只修改必要部分,不重建整个项目。
60
+
61
+ ### D4 — 失败可恢复
62
+ 任何阶段失败后,可以从最近有效状态继续。
63
+
64
+ ### D5 — Default to Action
65
+ 实现细节存在多种合理方案时,不打断人:选最贴合本项目现状的方案(无现状则取行业标准最佳实践),用 `// ASSUMPTION: <假设什么、为什么>` 注释留痕,继续推进。仍须停下来问的只有:架构/宪法级改动、中途需求变更(CR)、不可逆操作、花钱或外部请求、改公共 API、难替换的依赖。
66
+
67
+ ## 5. 禁止事项
68
+
69
+ | 禁令 | 拦截点 |
70
+ |---|---|
71
+ | ❌ Silent Architecture Drift | 架构级改动必须有 Accepted ADR,否则 CRITICAL |
72
+ | ❌ Chat-based Handoff | 跨 Unit/跨仓交接只认 artifact 路径 |
73
+ | ❌ Agent Self-Approval | Evidence 必须来自外部工具输出,不接受自然语言声称 |
74
+ | ❌ Giant Context | 常驻 AGENTS.md < 150 行,长规范走 Skill 懒加载 |
75
+
76
+ ## 6. 自动化等级
77
+
78
+ 本项目采用 **Level 1 — Agent Assisted**(可随成熟度上调,见 AEF §27):
79
+ - Agent 执行开发任务
80
+ - Human 审查关键决策
81
+ - Evidence 收集部分自动化
82
+ - Convergence 使用 Checklist
83
+
84
+ ---
85
+
86
+ ## 附录:不可单方面改动的 ADR
87
+
88
+ 以下决策已钉死,改动须经人确认流程,不可由 Agent 在改代码时顺手变更:
89
+
90
+ | ADR | 名称 | 所在文件 |
91
+ |-----|------|---------|
92
+ | ADR-001 | (起步决策) | `group/architecture/system.md` |
93
+ | ADR-002 | | |
@@ -0,0 +1,36 @@
1
+ # Evidence
2
+
3
+ 收尾证据存放处。**只放收尾报告引用到的东西**,不要变成垃圾场。
4
+
5
+ ## 命名
6
+
7
+ ```
8
+ evidence/
9
+ └── <feature-id>/ ← 与 specs/NNN-* 对应
10
+ ├── build.log E2 构建日志(关键片段即可)
11
+ ├── test-report.xml E3 测试报告
12
+ ├── screenshot-*.png E4 运行截图
13
+ └── acceptance.md E5 逐条验收确认
14
+ ```
15
+
16
+ ## 规则
17
+
18
+ 1. **E0(只有口头声称)不许存**——收尾报告里也不许出现。
19
+ 2. **证据时间戳必须晚于最后一次改动**。改完代码还贴之前的日志 = 过期证据。
20
+ 3. 命令输出类可以只在收尾报告里贴关键片段 + 指向完整日志的路径。
21
+ 4. 截图/录屏必须能打开验证(不要贴失效链接)。
22
+ 5. 级别要求见 playbook `docs/11-evidence.md` §2:
23
+ - 常规 feature:≥ E2 + E3
24
+ - 改 UI/交互:必须 E4
25
+ - 跨 Unit / 架构级:必须 E5
26
+
27
+ ## 收尾报告引用格式
28
+
29
+ ```markdown
30
+ | 改动 | 完成 | 证据 |
31
+ |---|---|---|
32
+ | T001 内容缓存 | ✅ | E3 `evidence/002/test-report.xml` (42 passed) |
33
+ | T006 迁移脚本 | ⚠️ 部分 | E2 build.log;e2e 未跑,已记 B-011 |
34
+ ```
35
+
36
+ **失败/跳过的项必须如实列出。** 只贴通过的 = 选择性取证。
@@ -0,0 +1,48 @@
1
+ # Dependency Graph — 跨 Unit 依赖协调图
2
+
3
+ > **唯一权威。** 谁依赖谁、契约归谁、谁先合,只认本文件。
4
+ > 不要在 AGENTS.md、PR 描述、聊天里另说一套依赖关系。
5
+ > 使用规则见 playbook `docs/14-dependency-graph.md`。
6
+
7
+ **Updated:** YYYY-MM-DD
8
+
9
+ ---
10
+
11
+ ## 表 1 — Unit 依赖矩阵
12
+
13
+ 读法:行依赖列 ⇒ **列必须先合、先发**。`✅` = 依赖,`—` = 无依赖。
14
+
15
+ | 依赖方 ↓ / 被依赖方 → | `<unit-A>` | `<unit-B>` | `<unit-C>` |
16
+ |---|---|---|---|
17
+ | `<unit-A>` | — | ✅ | — |
18
+ | `<unit-B>` | — | — | — |
19
+ | `<unit-C>` | ✅ | ✅ | — |
20
+
21
+ ## 表 2 — 契约与版本
22
+
23
+ | 契约文件 | 生产者 | 消费者 | 版本 | 最近变更 ADR |
24
+ |---|---|---|---|---|
25
+ | `group/contracts/api.md` | `<unit-A>` | `<unit-B>`, `<unit-C>` | v1 | ADR-0001 |
26
+
27
+ ## 表 3 — 合并 / 发布顺序(拓扑序)
28
+
29
+ ```
30
+ 1. group/contracts/ (契约变更,如有 — 必须最先)
31
+ 2. <unit-A>
32
+ 3. <unit-B>
33
+ 4. <unit-C>
34
+ ```
35
+
36
+ > 依赖方永远排在被依赖方之后。表 1 变了,本表必须重算。
37
+
38
+ ---
39
+
40
+ ## 变更记录
41
+
42
+ | 日期 | 变更 | ADR |
43
+ |---|---|---|
44
+ | YYYY-MM-DD | 初版 | ADR-0001 |
45
+
46
+ ## 待确认
47
+
48
+ - <未定的依赖关系 → 记入 `docs/backlogs/`>
@@ -0,0 +1,59 @@
1
+ # System Architecture
2
+
3
+ > 架构总览(单一事实源,AEF Layer 3)。具体决策写 ADR,本文件只做**地图**。
4
+
5
+ ## 1. 全景图
6
+
7
+ ```
8
+ ┌──────────────┐
9
+ 用户 →│ units/ios │
10
+ └──────┬───────┘
11
+ │ group/contracts/api.md
12
+ ┌──────▼───────┐
13
+ │ units/backend │
14
+ └──────┬───────┘
15
+ │
16
+ ┌──────▼───────┐
17
+ │ units/mcp │
18
+ └──────────────┘
19
+ ```
20
+
21
+ ## 2. Unit 清单
22
+
23
+ | Unit | 技术栈 | 职责 | 验证命令 |
24
+ |---|---|---|---|
25
+ | ios | SwiftUI | UI / 播放 / 收藏 | `xcodebuild test` |
26
+ | backend | <栈> | API / 存储 | `<test cmd>` |
27
+ | mcp | <栈> | Agent 工具层 | `<test cmd>` |
28
+
29
+ ## 3. 关键架构决策(只列编号与一句话)
30
+
31
+ | ADR | 决策 | 影响 |
32
+ |---|---|---|
33
+ | ADR-001 | <起步决策> | 全局 |
34
+ | ADR-002 | | |
35
+
36
+ > 细节与备选方案一律读 `adr/NNNN-*.md`。**不要在本文件复述 ADR 正文**——复述会分叉。
37
+
38
+ ## 4. 依赖与顺序
39
+
40
+ 见 `dependency-graph.md`(同目录)。改契约或改依赖关系,两份文件都要更新。
41
+
42
+ ## 5. 技术栈基线
43
+
44
+ | 层 | 版本 | 备注 |
45
+ |---|---|---|
46
+ | 语言 | | |
47
+ | 最低部署目标 | | |
48
+ | CI | | |
49
+
50
+ ## 6. 架构级约束(引 ADR,不复述)
51
+
52
+ - <约束一> → ADR-NNN
53
+ - <约束二> → ADR-NNN
54
+
55
+ ## 7. 非目标架构
56
+
57
+ 明确**不采用**的方案 + 理由(防止日后被"优化"回来):
58
+
59
+ - ❌ <方案> — 理由,见 ADR-NNN
@@ -0,0 +1,67 @@
1
+ # API Contract — 跨 Unit 契约(唯一权威)
2
+
3
+ > **单一事实源**:契约内容只认本文件。实现与文档若与本文件冲突,以本文件为准,且说明有人没走流程。
4
+ > **变更流程**:提出方写 ADR 草案 → 人 review → 更新本文件版本号 → 更新 `dependency-graph.md` 表 2 → 消费者才开始改。
5
+ > feature 级契约草案在 `specs/NNN-*/contracts/`,被采纳后才进这里。
6
+
7
+ **Version:** v1
8
+ **Producer:** `<unit-A>`
9
+ **Consumers:** `<unit-B>`, `<unit-C>`
10
+
11
+ ---
12
+
13
+ ## 端点 / 接口
14
+
15
+ ### `<METHOD> <path>`
16
+
17
+ **用途**:<一句话>
18
+ **消费者**:<哪个 Unit 用它>
19
+
20
+ 请求:
21
+ ```json
22
+ { }
23
+ ```
24
+
25
+ 响应(成功):
26
+ ```json
27
+ { }
28
+ ```
29
+
30
+ 错误:
31
+
32
+ | 码 | 含义 | 消费者处理方式 |
33
+ |---|---|---|
34
+ | 401 | 未登录 | 跳登录页 |
35
+ | 429 | 限流 | 退避重试 |
36
+
37
+ **约束**:
38
+ - 向后兼容规则:<字段只能加不能删 / 枚举只增不减>
39
+ - 版本策略:<路径版本 / header 版本>
40
+
41
+ ---
42
+
43
+ ## 共享数据模型
44
+
45
+ ### `<ModelName>`
46
+
47
+ | 字段 | 类型 | 必填 | 说明 |
48
+ |---|---|---|---|
49
+ | | | | |
50
+
51
+ ## 共享错误码 / 枚举
52
+
53
+ | 值 | 含义 |
54
+ |---|---|
55
+
56
+ ## 事件 / 消息(如有)
57
+
58
+ | Topic | 生产者 | 消费者 | Schema |
59
+ |---|---|---|---|
60
+
61
+ ---
62
+
63
+ ## 变更记录
64
+
65
+ | 版本 | 日期 | 变更 | ADR |
66
+ |---|---|---|---|
67
+ | v1 | YYYY-MM-DD | 初版 | ADR-0001 |
@@ -0,0 +1,30 @@
1
+ # <项目名> — Product Intent
2
+
3
+ > 一句话说清**为什么存在**。这不是 PRD,是最上游的 Intent(AEF Layer 1)。
4
+
5
+ ## Intent
6
+
7
+ <一句话:为谁、解决什么问题。例:
8
+ "帮用户发现值得看的内容,而不是提高停留时长。">
9
+
10
+ ## 为什么现在做
11
+
12
+ <两三行:触发事件 / 市场窗口 / 用户痛点的证据。>
13
+
14
+ ## 不做什么(Non-Goals)
15
+
16
+ - ❌ <明确排除的方向一>
17
+ - ❌ <明确排除的方向二>
18
+
19
+ > Non-Goals 和 Intent 同等重要:没有 Non-Goals,Agent 会把每次迭代都做成"功能更多"。
20
+
21
+ ## 成功判据
22
+
23
+ | 判据 | 目标 | 怎么测 |
24
+ |---|---|---|
25
+ | <可量化指标> | <数值> | <测量方式> |
26
+
27
+ ## 关联
28
+
29
+ - 需求:`group/product/requirements.md`
30
+ - 宪法:`constitution.md`(产品原则 P 系列源自本文件)