@scemoon/cdh 1.0.4 → 1.0.5

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 (268) hide show
  1. package/ai-dlc-skill/SKILL.md +4 -2
  2. package/ai-dlc-skill/agents/master.md +6 -0
  3. package/ai-dlc-skill/agents/plan-agent.md +2 -2
  4. package/ai-dlc-skill/agents/understand-agent.md +4 -4
  5. package/ai-dlc-skill/agents/verify-agent.md +1 -1
  6. package/ai-dlc-skill/architecture/project-structure.md +10 -10
  7. package/ai-dlc-skill/brownfield/README.md +2 -2
  8. package/ai-dlc-skill/brownfield/generate-context.sh +3 -3
  9. package/ai-dlc-skill/brownfield/scripts/extract-api.sh +5 -5
  10. package/ai-dlc-skill/components/backend.md +1 -1
  11. package/ai-dlc-skill/components/web.md +2 -2
  12. package/ai-dlc-skill/contracts/README.md +3 -3
  13. package/ai-dlc-skill/cross-tool/cline/export.sh +1 -1
  14. package/ai-dlc-skill/cross-tool/copilot/export.sh +1 -1
  15. package/ai-dlc-skill/cross-tool/onecode/export-skills.sh +7 -3
  16. package/ai-dlc-skill/cross-tool/onecode/export.sh +14 -8
  17. package/ai-dlc-skill/phases/deliver/lifecycle.md +6 -6
  18. package/ai-dlc-skill/phases/deliver/prompt.md +2 -2
  19. package/ai-dlc-skill/phases/deliver/rules.md +1 -1
  20. package/ai-dlc-skill/phases/plan/lifecycle.md +11 -11
  21. package/ai-dlc-skill/phases/plan/prompt.md +6 -6
  22. package/ai-dlc-skill/phases/plan/rules.md +1 -1
  23. package/ai-dlc-skill/phases/understand/entry.md +1 -1
  24. package/ai-dlc-skill/phases/understand/lifecycle.md +7 -7
  25. package/ai-dlc-skill/phases/understand/prompt.md +8 -8
  26. package/ai-dlc-skill/phases/understand/rules.md +5 -5
  27. package/ai-dlc-skill/phases/verify/lifecycle.md +24 -24
  28. package/ai-dlc-skill/phases/verify/prompt.md +8 -8
  29. package/ai-dlc-skill/phases/verify/rules.md +9 -9
  30. package/ai-dlc-skill/providers/README.md +2 -2
  31. package/ai-dlc-skill/providers/aliyun/preview.yaml +2 -2
  32. package/ai-dlc-skill/providers/tcb/preview.yaml +2 -2
  33. package/ai-dlc-skill/requirements.md +7 -7
  34. package/ai-dlc-skill/skill.yaml +4 -4
  35. package/ai-dlc-skill/templates/integration/CHANGELOG.md +2 -2
  36. package/ai-dlc-skill/templates/integration/contract-diff.md +7 -7
  37. package/ai-dlc-skill/templates/integration/contract-spec.md +7 -7
  38. package/ai-dlc-skill/templates/integration/runtime-contract.yaml +1 -1
  39. package/ai-dlc-skill/templates/project/README.md +18 -19
  40. package/ai-dlc-skill/templates/project/template.md +21 -21
  41. package/ai-dlc-skill/walkthrough/collect.sh +1 -1
  42. package/ai-dlc-skill/walkthrough/template.md +2 -2
  43. package/ai-dlc-skill/workflows/ai-dlc.yaml +12 -12
  44. package/ai-dlc-skill/workflows/deployment.yaml +4 -4
  45. package/cdh/__pycache__/cdh_mcp_injector.cpython-314.pyc +0 -0
  46. package/cdh/__pycache__/cdh_mcp_loader.cpython-314.pyc +0 -0
  47. package/cdh/__pycache__/cdh_mcp_manager.cpython-314.pyc +0 -0
  48. package/cdh/__pycache__/cdh_session_aggregator.cpython-314.pyc +0 -0
  49. package/cdh/__pycache__/cdh_skill_loader.cpython-314.pyc +0 -0
  50. package/cdh/__pycache__/cdh_skill_manager.cpython-314.pyc +0 -0
  51. package/cdh/__pycache__/cli.cpython-313.pyc +0 -0
  52. package/cdh/__pycache__/cli.cpython-314.pyc +0 -0
  53. package/cdh/__pycache__/scaffold.cpython-314.pyc +0 -0
  54. package/cdh/cdh_mcp_injector.py +115 -0
  55. package/cdh/cdh_mcp_loader.py +67 -0
  56. package/cdh/cdh_mcp_manager.py +73 -0
  57. package/cdh/cdh_session_aggregator.py +258 -0
  58. package/cdh/cdh_skill_manager.py +105 -0
  59. package/cdh/cli.py +14 -3
  60. package/cdh/scaffold.py +192 -41
  61. package/onecode/__init__.py +1 -1
  62. package/onecode/__pycache__/cli.cpython-314.pyc +0 -0
  63. package/onecode/__pycache__/commands.cpython-314.pyc +0 -0
  64. package/onecode/__pycache__/config.cpython-314.pyc +0 -0
  65. package/onecode/__pycache__/config_screen.cpython-314.pyc +0 -0
  66. package/onecode/__pycache__/migrate.cpython-314.pyc +0 -0
  67. package/onecode/agent/__pycache__/cdh_loader.cpython-314.pyc +0 -0
  68. package/onecode/agent/__pycache__/context.cpython-314.pyc +0 -0
  69. package/onecode/agent/__pycache__/engine.cpython-314.pyc +0 -0
  70. package/onecode/agent/__pycache__/hooks.cpython-314.pyc +0 -0
  71. package/onecode/agent/__pycache__/onecode_agent_acp.cpython-314.pyc +0 -0
  72. package/onecode/agent/__pycache__/permissions.cpython-314.pyc +0 -0
  73. package/onecode/agent/__pycache__/project_doc.cpython-314.pyc +0 -0
  74. package/onecode/agent/__pycache__/session.cpython-314.pyc +0 -0
  75. package/onecode/agent/agents/__pycache__/types.cpython-314.pyc +0 -0
  76. package/onecode/agent/agents/types.py +47 -164
  77. package/onecode/agent/attachments.py +0 -1
  78. package/onecode/agent/cdh_loader.py +17 -25
  79. package/onecode/agent/context.py +8 -3
  80. package/onecode/agent/engine.py +835 -220
  81. package/onecode/agent/hooks.py +1 -1
  82. package/onecode/agent/onecode_agent_acp.py +460 -47
  83. package/onecode/agent/onecode_agent_acp.py.bak +2447 -0
  84. package/onecode/agent/permissions.py +0 -1
  85. package/onecode/agent/project_doc.py +19 -0
  86. package/onecode/agent/session.py +17 -3
  87. package/onecode/agent/snapshot.py +3 -4
  88. package/onecode/agent/tools/__pycache__/agent_tools.cpython-314.pyc +0 -0
  89. package/onecode/agent/tools/__pycache__/apply_patch_tool.cpython-314.pyc +0 -0
  90. package/onecode/agent/tools/__pycache__/bash_tool.cpython-314.pyc +0 -0
  91. package/onecode/agent/tools/__pycache__/communication_tools.cpython-314.pyc +0 -0
  92. package/onecode/agent/tools/__pycache__/config_tool.cpython-314.pyc +0 -0
  93. package/onecode/agent/tools/__pycache__/cron_tools.cpython-314.pyc +0 -0
  94. package/onecode/agent/tools/__pycache__/file_ops.cpython-314.pyc +0 -0
  95. package/onecode/agent/tools/__pycache__/file_tools.cpython-314.pyc +0 -0
  96. package/onecode/agent/tools/__pycache__/git_tools.cpython-314.pyc +0 -0
  97. package/onecode/agent/tools/__pycache__/lsp_tools.cpython-314.pyc +0 -0
  98. package/onecode/agent/tools/__pycache__/mcp_tools.cpython-314.pyc +0 -0
  99. package/onecode/agent/tools/__pycache__/permission_handler.cpython-314.pyc +0 -0
  100. package/onecode/agent/tools/__pycache__/protocol.cpython-314.pyc +0 -0
  101. package/onecode/agent/tools/__pycache__/registry.cpython-314.pyc +0 -0
  102. package/onecode/agent/tools/__pycache__/sandbox.cpython-314.pyc +0 -0
  103. package/onecode/agent/tools/__pycache__/skill_tools.cpython-314.pyc +0 -0
  104. package/onecode/agent/tools/__pycache__/todo_tools.cpython-314.pyc +0 -0
  105. package/onecode/agent/tools/__pycache__/web_tools.cpython-314.pyc +0 -0
  106. package/onecode/agent/tools/agent_tools.py +4 -6
  107. package/onecode/agent/tools/apply_patch_tool.py +2 -8
  108. package/onecode/agent/tools/bash_tool.py +32 -12
  109. package/onecode/agent/tools/communication_tools.py +4 -5
  110. package/onecode/agent/tools/config_tool.py +3 -3
  111. package/onecode/agent/tools/cron_tools.py +4 -5
  112. package/onecode/agent/tools/file_ops.py +37 -3
  113. package/onecode/agent/tools/file_tools.py +10 -11
  114. package/onecode/agent/tools/git_tools.py +2 -2
  115. package/onecode/agent/tools/lsp_tools.py +2 -2
  116. package/onecode/agent/tools/mcp_tools.py +3 -5
  117. package/onecode/agent/tools/permission_handler.py +1 -1
  118. package/onecode/agent/tools/protocol.py +1 -1
  119. package/onecode/agent/tools/registry.py +69 -2
  120. package/onecode/agent/tools/sandbox.py +110 -16
  121. package/onecode/agent/tools/skill_tools.py +2 -2
  122. package/onecode/agent/tools/todo_tools.py +38 -19
  123. package/onecode/agent/tools/web_tools.py +6 -7
  124. package/onecode/builtin_skills/agent-browser/SKILL.md +212 -0
  125. package/onecode/builtin_skills/agent-browser/skill.yaml +8 -0
  126. package/onecode/builtin_skills/skill-creator/SKILL.md +106 -0
  127. package/onecode/builtin_skills/skill-creator/skill.yaml +8 -0
  128. package/onecode/cli.py +186 -6
  129. package/onecode/codebase/__pycache__/chunker.cpython-314.pyc +0 -0
  130. package/onecode/codebase/__pycache__/indexer.cpython-314.pyc +0 -0
  131. package/onecode/codebase/__pycache__/retriever.cpython-314.pyc +0 -0
  132. package/onecode/codebase/__pycache__/storage.cpython-314.pyc +0 -0
  133. package/onecode/codebase/chunker.py +0 -5
  134. package/onecode/codebase/indexer.py +14 -1
  135. package/onecode/codebase/retriever.py +13 -2
  136. package/onecode/codebase/storage.py +5 -4
  137. package/onecode/commands.py +81 -6
  138. package/onecode/config.py +41 -12
  139. package/onecode/config_screen.py +7 -3
  140. package/onecode/mcp/__pycache__/manager.cpython-314.pyc +0 -0
  141. package/onecode/mcp/manager.py +2 -3
  142. package/onecode/memory/__init__.py +7 -53
  143. package/onecode/memory/__pycache__/__init__.cpython-314.pyc +0 -0
  144. package/onecode/memory/__pycache__/backend.cpython-314.pyc +0 -0
  145. package/onecode/memory/__pycache__/offload.cpython-314.pyc +0 -0
  146. package/onecode/memory/__pycache__/pyramid.cpython-314.pyc +0 -0
  147. package/onecode/memory/__pycache__/recall.cpython-314.pyc +0 -0
  148. package/onecode/memory/backend.py +13 -39
  149. package/onecode/memory/pyramid.py +2 -71
  150. package/onecode/memory/recall.py +38 -3
  151. package/onecode/migrate.py +122 -0
  152. package/onecode/models/__pycache__/messages.cpython-314.pyc +0 -0
  153. package/onecode/models/__pycache__/provider.cpython-314.pyc +0 -0
  154. package/onecode/models/messages.py +58 -0
  155. package/onecode/models/provider.py +20 -2
  156. package/onecode/models/providers/__pycache__/anthropic_provider.cpython-314.pyc +0 -0
  157. package/onecode/models/providers/__pycache__/glm_provider.cpython-314.pyc +0 -0
  158. package/onecode/models/providers/__pycache__/minimax_provider.cpython-314.pyc +0 -0
  159. package/onecode/models/providers/__pycache__/minimaxi_provider.cpython-314.pyc +0 -0
  160. package/onecode/models/providers/__pycache__/ollama_provider.cpython-314.pyc +0 -0
  161. package/onecode/models/providers/anthropic_provider.py +59 -12
  162. package/onecode/models/providers/glm_provider.py +40 -0
  163. package/onecode/models/providers/minimax_provider.py +3 -0
  164. package/onecode/models/providers/minimaxi_provider.py +3 -0
  165. package/onecode/models/providers/ollama_provider.py +3 -0
  166. package/onecode/server/app.py +1 -1
  167. package/onecode/skills/__pycache__/argument_substitution.cpython-314.pyc +0 -0
  168. package/onecode/skills/__pycache__/bootstrap.cpython-314.pyc +0 -0
  169. package/onecode/skills/__pycache__/loader.cpython-314.pyc +0 -0
  170. package/onecode/skills/__pycache__/manager.cpython-314.pyc +0 -0
  171. package/onecode/skills/argument_substitution.py +0 -1
  172. package/onecode/skills/bootstrap.py +124 -0
  173. package/onecode/skills/loader.py +35 -53
  174. package/onecode/skills/manager.py +2 -2
  175. package/onecode/storage/activity.py +3 -4
  176. package/onecode/storage/session.py +3 -4
  177. package/onecode/tasks/manager.py +23 -10
  178. package/onecode/trace/tracer.py +2 -3
  179. package/package.json +1 -1
  180. package/pyproject.toml +5 -1
  181. package/tui/__pycache__/about.cpython-314.pyc +0 -0
  182. package/tui/__pycache__/app.cpython-313.pyc +0 -0
  183. package/tui/__pycache__/app.cpython-314.pyc +0 -0
  184. package/tui/__pycache__/danger.cpython-314.pyc +0 -0
  185. package/tui/__pycache__/directory_suggester.cpython-314.pyc +0 -0
  186. package/tui/__pycache__/messages.cpython-314.pyc +0 -0
  187. package/tui/__pycache__/path_complete.cpython-314.pyc +0 -0
  188. package/tui/__pycache__/paths.cpython-314.pyc +0 -0
  189. package/tui/__pycache__/session_tracker.cpython-314.pyc +0 -0
  190. package/tui/__pycache__/settings_schema.cpython-314.pyc +0 -0
  191. package/tui/acp/__pycache__/agent.cpython-314.pyc +0 -0
  192. package/tui/acp/__pycache__/api.cpython-314.pyc +0 -0
  193. package/tui/acp/__pycache__/messages.cpython-314.pyc +0 -0
  194. package/tui/acp/__pycache__/prompt.cpython-314.pyc +0 -0
  195. package/tui/acp/__pycache__/protocol.cpython-314.pyc +0 -0
  196. package/tui/acp/agent.py +125 -58
  197. package/tui/acp/api.py +12 -0
  198. package/tui/acp/messages.py +3 -1
  199. package/tui/acp/prompt.py +0 -57
  200. package/tui/acp/protocol.py +6 -0
  201. package/tui/app.py +11 -33
  202. package/tui/messages.py +2 -0
  203. package/tui/path_complete.py +1 -1
  204. package/tui/paths.py +16 -0
  205. package/tui/screens/__pycache__/agent_modal.cpython-314.pyc +0 -0
  206. package/tui/screens/__pycache__/component_picker.cpython-314.pyc +0 -0
  207. package/tui/screens/__pycache__/diff_screen.cpython-314.pyc +0 -0
  208. package/tui/screens/__pycache__/log.cpython-314.pyc +0 -0
  209. package/tui/screens/__pycache__/main.cpython-313.pyc +0 -0
  210. package/tui/screens/__pycache__/main.cpython-314.pyc +0 -0
  211. package/tui/screens/__pycache__/permissions.cpython-314.pyc +0 -0
  212. package/tui/screens/__pycache__/projects_app.cpython-314.pyc +0 -0
  213. package/tui/screens/__pycache__/projects_screen.cpython-314.pyc +0 -0
  214. package/tui/screens/__pycache__/sessions.cpython-314.pyc +0 -0
  215. package/tui/screens/__pycache__/store.cpython-314.pyc +0 -0
  216. package/tui/screens/__pycache__/tool_content_screen.cpython-314.pyc +0 -0
  217. package/tui/screens/component_picker.py +35 -15
  218. package/tui/screens/diff_screen.py +84 -0
  219. package/tui/screens/log.py +25 -25
  220. package/tui/screens/main.py +48 -26
  221. package/tui/screens/projects.tcss +5 -1
  222. package/tui/screens/projects_app.py +6 -6
  223. package/tui/screens/projects_screen.py +19 -39
  224. package/tui/screens/sessions.py +3 -5
  225. package/tui/session_tracker.py +3 -0
  226. package/tui/settings_schema.py +1 -1
  227. package/tui/visuals/__pycache__/columns.cpython-314.pyc +0 -0
  228. package/tui/visuals/columns.py +1 -2
  229. package/tui/widgets/__pycache__/acp_content.cpython-314.pyc +0 -0
  230. package/tui/widgets/__pycache__/agent_response.cpython-314.pyc +0 -0
  231. package/tui/widgets/__pycache__/agent_thought.cpython-314.pyc +0 -0
  232. package/tui/widgets/__pycache__/conversation.cpython-314.pyc +0 -0
  233. package/tui/widgets/__pycache__/diff_view.cpython-314.pyc +0 -0
  234. package/tui/widgets/__pycache__/directory_input.cpython-314.pyc +0 -0
  235. package/tui/widgets/__pycache__/future_text.cpython-314.pyc +0 -0
  236. package/tui/widgets/__pycache__/grid_select.cpython-314.pyc +0 -0
  237. package/tui/widgets/__pycache__/load_more.cpython-314.pyc +0 -0
  238. package/tui/widgets/__pycache__/mandelbrot.cpython-314.pyc +0 -0
  239. package/tui/widgets/__pycache__/markdown_note.cpython-314.pyc +0 -0
  240. package/tui/widgets/__pycache__/modified_files.cpython-314.pyc +0 -0
  241. package/tui/widgets/__pycache__/plan.cpython-314.pyc +0 -0
  242. package/tui/widgets/__pycache__/project_grid_select.cpython-314.pyc +0 -0
  243. package/tui/widgets/__pycache__/project_summary.cpython-314.pyc +0 -0
  244. package/tui/widgets/__pycache__/session_grid_select.cpython-314.pyc +0 -0
  245. package/tui/widgets/__pycache__/session_summary.cpython-314.pyc +0 -0
  246. package/tui/widgets/__pycache__/shell_result.cpython-314.pyc +0 -0
  247. package/tui/widgets/__pycache__/side_bar.cpython-314.pyc +0 -0
  248. package/tui/widgets/__pycache__/subagent.cpython-314.pyc +0 -0
  249. package/tui/widgets/__pycache__/subagent_screen.cpython-314.pyc +0 -0
  250. package/tui/widgets/__pycache__/terminal.cpython-314.pyc +0 -0
  251. package/tui/widgets/__pycache__/tool_call.cpython-314.pyc +0 -0
  252. package/tui/widgets/agent_response.py +0 -1
  253. package/tui/widgets/agent_thought.py +0 -1
  254. package/tui/widgets/conversation.py +157 -14
  255. package/tui/widgets/diff_view.py +10 -0
  256. package/tui/widgets/load_more.py +24 -0
  257. package/tui/widgets/modified_files.py +86 -12
  258. package/tui/widgets/plan.py +1 -1
  259. package/tui/widgets/project_grid_select.py +9 -2
  260. package/tui/widgets/session_grid_select.py +6 -0
  261. package/tui/widgets/side_bar.py +10 -0
  262. package/tui/widgets/subagent.py +92 -58
  263. package/tui/widgets/subagent_screen.py +638 -115
  264. package/tui/widgets/terminal.py +1 -2
  265. package/tui/widgets/terminal_tool.py +11 -2
  266. package/tui/widgets/tool_call.py +35 -2
  267. package/onecode/memory/offload.py +0 -114
  268. package/onecode/memory/symbolic.py +0 -164
@@ -52,7 +52,7 @@ metadata:
52
52
  | WXA | WeChat Mini | `apps/wxa/` | `WXA-FR-NNN` |
53
53
  | MYA | Alipay Mini | `apps/mya/` | `MYA-FR-NNN` |
54
54
  | TTA | TikTok Mini | `apps/tta/` | `TTA-FR-NNN` |
55
- | INT | Contracts | `contracts/`, `packages/shared/` | `INT-FR-NNN` |
55
+ | INT | Contracts | `aidlc/contracts/`, `aidlc/packages/shared/` | `INT-FR-NNN` |
56
56
 
57
57
  ## Adaptive Flow
58
58
 
@@ -60,9 +60,11 @@ See `core/adaptive-flow.md` for complexity assessment.
60
60
 
61
61
  1. Analyze intent → determine complexity (L1-L5)
62
62
  2. Select phases to execute
63
- 3. Delegate each phase via `Task(agent_type="general", prompt=...)` using the phase's `prompt.md`
63
+ 3. Delegate each phase via `Spawn(agent_type="general", prompt=...)` using the phase's `prompt.md`
64
64
  4. Collect results, enforce gates, iterate or advance
65
65
 
66
+ ```
67
+
66
68
  ## Phase Reference
67
69
 
68
70
  | Phase | Lifecycle | Rules | Practices |
@@ -10,6 +10,12 @@
10
10
  4. **收集结果**:检查每个 phase 的 Gate 是否通过
11
11
  5. **Human Gate**:关键决策点(breaking change、production deploy)暂停等待用户确认
12
12
 
13
+ ## ⚠️ 角色边界(重要)
14
+
15
+ - **你(主 Agent)负责所有规划**:分析复杂度、创建 TODO、判断直行还是 Spawn
16
+ - **子 Agent 是叶子节点**:只做实现,不可嵌套
17
+ - **禁止**:把"分析复杂度"或"判断是否 Spawn"的逻辑下放给子 Agent
18
+
13
19
  ## 复杂度判断
14
20
 
15
21
  见 `core/adaptive-flow.md`。
@@ -11,8 +11,8 @@
11
11
 
12
12
  ## 关键产出
13
13
 
14
- 1. Design Doc → `openspec/changes/{id}/design.md`
15
- 2. Task DAG → `openspec/changes/{id}/task-list.md`
14
+ 1. Design Doc → `aidlc/openspec/changes/{id}/design.md`
15
+ 2. Task DAG → `aidlc/openspec/changes/{id}/task-list.md`
16
16
  3. Test Plan → embedded in task-list
17
17
  4. Contract Plan → `contract-diff.md` 占位
18
18
 
@@ -11,11 +11,11 @@
11
11
 
12
12
  ## 关键产出
13
13
 
14
- 1. Intent 捕获 → `requirements.md`
15
- 2. Spec Delta (EARS) → `openspec/changes/{id}/spec-delta.md`
14
+ 1. Intent 捕获 → `aidlc/requirements.md`
15
+ 2. Spec Delta (EARS) → `aidlc/openspec/changes/{id}/spec-delta.md`
16
16
  3. BDD Feature 文件 → `apps/{component}/features/`
17
- 4. 跨组件 Feature 文件 → `features/cross-stack/`(如适用)
18
- 5. 合约文件 → `contracts/{api,events}/`(跨组件时)
17
+ 4. 跨组件 Feature 文件 → `aidlc/features/cross-stack/`(如适用)
18
+ 5. 合约文件 → `aidlc/contracts/{api,events}/`(跨组件时)
19
19
 
20
20
  ## 约束
21
21
 
@@ -16,7 +16,7 @@
16
16
  3. BDD step defs → `apps/{component}/features/steps/`
17
17
  4. 合约测试 → `tests/contract/`
18
18
  5. 跨组件 e2e → `tests/cross-stack/`
19
- 6. Contract Diff → `openspec/changes/{id}/contract-diff.md`
19
+ 6. Contract Diff → `aidlc/openspec/changes/{id}/contract-diff.md`
20
20
 
21
21
  ## 质量门禁
22
22
 
@@ -12,27 +12,27 @@
12
12
  │ ├── wxa/ # WXA-FR-* WeChat Mini Program (Vant Weapp/JavaScript)
13
13
  │ ├── mya/ # MYA-FR-* Alipay Mini Program (Ant Design Mini/JavaScript)
14
14
  │ └── tta/ # TTA-FR-* TikTok Mini Program (TypeScript)
15
- ├── contracts/ # INT-FR-* OpenAPI / AsyncAPI / Runtime Contract
15
+ ├── aidlc/contracts/ # INT-FR-* OpenAPI / AsyncAPI / Runtime Contract
16
16
  │ ├── api/
17
17
  │ ├── events/
18
18
  │ └── functions/
19
- ├── packages/shared/ # INT-FR-* 从 contracts 生成的共享类型
20
- ├── features/ # BDD feature 文件
19
+ ├── aidlc/packages/shared/ # INT-FR-* 从 contracts 生成的共享类型
20
+ ├── aidlc/features/ # BDD feature 文件
21
21
  │ └── cross-stack/ # 跨组件集成场景
22
- ├── tests/
22
+ ├── aidlc/tests/
23
23
  │ ├── contract/ # 合约测试 (INT-FR 级别, provider-agnostic)
24
24
  │ └── cross-stack/ # 跨组件 e2e 测试 (对 STACK_URL 运行)
25
- ├── openspec/ # AI-DLC 生命周期产出物
25
+ ├── aidlc/openspec/ # AI-DLC 生命周期产出物
26
26
  │ └── changes/{id}/
27
27
  │ ├── spec-delta.md
28
28
  │ ├── design.md
29
29
  │ ├── task-list.md
30
30
  │ ├── contract-diff.md
31
31
  │ └── walkthrough.md
32
- ├── providers/ # 云平台部署配置
32
+ ├── aidlc/providers/ # 云平台部署配置
33
33
  │ ├── tcb/
34
34
  │ └── aliyun/
35
- ├── tools/ # 脚手架脚本
35
+ ├── aidlc/tools/ # 脚手架脚本
36
36
  │ ├── generate_shared.py
37
37
  │ └── contract_diff.py
38
38
  ├── .opencode/ # OpenCode 配置
@@ -41,7 +41,7 @@
41
41
  │ ├── config.yaml
42
42
  │ ├── state.json
43
43
  │ └── SKILL.md
44
- └── AI-DLC-CONTEXT.md # Brownfield 上下文摘要 (自动生成)
44
+ └── aidlc/AI-DLC-CONTEXT.md # Brownfield 上下文摘要 (自动生成)
45
45
  ```
46
46
 
47
47
  ## 组件内部结构 (标准模板)
@@ -74,5 +74,5 @@ apps/{component}/
74
74
  | WXA-FR-NNN | `apps/wxa/` | `apps/wxa/tests/` | BACKEND_URL |
75
75
  | MYA-FR-NNN | `apps/mya/` | `apps/mya/tests/` | BACKEND_URL |
76
76
  | TTA-FR-NNN | `apps/tta/` | `apps/tta/tests/` | BACKEND_URL |
77
- | INT-FR-NNN | `contracts/` + `packages/shared/` | `tests/contract/` | generated types |
78
- | 跨组件 | `features/cross-stack/` | `tests/cross-stack/` | STACK_URL |
77
+ | INT-FR-NNN | `aidlc/contracts/` + `aidlc/packages/shared/` | `aidlc/tests/contract/` | generated types |
78
+ | 跨组件 | `aidlc/features/cross-stack/` | `aidlc/tests/cross-stack/` | STACK_URL |
@@ -5,7 +5,7 @@
5
5
  ## 使用方式
6
6
 
7
7
  ```bash
8
- # 一键生成 AI-DLC-CONTEXT.md
8
+ # 一键生成 aidlc/AI-DLC-CONTEXT.md
9
9
  ./brownfield/generate-context.sh
10
10
 
11
11
  # 单独步骤
@@ -16,7 +16,7 @@
16
16
 
17
17
  ## 产出
18
18
 
19
- `AI-DLC-CONTEXT.md` 文件包含:
19
+ `aidlc/AI-DLC-CONTEXT.md` 文件包含:
20
20
  1. 发现的组件列表 + 技术栈
21
21
  2. API 端点摘要
22
22
  3. 跨组件依赖 Mermaid 图
@@ -4,7 +4,7 @@ set -euo pipefail
4
4
 
5
5
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
6
  PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
7
- OUTPUT="$PROJECT_ROOT/AI-DLC-CONTEXT.md"
7
+ OUTPUT="$PROJECT_ROOT/aidlc/AI-DLC-CONTEXT.md"
8
8
 
9
9
  echo "# AI-DLC Context — $(basename "$PROJECT_ROOT")"
10
10
  echo ""
@@ -29,8 +29,8 @@ echo ""
29
29
  # 2. API surface
30
30
  echo "## API Surface"
31
31
  echo ""
32
- if [ -d "$PROJECT_ROOT/contracts/api" ]; then
33
- find "$PROJECT_ROOT/contracts/api" -name "*.yaml" -o -name "*.yml" | while read -r f; do
32
+ if [ -d "$PROJECT_ROOT/aidlc/contracts/api" ]; then
33
+ find "$PROJECT_ROOT/aidlc/contracts/api" -name "*.yaml" -o -name "*.yml" | while read -r f; do
34
34
  echo "- $(basename "$f")"
35
35
  done
36
36
  else
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # extract-api.sh — Extract API surface from contracts/ directory
2
+ # extract-api.sh — Extract API surface from aidlc/contracts/ directory
3
3
  set -euo pipefail
4
4
 
5
5
  PROJECT_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
@@ -7,13 +7,13 @@ PROJECT_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
7
7
  echo "# API Surface"
8
8
  echo ""
9
9
 
10
- if [ ! -d "$PROJECT_ROOT/contracts" ]; then
11
- echo "(No contracts/ directory found)"
10
+ if [ ! -d "$PROJECT_ROOT/aidlc/contracts" ]; then
11
+ echo "(No aidlc/contracts/ directory found)"
12
12
  exit 0
13
13
  fi
14
14
 
15
15
  # OpenAPI
16
- for f in "$PROJECT_ROOT"/contracts/api/*.yaml "$PROJECT_ROOT"/contracts/api/*.yml; do
16
+ for f in "$PROJECT_ROOT"/aidlc/contracts/api/*.yaml "$PROJECT_ROOT"/aidlc/contracts/api/*.yml; do
17
17
  [ -f "$f" ] || continue
18
18
  echo "## File: $(basename "$f")"
19
19
  python3 -c "
@@ -31,7 +31,7 @@ if 'info' in d:
31
31
  done
32
32
 
33
33
  # AsyncAPI
34
- for f in "$PROJECT_ROOT"/contracts/events/*.yaml "$PROJECT_ROOT"/contracts/events/*.yml; do
34
+ for f in "$PROJECT_ROOT"/aidlc/contracts/events/*.yaml "$PROJECT_ROOT"/aidlc/contracts/events/*.yml; do
35
35
  [ -f "$f" ] || continue
36
36
  echo "## File: $(basename "$f")"
37
37
  python3 -c "
@@ -28,7 +28,7 @@
28
28
 
29
29
  ## 特定约束
30
30
  - 后端组件是 Stack 部署的入口点(先部署再暴露 BACKEND_URL)
31
- - API 合约定义在 `contracts/api/`(OpenAPI 3.1)
31
+ - API 合约定义在 `aidlc/contracts/api/`(OpenAPI 3.1)
32
32
  - 依赖注入使用 provider pattern
33
33
  - 所有输入必须验证(SEC-002)
34
34
  - DB 查询必须使用参数化语句(SEC-003)
@@ -27,5 +27,5 @@
27
27
 
28
28
  ## 特定约束
29
29
  - Web 组件在构建时接收 `BACKEND_URL` 环境变量
30
- - 使用 `packages/shared/` 中的生成类型
31
- - API 调用走 `packages/shared/api/`
30
+ - 使用 `aidlc/packages/shared/` 中的生成类型
31
+ - API 调用走 `aidlc/packages/shared/api/`
@@ -9,15 +9,15 @@ contracts/
9
9
  └── functions/ ← Runtime Contract — Serverless 函数接口 (新增)
10
10
  ```
11
11
 
12
- ## contracts/api/
12
+ ## aidlc/contracts/api/
13
13
  HTTP API 描述,使用 OpenAPI 3.1 格式。
14
14
  每个文件对应一个 INT-FR-NNN,描述请求/响应 schema。
15
15
 
16
- ## contracts/events/
16
+ ## aidlc/contracts/events/
17
17
  事件驱动合约,使用 AsyncAPI 3.0 + CloudEvents 格式。
18
18
  描述事件的生产/消费关系。
19
19
 
20
- ## contracts/functions/
20
+ ## aidlc/contracts/functions/
21
21
  Serverless 函数接口描述,Provider-agnostic。
22
22
  描述函数的触发器、资源需求、环境变量。
23
23
  部署时根据选择的 provider + compute_mode 自动映射到具体平台。
@@ -15,7 +15,7 @@ AI-DLC: Intent → Spec (EARS) → BDD → Design → TDD → Deploy
15
15
  ## FR Namespaces
16
16
  NATIVE apps/native | DESKTOP apps/desktop | WEB apps/web
17
17
  BE apps/backend | WXA apps/wxa | MYA apps/mya | TTA apps/tta
18
- INT contracts/ + packages/shared/
18
+ INT aidlc/contracts/ + aidlc/packages/shared/
19
19
 
20
20
  ## Quality Gates
21
21
  - Coverage >= 80%
@@ -26,7 +26,7 @@ Follow the AI-Driven Development Lifecycle:
26
26
  - WXA-FR-* → apps/wxa/
27
27
  - MYA-FR-* → apps/mya/
28
28
  - TTA-FR-* → apps/tta/
29
- - INT-FR-* → contracts/ + packages/shared/
29
+ - INT-FR-* → aidlc/contracts/ + aidlc/packages/shared/
30
30
 
31
31
  ## Quality Gates
32
32
  - Coverage ≥80%
@@ -2,9 +2,13 @@
2
2
  # export-skills.sh — Generate per-component .skill/SKILL.md from components/*.md
3
3
  set -euo pipefail
4
4
 
5
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
- SKILL_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
7
- PROJECT_ROOT="$(cd "$SKILL_DIR/.." && pwd)"
5
+ PROJECT_ROOT="${1:-$PWD}"
6
+ SKILL_DIR="${2:-${AI_DLC_SKILL_DIR:-$HOME/.cdh/skills/ai-dlc-skill}}"
7
+
8
+ if [ ! -d "$SKILL_DIR" ]; then
9
+ echo " ✗ ai-dlc-skill not found at $SKILL_DIR" >&2
10
+ exit 1
11
+ fi
8
12
 
9
13
  echo "Generating component skills in $PROJECT_ROOT/apps/*/.skill/"
10
14
 
@@ -2,21 +2,27 @@
2
2
  # onecode/export.sh — Export AI-DLC rules to onecode format
3
3
  set -euo pipefail
4
4
 
5
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6
- # ai-dlc-skill root: onecode/.. → cross-tool/.. → ai-dlc-skill
7
- SKILL_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
8
- # project root: ai-dlc-skill → skills → .opencode → project
9
- PROJECT_ROOT="$(cd "$SKILL_DIR/.." && pwd)"
5
+ # Project root: first arg or current working directory
6
+ PROJECT_ROOT="${1:-$PWD}"
7
+ # Skill dir: CDH platform skill pool or AI_DLC_SKILL_DIR env var
8
+ SKILL_DIR="${AI_DLC_SKILL_DIR:-$HOME/.cdh/skills/ai-dlc-skill}"
9
+
10
+ if [ ! -d "$SKILL_DIR" ]; then
11
+ echo " ✗ ai-dlc-skill not found at $SKILL_DIR" >&2
12
+ echo " Run: cdh skill install ai-dlc-skill" >&2
13
+ exit 1
14
+ fi
10
15
 
11
- echo " Exporting onecode configs..."
16
+ echo " Exporting onecode configs for project: $(basename "$PROJECT_ROOT")"
12
17
 
13
18
  CDH_DIR="$PROJECT_ROOT/.cdh"
19
+ CROSS_TOOL_DIR="$SKILL_DIR/cross-tool/onecode"
14
20
 
15
21
  # 1. Generate .cdh/config.yaml if not exists
16
22
  if [ ! -f "$CDH_DIR/config.yaml" ]; then
17
23
  mkdir -p "$CDH_DIR"
18
24
  sed "s/{{project_name}}/$(basename "$PROJECT_ROOT")/g; s/{{cloud_provider}}/tcb/g; s/{{current_phase}}/understand/g; s/{{compute_mode}}/cloudbase-functions/g" \
19
- "$SCRIPT_DIR/config.yaml.tpl" > "$CDH_DIR/config.yaml"
25
+ "$CROSS_TOOL_DIR/config.yaml.tpl" > "$CDH_DIR/config.yaml"
20
26
  echo " ✓ $CDH_DIR/config.yaml created"
21
27
  else
22
28
  echo " - $CDH_DIR/config.yaml exists, skipping"
@@ -43,6 +49,6 @@ cp "$SKILL_DIR/SKILL.md" "$CDH_DIR/SKILL.md"
43
49
  echo " ✓ $CDH_DIR/SKILL.md updated"
44
50
 
45
51
  # 4. Generate component skills into apps/*/.skill/
46
- bash "$SCRIPT_DIR/export-skills.sh"
52
+ bash "$CROSS_TOOL_DIR/export-skills.sh" "$PROJECT_ROOT" "$SKILL_DIR"
47
53
 
48
54
  echo " onecode export complete."
@@ -103,8 +103,8 @@ pytest apps/tta/tests/e2e/ --backend-url $BACKEND_URL
103
103
  ## Cross-Stack E2E
104
104
 
105
105
  ```bash
106
- pytest tests/cross-stack/ --stack-url $STACK_URL --verbose
107
- # Runs the full multi-client ↔ backend flow defined in features/cross-stack/
106
+ pytest aidlc/tests/cross-stack/ --stack-url $STACK_URL --verbose
107
+ # Runs the full multi-client ↔ backend flow defined in aidlc/features/cross-stack/
108
108
  ```
109
109
 
110
110
  **Rule STK-001:** All `cross-stack` scenarios must pass before staging or production.
@@ -114,7 +114,7 @@ pytest tests/cross-stack/ --stack-url $STACK_URL --verbose
114
114
  ```bash
115
115
  deploy_stack --env staging
116
116
  export STAGING_URL=$(deploy_stack --env staging --output url)
117
- pytest tests/cross-stack/ --stack-url $STAGING_URL
117
+ pytest aidlc/tests/cross-stack/ --stack-url $STAGING_URL
118
118
  smoke-test $STAGING_URL
119
119
  ```
120
120
 
@@ -158,7 +158,7 @@ deploy_stack --rollback ${LAST_STABLE_STACK_VERSION}
158
158
  deploy_stack --rollback --stack-version v1.2.3
159
159
  ```
160
160
 
161
- The previous stable stack version is identified by the `contracts/CHANGELOG.md` version at the time of the last green BVT.
161
+ The previous stable stack version is identified by the `aidlc/contracts/CHANGELOG.md` version at the time of the last green BVT.
162
162
 
163
163
  ## Artifacts
164
164
 
@@ -167,7 +167,7 @@ The previous stable stack version is identified by the `contracts/CHANGELOG.md`
167
167
  | `STACK_URL` / `BACKEND_URL` | Dynamic, per-platform, per-env |
168
168
  | Per-component e2e report | Scenario pass/fail per component |
169
169
  | Cross-stack e2e report | Full flow pass/fail |
170
- | `openspec/changes/{id}/contract-diff.md` | Final contract change record |
170
+ | `aidlc/openspec/changes/{id}/contract-diff.md` | Final contract change record |
171
171
  | BVT report | Stack-level health check results |
172
172
  | Deploy log | Stack version, timestamp, component versions |
173
173
 
@@ -182,4 +182,4 @@ The previous stable stack version is identified by the `contracts/CHANGELOG.md`
182
182
  - [ ] Production stack deploy succeeded
183
183
  - [ ] Stack BVT passed
184
184
  - [ ] (If BVT failed) Stack rollback executed and confirmed
185
- - [ ] `openspec/changes/{id}/contract-diff.md` archived
185
+ - [ ] `aidlc/openspec/changes/{id}/contract-diff.md` archived
@@ -4,7 +4,7 @@
4
4
  由 Master Agent 委派处理部署交付。
5
5
 
6
6
  ## 输入
7
- - `openspec/changes/{id}/contract-diff.md`
7
+ - `aidlc/openspec/changes/{id}/contract-diff.md`
8
8
  - 所有 e2e 测试报告
9
9
 
10
10
  ## 任务
@@ -18,7 +18,7 @@
18
18
  - 使用动态解析的 URL
19
19
 
20
20
  3. **Cross-Stack e2e**
21
- - `pytest tests/cross-stack/ --stack-url ${STACK_URL}`
21
+ - `pytest aidlc/tests/cross-stack/ --stack-url ${STACK_URL}`
22
22
 
23
23
  4. **Staging Deploy + Smoke**
24
24
  - `deploy_stack --env staging`
@@ -3,7 +3,7 @@
3
3
  ## DLV-001: Unified Stack Preview Before Production
4
4
  **Severity:** MUST
5
5
  **Description:** Every release MUST deploy as unified stack preview with per-component e2e + cross-stack e2e passing before production.
6
- **Valid:** `deploy_stack --preview` → `pytest tests/cross-stack/ --stack-url $STACK_URL`.
6
+ **Valid:** `deploy_stack --preview` → `pytest aidlc/tests/cross-stack/ --stack-url $STACK_URL`.
7
7
  **Invalid:** Deploying only one component to preview.
8
8
 
9
9
  ## DLV-002: Production Approval Gate
@@ -52,27 +52,27 @@ A multi-component design doc is organized by **component sections** plus an **in
52
52
  ### Component: web (WEB-FR-*)
53
53
  - Architecture: {{SPA / SSR}}
54
54
  - Routes: {{...}}
55
- - Data flow: {{uses packages/shared generated from INT-FR-001}}
55
+ - Data flow: {{uses aidlc/packages/shared generated from INT-FR-001}}
56
56
 
57
57
  ### Component: native (NATIVE-FR-*)
58
58
  - Architecture: {{native architecture}}
59
- - Data flow: {{uses packages/shared generated from INT-FR-*}}
59
+ - Data flow: {{uses aidlc/packages/shared generated from INT-FR-*}}
60
60
 
61
61
  ### Component: desktop (DESKTOP-FR-*)
62
62
  - Architecture: {{desktop architecture}}
63
- - Data flow: {{uses packages/shared generated from INT-FR-*}}
63
+ - Data flow: {{uses aidlc/packages/shared generated from INT-FR-*}}
64
64
 
65
65
  ### Component: wxa (WXA-FR-*)
66
66
  - Architecture: {{WeChat Mini Program}}
67
- - Data flow: {{uses packages/shared generated from INT-FR-*}}
67
+ - Data flow: {{uses aidlc/packages/shared generated from INT-FR-*}}
68
68
 
69
69
  ### Component: mya (MYA-FR-*)
70
70
  - Architecture: {{Mini Program}}
71
- - Data flow: {{uses packages/shared generated from INT-FR-*}}
71
+ - Data flow: {{uses aidlc/packages/shared generated from INT-FR-*}}
72
72
 
73
73
  ### Component: tta (TTA-FR-*)
74
74
  - Architecture: {{TikTok Mini Program}}
75
- - Data flow: {{uses packages/shared generated from INT-FR-*}}
75
+ - Data flow: {{uses aidlc/packages/shared generated from INT-FR-*}}
76
76
 
77
77
  ### Integration
78
78
  - Flow: {{web → backend → DB; or app → backend → event → ...}}
@@ -130,7 +130,7 @@ units:
130
130
  fr: INT-FR-001
131
131
  affects: [contracts]
132
132
  depends_on: []
133
- deliverables: [contracts/api/auth.yaml]
133
+ deliverables: [aidlc/contracts/api/auth.yaml]
134
134
  - id: be-unit-1
135
135
  fr: BE-FR-001
136
136
  affects: [backend]
@@ -180,7 +180,7 @@ Test cases:
180
180
 
181
181
  For each contract change, list:
182
182
  - Old version, new version
183
- - Breaking? (yes / no) → if yes, plan migration in `contracts/CHANGELOG.md`
183
+ - Breaking? (yes / no) → if yes, plan migration in `aidlc/contracts/CHANGELOG.md`
184
184
  - Consumers affected (which components will pull the new shared types)
185
185
  - Backward-compat strategy (additive vs. deprecate-then-remove)
186
186
 
@@ -188,10 +188,10 @@ For each contract change, list:
188
188
 
189
189
  | Artifact | Location | Purpose |
190
190
  |----------|----------|---------|
191
- | Design doc | `openspec/changes/{id}/design.md` | Per-component + integration |
192
- | Task list | `openspec/changes/{id}/task-list.md` | DAG with cross-component edges |
191
+ | Design doc | `aidlc/openspec/changes/{id}/design.md` | Per-component + integration |
192
+ | Task list | `aidlc/openspec/changes/{id}/task-list.md` | DAG with cross-component edges |
193
193
  | Test plan | Embedded in task-list or separate | Per-scenario, per-layer |
194
- | Contract plan | `openspec/changes/{id}/contract-diff.md` placeholder | Filled in Verify |
194
+ | Contract plan | `aidlc/openspec/changes/{id}/contract-diff.md` placeholder | Filled in Verify |
195
195
 
196
196
  ## Gate
197
197
 
@@ -4,18 +4,18 @@
4
4
  由 Master Agent 委派处理方案设计。
5
5
 
6
6
  ## 输入
7
- - `openspec/changes/{id}/spec-delta.md`
7
+ - `aidlc/openspec/changes/{id}/spec-delta.md`
8
8
  - BDD feature 文件
9
9
 
10
10
  ## 任务
11
11
 
12
12
  1. **SDD: Design Doc**
13
- - 在 `openspec/changes/{id}/design.md` 输出
13
+ - 在 `aidlc/openspec/changes/{id}/design.md` 输出
14
14
  - 包含:架构图(Mermaid)、数据模型、API 表、状态机
15
15
  - 每组件独立 section + 集成 section
16
16
 
17
17
  2. **SDD: Task Decomposition**
18
- - 在 `openspec/changes/{id}/task-list.md` 输出
18
+ - 在 `aidlc/openspec/changes/{id}/task-list.md` 输出
19
19
  - YAML 格式,unit 带 `depends_on` DAG
20
20
  - 跨组件 task 显示声明 `depends_on` 关系
21
21
 
@@ -28,9 +28,9 @@
28
28
  - 如需 breaking change 标记为 human-approval 阻塞
29
29
 
30
30
  ## 输出产物
31
- - `openspec/changes/{id}/design.md`
32
- - `openspec/changes/{id}/task-list.md`
33
- - `openspec/changes/{id}/contract-diff.md`(占位)
31
+ - `aidlc/openspec/changes/{id}/design.md`
32
+ - `aidlc/openspec/changes/{id}/task-list.md`
33
+ - `aidlc/openspec/changes/{id}/contract-diff.md`(占位)
34
34
 
35
35
  ## 约束
36
36
  - 遵守 `rules.md` 中的 PLN-001 到 PLN-004
@@ -3,7 +3,7 @@
3
3
  ## PLN-001: Design Documentation
4
4
  **Severity:** MUST
5
5
  **Description:** Each feature MUST have a design document covering architecture, data model, API contracts, and state machine. For multi-component features, MUST have per-component sections and an integration section.
6
- **Valid:** `openspec/changes/{id}/design.md` with `## Component: backend`, `## Component: web`, `## Integration`.
6
+ **Valid:** `aidlc/openspec/changes/{id}/design.md` with `## Component: backend`, `## Component: web`, `## Integration`.
7
7
  **Invalid:** A single flat architecture section with no per-component concerns.
8
8
 
9
9
  ## PLN-002: Dependency DAG
@@ -23,4 +23,4 @@ See `prompt.md` for the sub-agent delegation prompt template.
23
23
  1. 读取 intent 输入
24
24
  2. 按 SDD 方法生成 spec-delta(EARS 格式)
25
25
  3. 为每个 FR 写 BDD feature 文件(≥3 scenarios: positive, negative, edge)
26
- 4. 输出到 `openspec/changes/{id}/`
26
+ 4. 输出到 `aidlc/openspec/changes/{id}/`
@@ -23,7 +23,7 @@ SDD: Spec Delta (EARS format — ADDED/MODIFIED/REMOVED, FR namespaces)
23
23
 
24
24
  BDD: Feature Files
25
25
  - features/{component}/{domain}/{feature}.feature (per-component)
26
- - features/cross-stack/{domain}/{feature}.feature (full flow, if applies)
26
+ - aidlc/features/cross-stack/{domain}/{feature}.feature (full flow, if applies)
27
27
 
28
28
 
29
29
  Gate: Human review → approved or revise
@@ -167,11 +167,11 @@ Feature: Cross-stack login flow
167
167
 
168
168
  | Artifact | Location | Purpose |
169
169
  |----------|----------|---------|
170
- | Intent | `requirements.md` | Business need + `affects` |
171
- | Spec delta | `openspec/changes/{id}/spec-delta.md` | EARS, FR namespaces, `affects` |
170
+ | Intent | `aidlc/requirements.md` | Business need + `affects` |
171
+ | Spec delta | `aidlc/openspec/changes/{id}/spec-delta.md` | EARS, FR namespaces, `affects` |
172
172
  | Per-component BDD | `apps/{component}/features/{domain}/{feature}.feature` | Component behavior |
173
- | Cross-stack BDD | `features/cross-stack/{domain}/{feature}.feature` | End-to-end flow |
174
- | Contract spec | `contracts/{api,events}/{name}.{yaml,graphql}` | INT-FR-NNN source of truth |
173
+ | Cross-stack BDD | `aidlc/features/cross-stack/{domain}/{feature}.feature` | End-to-end flow |
174
+ | Contract spec | `aidlc/contracts/{api,events}/{name}.{yaml,graphql}` | INT-FR-NNN source of truth |
175
175
 
176
176
  ## Gate
177
177
 
@@ -179,6 +179,6 @@ Feature: Cross-stack login flow
179
179
  - [ ] `affects: [...]` declared in spec-delta
180
180
  - [ ] Spec delta uses EARS format
181
181
  - [ ] Per-component FRs: each tagged `@FR-{PREFIX}-NNN` (e.g. `@NATIVE-`, `@DESKTOP-`, `@WEB-`, `@BE-`, `@WXA-`, `@MYA-`, `@TTA-`), ≥3 scenarios (positive/negative/edge)
182
- - [ ] If `affects` includes ≥2 components: at least one `INT-FR-NNN` and a `features/cross-stack/*.feature` with ≥3 scenarios
183
- - [ ] If `affects` includes contracts: contract file present in `contracts/`
182
+ - [ ] If `affects` includes ≥2 components: at least one `INT-FR-NNN` and a `aidlc/features/cross-stack/*.feature` with ≥3 scenarios
183
+ - [ ] If `affects` includes contracts: contract file present in `aidlc/contracts/`
184
184
  - [ ] Human reviewed and approved
@@ -10,30 +10,30 @@
10
10
  ## 任务
11
11
 
12
12
  1. **SDD: Intent Capture**
13
- - 在 `requirements.md` 记录 Why / What / Success Criteria / Scope
13
+ - 在 `aidlc/requirements.md` 记录 Why / What / Success Criteria / Scope
14
14
  - 声明 `affects: [native|desktop|web|backend|wxa|mya|tta|contracts]`
15
15
 
16
16
  2. **SDD: Spec Delta (EARS)**
17
- - 在 `openspec/changes/{id}/spec-delta.md` 输出
17
+ - 在 `aidlc/openspec/changes/{id}/spec-delta.md` 输出
18
18
  - 使用 EARS 格式:Ubiquitous / Event-Driven / State-Driven / Unwanted / Optional
19
19
  - FR 必须使用命名空间前缀(BE-FR-001, WEB-FR-001 等)
20
20
 
21
21
  3. **BDD: Feature Files**
22
22
  - 每个 FR ≥3 个 scenario(positive / negative / edge)
23
23
  - Per-component: `apps/{component}/features/{domain}/{feature}.feature`
24
- - Cross-stack: `features/cross-stack/{domain}/{feature}.feature`
24
+ - Cross-stack: `aidlc/features/cross-stack/{domain}/{feature}.feature`
25
25
  - Tag 使用 `@FR-PREFIX-NNN`
26
26
 
27
27
  4. **Contract First**(跨组件时)
28
- - 在 `contracts/{api,events}/` 创建合约文件
28
+ - 在 `aidlc/contracts/{api,events}/` 创建合约文件
29
29
  - 引用 INT-FR-NNN
30
30
 
31
31
  ## 输出产物
32
- - `requirements.md`
33
- - `openspec/changes/{id}/spec-delta.md`
32
+ - `aidlc/requirements.md`
33
+ - `aidlc/openspec/changes/{id}/spec-delta.md`
34
34
  - `apps/{component}/features/{domain}/{feature}.feature`
35
- - `features/cross-stack/{domain}/{feature}.feature`(跨组件时)
36
- - `contracts/{api,events}/{name}.yaml`(跨组件时)
35
+ - `aidlc/features/cross-stack/{domain}/{feature}.feature`(跨组件时)
36
+ - `aidlc/contracts/{api,events}/{name}.yaml`(跨组件时)
37
37
 
38
38
  ## 约束
39
39
  - 遵守 `rules.md` 中的 UND-001 到 UND-006
@@ -3,7 +3,7 @@
3
3
  ## UND-001: Intent Documentation
4
4
  **Severity:** MUST
5
5
  **Description:** Before any specification or implementation, the business intent MUST be documented. Intent includes: what is being built, why, and how success is measured.
6
- **Valid:** Intent captured in `requirements.md` with `affects: [...]` before spec delta.
6
+ **Valid:** Intent captured in `aidlc/requirements.md` with `affects: [...]` before spec delta.
7
7
  **Invalid:** Starting spec delta or feature files without documented intent or without an `affects` declaration.
8
8
 
9
9
  ## UND-002: EARS Format
@@ -26,12 +26,12 @@
26
26
 
27
27
  ## UND-005: Cross-Component Feature Decomposition
28
28
  **Severity:** MUST
29
- **Description:** A feature that affects ≥2 components MUST be split into: one FR per component, one or more `INT-*` FRs, and a `features/cross-stack/*.feature` file.
29
+ **Description:** A feature that affects ≥2 components MUST be split into: one FR per component, one or more `INT-*` FRs, and a `aidlc/features/cross-stack/*.feature` file.
30
30
  **Valid:** `affects: [web, backend]` → `WEB-FR-001`, `BE-FR-001`, `INT-FR-001`, plus cross-stack feature file.
31
31
  **Invalid:** A single feature file claiming to test both web and backend behavior.
32
32
 
33
33
  ## UND-006: Contract-First for Cross-Component
34
34
  **Severity:** MUST
35
- **Description:** When a feature introduces or changes a public API or event consumed by another component, a contract file MUST be added or updated in `contracts/` before any per-component implementation.
36
- **Valid:** `contracts/api/auth.yaml` defines `POST /auth/login` before any code.
37
- **Invalid:** Per-component code that depends on a contract not in `contracts/`.
35
+ **Description:** When a feature introduces or changes a public API or event consumed by another component, a contract file MUST be added or updated in `aidlc/contracts/` before any per-component implementation.
36
+ **Valid:** `aidlc/contracts/api/auth.yaml` defines `POST /auth/login` before any code.
37
+ **Invalid:** Per-component code that depends on a contract not in `aidlc/contracts/`.