coding-agent-harness 1.0.1 → 1.0.4

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 (262) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/CONTRIBUTING.md +98 -0
  3. package/README.en-US.md +14 -0
  4. package/README.md +230 -80
  5. package/README.zh-CN.md +290 -0
  6. package/SKILL.md +132 -198
  7. package/docs-release/README.md +80 -9
  8. package/docs-release/architecture/overview.md +298 -28
  9. package/docs-release/architecture/overview.zh-CN.md +292 -0
  10. package/docs-release/assets/dashboard-overview.png +0 -0
  11. package/docs-release/assets/harness-architecture.svg +163 -0
  12. package/docs-release/assets/harness-workflow.svg +64 -0
  13. package/docs-release/guides/agent-installation.en-US.md +237 -0
  14. package/docs-release/guides/agent-installation.md +149 -27
  15. package/docs-release/guides/contributing.md +100 -0
  16. package/docs-release/guides/contributing.zh-CN.md +99 -0
  17. package/docs-release/guides/document-audience-and-surfaces.en-US.md +113 -0
  18. package/docs-release/guides/document-audience-and-surfaces.md +113 -0
  19. package/docs-release/guides/full-legacy-migration-subagent-strategy.md +334 -0
  20. package/docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md +334 -0
  21. package/docs-release/guides/legacy-migration-agent-prompt.md +373 -0
  22. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +350 -0
  23. package/docs-release/guides/migration-playbook.en-US.md +324 -0
  24. package/docs-release/guides/migration-playbook.md +328 -0
  25. package/docs-release/guides/parent-control-repository-pattern.en-US.md +254 -0
  26. package/docs-release/guides/parent-control-repository-pattern.md +254 -0
  27. package/docs-release/guides/preset-development.md +214 -0
  28. package/docs-release/guides/repository-operating-models.en-US.md +197 -0
  29. package/docs-release/guides/repository-operating-models.md +197 -0
  30. package/docs-release/guides/task-state-machine.en-US.md +207 -0
  31. package/docs-release/guides/task-state-machine.md +214 -0
  32. package/docs-release/intl/README.md +15 -0
  33. package/docs-release/intl/de-DE.md +18 -0
  34. package/docs-release/intl/en-US.md +18 -0
  35. package/docs-release/intl/es-ES.md +18 -0
  36. package/docs-release/intl/fr-FR.md +18 -0
  37. package/docs-release/intl/ja-JP.md +18 -0
  38. package/docs-release/intl/ko-KR.md +18 -0
  39. package/docs-release/intl/zh-CN.md +18 -0
  40. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/brief.md +13 -0
  41. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/findings.md +7 -0
  42. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/lesson_candidates.md +24 -0
  43. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/progress.md +1 -1
  44. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/task_plan.md +4 -2
  45. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/{visual_roadmap.md → visual_map.md} +9 -1
  46. package/package.json +10 -3
  47. package/presets/legacy-migration/checks/preset-check.mjs +3 -0
  48. package/presets/legacy-migration/preset.yaml +134 -0
  49. package/presets/legacy-migration/scripts/plan-work-queue.mjs +4 -0
  50. package/presets/legacy-migration/scripts/scaffold-task-contracts.mjs +4 -0
  51. package/presets/legacy-migration/templates/execution_strategy.append.md +18 -0
  52. package/presets/legacy-migration/templates/findings.seed.md +17 -0
  53. package/presets/legacy-migration/templates/review.seed.md +12 -0
  54. package/presets/legacy-migration/templates/task_plan.append.md +9 -0
  55. package/presets/legacy-migration/templates/visual_map.append.md +12 -0
  56. package/presets/legacy-migration/workbench/dashboard-panels.yaml +2 -0
  57. package/presets/legacy-migration/workbench/migration-queue.schema.json +23 -0
  58. package/presets/lesson-sedimentation/preset.yaml +23 -0
  59. package/presets/lesson-sedimentation/templates/prompt.md +23 -0
  60. package/presets/module/preset.yaml +25 -0
  61. package/presets/module/templates/execution_strategy.append.md +8 -0
  62. package/presets/module/templates/task_plan.append.md +17 -0
  63. package/presets/standard-task/preset.yaml +31 -0
  64. package/presets/standard-task/templates/task_plan.append.md +7 -0
  65. package/references/adversarial-review-standard.md +2 -2
  66. package/references/agents-md-pattern.md +5 -5
  67. package/references/delivery-operating-model-standard.md +3 -3
  68. package/references/docs-directory-standard.md +53 -10
  69. package/references/external-source-intake-standard.md +75 -0
  70. package/references/harness-ledger.md +53 -94
  71. package/references/legacy-12-phase-bootstrap.md +41 -0
  72. package/references/lessons-governance.md +100 -88
  73. package/references/module-parallel-standard.md +14 -14
  74. package/references/planning-loop.md +51 -7
  75. package/references/project-onboarding-audit.md +10 -0
  76. package/references/pull-request-standard.md +118 -0
  77. package/references/repo-governance-standard.md +12 -1
  78. package/references/review-routing-standard.md +7 -1
  79. package/references/ssot-governance.md +67 -59
  80. package/references/taskr-gap-analysis.md +600 -0
  81. package/references/testing-standard.md +50 -0
  82. package/references/walkthrough-closeout.md +10 -9
  83. package/scripts/check-harness.mjs +111 -331
  84. package/scripts/commands/dashboard-command.mjs +67 -0
  85. package/scripts/commands/migration-command.mjs +96 -0
  86. package/scripts/commands/preset-command.mjs +73 -0
  87. package/scripts/commands/task-command.mjs +327 -0
  88. package/scripts/harness.mjs +106 -20
  89. package/scripts/lib/capability-registry.mjs +591 -0
  90. package/scripts/lib/check-module-parallel.mjs +237 -0
  91. package/scripts/lib/check-profiles.mjs +418 -0
  92. package/scripts/lib/check-task-contracts.mjs +47 -0
  93. package/scripts/lib/core-shared.mjs +196 -0
  94. package/scripts/lib/dashboard-data.mjs +412 -0
  95. package/scripts/lib/dashboard-workbench.mjs +257 -0
  96. package/scripts/lib/dashboard-writer.mjs +107 -4
  97. package/scripts/lib/git-status-summary.mjs +46 -0
  98. package/scripts/lib/governance-index-generator.mjs +174 -0
  99. package/scripts/lib/governance-sync.mjs +514 -0
  100. package/scripts/lib/governance-table-boundary.mjs +175 -0
  101. package/scripts/lib/harness-core.mjs +15 -1318
  102. package/scripts/lib/lesson-maintenance.mjs +152 -0
  103. package/scripts/lib/markdown-utils.mjs +158 -0
  104. package/scripts/lib/migration-planner.mjs +478 -0
  105. package/scripts/lib/migration-support.mjs +312 -0
  106. package/scripts/lib/preset-audit-contracts.mjs +37 -0
  107. package/scripts/lib/preset-engine.mjs +497 -0
  108. package/scripts/lib/preset-registry.mjs +627 -0
  109. package/scripts/lib/preset-resource-contracts.mjs +83 -0
  110. package/scripts/lib/review-confirm-git-gate.mjs +248 -0
  111. package/scripts/lib/status-dashboard-renderer.mjs +102 -0
  112. package/scripts/lib/subagent-authorization-audit.mjs +196 -0
  113. package/scripts/lib/task-completion-consistency.mjs +16 -0
  114. package/scripts/lib/task-index.mjs +93 -0
  115. package/scripts/lib/task-lesson-candidates.mjs +242 -0
  116. package/scripts/lib/task-lesson-sedimentation.mjs +326 -0
  117. package/scripts/lib/task-lifecycle/review-confirm.mjs +101 -0
  118. package/scripts/lib/task-lifecycle/review-gates.mjs +70 -0
  119. package/scripts/lib/task-lifecycle/text-utils.mjs +24 -0
  120. package/scripts/lib/task-lifecycle.mjs +649 -0
  121. package/scripts/lib/task-review-model.mjs +469 -0
  122. package/scripts/lib/task-scanner.mjs +576 -0
  123. package/scripts/lib/task-tombstone-commands.mjs +140 -0
  124. package/scripts/postinstall.mjs +14 -0
  125. package/skills/preset-creator/SKILL.md +179 -0
  126. package/skills/preset-creator/references/complex-task-skeleton/README.md +31 -0
  127. package/skills/preset-creator/references/complex-task-skeleton/artifacts/INDEX.md +12 -0
  128. package/skills/preset-creator/references/complex-task-skeleton/brief.md +32 -0
  129. package/skills/preset-creator/references/complex-task-skeleton/execution_strategy.md +71 -0
  130. package/skills/preset-creator/references/complex-task-skeleton/findings.md +24 -0
  131. package/skills/preset-creator/references/complex-task-skeleton/lesson_candidates.md +70 -0
  132. package/skills/preset-creator/references/complex-task-skeleton/long-running-task-contract.md +76 -0
  133. package/skills/preset-creator/references/complex-task-skeleton/progress.md +33 -0
  134. package/skills/preset-creator/references/complex-task-skeleton/references/INDEX.md +13 -0
  135. package/skills/preset-creator/references/complex-task-skeleton/review.md +107 -0
  136. package/skills/preset-creator/references/complex-task-skeleton/task_plan.md +111 -0
  137. package/{templates/planning/visual_roadmap.md → skills/preset-creator/references/complex-task-skeleton/visual_map.md} +24 -2
  138. package/skills/preset-creator/references/preset-package-skeleton.md +296 -0
  139. package/templates/AGENTS.md.template +51 -36
  140. package/templates/architecture/Architecture-SSoT.md +21 -0
  141. package/templates/architecture/README.md +49 -0
  142. package/templates/architecture/critical-flows.md +22 -0
  143. package/templates/architecture/local-repo-context.md +20 -0
  144. package/templates/architecture/service-catalog.md +17 -0
  145. package/templates/architecture/services/service-template.md +31 -0
  146. package/templates/architecture/system-map.md +22 -0
  147. package/templates/dashboard/assets/app-src/00-state.js +42 -0
  148. package/templates/dashboard/assets/app-src/10-router.js +77 -0
  149. package/templates/dashboard/assets/app-src/20-overview.js +241 -0
  150. package/templates/dashboard/assets/app-src/30-tasks.js +409 -0
  151. package/templates/dashboard/assets/app-src/35-task-detail.js +246 -0
  152. package/templates/dashboard/assets/app-src/40-modules.js +58 -0
  153. package/templates/dashboard/assets/app-src/45-review.js +347 -0
  154. package/templates/dashboard/assets/app-src/50-migration.js +183 -0
  155. package/templates/dashboard/assets/app-src/60-shared.js +61 -0
  156. package/templates/dashboard/assets/app-src/90-bindings.js +524 -0
  157. package/templates/dashboard/assets/app.css +3107 -300
  158. package/templates/dashboard/assets/app.css.manifest.json +9 -0
  159. package/templates/dashboard/assets/app.js +2068 -306
  160. package/templates/dashboard/assets/app.manifest.json +12 -0
  161. package/templates/dashboard/assets/css-src/00-foundation.css +342 -0
  162. package/templates/dashboard/assets/css-src/10-panels-flow.css +236 -0
  163. package/templates/dashboard/assets/css-src/20-briefs-controls.css +398 -0
  164. package/templates/dashboard/assets/css-src/30-task-index.css +739 -0
  165. package/templates/dashboard/assets/css-src/35-review-workspace.css +507 -0
  166. package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +427 -0
  167. package/templates/dashboard/assets/css-src/50-responsive-overrides.css +551 -0
  168. package/templates/dashboard/assets/i18n.js +531 -44
  169. package/templates/dashboard/assets/mermaid-renderer.js +58 -8
  170. package/templates/development/README.md +52 -0
  171. package/templates/development/codebase-map.md +11 -0
  172. package/templates/development/cross-repo-debugging.md +18 -0
  173. package/templates/development/external-context/service-template.md +33 -0
  174. package/templates/development/external-source-packs/README.md +24 -0
  175. package/templates/development/external-source-packs/digest-template.md +28 -0
  176. package/templates/development/local-setup.md +16 -0
  177. package/templates/development/stubs-and-mocks.md +11 -0
  178. package/templates/integrations/README.md +40 -0
  179. package/templates/integrations/api-contract.md +42 -0
  180. package/templates/integrations/event-contract.md +46 -0
  181. package/templates/integrations/third-party/vendor-template.md +42 -0
  182. package/templates/integrations/webhook-contract.md +41 -0
  183. package/templates/ledger/Harness-Ledger.md +13 -25
  184. package/templates/lessons/lesson-arch-process-change.md +1 -1
  185. package/templates/lessons/lesson-new-doc.md +1 -1
  186. package/templates/lessons/lesson-ref-change.md +1 -1
  187. package/templates/planning/brief.md +32 -0
  188. package/templates/planning/execution_strategy.md +31 -0
  189. package/templates/planning/lesson_candidates.md +70 -0
  190. package/templates/planning/long-running-task-contract.md +7 -0
  191. package/templates/planning/module_brief.md +25 -0
  192. package/templates/planning/module_session_prompt.md +6 -0
  193. package/templates/planning/optional/artifacts/INDEX.md +3 -3
  194. package/templates/planning/optional/references/INDEX.md +3 -3
  195. package/templates/planning/review.md +59 -0
  196. package/templates/planning/task_plan.md +40 -15
  197. package/templates/planning/visual_map.md +50 -0
  198. package/templates/reference/docs-library-standard.md +31 -0
  199. package/templates/reference/execution-workflow-standard.md +5 -2
  200. package/templates/reference/external-source-intake-standard.md +82 -0
  201. package/templates/reference/harness-ledger-standard.md +1 -0
  202. package/templates/reference/pull-request-standard.md +80 -0
  203. package/templates/reference/repo-governance-standard.md +8 -5
  204. package/templates/reference/review-routing-standard.md +6 -0
  205. package/templates/reference/walkthrough-standard.md +3 -1
  206. package/templates/verifier/verifier-output.md +1 -1
  207. package/templates/walkthrough/walkthrough-template.md +2 -2
  208. package/templates-zh-CN/AGENTS.md.template +73 -70
  209. package/templates-zh-CN/architecture/Architecture-SSoT.md +21 -0
  210. package/templates-zh-CN/architecture/README.md +51 -0
  211. package/templates-zh-CN/architecture/critical-flows.md +24 -0
  212. package/templates-zh-CN/architecture/local-repo-context.md +20 -0
  213. package/templates-zh-CN/architecture/service-catalog.md +17 -0
  214. package/templates-zh-CN/architecture/services/service-template.md +31 -0
  215. package/templates-zh-CN/architecture/system-map.md +22 -0
  216. package/templates-zh-CN/development/README.md +54 -0
  217. package/templates-zh-CN/development/codebase-map.md +11 -0
  218. package/templates-zh-CN/development/cross-repo-debugging.md +18 -0
  219. package/templates-zh-CN/development/external-context/service-template.md +33 -0
  220. package/templates-zh-CN/development/external-source-packs/README.md +24 -0
  221. package/templates-zh-CN/development/external-source-packs/digest-template.md +28 -0
  222. package/templates-zh-CN/development/local-setup.md +16 -0
  223. package/templates-zh-CN/development/stubs-and-mocks.md +11 -0
  224. package/templates-zh-CN/integrations/README.md +42 -0
  225. package/templates-zh-CN/integrations/api-contract.md +42 -0
  226. package/templates-zh-CN/integrations/event-contract.md +46 -0
  227. package/templates-zh-CN/integrations/third-party/vendor-template.md +42 -0
  228. package/templates-zh-CN/integrations/webhook-contract.md +41 -0
  229. package/templates-zh-CN/ledger/Harness-Ledger.md +17 -40
  230. package/templates-zh-CN/planning/brief.md +32 -0
  231. package/templates-zh-CN/planning/execution_strategy.md +30 -0
  232. package/templates-zh-CN/planning/lesson_candidates.md +70 -0
  233. package/templates-zh-CN/planning/long-running-task-contract.md +1 -1
  234. package/templates-zh-CN/planning/module_brief.md +25 -0
  235. package/templates-zh-CN/planning/module_plan.md +2 -2
  236. package/templates-zh-CN/planning/module_session_prompt.md +4 -3
  237. package/templates-zh-CN/planning/review.md +59 -1
  238. package/templates-zh-CN/planning/task_plan.md +37 -11
  239. package/templates-zh-CN/planning/{visual_roadmap.md → visual_map.md} +21 -2
  240. package/templates-zh-CN/reference/adversarial-review-standard.md +1 -1
  241. package/templates-zh-CN/reference/docs-library-standard.md +36 -1
  242. package/templates-zh-CN/reference/execution-workflow-standard.md +10 -2
  243. package/templates-zh-CN/reference/external-source-intake-standard.md +82 -0
  244. package/templates-zh-CN/reference/harness-ledger-standard.md +7 -4
  245. package/templates-zh-CN/reference/pull-request-standard.md +106 -0
  246. package/templates-zh-CN/reference/repo-governance-standard.md +4 -1
  247. package/templates-zh-CN/reference/review-routing-standard.md +8 -1
  248. package/templates-zh-CN/reference/walkthrough-standard.md +6 -5
  249. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +2 -2
  250. package/templates-zh-CN/walkthrough/walkthrough-template.md +2 -2
  251. package/scripts/smoke-dashboard.mjs +0 -70
  252. package/scripts/test-harness.mjs +0 -483
  253. package/templates/ssot/Feature-SSoT.md +0 -43
  254. package/templates/ssot/Lessons-SSoT.md +0 -44
  255. package/templates-zh-CN/dashboard/assets/app.css +0 -399
  256. package/templates-zh-CN/dashboard/assets/app.js +0 -435
  257. package/templates-zh-CN/dashboard/assets/i18n.js +0 -47
  258. package/templates-zh-CN/dashboard/assets/markdown-reader.js +0 -116
  259. package/templates-zh-CN/dashboard/assets/mermaid-renderer.js +0 -59
  260. package/templates-zh-CN/dashboard/index.html +0 -18
  261. package/templates-zh-CN/ssot/Feature-SSoT.md +0 -49
  262. package/templates-zh-CN/ssot/Lessons-SSoT.md +0 -49
@@ -0,0 +1,80 @@
1
+ # Pull Request Standard
2
+
3
+ ## Purpose
4
+
5
+ Every non-trivial PR must be reviewable without reading the full agent
6
+ conversation. The PR body is a handoff packet for maintainers: what changed,
7
+ why it changed, how it was verified, which version is affected, and what risks
8
+ remain.
9
+
10
+ ## Required Shape
11
+
12
+ The PR body must include:
13
+
14
+ 1. Summary
15
+ 2. What Changed
16
+ 3. Version Impact
17
+ 4. Verification
18
+ 5. Review Evidence
19
+ 6. Residual Risk
20
+ 7. References
21
+
22
+ Use a bilingual PR body when the repository has Chinese and English users or
23
+ the task discussion is Chinese. English comes first for public GitHub readers,
24
+ then the localized section follows after the English section.
25
+
26
+ ## Content Rules
27
+
28
+ - State the target version explicitly. If `package.json` changes from `1.0.3`
29
+ to `1.0.4`, say so in Version Impact.
30
+ - List changed surfaces by user-visible area or module, not by dumping every
31
+ file path.
32
+ - Verification must name the real commands, browser checks, CI runs, or
33
+ evidence artifacts. If a check was not run, say why.
34
+ - Review Evidence must mention self-review, subagent review, human review, or
35
+ code-quality review status. Release-blocking findings must be closed or
36
+ routed before merge.
37
+ - Residual Risk must distinguish accepted risk, deferred follow-up, and
38
+ unrelated local/private debt.
39
+ - References must link relevant task docs, SSoT rows, review files, commits,
40
+ issues, or PRs.
41
+
42
+ ## Template
43
+
44
+ ```markdown
45
+ ## Summary
46
+
47
+ [One or two sentences explaining the intent and outcome.]
48
+
49
+ ## What Changed
50
+
51
+ - [User-facing or module-level change.]
52
+ - [Governance, CLI, dashboard, docs, or template change.]
53
+
54
+ ## Version Impact
55
+
56
+ - Package version: `[old]` -> `[new]`
57
+ - Release notes: [CHANGELOG entry or reason no release note is needed]
58
+
59
+ ## Verification
60
+
61
+ - `[command]`: pass
62
+ - `[browser/runtime/CI evidence]`: pass
63
+ - Not run: [reason]
64
+
65
+ ## Review Evidence
66
+
67
+ - Self-review: [summary]
68
+ - Additional review: [reviewer/subagent/human result]
69
+ - Blocking findings: [none / closed / routed]
70
+
71
+ ## Residual Risk
72
+
73
+ - [none / accepted / deferred / unrelated debt]
74
+
75
+ ## References
76
+
77
+ - Task: [path or issue]
78
+ - Review: [path or PR review]
79
+ - Evidence: [path, commit, screenshot, workflow, or dashboard]
80
+ ```
@@ -10,9 +10,11 @@ Define repository-level rules for branches, commits, pull requests, ownership, g
10
10
  2. Use task-scoped branches and worktrees for non-trivial changes, especially when multiple workers are active.
11
11
  3. Keep commits focused on the requested scope and avoid mixing unrelated cleanup with feature work.
12
12
  4. Generated files, caches, build output, local runtime state, and secrets must be ignored or stored in the approved location.
13
- 5. Pull requests must describe intent, changed surfaces, checks run, checks not run, review status, and residual risk.
14
- 6. Required checks and material review findings block merge unless an approved exception is recorded.
15
- 7. Merge or release ownership must be explicit when several branches or workers contribute to the same outcome.
13
+ 5. Commit verified, meaningful slices proactively. Deferred commits require an explicit no-commit reason, owner, and next step.
14
+ 6. Do not mix unrelated dirty changes into a task commit. CLI-owned Harness writes should use the local Harness commands so their locked, allowlisted auto-commit can protect shared governance files.
15
+ 7. Pull requests must follow `docs/11-REFERENCE/pull-request-standard.md` and describe intent, changed surfaces, version impact, checks run, checks not run, review status, references, and residual risk.
16
+ 8. Required checks and material review findings block merge unless an approved exception is recorded.
17
+ 9. Merge or release ownership must be explicit when several branches or workers contribute to the same outcome.
16
18
 
17
19
  ## Required Checklist
18
20
 
@@ -20,10 +22,11 @@ Define repository-level rules for branches, commits, pull requests, ownership, g
20
22
  - Allowed and forbidden paths are respected.
21
23
  - Dirty worktree state was checked before edits.
22
24
  - Generated and private files are not accidentally staged.
23
- - PR summary includes evidence and residuals.
25
+ - Verified slices have commit SHAs, or deferred commit rationale records the no-commit reason, owner, and next step.
26
+ - PR summary follows `pull-request-standard.md` and includes evidence, version impact, references, and residuals.
24
27
  - Review findings are resolved or explicitly accepted.
25
28
  - Merge strategy and rollback or revert path are understood.
26
29
 
27
30
  ## Closeout Expectations
28
31
 
29
- Repository closeout must list changed paths, confirm scope boundaries were honored, report git status relevant to the task, summarize checks, and identify unrelated dirty files left untouched.
32
+ Repository closeout must list changed paths, confirm scope boundaries were honored, report git status relevant to the task, cite relevant commit SHAs or deferred-commit rationale, summarize checks, and identify unrelated dirty files left untouched.
@@ -13,6 +13,12 @@ Define when work needs review, which reviewer identity is appropriate, and how r
13
13
  5. Reviewers must list `Evidence Checked`; unverified claims are questions, not conclusions.
14
14
  6. The implementation owner is responsible for reconciling conflicting reviewer feedback.
15
15
  7. Closeout must include the final review disposition and `Final Confidence Basis`.
16
+ 8. At task start, read the current task `execution_strategy.md` Subagent Authorization and Subagent Delegation Decision sections, then report the state and delegation choice; users do not need to know or ask for subagents.
17
+ 9. Reviewer subagents are allowed by default for read-only review within the current task.
18
+ 10. If a worker subagent would materially help and is not authorized, proactively ask the user once in plain language for task/scope/worktree authorization; it is fine to say "worker subagent", but do not wait for the user to know or suggest subagents.
19
+ 11. If independent slices are obvious but exact file paths are not, identify the file paths first and then immediately ask for independent-execution-helper authorization before implementation.
20
+ 12. Worker subagents require one user authorization recorded in `execution_strategy.md`; reuse is limited to the same task, scope, and worktree/branch.
21
+ 13. A `Would a worker subagent materially help?` decision of `ask-user` is a blocking gate until `User Authorization Decision` records `authorized`, `denied`, or `not-needed`.
16
22
 
17
23
  ## Required Checklist
18
24
 
@@ -10,7 +10,7 @@ Define the closeout walkthrough that converts implementation work into durable p
10
10
  2. A walkthrough must explain what changed, why it changed, how it was verified, what review found, and what residual risk remains.
11
11
  3. Do not paste large raw logs. Link to evidence files, commands, PRs, screenshots, or CI runs.
12
12
  4. Material findings and their resolution must be visible.
13
- 5. Lessons that change future behavior must be routed to the appropriate SSoT, reference standard, or Harness Ledger.
13
+ 5. Lessons that change future behavior must first be routed through `lesson_candidates.md`; candidates marked `needs-promotion` must link a task-local `lessons/LC-*.md` detail artifact before a follow-up task or promotion tries to preserve them.
14
14
  6. Walkthroughs must be written from the final integrated state, not from a single worker's partial view.
15
15
  7. If work is incomplete, the walkthrough must identify the next safe action and stop reason.
16
16
 
@@ -21,6 +21,8 @@ Define the closeout walkthrough that converts implementation work into durable p
21
21
  - Review summary with material findings and disposition.
22
22
  - Residual risk section.
23
23
  - Lesson or follow-up section.
24
+ - Lesson candidate decision: `checked-candidate:<LC-ID>`, `queued-promotion:<LC-ID>`, `checked-created:<L-ID>`, or legacy `checked-none:<reason>`.
25
+ - Source lesson detail link for any queued or promoted candidate.
24
26
  - Links to updated SSoT, Regression SSoT, or Harness Ledger entries when applicable.
25
27
 
26
28
  ## Closeout Expectations
@@ -16,7 +16,7 @@
16
16
  | Tests and regression | yes / no | commands, CI runs, logs, screenshots |
17
17
  | SSoT and ledger updates | yes / no | Feature, Delivery, Regression, Closeout, or Harness Ledger links |
18
18
  | Review disposition | yes / no | review path, finding IDs, or no-finding statement |
19
- | Lessons and references | yes / no | Lessons SSoT, detail doc, or checked-none reason |
19
+ | Lessons and references | yes / no | lesson_candidates.md, detail doc, or checked-none reason |
20
20
 
21
21
  ## Explicit Exclusions
22
22
 
@@ -49,8 +49,8 @@ One sentence describing what changed and why it matters.
49
49
  | --- | --- |
50
50
  | Did this reveal a reusable reference, workflow, or checker gap? | yes / no, reason |
51
51
  | Could a future agent repeat the same mistake? | yes / no, reason |
52
- | Was a lesson created or updated? | L-YYYY-MM-DD-001 or checked-none: reason |
53
- | Lessons detail doc | path or none |
52
+ | Was a lesson candidate reviewed? | checked-candidate:LC-... / queued-promotion:LC-... / checked-created:L-YYYY-MM-DD-001 / legacy checked-none: reason |
53
+ | Lessons detail doc | lesson_candidates.md, governance detail doc, or none |
54
54
 
55
55
  ## Closeout Links
56
56
 
@@ -1,92 +1,95 @@
1
1
  # [项目名称]
2
2
 
3
- > Agent 进入本仓库时先读这个文件。它负责说明项目边界、工作顺序和文档入口,不承载所有细节。
3
+ 这个文件是 Agent 进入本仓库时的工作入口。它只负责说明硬规则和阅读路由;
4
+ 详细规范放在 `docs/11-REFERENCE/`,不要把操作手册全部塞进这里。
4
5
 
5
6
  ## 项目概况
6
7
 
7
8
  - **项目名**:[项目名称]
8
9
  - **技术栈**:[语言 / 框架 / 运行时]
9
10
  - **仓库形态**:[单仓 / monorepo / 多仓协作]
10
- - **主要模块**:[列出主要子项目、包或服务]
11
- - **默认分支**:[例如 `main`]
11
+ - **主要模块**:[模块列表]
12
+ - **默认分支**:[main / master / 其他]
12
13
 
13
14
  ## 不可违反的规则
14
15
 
15
- 1. [架构约束,例如:外部依赖必须通过 adapter 层隔离]
16
- 2. [安全约束,例如:不得提交密钥、令牌、用户隐私数据]
17
- 3. [流程约束,例如:非平凡任务必须先建立任务目录和计划文件]
18
- 4. [发布约束,例如:未通过指定回归门禁不得合并或发布]
16
+ 1. 遵守 `docs/11-REFERENCE/engineering-standard.md` 中的架构边界。
17
+ 2. 不提交密钥、令牌、私有接口、用户隐私数据或生产凭据。
18
+ 3. 非平凡任务先在 `docs/09-PLANNING/TASKS/` 下建立任务目录。
19
+ 4. 声称完成前必须记录证据。
20
+ 5. 保护无关工作区改动,不回滚任务范围外文件。
21
+ 6. 已验证的、有意义的工作切片要主动提交。除非用户明确暂停提交、检查失败、dirty 归属不清,或安全边界导致无法形成干净提交,否则不要把已完成工作只留在未提交文件里;不能提交时,必须在 progress、handoff 或 closeout 中写明 no-commit reason、owner 和下一步。不要把无关 dirty 改动混入本任务提交。
19
22
 
20
23
  ## 任务阅读矩阵
21
24
 
22
- 按任务类型读取最少但足够的上下文。不要一次性加载整套文档。
25
+ 按任务类型读取最少但足够的上下文,不要一次性加载整套文档。
23
26
 
24
27
  | 任务类型 | 先读文件 |
25
28
  | --- | --- |
26
29
  | 架构、核心模块、跨模块改动 | `docs/11-REFERENCE/engineering-standard.md` |
27
- | 测试、冒烟、回归 | `docs/11-REFERENCE/testing-standard.md` |
28
- | 开发执行、提交、PR | `docs/11-REFERENCE/execution-workflow-standard.md` |
29
- | 多人协作、多仓交付、前后端分工 | `docs/11-REFERENCE/delivery-operating-model-standard.md`,再读 `docs/09-PLANNING/Delivery-SSoT.md` |
30
- | 仓库治理、PR 规则、分支保护 | `docs/11-REFERENCE/repo-governance-standard.md` |
31
- | CI/CD、必跑检查、发布门禁 | `docs/11-REFERENCE/ci-cd-standard.md` |
32
- | 长程任务、连续执行、子代理审查 | `docs/11-REFERENCE/long-running-task-standard.md` |
33
- | 对抗性审查、reviewer 报告 | `docs/11-REFERENCE/adversarial-review-standard.md` |
34
- | reviewer、subagent、外部审查路由 | `docs/11-REFERENCE/review-routing-standard.md` |
35
- | 文档治理、planning、任务目录 | `docs/11-REFERENCE/docs-library-standard.md` |
36
- | Harness Ledger 回写 | `docs/11-REFERENCE/harness-ledger-standard.md` |
30
+ | 系统地图、服务职责、外部系统关系 | `docs/03-ARCHITECTURE/README.md`、`docs/03-ARCHITECTURE/service-catalog.md` |
31
+ | 本地开发、mock、stub、跨仓调试 | `docs/04-DEVELOPMENT/README.md`、`docs/04-DEVELOPMENT/codebase-map.md` |
32
+ | API、event、webhook、SDK、第三方契约 | `docs/06-INTEGRATIONS/README.md` 和相关契约文件 |
33
+ | 测试、冒烟、回归 | `docs/11-REFERENCE/testing-standard.md`、`docs/05-TEST-QA/Regression-SSoT.md` |
34
+ | 开发执行、提交、PR、发布 | `docs/11-REFERENCE/execution-workflow-standard.md`、`docs/11-REFERENCE/repo-governance-standard.md`、`docs/11-REFERENCE/pull-request-standard.md`、`docs/11-REFERENCE/ci-cd-standard.md` |
35
+ | 创建或推进任务 | `docs/09-PLANNING/TASKS/` 下的当前任务目录;如果本项目已配置 Harness CLI,优先用 CLI |
36
+ | Brief、Execution Strategy、Visual Map | 当前任务的 `brief.md`、`execution_strategy.md`、`visual_map.md` |
37
+ | 长程任务 | `docs/11-REFERENCE/long-running-task-standard.md` |
38
+ | reviewer、subagent、对抗性审查 | `docs/11-REFERENCE/review-routing-standard.md`、`docs/11-REFERENCE/adversarial-review-standard.md` |
39
+ | 多人协作、多仓交付、阶段性交付 | `docs/11-REFERENCE/delivery-operating-model-standard.md`、`docs/09-PLANNING/Delivery-SSoT.md` |
40
+ | 模块并行 | `docs/09-PLANNING/Module-Registry.md` 和相关 module plan |
41
+ | 文档治理或 Harness 更新 | `docs/11-REFERENCE/docs-library-standard.md`、`.harness-capabilities.json` |
42
+ | 外部资料摄取 | `docs/11-REFERENCE/external-source-intake-standard.md` |
37
43
  | Regression SSoT 维护 | `docs/11-REFERENCE/regression-ssot-governance.md` |
38
- | 收口记录、Closeout、Lessons | `docs/11-REFERENCE/walkthrough-standard.md`,再读 `docs/01-GOVERNANCE/Lessons-SSoT.md` `docs/10-WALKTHROUGH/Closeout-SSoT.md` |
39
- | Worktree、并行开发、worker 隔离 | `docs/11-REFERENCE/worktree-standard.md` |
40
- | [前端任务] | `docs/11-REFERENCE/frontend-standard.md` |
41
- | [API 任务] | `docs/11-REFERENCE/api-standard.md` |
44
+ | 收口、walkthrough、Lessons | `docs/11-REFERENCE/walkthrough-standard.md`、`docs/10-WALKTHROUGH/Closeout-SSoT.md`、当前任务 `lesson_candidates.md`、`docs/01-GOVERNANCE/lessons/` |
45
+ | Worktree、并行开发隔离 | `docs/11-REFERENCE/worktree-standard.md` |
42
46
 
43
47
  ## 标准执行流程
44
48
 
45
- 1. 判断任务是否非平凡;非平凡任务先在 `docs/09-PLANNING/TASKS/` 建任务目录。
46
- 2. 填写 `task_plan.md`,并补齐同级 `execution_strategy.md` 与 `visual_roadmap.md`。
47
- 3. 确认本任务的 delivery operating model;涉及多人、多仓或共享交付时更新 Delivery SSoT
48
- 4. 如果任务可能长时间连续执行,先填写 `long-running-task-contract.md`。
49
- 5. 如需 reviewer、subagent、release review,在任务目录维护 `review.md`。
50
- 6. 涉及合并、PR、CI 或发布时,先读仓库治理和 CI/CD 标准。
51
- 7. 根据任务类型回写功能 SSoT、Delivery SSoT 或 Regression SSoT。
52
- 8. 按 worktree 标准创建独立 worktree、feature branch、contract branch 或 release branch。
53
- 9. 实现后运行约定检查和回归门禁,并把证据写入 `progress.md` 或 artifacts index。
54
- 10. 收口前按 `review-routing-standard.md` 触发所需审查,处理所有阻塞发现。
55
- 11. walkthrough,并引用任务计划、证据、审查结论和残余风险。
56
- 12. 执行 Lessons 检查:有可复用经验则写入 `docs/01-GOVERNANCE/lessons/` 并更新 Lessons SSoT;无经验也要记录 `checked-none: <原因>`。
57
- 13. 更新 `docs/10-WALKTHROUGH/Closeout-SSoT.md` 与 `docs/Harness-Ledger.md`。
58
- 14. 清理已完成并合并的 worktree。
59
-
60
- ## 子代理 / Worker 规则
61
-
62
- agent 作为 coordinator 调用 subagent、外部 agent 或 reviewer 时,必须先判断对方角色。
63
-
64
- - `reviewer`:默认只读,只能写审查报告、findings `review.md`,不得直接改业务代码。
65
- - `worker`:凡是会改代码、测试、产品文档或 harness 文档的 subagent,都必须在独立 worktree 和分支内工作。
66
-
67
- Worker 的最低交付合同:
68
-
69
- 1. coordinator 先分配 worktree 路径、分支名、任务目录和允许写入范围。
70
- 2. worker 只在自己的 worktree 内编辑,不写 coordinator 当前 checkout。
71
- 3. worker 完成后运行约定检查,并提交自己的改动。
72
- 4. worker handoff 必须包含 worktree path、branch、commit SHA、checks、residual risks。
73
- 5. coordinator 只集成 worker 的 commit,不把多个 worker 的未提交改动混在同一个 checkout。
74
- 6. coordinator 合并后运行最终回归,并更新 walkthrough、Harness Ledger 和 Lessons。
75
-
76
- 如果环境或用户明确要求不使用独立 worktree,必须在 `progress.md`、walkthrough 或 Harness Ledger 记录偏离原因、风险和补偿验证。
77
-
78
- ## SSoT 与总账
79
-
80
- - **功能 SSoT**:`docs/09-PLANNING/[功能-SSoT].md`
81
- - **Delivery SSoT**:`docs/09-PLANNING/Delivery-SSoT.md`
82
- - **Regression SSoT**:`docs/05-TEST-QA/Regression-SSoT.md`
83
- - **Lessons SSoT**:`docs/01-GOVERNANCE/Lessons-SSoT.md`
84
- - **Cadence Ledger**:`docs/05-TEST-QA/Cadence-Ledger.md`
85
- - **Harness Ledger**:`docs/Harness-Ledger.md`
86
- - **Closeout SSoT**:`docs/10-WALKTHROUGH/Closeout-SSoT.md`
87
- - **仓库治理标准**:`docs/11-REFERENCE/repo-governance-standard.md`
88
- - **CI/CD 标准**:`docs/11-REFERENCE/ci-cd-standard.md`
89
-
90
- ## 协作补充
91
-
92
- [按项目实际填写:模块 owner、共享文件锁、merge 顺序、发布审批人、环境限制等。]
49
+ 1. 先确认请求、范围和受影响文件。
50
+ 2. 非平凡任务先创建或更新任务计划,再改代码。
51
+ 3. 根据用户目标主动判断是否需要分工;用户不需要知道或主动要求 subagent
52
+ 4. 只读取任务阅读矩阵要求的 reference 文档。
53
+ 5. 保留已有项目事实;新增上下文使用 merge / append,不覆盖历史。
54
+ 6. 需要隔离或并行时,使用独立 worktree 或分支。
55
+ 7. 只在确认范围内实现。
56
+ 8. 运行相关检查,并把证据写入任务记录。
57
+ 9. 按需触发 review,关闭阻塞发现。
58
+ 10. 写入或更新 walkthrough 与 closeout 记录。
59
+ 11. 只更新本任务实际触达的 SSoT / ledger;任务生命周期总账优先由 Harness CLI 生成,不手写任务行。
60
+
61
+ ## 协作规则
62
+
63
+ - 任务开始时,先读取当前任务 `execution_strategy.md` 的 Subagent Authorization 和 Subagent Delegation Decision,并说明是否应该使用 reviewer 或 worker subagent;即使用户只说目标,也要主动判断。
64
+ - reviewer subagent 默认允许,只能做当前任务的只读审查。
65
+ - 如果 worker subagent 对任务有明显帮助但尚未授权,用白话主动向用户申请一次 task/scope/worktree 授权;可以直接说 worker subagent,但不要等用户知道或主动提醒你用 subagent。
66
+ - 如果独立切片已经明显但精确文件路径还不清楚,先确认文件路径,然后在 implementation 前立刻申请独立执行助手授权。
67
+ - worker subagent 需要用户授权一次,并记录到 `execution_strategy.md`;之后只可在同一任务、同一范围、同一 worktree/branch 内复用。
68
+ - 共享 ledger、registry 和 SSoT 默认由 coordinator 维护,除非明确登记锁。
69
+ - worker 交接必须包含分支或 worktree、改动文件、检查、证据和残余风险。
70
+
71
+ ## 单一事实源
72
+
73
+ - Harness Ledger:`docs/Harness-Ledger.md`(任务生命周期总账,由 CLI 生成)
74
+ - Delivery SSoT:`docs/09-PLANNING/Delivery-SSoT.md`
75
+ - Module Registry:`docs/09-PLANNING/Module-Registry.md`
76
+ - Regression SSoT:`docs/05-TEST-QA/Regression-SSoT.md`
77
+ - Cadence Ledger:`docs/05-TEST-QA/Cadence-Ledger.md`
78
+ - Lesson Candidates:当前任务 `lesson_candidates.md`
79
+ - Lesson Detail Docs:`docs/01-GOVERNANCE/lessons/`
80
+ - Closeout SSoT:`docs/10-WALKTHROUGH/Closeout-SSoT.md`
81
+
82
+ ## 本地命令
83
+
84
+ | 用途 | 命令 |
85
+ | --- | --- |
86
+ | 安装 | `[install command]` |
87
+ | 测试 | `[test command]` |
88
+ | Lint | `[lint command]` |
89
+ | 构建 | `[build command]` |
90
+ | 冒烟 | `[smoke command]` |
91
+
92
+ ## 完成标准
93
+
94
+ 只有当请求的改动已经实现、证据已经记录、必要审查已经处理、相关 SSoT 或
95
+ ledger 已经更新时,任务才算完成。
@@ -0,0 +1,21 @@
1
+ # 架构事实源 / Architecture SSoT
2
+
3
+ Context Doc Type: architecture-ssot
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## System Summary
9
+
10
+ [用中文描述当前仓库,以及它参与的更大系统。保留关键服务名、仓库名和接口名原文。]
11
+
12
+ ## Current Architecture Facts
13
+
14
+ | ID | Fact | Source Evidence | Last Verified | Confidence | Read Before |
15
+ | --- | --- | --- | --- | --- | --- |
16
+ | ARCH-001 | [事实,尽量一行说清] | [代码/文档/负责人说明/命令输出] | unknown | low | [path] |
17
+
18
+ ## Promotion Log
19
+
20
+ | Source Task | Promoted Fact | Destination | Decision | Date |
21
+ | --- | --- | --- | --- | --- |
@@ -0,0 +1,51 @@
1
+ # 架构 / Architecture
2
+
3
+ Context Doc Type: architecture-index
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Purpose
9
+
10
+ 这个文件夹是系统结构事实源。它说明当前仓库负责什么、属于哪个更大的系统、以及 Agent 改代码前必须理解哪些服务、流程和架构决策。
11
+
12
+ Keep the English field names and file names because CLI checks rely on them.
13
+
14
+ ## Read Order
15
+
16
+ 1. `Architecture-SSoT.md`
17
+ 2. `local-repo-context.md`
18
+ 3. `system-map.md`
19
+ 4. `service-catalog.md`
20
+ 5. `critical-flows.md`
21
+ 6. `services/<service-key>.md`
22
+ 7. `decisions/ADR-*.md`
23
+
24
+ ## Boundary
25
+
26
+ - 系统结构、服务责任、归属关系、关键流程放这里。
27
+ - Payload、endpoint 参数、event schema、SDK 细节放 `docs/06-INTEGRATIONS/`。
28
+ - 本地启动、mock、stub、跨仓调试经验放 `docs/04-DEVELOPMENT/`。
29
+
30
+ ## Structure Contract
31
+
32
+ | 文件 / 路径 | 必须维护的事实 | 写入规则 |
33
+ | --- | --- | --- |
34
+ | `Architecture-SSoT.md` | 当前架构状态、关键决策、已知风险 | 只写跨任务仍成立的系统事实 |
35
+ | `local-repo-context.md` | 当前仓库在整体系统中的职责和边界 | 说明本仓负责什么、不负责什么 |
36
+ | `system-map.md` | 服务/模块拓扑、上下游关系、部署边界 | 用图或表表达全局关系,不写 payload |
37
+ | `service-catalog.md` | 服务总表;每个服务/微服务一行 | 新增服务先加这里,再决定是否建 profile |
38
+ | `services/<service-key>.md` | 单个服务的职责、数据、接口摘要、阅读入口 | 一个服务一个文件,不要多个服务混写 |
39
+ | `critical-flows.md` | 跨服务关键流程 | 写业务/系统流,不写接口字段明细 |
40
+
41
+ ## Microservice Rule
42
+
43
+ 如果系统有多个微服务,`service-catalog.md` 是总索引。每个已知服务至少有一行;只要该服务会影响本仓开发、调试、接口或任务判断,就为它创建 `services/<service-key>.md`。
44
+
45
+ 每个 `services/<service-key>.md` 只回答三个问题:
46
+
47
+ 1. 这个服务负责什么、拥有什么数据。
48
+ 2. 它和本仓有什么关系。
49
+ 3. Agent 修改本仓前还需要读哪些 `04-DEVELOPMENT` 和 `06-INTEGRATIONS` 文档。
50
+
51
+ 不要在 `03-ARCHITECTURE` 里堆接口字段、mock 指令或临时调试记录。那些内容分别放到 `06-INTEGRATIONS` 和 `04-DEVELOPMENT`。
@@ -0,0 +1,24 @@
1
+ # 关键流程 / Critical Flows
2
+
3
+ Context Doc Type: critical-flows
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Flow Index
9
+
10
+ | Flow ID | Name | Trigger | Services | Business Impact | Source Evidence | Last Verified | Confidence |
11
+ | --- | --- | --- | --- | --- | --- | --- | --- |
12
+
13
+ ## Flow Template
14
+
15
+ 下面只是示例。按真实业务选择 sequenceDiagram、flowchart 或 stateDiagram,不需要为每个任务强行画图。
16
+
17
+ ```mermaid
18
+ sequenceDiagram
19
+ participant User
20
+ participant CurrentRepo
21
+ participant ExternalService
22
+ User->>CurrentRepo: request
23
+ CurrentRepo->>ExternalService: call
24
+ ```
@@ -0,0 +1,20 @@
1
+ # 本仓上下文 / Local Repo Context
2
+
3
+ Context Doc Type: local-repo-context
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Responsibility
9
+
10
+ [说明这个仓库的职责边界。不要把外部系统的实现细节写成当前仓库事实。]
11
+
12
+ ## Main Components
13
+
14
+ | Component | Path | Responsibility | Source Evidence | Last Verified | Confidence |
15
+ | --- | --- | --- | --- | --- | --- |
16
+
17
+ ## External Dependencies
18
+
19
+ | Dependency | Why It Matters | Architecture Link | Integration Link | Development Link |
20
+ | --- | --- | --- | --- | --- |
@@ -0,0 +1,17 @@
1
+ # 服务目录 / Service Catalog
2
+
3
+ Context Doc Type: service-catalog
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Services
9
+
10
+ | Service Key | Service / Component | Owner | Repo / Path | Responsibility | Interfaces | Data Owned | Dependencies | Service Profile | Development Context | Source Pack | Contract Index | Source Evidence | Last Verified | Stale After | Confidence |
11
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
12
+
13
+ ## Boundary Rule
14
+
15
+ 这个目录只放服务责任、接口摘要和跳转链接。Payload、auth、error code、event schema 放 `docs/06-INTEGRATIONS/`。
16
+
17
+ 一个服务或微服务只占一行。只要该服务影响本仓开发或判断,就补 `services/<service-key>.md`、`docs/04-DEVELOPMENT/external-context/<service-key>.md` 和相关 `docs/06-INTEGRATIONS/<contract>.md` 链接。
@@ -0,0 +1,31 @@
1
+ # 服务:<service-key> / Service: <service-key>
2
+
3
+ Context Doc Type: service-profile
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Index Links
9
+
10
+ | Catalog Row | Development Context | Source Pack | Integration Contracts | Last Verified | Confidence |
11
+ | --- | --- | --- | --- | --- | --- |
12
+ | `docs/03-ARCHITECTURE/service-catalog.md` | `docs/04-DEVELOPMENT/external-context/<service-key>.md` | `docs/04-DEVELOPMENT/external-source-packs/<source-key>/README.md` 或 N/A | `docs/06-INTEGRATIONS/<contract>.md` | unknown | low |
13
+
14
+ ## Responsibility
15
+
16
+ [说明该服务拥有的职责、数据和边界。外部服务只写可验证事实。]
17
+
18
+ ## Interfaces Summary
19
+
20
+ | Interface | Direction | Contract Link | Source Evidence | Last Verified | Confidence |
21
+ | --- | --- | --- | --- | --- | --- |
22
+
23
+ ## Agent Read Before
24
+
25
+ - [架构链接 / architecture link]
26
+ - [开发上下文链接 / development context link]
27
+ - [接口契约链接 / integration contract link]
28
+
29
+ ## Placement Rule
30
+
31
+ 本文件只描述一个服务。不要把多个服务的职责、接口细节、mock 指令或临时调试记录合并到这里。
@@ -0,0 +1,22 @@
1
+ # 系统图谱 / System Map
2
+
3
+ Context Doc Type: system-map
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Scope
9
+
10
+ [描述当前仓库所在的系统边界。图谱只表达结构关系,不承载 payload 或本地 mock 细节。]
11
+
12
+ ## Mermaid Map
13
+
14
+ ```mermaid
15
+ flowchart LR
16
+ current["Current Repository"] --> external["External Service"]
17
+ ```
18
+
19
+ ## Map Evidence
20
+
21
+ | Node | Meaning | Source Evidence | Last Verified | Confidence |
22
+ | --- | --- | --- | --- | --- |
@@ -0,0 +1,54 @@
1
+ # 开发上下文 / Development Context
2
+
3
+ Context Doc Type: development-index
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Purpose
9
+
10
+ 这个文件夹是 Agent 的开发输入包。它说明如何在本仓工作、外部服务不可见时如何开发、哪些内容只能 mock 或 stub、以及哪些假设不能直接成立。
11
+
12
+ Keep the English field names and section headings because CLI checks rely on them.
13
+
14
+ ## Boundary
15
+
16
+ - 本地启动、代码地图、外部服务开发摘要、mock、stub、跨仓调试放这里。
17
+ - 长期系统结构放 `docs/03-ARCHITECTURE/`。
18
+ - API、event、webhook 等具体契约放 `docs/06-INTEGRATIONS/`。
19
+
20
+ ## Structure Contract
21
+
22
+ | 文件 / 路径 | 必须维护的事实 | 写入规则 |
23
+ | --- | --- | --- |
24
+ | `local-setup.md` | 本仓启动、依赖、环境变量、常见失败 | 只写开发启动事实,不写生产架构 |
25
+ | `codebase-map.md` | 本仓代码入口、目录职责、阅读顺序 | Agent 改代码前先看这里 |
26
+ | `external-context/<service-key>.md` | 外部服务对本仓开发的影响、mock/stub、调试入口 | 一个外部服务一个文件 |
27
+ | `external-source-packs/` | 外部团队提供的大量资料、索引、摘要、投影状态 | 资料摄取层,不是最终事实层 |
28
+ | `stubs-and-mocks.md` | 本仓可用 mock/stub 策略 | 写可执行路径或命令 |
29
+ | `cross-repo-debugging.md` | 跨仓问题定位顺序和证据 | 写调试流程,不写服务职责总览 |
30
+
31
+ ## External Service Rule
32
+
33
+ 如果本仓依赖多个微服务,不要把所有外部知识写进一个大文档。只要某个外部服务会影响本仓开发或测试,就创建:
34
+
35
+ - `docs/03-ARCHITECTURE/services/<service-key>.md`:该服务是什么、负责什么。
36
+ - `docs/04-DEVELOPMENT/external-context/<service-key>.md`:本仓开发时如何 mock、stub、调试它。
37
+ - `docs/06-INTEGRATIONS/<contract>.md`:具体 API/event/webhook 契约。
38
+
39
+ `04-DEVELOPMENT` 只放“开发时怎么处理这个外部服务”。不要在这里维护完整系统拓扑,也不要把 payload schema 塞进来。
40
+
41
+ ## External Source Pack Rule
42
+
43
+ 如果外部团队给了多份文档、截图、导出包、会议纪要或链接,不要直接塞进 `03/04/06`。先读 `docs/11-REFERENCE/external-source-intake-standard.md`,再决定是否创建 `external-source-packs/<source-key>/`。
44
+
45
+ `external-source-packs/` 只负责资料索引、摘要和投影状态。稳定结论必须回写到:
46
+
47
+ - `docs/03-ARCHITECTURE/services/<service-key>.md`
48
+ - `docs/04-DEVELOPMENT/external-context/<service-key>.md`
49
+ - `docs/06-INTEGRATIONS/<contract>.md`
50
+
51
+ ## External Context Index
52
+
53
+ | Service Key | Why It Matters To This Repo | Local Stub / Mock | Debug Entry | Architecture Link | Contract Link | Last Verified | Confidence |
54
+ | --- | --- | --- | --- | --- | --- | --- | --- |
@@ -0,0 +1,11 @@
1
+ # 代码地图 / Codebase Map
2
+
3
+ Context Doc Type: codebase-map
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Entry Points
9
+
10
+ | Area | Path | Responsibility | Read When | Source Evidence | Last Verified | Confidence |
11
+ | --- | --- | --- | --- | --- | --- | --- |
@@ -0,0 +1,18 @@
1
+ # 跨仓调试 / Cross-Repo Debugging
2
+
3
+ Context Doc Type: cross-repo-debugging
4
+ Owner: project coordinator
5
+ Last Verified: unknown
6
+ Confidence: low
7
+
8
+ ## Debug Flow
9
+
10
+ 1. 先定位失败的 interface 或 flow。
11
+ 2. 读 `docs/03-ARCHITECTURE/service-catalog.md`,确认归属和上下游服务。
12
+ 3. 读对应的 `docs/06-INTEGRATIONS/` 契约。
13
+ 4. 读 `docs/04-DEVELOPMENT/external-context/<service-key>.md`,使用其中的 mock、stub 和本地调试说明。
14
+
15
+ ## Known Failure Modes
16
+
17
+ | Symptom | Likely Service | First Check | Source Evidence | Last Verified | Confidence |
18
+ | --- | --- | --- | --- | --- | --- |