@guanlin4924/devflow-pi 0.1.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 (254) hide show
  1. package/README.md +164 -0
  2. package/docs/OMP-NATIVE-ARCHITECTURE.md +104 -0
  3. package/package.json +40 -0
  4. package/plugins/devflow-core/extensions/devflow-core.ts +1642 -0
  5. package/plugins/devflow-core/package.json +14 -0
  6. package/plugins/devflow-core/runtime/hooks/context_sync_gate.py +174 -0
  7. package/plugins/devflow-core/runtime/hooks/hook_common.py +696 -0
  8. package/plugins/devflow-core/runtime/hooks/index_gate.py +63 -0
  9. package/plugins/devflow-core/runtime/hooks/injection_code_specification.py +7 -0
  10. package/plugins/devflow-core/runtime/hooks/post_tool.py +44 -0
  11. package/plugins/devflow-core/runtime/hooks/start.py +288 -0
  12. package/plugins/devflow-core/skills/workflow-orchestrator/SKILL.md +265 -0
  13. package/plugins/devflow-core/skills/workflow-orchestrator/agents/openai.yaml +4 -0
  14. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/advance_state.rb +520 -0
  15. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/control_io.rb +42 -0
  16. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_state.rb +138 -0
  17. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_workflow.rb +121 -0
  18. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/inspect_state.rb +553 -0
  19. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/manage_lessons.rb +219 -0
  20. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/sync_artifacts.rb +168 -0
  21. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/update_triage_route.rb +110 -0
  22. package/plugins/devflow-core/skills/workflow-orchestrator/scripts/validate_state.rb +565 -0
  23. package/plugins/devflow-core/skills/workflow-orchestrator/templates/feature-development.yaml +783 -0
  24. package/plugins/devflow-core/skills/workflow-orchestrator/templates/uat-remediation.yaml +143 -0
  25. package/plugins/devflow-core/skills/workflow-orchestrator/templates/workflows-README.md +10 -0
  26. package/plugins/devflow-core/skills/workflow-pipeline/SKILL.md +117 -0
  27. package/plugins/devflow-core/skills/workflow-pipeline/references/pipeline-flow.md +167 -0
  28. package/plugins/devflow-core/skills/workflow-pipeline/references/slice-safety-guide.md +125 -0
  29. package/plugins/devflow-core/skills/workflow-project-context/SKILL.md +819 -0
  30. package/plugins/devflow-core/skills/workflow-project-context/assets/agents-md-template.md +25 -0
  31. package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-backend-spec-template.md +68 -0
  32. package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-frontend-spec-template.md +64 -0
  33. package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-navigation-template.md +168 -0
  34. package/plugins/devflow-core/skills/workflow-project-context/assets/context-domain-index-template.md +43 -0
  35. package/plugins/devflow-core/skills/workflow-project-context/assets/context-spec-index-template.md +45 -0
  36. package/plugins/devflow-core/skills/workflow-project-context/assets/execution-contract-template.md +57 -0
  37. package/plugins/devflow-core/skills/workflow-project-context/assets/navigation-index-template.md +40 -0
  38. package/plugins/devflow-core/skills/workflow-project-context/assets/project-initialization-template.md +109 -0
  39. package/plugins/devflow-core/skills/workflow-project-context/assets/rules-index-template.md +80 -0
  40. package/plugins/devflow-core/skills/workflow-project-context/assets/run-manifest-template.json +40 -0
  41. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/directory-structure.md +46 -0
  42. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/engine.md +46 -0
  43. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/errors.md +46 -0
  44. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/locator.md +46 -0
  45. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/model.md +46 -0
  46. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/repository.md +46 -0
  47. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/router.md +46 -0
  48. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/scheduler.md +46 -0
  49. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/schema.md +46 -0
  50. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/service.md +46 -0
  51. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/testing.md +46 -0
  52. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/api-client.md +46 -0
  53. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/case-editor.md +46 -0
  54. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/components.md +46 -0
  55. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/directory-structure.md +46 -0
  56. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/forms.md +46 -0
  57. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/routing.md +46 -0
  58. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/state.md +46 -0
  59. package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/testing.md +46 -0
  60. package/plugins/devflow-core/skills/workflow-project-context/assets/stack-spec-template.md +106 -0
  61. package/plugins/devflow-core/skills/workflow-project-context/assets/state-template.md +77 -0
  62. package/plugins/devflow-core/skills/workflow-project-context/assets/toolchain-template.md +37 -0
  63. package/plugins/devflow-core/skills/workflow-project-context/references/navigation-guide.md +262 -0
  64. package/plugins/devflow-core/skills/workflow-project-context/scripts/validate_initialization.py +545 -0
  65. package/plugins/devflow-design/agents/contract-auditor.md +18 -0
  66. package/plugins/devflow-design/extensions/devflow-design.ts +47 -0
  67. package/plugins/devflow-design/package.json +14 -0
  68. package/plugins/devflow-design/skills/workflow-api-call-guide/SKILL.md +142 -0
  69. package/plugins/devflow-design/skills/workflow-api-contract/SKILL.md +150 -0
  70. package/plugins/devflow-design/skills/workflow-api-supplement/SKILL.md +121 -0
  71. package/plugins/devflow-design/skills/workflow-backend-tech-spec/SKILL.md +257 -0
  72. package/plugins/devflow-design/skills/workflow-backend-tech-spec/assets/adr-template.md +57 -0
  73. package/plugins/devflow-design/skills/workflow-backend-tech-spec/assets/backend-spec-template.md +205 -0
  74. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/affected-module-exploration.md +59 -0
  75. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/backend-conventions.md +30 -0
  76. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/code-explore-guide.md +40 -0
  77. package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/project-rule-contract.md +66 -0
  78. package/plugins/devflow-design/skills/workflow-design-rule-pack/SKILL.md +91 -0
  79. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/index.md +71 -0
  80. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/accessibility.md +31 -0
  81. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/component-library.md +31 -0
  82. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/design-systems.md +47 -0
  83. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/responsive-grid.md +29 -0
  84. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/stack-guidelines.md +31 -0
  85. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/ux-patterns.md +40 -0
  86. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tokens/project-tokens.md +19 -0
  87. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/SKILL.md +377 -0
  88. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/charts.csv +26 -0
  89. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/colors.csv +97 -0
  90. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/icons.csv +101 -0
  91. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/landing.csv +31 -0
  92. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/products.csv +97 -0
  93. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/react-performance.csv +45 -0
  94. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  95. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  96. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  97. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  98. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  99. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  100. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  101. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  102. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/react.csv +54 -0
  103. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  104. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  105. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  106. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  107. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/styles.csv +68 -0
  108. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/typography.csv +58 -0
  109. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  110. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  111. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/web-interface.csv +31 -0
  112. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/scripts/core.py +253 -0
  113. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/scripts/design_system.py +1067 -0
  114. package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/scripts/search.py +114 -0
  115. package/plugins/devflow-design/skills/workflow-design-rule-pack/scripts/install.py +67 -0
  116. package/plugins/devflow-design/skills/workflow-feature-breakdown/SKILL.md +370 -0
  117. package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/admin-system-template.md +57 -0
  118. package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/api-service-template.md +42 -0
  119. package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/c-end-system-template.md +25 -0
  120. package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/output-template.md +139 -0
  121. package/plugins/devflow-design/skills/workflow-feature-breakdown/references/bug-rules.md +12 -0
  122. package/plugins/devflow-design/skills/workflow-feature-breakdown/references/exception-checklist.md +31 -0
  123. package/plugins/devflow-design/skills/workflow-feature-breakdown/references/trace-integrity-guide.md +153 -0
  124. package/plugins/devflow-design/skills/workflow-feature-breakdown/references/writing-guide.md +92 -0
  125. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/SKILL.md +223 -0
  126. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/assets/frontend-spec-template.md +204 -0
  127. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/affected-module-exploration.md +58 -0
  128. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/component-patterns.md +42 -0
  129. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-conventions.md +28 -0
  130. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-stack-slots/common-web.md +53 -0
  131. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-stack-slots/next.md +40 -0
  132. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-stack-slots/react.md +41 -0
  133. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-stack-slots/vue.md +41 -0
  134. package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/project-rule-contract.md +95 -0
  135. package/plugins/devflow-design/skills/workflow-integration-verify/SKILL.md +172 -0
  136. package/plugins/devflow-design/skills/workflow-ui-spec/SKILL.md +302 -0
  137. package/plugins/devflow-design/skills/workflow-ui-spec/assets/ui-spec-template.md +244 -0
  138. package/plugins/devflow-design/skills/workflow-ui-spec/references/affected-module-exploration.md +55 -0
  139. package/plugins/devflow-implementation/agents/implementation-worker.md +20 -0
  140. package/plugins/devflow-implementation/package.json +6 -0
  141. package/plugins/devflow-implementation/skills/workflow-bug-fix/SKILL.md +124 -0
  142. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/INDEX.md +13 -0
  143. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/adversarial-review.md +35 -0
  144. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/first-principles.md +26 -0
  145. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/lesson-format.md +28 -0
  146. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/root-cause-ladder.md +51 -0
  147. package/plugins/devflow-implementation/skills/workflow-bug-fix/references/seam-analysis.md +30 -0
  148. package/plugins/devflow-implementation/skills/workflow-change-plan/SKILL.md +160 -0
  149. package/plugins/devflow-implementation/skills/workflow-change-plan/references/code-conventions.md +33 -0
  150. package/plugins/devflow-implementation/skills/workflow-change-plan/references/ddl-guidelines.md +60 -0
  151. package/plugins/devflow-implementation/skills/workflow-change-plan/references/output-template.md +217 -0
  152. package/plugins/devflow-implementation/skills/workflow-change-plan/references/project-rule-contract.md +55 -0
  153. package/plugins/devflow-implementation/skills/workflow-execute-phase/SKILL.md +271 -0
  154. package/plugins/devflow-implementation/skills/workflow-execute-phase/references/execute-phase.md +1251 -0
  155. package/plugins/devflow-implementation/skills/workflow-execute-phase/references/ui-brand.md +160 -0
  156. package/plugins/devflow-intel/agents/project-scout.md +27 -0
  157. package/plugins/devflow-intel/extensions/devflow-intel.ts +104 -0
  158. package/plugins/devflow-intel/package.json +14 -0
  159. package/plugins/devflow-intel/skills/code-index-query/SKILL.md +37 -0
  160. package/plugins/devflow-intel/skills/code-index-query/references/query-patterns.md +27 -0
  161. package/plugins/devflow-intel/skills/workflow-code-index/SKILL.md +68 -0
  162. package/plugins/devflow-intel/skills/workflow-code-index/references/adapter-contract.md +38 -0
  163. package/plugins/devflow-intel/skills/workflow-code-index/references/audit-checklist.md +10 -0
  164. package/plugins/devflow-intel/skills/workflow-code-index/references/confidence-rules.md +43 -0
  165. package/plugins/devflow-intel/skills/workflow-code-index/references/data-model.md +74 -0
  166. package/plugins/devflow-intel/skills/workflow-code-index/references/discovery.md +24 -0
  167. package/plugins/devflow-intel/skills/workflow-code-index/references/query-guide.md +20 -0
  168. package/plugins/devflow-intel/skills/workflow-code-index/scripts/adapters/__init__.py +1 -0
  169. package/plugins/devflow-intel/skills/workflow-code-index/scripts/adapters/base.py +30 -0
  170. package/plugins/devflow-intel/skills/workflow-code-index/scripts/adapters/generic_text.py +287 -0
  171. package/plugins/devflow-intel/skills/workflow-code-index/scripts/adapters/registry.py +17 -0
  172. package/plugins/devflow-intel/skills/workflow-code-index/scripts/code_index.py +437 -0
  173. package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/__init__.py +1 -0
  174. package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/discovery.py +139 -0
  175. package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/hashing.py +11 -0
  176. package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/scanner.py +115 -0
  177. package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/schema.py +123 -0
  178. package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/__init__.py +1 -0
  179. package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/project_binding_check.py +66 -0
  180. package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/relation_check.py +36 -0
  181. package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/schema_validate.py +11 -0
  182. package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/stale_check.py +42 -0
  183. package/plugins/devflow-intel/skills/workflow-code-index/scripts/writers/__init__.py +1 -0
  184. package/plugins/devflow-intel/skills/workflow-code-index/scripts/writers/jsonl_writer.py +25 -0
  185. package/plugins/devflow-intel/skills/workflow-code-index/scripts/writers/markdown_writer.py +106 -0
  186. package/plugins/devflow-intel/skills/workflow-code-index/scripts/writers/sqlite_writer.py +143 -0
  187. package/plugins/devflow-intel/skills/workflow-context-sync/SKILL.md +381 -0
  188. package/plugins/devflow-intel/skills/workflow-context-sync/agents/openai.yaml +4 -0
  189. package/plugins/devflow-intel/skills/workflow-context-sync/scripts/context_sync_cursor.py +241 -0
  190. package/plugins/devflow-intel/skills/workflow-update-navigation/SKILL.md +186 -0
  191. package/plugins/devflow-intel/skills/workflow-update-navigation/references/incremental-update-guide.md +47 -0
  192. package/plugins/devflow-quality/agents/code-reviewer.md +18 -0
  193. package/plugins/devflow-quality/agents/verification-runner.md +21 -0
  194. package/plugins/devflow-quality/extensions/devflow-quality.ts +59 -0
  195. package/plugins/devflow-quality/package.json +14 -0
  196. package/plugins/devflow-quality/skills/code-review/SKILL.md +288 -0
  197. package/plugins/devflow-quality/skills/code-review/references/cross-layer-checklist.md +70 -0
  198. package/plugins/devflow-quality/skills/code-review/references/dao-checklist.md +70 -0
  199. package/plugins/devflow-quality/skills/code-review/references/handler-checklist.md +48 -0
  200. package/plugins/devflow-quality/skills/code-review/references/repository-checklist.md +44 -0
  201. package/plugins/devflow-quality/skills/code-review/references/service-checklist.md +57 -0
  202. package/plugins/devflow-quality/skills/code-review/references/spec-checklist.md +34 -0
  203. package/plugins/devflow-quality/skills/code-review/references/vo-checklist.md +26 -0
  204. package/plugins/devflow-quality/skills/workflow-audit-milestone/SKILL.md +31 -0
  205. package/plugins/devflow-quality/skills/workflow-audit-milestone/references/audit-milestone.md +328 -0
  206. package/plugins/devflow-quality/skills/workflow-complete-milestone/SKILL.md +132 -0
  207. package/plugins/devflow-quality/skills/workflow-complete-milestone/assets/milestone-archive.md +123 -0
  208. package/plugins/devflow-quality/skills/workflow-complete-milestone/references/complete-milestone.md +775 -0
  209. package/plugins/devflow-quality/skills/workflow-complete-milestone/references/milestone-archive.md +123 -0
  210. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/SKILL.md +126 -0
  211. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/api-mainflow-rules.md +27 -0
  212. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/codebase-discovery.md +54 -0
  213. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/intermediate-format.md +244 -0
  214. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/mainflow-selection.md +36 -0
  215. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/project-dsl-contract.md +190 -0
  216. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/ui-mainflow-rules.md +110 -0
  217. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/compile_dsl.py +583 -0
  218. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/discover_codebases.py +199 -0
  219. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/normalize_case_payloads.py +177 -0
  220. package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/validate_case_payloads.py +370 -0
  221. package/plugins/devflow-quality/skills/workflow-verify-work/SKILL.md +106 -0
  222. package/plugins/devflow-quality/skills/workflow-verify-work/assets/UAT.md +265 -0
  223. package/plugins/devflow-quality/skills/workflow-verify-work/references/verify-work.md +759 -0
  224. package/plugins/devflow-requirements/agents/requirements-auditor.md +20 -0
  225. package/plugins/devflow-requirements/package.json +6 -0
  226. package/plugins/devflow-requirements/skills/requirement-feasibility-review/SKILL.md +219 -0
  227. package/plugins/devflow-requirements/skills/requirement-feasibility-review/agents/openai.yaml +4 -0
  228. package/plugins/devflow-requirements/skills/requirement-feasibility-review/references/review-method.md +257 -0
  229. package/plugins/devflow-requirements/skills/requirement-feasibility-review/references/review-template.md +80 -0
  230. package/plugins/devflow-requirements/skills/workflow-demand-clarify/SKILL.md +325 -0
  231. package/plugins/devflow-requirements/skills/workflow-domain-modeling/SKILL.md +163 -0
  232. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/SKILL.md +748 -0
  233. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/assets/baseline-template.md +281 -0
  234. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/antipatterns.md +69 -0
  235. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/challenge-review-guide.md +158 -0
  236. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/decomposition-guide.md +115 -0
  237. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/project-context-guide.md +119 -0
  238. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/questioning.md +76 -0
  239. package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/requirement-review-checklist.md +115 -0
  240. package/plugins/devflow-requirements/skills/workflow-requirement-triage/SKILL.md +204 -0
  241. package/plugins/devflow-requirements/skills/workflow-wayfinder/SKILL.md +183 -0
  242. package/src/cli.ts +76 -0
  243. package/src/constants.ts +15 -0
  244. package/src/doctor.ts +66 -0
  245. package/src/paths.ts +37 -0
  246. package/src/platform-extension.ts +46 -0
  247. package/src/project-context.ts +165 -0
  248. package/src/runtime.ts +167 -0
  249. package/src/usage-stats.ts +101 -0
  250. package/templates/commands/start.md +58 -0
  251. package/templates/omp/AGENTS.md +36 -0
  252. package/templates/omp/config.yml +112 -0
  253. package/templates/omp/hook-config.json +18 -0
  254. package/templates/omp/index-policy.json +57 -0
@@ -0,0 +1,748 @@
1
+ ---
2
+ name: workflow-requirement-baseline
3
+ description: "Use after the mandatory requirement chain workflow-requirement-triage → workflow-wayfinder → workflow-domain-modeling → requirement-feasibility-review when raw requirements, PRDs, meeting notes, or feature requests need decomposition, conflict checks, and a unified baseline. Do not enter baseline before the feasibility review passes."
4
+ ---
5
+
6
+ ## Legacy Command Metadata
7
+
8
+ Original slash-command metadata retained only as workflow invocation guidance.
9
+
10
+ ```yaml
11
+ argument-hint: '[@需求文档.md]'
12
+ user-invocable: true
13
+ pattern: inversion+generator+reviewer
14
+ inputs:
15
+ - .planning/PROJECT.md
16
+ - .planning/navigation/INDEX.md
17
+ - .planning/navigation/*.md
18
+ - .planning/milestones/
19
+ - 原始需求文档/PRD/会议纪要/用户描述
20
+ output: .planning/requirements/baseline.md
21
+ phase-gate:
22
+ step1: 加载项目上下文和原始需求
23
+ step2: 需求整理:结构化原文信息
24
+ step3: 功能点拆解:生成稳定功能点 ID
25
+ step4: Reviewer:检查缺口、历史影响、可开发性和可测试性
26
+ step4.5: Challenge Review:冲突识别、复用机会、历史教训、过度工程和替代方案审视
27
+ step5: Inversion:只针对缺口和需要用户拍板的决策定向提问
28
+ step5.5: 回答影响复查:根据用户回答更新受影响需求项
29
+ step6: Generator:输出统一需求基线
30
+ step7: 最终审查:追溯、下游契约和范围控制检查
31
+ resumable: true
32
+ state-key: requirement-refine
33
+ allowed-tools:
34
+ - Read
35
+ - Write
36
+ - Bash
37
+ - Grep
38
+ - Glob
39
+ - ask
40
+ ```
41
+
42
+ # Requirement Discussion
43
+
44
+ This skill receives raw requirements and turns them into a stable requirement baseline. Do not generate technical plans, change lists, code, roadmap, or implementation tasks.
45
+
46
+ ## Phase 0 — Requirement Main-Chain Gate
47
+
48
+ Before Phase 1, check these mandatory upstream artifacts:
49
+
50
+ - `.planning/requirements/{feature}/入口分诊.md` and `.meta.json`;
51
+ - `.planning/requirements/{feature}/决策地图.md` and `.meta.json`;
52
+ - `.planning/requirements/{feature}/领域模型记录.md` and `.meta.json`;
53
+ - `.planning/requirements/{feature}/可实现性审查.md` and `.meta.json`.
54
+
55
+ If any are missing, run the earliest missing main-chain step. Baseline must not become the first place where duplicate capability, fog, terminology ambiguity, or feasibility gaps are discovered.
56
+
57
+ Route based on triage meta:
58
+
59
+ | route | Required action |
60
+ |-------|-----------------|
61
+ | `ready_for_wayfinder` | Continue only after Wayfinder, domain modeling and feasibility review all pass; carry duplicate/reuse/history notes into Phase 4 and 4.5. |
62
+ | `needs_info` | Ask the minimum blocking question recorded by triage. |
63
+ | `ready_for_human` | Report the evidence and wait for user decision. |
64
+ | `already_done` | Do not create a new baseline entry unless the user says this is a change on top of existing behavior. |
65
+ | `wontfix` | Do not proceed unless the user explicitly reverses the prior out-of-scope decision. |
66
+
67
+ Require `决策地图.meta.json.ready_for_baseline = true`, a valid domain-model record, and `可实现性审查.meta.json.status = ready_for_baseline` with `baseline_gate = pass`, `gap_count = 0`, and no critical findings. A Wayfinder Grilling ticket may invoke `workflow-demand-clarify`; demand clarification is not a bypass around this gate.
68
+
69
+ When triage found partial overlap or prior rejection, preserve it as source material; do not re-run the same search later unless Phase 4 needs deeper code evidence.
70
+
71
+ ## 全局法则:对抗式审查
72
+
73
+ **需求基线阶段就要植入攻击视角。不等到代码写完才做对抗式审查——需求本身就是第一道防线。**
74
+
75
+ 核心追问:**"如果我是攻击者/异常数据/极端场景,这个需求的哪条规则会被我利用?"**
76
+
77
+ ### 审查维度
78
+
79
+ | 维度 | 在需求基线中的表现形式 | 示例 |
80
+ |------|---------------------|------|
81
+ | 输入攻击 | FP 的业务规则是否定义了字段上限? | "用户可上传附件" → 大小上限?格式限制? |
82
+ | 时序攻击 | BC 是否覆盖了时间异常? | 发布时间是未来/过去的文章如何处理? |
83
+ | 状态攻击 | 状态流转规则是否封闭? | 是否允许从"已取消"直接跳到"已完成"? |
84
+ | 并发攻击 | 业务规则是否定义了幂等性? | 双重点击提交 → 是否创建了重复记录? |
85
+ | 依赖攻击 | 外部依赖失败时的行为是否已定义? | 支付回调超时 → 订单状态是什么? |
86
+ | 资源攻击 | 是否定义了资源上限? | 批量操作一次最多多少条?导出最大行数? |
87
+
88
+ ### 应用规则
89
+
90
+ | 阶段 | 对抗式审查检查点 |
91
+ |------|----------------|
92
+ | Phase 2 需求结构化 | "异常和边界情况"bucket 中必须包含恶意输入/极端数据场景 |
93
+ | Phase 3 功能点拆解 | BC(边界情况)必须覆盖资源上限、输入极端值、并发冲突 |
94
+ | Phase 4 需求审查 | 检查基线是否只描述了"正常用户"的路径 |
95
+ | Phase 7 最终审查 | 逐 FP 做对抗式反问:该 FP 的哪条规则可能被攻击? |
96
+
97
+ ### 关键原则
98
+
99
+ 1. **不信任任何外部输入** — 如果 baseline 中某个操作接受外部数据但没有上限/校验定义,标记为 `BC-* 待补充`
100
+ 2. **不假定"用户不会那样做"** — 恶意用户就是会那样做。如果一条路径存在但没有防御规则,它就是攻击面
101
+ 3. **对抗式检查不增加 FP** — 不创建新的功能点,而是在已有 FP 的 BC(边界情况)和 BR(业务规则)中补全防御描述
102
+ 4. **遇到来自 demand-clarify 的"攻击面假设"** — 逐条转化为 BC 或 BR,不丢弃上游的攻击面预判
103
+
104
+ ## Outputs
105
+
106
+ Always create or update:
107
+
108
+ - `.planning/requirements/baseline.md` — unified requirement baseline
109
+ - `.planning/requirements/baseline.meta.json` — structured metadata. Schema defined in `feature-development.yaml` under `steps[requirement-baseline].meta_output.fields`: `review_status`, `fp_count`, `br_count`, `bc_count`, `blocking_pending_count`, `critical_image_missing_count`, `challenge_pending_count`, `code_reality_missing_count`, `current_feature`, `depends_on_count`, plus optional `pending_items`, `risks`, and `key_decisions`.
110
+
111
+ Do not create by default:
112
+
113
+ - `.planning/features/{功能名}/功能点梳理.md`
114
+ - `.planning/features/{功能名}/前端技术方案.md`
115
+ - `.planning/features/{功能名}/后端技术方案.md`
116
+ - `.planning/features/{功能名}/变更清单.md`
117
+
118
+ ## Argument Handling
119
+
120
+ Parse `$ARGUMENTS` before Phase 1:
121
+
122
+ - `@path/to/file.md`: load the referenced requirement document as the primary source.
123
+ - Other text: treat as pasted requirement content or feature name context.
124
+
125
+ If both a requirement document and pasted text are provided, use both and record them separately in the source summary.
126
+
127
+ ### 上游契约(与本技能串联的上游流程)
128
+
129
+ 当 `.planning/requirements/{feature}/入口分诊.md` 存在时(由 `workflow-requirement-triage` 生成):
130
+
131
+ 1. 将分诊分类写入 `baseline.meta.json.requirement_type` 或需求来源摘要。
132
+ 2. 将 `related_code_paths` 作为 Phase 1.5/4 的优先检查入口,但不能直接当作行为结论。
133
+ 3. 将 `related_history_paths` 和 prior rejection 记录纳入 Phase 4.5 Challenge Review。
134
+ 4. 如果 `route` 不是 `ready_for_wayfinder`,按 Phase 0 路由停止或切换技能。
135
+
136
+ 当 `.planning/requirements/{feature}/决策地图.md` 存在时(由 `workflow-wayfinder` 生成):
137
+
138
+ 1. 只有 `决策地图.meta.json.ready_for_baseline = true` 才可继续 baseline。
139
+ 2. Destination 和 Known Land 作为需求来源。
140
+ 3. 读取 `.planning/requirements/{feature}/wayfinder/WF-*.md` 中 `status=resolved` 的 ticket;其 Findings / Answer 转为 FP/BR/BC 或 `反向审视与用户拍板` 记录。
141
+ 4. Open ticket 只能进入待确认或后置探索,不能伪装成已确认需求。
142
+
143
+ 当 `.planning/requirements/{feature}/需求澄清记录.md` 存在时(由 `workflow-demand-clarify` 生成):
144
+
145
+ 1. 优先以 **需求澄清记录.md** 的场景清单和分级任务单作为原始需求来源
146
+ 2. 将决策日志中的 L1-L4 决策结论转化为 `key_decisions` 元数据
147
+ 3. 核心确定区内容直接进入 FP 功能点拆解
148
+ 4. 假设验证区内容进入 BR(业务规则),标记为"待上线验证"
149
+ 5. 不需要再对用户做"场景反讲"等基础澄清——这些已经在 demand-clarify 阶段完成
150
+
151
+ 当 `.planning/requirements/{feature}/领域模型记录.md` 或 `.planning/CONTEXT.md` 存在时(由 `workflow-domain-modeling` 维护):
152
+
153
+ 1. `.planning/CONTEXT.md` 只作为纯词汇表读取,不从中读取需求追溯。
154
+ 2. 使用已确认术语写 FP/BR/BC 名称,避免同义多词。
155
+ 3. 从 `领域模型记录.md` 读取术语冲突、边缘案例压力测试和追溯信息,并纳入 Phase 4/7 审查。
156
+ 4. ADR 只作为需求决策证据,不展开技术方案。
157
+
158
+ 当 `.planning/requirements/{feature}/可实现性审查.md` 存在时(由 `requirement-feasibility-review` 维护):
159
+
160
+ 1. 仅消费其中 `SOURCE_FACT`、`CONFIRMED_DECISION` 和已接受实现方向;不得把 `DERIVED_QUESTION` 或 `ASSUMPTION` 写入 baseline。
161
+ 2. 将审查已确认的范围排除、外部能力边界、入口门禁和存量兼容规则转化为 FP/BR/BC。
162
+ 3. 若 review meta 未通过,不得用 baseline 阶段的追问绕过;回到审查或 Wayfinder ticket 解决。
163
+
164
+ ## Existing Baseline Update Policy
165
+
166
+ **叠加原则:baseline.md 是需求的累积目录,不是单功能快照。每次新增需求时,在已有内容上追加,不覆盖。**
167
+
168
+ If `.planning/requirements/baseline.md` already exists:
169
+
170
+ 1. Read it before restructuring new input. Understand ALL existing features, not just the current one.
171
+ 2. **Preserve all confirmed `FP-*`, `BR-*`, `BC-*` from previous features.** Do not delete, renumber, or silently drop them.
172
+ 3. Add new feature points with IDs that continue from the last used number (e.g., if last FP is FP-015, new ones start at FP-016).
173
+ 4. Update existing feature points only when the new input explicitly changes them. Record the reason in `澄清与变更记录`.
174
+ 5. If a feature point is replaced or moved out of scope, mark it as `已废弃` or `已移出范围` rather than silently deleting it.
175
+ 6. The baseline must represent the **union** of all features ever baselined — it is the project's single source of truth for requirements.
176
+ 7. Do not regenerate from scratch. Start from the existing file and append.
177
+
178
+ ## Feature Name And Directory Rule
179
+
180
+ Each new requirement gets its own stable `{功能名}`. **This is additive — a new feature does not overwrite the name or directory of previous features.**
181
+
182
+ 1. Prefer an explicit feature name from `$ARGUMENTS`.
183
+ 2. Otherwise use the requirement document title or the clearest feature title in the raw requirement.
184
+ 3. Keep it short, stable, and safe as a path segment.
185
+ 4. Once written to baseline, do not change it in later clarification unless the user explicitly renames the feature.
186
+ 5. If the feature name changes, record the old name, new name, reason, and downstream directory impact in `澄清与变更记录`.
187
+ 6. The canonical downstream output directory is `.planning/features/{功能名}/`. Multiple features → multiple directories.
188
+ 7. Legacy root `features/{功能名}/` may be read as historical evidence only; new workflow outputs must not use it.
189
+ 8. When baseline already has features, the new `{功能名}` must be distinct from existing ones unless the user explicitly says it's an iteration on the same feature.
190
+
191
+ ## Pattern
192
+
193
+ This skill follows the Google Cloud Tech ADK skill pattern split:
194
+
195
+ - **Inversion**: interview the user only after raw requirements have been decomposed and gaps are known.
196
+ - **Generator**: fill `assets/baseline-template.md`.
197
+ - **Reviewer**: review decomposed requirements against `references/requirement-review-checklist.md`.
198
+
199
+ Load bundled resources only when needed:
200
+
201
+ - Read `references/decomposition-guide.md` before decomposing requirements.
202
+ - Read `skill://workflow-pipeline/references/slice-safety-guide.md` before Phase 3.1 and whenever the requirement may be oversized.
203
+ - Read `references/project-context-guide.md` before checking historical impact(含三级递进审查:Call Chain Map 对照 → 源码逻辑侵入 → 需求回洗).
204
+ - Read `references/challenge-review-guide.md` before challenge review and user decision questions.
205
+ - Read `references/antipatterns.md` before challenge review and final review.
206
+ - Read `references/questioning.md` before asking clarification questions.
207
+ - Read `references/requirement-review-checklist.md` before the review gate.
208
+ - Read `assets/baseline-template.md` before writing `baseline.md`.
209
+
210
+ ## Phase 1 — Context And Requirement Intake
211
+
212
+ Load available project context:
213
+
214
+ 1. `.planning/PROJECT.md`
215
+ 2. `.planning/navigation/INDEX.md`
216
+ 3. `.planning/navigation/INDEX.md` for the Codebase Registry — identify which codebases are relevant to the requirement
217
+ 4. Load the navigation files (`.planning/navigation/{name}.md`) for each relevant codebase from the registry
218
+ 5. If `.planning/code-index/` exists, note that `code-index-query` must be used for Phase 1.5 routing and Phase 4 source-reality checks
219
+ 6. `.planning/milestones/`
220
+ 7. `.planning/requirements/`
221
+ 8. `.planning/lessons/`
222
+ 9. `.planning/*/CONTEXT.md`
223
+
224
+ History model rule:
225
+
226
+ - This workflow's primary historical artifacts are milestone and planning artifacts, not outbound-call style `features/*.spec.md` files.
227
+ - Use `.planning/milestones/`, `.planning/requirements/`, `.planning/lessons/`, and `.planning/*/CONTEXT.md` first.
228
+ - If `features/`, `.context/lessons/`, or `.context/workflow/` exist in the target project, treat them as optional legacy/project-rule evidence and record that distinction.
229
+
230
+ Then collect this requirement input:
231
+
232
+ - PRD / feature document
233
+ - pasted requirement text
234
+ - meeting notes
235
+ - user description
236
+
237
+ If no requirement is provided, ask for it. Do not proceed without raw requirement content.
238
+
239
+ Completion gate: project context is loaded or explicitly missing, and raw requirement content is available.
240
+
241
+ ## Phase 1.5 — PRD Media And Code Routing Scan
242
+
243
+ Before structuring requirements or asking clarification questions, ground the input in visible artifacts and current code reality.
244
+
245
+ ### 1.5.1 PRD image processing
246
+
247
+ If the PRD, pasted requirement, meeting notes, or user message contains image references, process every image before Phase 2:
248
+
249
+ - Image references include `http://...` / `https://...` image URLs, Markdown images, attached screenshots/designs, and local image paths.
250
+ - Use the available image-capable tools to access and inspect each image.
251
+ - Convert the visible content into text notes: flowcharts, page screenshots, prototypes, tables, field labels, buttons, status names, and any visible constraints.
252
+ - Treat extracted image notes as requirement source material and record them in the source summary.
253
+ - Classify each image by its role:
254
+ - `critical_image`: nearby text says the image contains the primary flow, page prototype, field list, state machine, or required decision path.
255
+ - `supporting_image`: the image supplements wording but the requirement is still understandable from text.
256
+ - `decorative_image`: logo, cover, illustration, or other non-requirement image.
257
+ - If an image cannot be accessed, authenticated, decoded, or read clearly, classify it from nearby text and mark the classification `推断,待确认`.
258
+ - If nearby text does not reveal the image role, default to `supporting_image`, not `critical_image`.
259
+ - A missing `critical_image` blocks a passed baseline until the user describes it or provides an accessible replacement. A missing `supporting_image` may be recorded as non-blocking pending with impact. A `decorative_image` may be skipped with a note.
260
+
261
+ Use this wording pattern when blocked by an image:
262
+
263
+ ```text
264
+ 我尝试查看 PRD 中的图片「{image_ref}」,但无法识别内容(原因:{reason})。这张图会影响需求理解,请描述图片中的页面/流程/字段,或提供一个可访问的替代链接。
265
+ ```
266
+
267
+ ### 1.5.2 需求类型路由
268
+
269
+ 在代码路由扫描之前,先判断当前需求的类型。只做标记,不做分支切换。
270
+
271
+ 根据 WHY 确认后的信息判断需求属于以下哪种(或混合)类型:
272
+
273
+ | 类型 | 识别特征 | 后续 Phase 策略 |
274
+ |------|---------|----------------|
275
+ | **A. 用户功能** | 有明确的用户、有界面/交互/可感知的输出 | 标准流程 |
276
+ | **B. 技术/平台能力** | 用户感知间接,核心是系统能力(API、算法、基础设施) | 下移界面相关检查,聚焦接口契约 |
277
+ | **C. WHO 模糊** | 连给谁用、解决谁的问题都不确定 | 需要退回 demand-clarify 先澄清用户群 |
278
+ | **D. 系统性改造** | 跨多个模块/触点的整体改动 | Phase 3.5 模块边界检查优先级提升 |
279
+ | **E. 删减/简化** | 目标是减少复杂度而非增加功能 | 略过 Phase 2 需求整理,直接审计现状 |
280
+
281
+ **混合类型**:一个需求可能同时涉及多种类型(如 A+D 混合)。标记为主类型+副类型(如 `A+D`),后续 Phase 按主类型流程推进,在 Phase 3.5 和 Phase 4 兼顾副类型的检查项。
282
+
283
+ 写入 `.planning/requirements/baseline.meta.json` 的 `requirement_type` 字段。
284
+
285
+ ### 1.5.3 Code routing scan before questions
286
+
287
+ Before asking the user any clarification question, produce an internal code routing summary from project artifacts:
288
+
289
+ 1. Use `.planning/navigation/INDEX.md` to identify relevant codebases.
290
+ 2. Read the relevant navigation files (`.planning/navigation/BACKEND.md`, `.planning/navigation/FRONTEND.md`, or other registered codebase files).
291
+ 3. Treat navigation as a routing index only. It helps find files quickly, but it is not sufficient evidence for requirement conclusions.
292
+ 4. If `.planning/code-index/` exists, use `code-index-query` with requirement concepts to find candidate routes/pages/services/models/tests/resources. Treat these as routing candidates only.
293
+ 5. Confirm likely related source paths exist by listing directories or opening only top-level file structure, imports, class/function names, route declarations, comments, and short module headers.
294
+ 6. Do not inspect function bodies, branch logic, data flow, SQL/query details, permission checks, or state transitions in Phase 1.5. Those are Phase 4 Level 2 responsibilities.
295
+ 7. Do not conclude "already supported", "not supported", or "conflicting" in Phase 1.5. Only record "possibly related" modules and why they should be checked later.
296
+ 8. Record:
297
+ - possibly related modules, routes, pages, services, models, engines, or jobs
298
+ - source paths to inspect in Phase 4
299
+ - code-index symbol/relation ids when used
300
+ - if code-index exists but is missing, stale, or has no useful hits, record the fallback reason
301
+ - requirement terms that mapped to those paths
302
+ - concrete unknowns that require user clarification before decomposition
303
+
304
+ Do not hard-code Go-style directories such as `internal/domain`, `internal/service`, or `internal/web`. Use the project navigation registry first to find candidate files, then only perform light routing checks here.
305
+
306
+ Completion gate: all referenced images are summarized, skipped, or explicitly blocked by role; requirement type is classified and recorded; and a code routing summary exists without behavior conclusions.
307
+
308
+ ## Clarification Question Protocol
309
+
310
+ This protocol applies before any user-facing clarification question in this skill, including early intake questions and Phase 5 review/challenge questions.
311
+
312
+ - Number questions sequentially as `Q1`, `Q2`, `Q3` within the current requirement discussion.
313
+ - Ask exactly one question at a time. Do not present a questionnaire unless the user explicitly asks for batch questions.
314
+ - Every question must include a short "已发现" context line from source material, code routing scan, or review finding.
315
+ - Ask concrete questions tied to a source section, existing module, or `FP-*`/`BR-*`/`BC-*`/`CR-*` candidate. Do not ask generic checklist questions.
316
+ - If the user answer is ambiguous, ask a follow-up with the same question number plus suffix, e.g. `Q2.1`.
317
+ - Capture the user's priority or attitude when it affects scope: must-have, nice-to-have, later, avoid, risky, or blocked.
318
+ - Do not skip blocking questions. If a missing answer blocks a reliable baseline, ask it before generating a passed baseline.
319
+
320
+ Clarification questions are not review findings:
321
+
322
+ - **Clarification question**: fills missing user intent or source ambiguity before or during decomposition.
323
+ - **Review/challenge question**: comes from Phase 4 / Phase 4.5 evidence, must cite the affected `FP-*`, `BR-*`, `BC-*`, `CR-*`, existing module, or artifact conflict.
324
+
325
+ Question format:
326
+
327
+ ```text
328
+ 已发现:{one concise code/source/review finding}
329
+
330
+ Q{n}: {one concrete question}
331
+ ```
332
+
333
+ ## Phase 2 — Requirement Structuring
334
+
335
+ Read `references/decomposition-guide.md`.
336
+
337
+ Before asking follow-up questions, restructure the raw requirement into these buckets:
338
+
339
+ - Background / goal
340
+ - User roles
341
+ - Pages / modules
342
+ - User actions
343
+ - Data fields
344
+ - Business rules
345
+ - Permission rules
346
+ - State changes
347
+ - Exception and boundary cases — **必须包含恶意输入/极端数据/资源耗尽场景**(巨型输入、未来时间戳、非法状态跳转、并发冲突、重入递归)。如果原始需求完全没有提及,在该 bucket 中标注"未覆盖,需下游补充"
348
+ - Non-functional requirements
349
+ - Explicit open questions
350
+
351
+ Do not add assumptions as facts. Mark inferred items as `推断,待确认`.
352
+
353
+ Completion gate: raw requirement has been normalized into structured buckets.
354
+
355
+ ## Phase 3 — Feature Point Decomposition
356
+
357
+ Convert the structured requirement into feature points.
358
+
359
+ Rules:
360
+
361
+ - Apply `references/decomposition-guide.md` FP / BR / BC classification before assigning IDs. Mixed requirement sentences must be split into capability (FP), rule (BR), and boundary handling (BC) instead of being stored as one overloaded FP.
362
+ - If baseline already exists, assign IDs that **continue from the last used FP number** (e.g., last existing FP is FP-015 → new ones start at FP-016). Never renumber or reuse old IDs.
363
+ - If this is the first baseline, start from FP-001.
364
+ - One feature point should describe one testable user/business capability.
365
+ - Split mixed descriptions into separate feature points.
366
+ - Merge duplicate wording that describes the same capability.
367
+ - Keep cross-cutting requirements such as permission, export, audit log, notification, compatibility, and data migration as independent feature points when they can be built or tested separately.
368
+
369
+ Each feature point must include:
370
+
371
+ - ID
372
+ - Name
373
+ - Source excerpt or source section
374
+ - Type: `新增` / `修改` / `影响`
375
+ - Priority: `P0` / `P1` / `P2`, based on source priority or inferred from user-visible/business criticality
376
+ - Description
377
+ - User role
378
+ - Entry / trigger
379
+ - Precondition
380
+ - Main flow
381
+ - Business rules
382
+ - Data requirements
383
+ - Boundary cases
384
+ - Related existing module
385
+ - Status: `明确` / `待确认` / `推断,待确认`
386
+ - Open questions
387
+
388
+ Completion gate: all raw requirement content is mapped to feature points or explicitly marked as ignored/out of scope.
389
+
390
+ ## Phase 3.1 — Large Requirement Slice Plan
391
+
392
+ Read `skill://workflow-pipeline/references/slice-safety-guide.md`.
393
+
394
+ After FP/BR/BC decomposition and before module-boundary checks, decide whether the current requirement is oversized. Use the guide's oversize triggers: FP count, affected codebases, high-risk chains, migration/runtime scope, contract replacement, projected document length, and reviewability.
395
+
396
+ If no trigger applies:
397
+
398
+ - Record `slicing_required = false`.
399
+ - Treat the whole current feature as `SL-001`.
400
+ - Still write a one-row slice plan so downstream artifacts have a stable active slice ID.
401
+
402
+ If any trigger applies:
403
+
404
+ - Create a slice plan with `SL-*` IDs.
405
+ - Assign every current FP to exactly one primary slice.
406
+ - Assign BR/BC ownership or references per slice.
407
+ - Define dependencies and gates for each slice.
408
+ - Mark only the first executable slice as the active downstream slice unless the user explicitly asks to plan another slice.
409
+ - Move non-active slice FP/BR/BC to "deferred current-feature slices" for downstream context only.
410
+ - If a reliable slice plan cannot be produced from current information, ask one blocking question or mark baseline review as failed.
411
+
412
+ Anti-smuggling rule:
413
+
414
+ - Shared setup may be a foundation slice only if it has its own observable gate. Otherwise it belongs to the first slice that needs it.
415
+ - Do not create "frontend slice" and "backend slice" from one user outcome. Slice by business outcome and chain closure.
416
+
417
+ Completion gate:
418
+
419
+ - [ ] Slice plan exists, even if it is a single-slice plan
420
+ - [ ] Active slice ID is identified
421
+ - [ ] Every current FP has exactly one primary slice
422
+ - [ ] Every slice has outcome, dependencies, exclusions, and gate
423
+ - [ ] Deferred slices are not part of the active downstream implementation scope
424
+ - [ ] Coverage conservation passes: every source row maps to FP/BR/BC/Q/OUT/DUP; active + deferred + out-of-scope FP count equals total current-feature FP; every deferred item has reason, dependency, re-entry condition, and gate
425
+
426
+ ## Phase 3.5 — 模块边界检查
427
+
428
+ 目标:在进入审查前预判每个 FP 的模块边界和接口深度,让下游 tech-spec 能直接使用这些信息。
429
+
430
+ ### 对每个新增或修改的 FP 执行以下检查
431
+
432
+ **1. 预估接口签名**
433
+
434
+ | FP | 候选接口签名 | 入口数 | 评估 |
435
+ |----|------------|:------:|:----:|
436
+ | FP-001 | OrderWorkflow.process(orderId, action) | 1 | ✅ 单入口 |
437
+ | FP-002 | Order.export() + Order.batchDelete() | 2 | ⚠️ 多入口,考虑聚合 |
438
+
439
+ 如果入口多于 1 个,标记为"浅模块风险",下游 tech-spec 需关注是否应聚合。
440
+
441
+ **2. Deletion Test**
442
+
443
+ 假装删掉这个 FP 对应的模块,复杂度去哪了?
444
+
445
+ - **消失** → 大概率是深模块(复杂度在模块内部,删了就没了)
446
+ - **分散到 N 个调用方** → 可能是浅模块(复杂度分散在各调用者中)
447
+ - **不确定** → 标记为"需下游 tech-spec 评估"
448
+
449
+ **3. 关联模块标记**
450
+
451
+ | FP | 关联已有模块 | 交互方式 | 是否新建模块 |
452
+ |----|------------|---------|:-----------:|
453
+ | FP-001 | OrderService | 扩展现有接口 | ❌ 扩展 |
454
+ | FP-003 | 无 | 全新功能 | ✅ 新建 |
455
+
456
+ ### 输出
457
+
458
+ 在 FP 详情中增加两个字段:
459
+
460
+ ```yaml
461
+ seam_type: "新建" | "扩展" | "修改"
462
+ module_depth: "深" | "浅(需下游关注)" | "待评估"
463
+ ```
464
+
465
+ 写入 `.planning/requirements/baseline.md` 中每个 FP 的描述末尾。
466
+
467
+ ### 完成门禁
468
+
469
+ - [ ] 每个新建/修改的 FP 已有 seam_type 标记
470
+ - [ ] 每个新建/修改的 FP 有 module_depth 初步评估
471
+ - [ ] 浅模块或待评估的 FP 已在备注中说明原因,供 Phase 4 审查和下游 tech-spec 使用
472
+
473
+ ## Phase 4 — Requirement Review(三级递进审查)
474
+
475
+ Read:
476
+
477
+ - `references/project-context-guide.md`(含三级递进审查方法)
478
+ - `references/requirement-review-checklist.md`
479
+
480
+ ### 4.1 基础审查
481
+
482
+ Review the decomposed feature points for:
483
+
484
+ - Missing roles, entries, flows, fields, rules, permissions, boundary cases
485
+ - Frontend/backend/test readiness
486
+ - Ambiguous ownership between frontend and backend
487
+ - **对抗式审查**:逐 FP 检查 BC(边界情况)是否覆盖了以下攻击视角:
488
+ - 输入攻击:字段有无上限/格式/注入防护定义?
489
+ - 时序攻击:时间异常(未来/过去/时区错误)是否在边界情况中?
490
+ - 状态攻击:状态流转是否封闭?有无非法跳转路径?
491
+ - 并发攻击:是否定义了幂等/去重/锁机制?
492
+ - 资源攻击:批量/导出/上传是否定义了最大限制?
493
+ - 依赖攻击:外部服务失败时行为是否已定义?
494
+ - 如有缺失,标记为 BC-* 待补充,不视为审查通过
495
+
496
+ ### 4.2 三级递进审查(项目历史影响)
497
+
498
+ 按 `project-context-guide.md` 的三级递进方法执行:
499
+
500
+ **Level 1: 导航 Call Chain Map 对照(结构层)**
501
+ - 对每个涉及已有代码的 FP,从导航文件的 API Modules / Route-Component Map 提取受影响文件清单
502
+ - 若 `.planning/code-index/` 存在,必须通过 `code-index-query` 用需求关键词、API 路径、页面名、字段名、状态名、表/配置/资源名查询 Symbol Index 和 Relation Graph,补充 navigation 未覆盖的调用方、被调用方、入口和数据流候选
503
+ - 调用链重叠类型判断:扩展已有 vs 新建分支
504
+ - 契约影响预判:修改已有接口时检查其他调用方
505
+ - 导航无候选时,先通过 `code-index-query` 查 code-index;仍无候选时,再用需求关键词、API 路径、页面名、字段名、状态名通过 `rg` 查实际源码。navigation 不能作为"无相关代码"的唯一证据
506
+ - **找到候选调用链或既有模块 → 必须进入 Level 2**
507
+ - **仍找不到候选源码路径**:
508
+ - 若该 FP 是明确全新且无已有模块重叠,记录已搜索范围和"未找到候选路径",可不做 Level 2
509
+ - 若该 FP 修改、影响或疑似重叠已有模块,记录 `code_reality_missing`,审查结论不得为 `通过`
510
+
511
+ **Level 2: 源码逻辑侵入(逻辑层)**
512
+ - 侵入调用链末端源码:读 domain 结构体 / DAO 参数 / service 逻辑 / VO 结构体 / handler 路由
513
+ - 若 Level 1 使用了 code-index,优先读取 relation 的 `evidence_path:evidence_line`,再按源码上下文扩展阅读;不得只凭 Markdown 或 relation 摘要下结论
514
+ - 逐项比差:已存在且一致 / 已存在但冲突 / 不存在
515
+ - 每条比差结论带源码证据(文件路径 + 行号)
516
+ - Source inspection output must use this template only:
517
+
518
+ ```markdown
519
+ - 关联项:FP-xxx / BR-xxx / BC-xxx
520
+ - 源码证据:path:line
521
+ - 当前行为:只描述已读源码中的现状
522
+ - 比差结论:已存在且一致 / 已存在但冲突 / 不存在
523
+ - 需求影响:可复用 / 需要用户确认 / 需下游 tech-spec 评估
524
+ ```
525
+
526
+ - Do not write implementation plans, new API shapes, new fields, DDL, code tasks, class/function changes, or migration steps in Level 2 notes. If such content appears, delete it before continuing.
527
+ - **比差结论为已存在且一致/已存在但冲突 → 进入 Level 3**
528
+ - **比差结论为不存在 → 记录需求缺口和下游 tech-spec 评估点,该 FP 可继续审查**
529
+
530
+ **Level 3: 需求回洗 + 定向重问**
531
+ - 将比差发现转为定向问题,带源码证据 + 互斥选项
532
+ - 用户回答后更新受影响的 FP/BR/BC/范围项
533
+ - 记录到 `澄清与变更记录`
534
+ - 不得自行选择方案,必须用户拍板
535
+
536
+ Produce an internal gap list grouped by feature point. Do not generate baseline yet.
537
+
538
+ Completion gate: every feature point has review status `通过` or has open questions.
539
+
540
+ ## Phase 4.5 — Challenge Review
541
+
542
+ Read:
543
+
544
+ - `references/challenge-review-guide.md`
545
+ - `references/antipatterns.md`
546
+
547
+ Review the decomposed feature points against project reality and simplicity:
548
+
549
+ 0. **Review depth**: choose `light`, `standard`, or `strict` using `references/challenge-review-guide.md`.
550
+ - `light`: run C1/C2/C4.
551
+ - `standard`: run C1/C2/C4 plus C5-lite. Use this by default and whenever existing code is modified or overlapped.
552
+ - `strict`: run C1-C5 full review.
553
+ 1. **Current-state conflict**: identify conflicts between requested behavior and current project context.
554
+ 2. **Reuse opportunity**: check existing business capability, installed libraries, and project patterns before treating a capability as new.
555
+ 3. **Historical lesson and prior work**: search available milestone, requirement, lesson, and project-rule history before claiming there is no precedent.
556
+ 4. **Over-engineering candidate**: flag scope that is not explicitly requested, is future-oriented, or is disproportionately expensive.
557
+ 5. **Alternative path and do-nothing baseline**: for standard review run C5-lite; for strict review or when C5-lite finds a real alternative, compare the requested path with a simpler path and the baseline of not doing it now.
558
+
559
+ Rules:
560
+
561
+ - Tie every challenge item to `FP-*`, `BR-*`, `BC-*`, a scope item, or the downstream contract.
562
+ - Present mutually exclusive options when a user decision changes scope, semantics, ownership, or long-term maintenance.
563
+ - Do not recommend one option unless the user explicitly asks for advice.
564
+ - In interactive mode, ask for a substantive answer when a challenge decision affects scope, semantics, ownership, compatibility, or implementation cost. Do not treat "OK" or vague confirmation as a decision reason.
565
+ - For P0 or expensive feature points, C5 alternative-path review must produce either a user-provided reason, a pending reason, or confirmed hard constraints. It must not be empty.
566
+ - Historical review must name the planning/milestone sources searched. Do not claim "无历史" from memory.
567
+ - Record challenge results under baseline `反向审视与用户拍板`.
568
+
569
+ Completion gate: every challenge dimension has either a recorded finding or a recorded no-finding statement with evidence searched. Pending challenge decisions that affect scope, semantics, ownership, compatibility, implementation cost, or downstream contracts block a passed baseline until answered.
570
+
571
+ ## Phase 5 — Targeted Clarification
572
+
573
+ Use `ask` only for gaps or challenge decisions that block development, testing, technical planning, scope control, or downstream contracts.
574
+
575
+ Question rules:
576
+
577
+ - Follow `Clarification Question Protocol` for numbering, one-question-at-a-time cadence, code/source context, and ambiguity follow-up.
578
+ - Build a prioritized clarification queue, but ask only one question at a time.
579
+ - Before asking, merge duplicate or related questions so each answer can resolve the widest useful gap.
580
+ - After receiving each answer, review whether it changes any previously structured bucket, feature point, business rule, boundary case, historical impact, scope item, or downstream contract.
581
+ - If the answer changes previous requirements, update the affected items immediately before asking the next question.
582
+ - Record each accepted answer and requirement update in the baseline `澄清与变更记录`.
583
+ - For non-blocking warnings, write pending questions into the baseline instead of interrupting the user.
584
+ - Blocking questions must be answered before a baseline can receive review conclusion `通过`.
585
+ - For challenge decisions, ask the user to choose among concrete options or provide the missing reason/constraint. Do not ask generic "is this ok?" questions.
586
+
587
+ Do not ask generic checklist questions. Ask questions tied to specific feature point IDs:
588
+
589
+ ```text
590
+ FP-003 导出文件字段和格式:导出字段以列表当前展示字段为准,还是需要额外字段?
591
+ ```
592
+
593
+ If the user cannot answer a blocking question, keep the item in `待确认事项`, mark the baseline review conclusion as not passed, and stop before downstream handoff. If the question is non-blocking, keep it in `待确认事项` and continue with impact clearly recorded.
594
+
595
+ Completion gate: blocking questions are answered. Non-blocking questions may be recorded as pending with impact and current handling.
596
+
597
+ ## Phase 5.5 — Answer Impact Review
598
+
599
+ After every user answer in Phase 5:
600
+
601
+ 1. Classify the answer as confirmation, correction, new requirement, scope reduction, scope expansion, or contradiction.
602
+ 2. Re-check affected previous content, including structured buckets, feature points, rules, boundary cases, historical impact, scope control, and downstream read contract.
603
+ 3. Update affected feature points in place while preserving stable IDs. Create a new feature point only when the answer introduces an independently testable capability.
604
+ 4. If an answer invalidates a previous feature point or rule, mark the old item as changed or out of scope instead of silently deleting it.
605
+ 5. Re-run the requirement review for affected items before asking the next question.
606
+ 6. Record what changed, why it changed, and which answer caused it in `澄清与变更记录`.
607
+
608
+ ## Phase 6 — Generate Baseline
609
+
610
+ **叠加模式(baseline 已存在)**:
611
+
612
+ 1. Read existing `.planning/requirements/baseline.md` as the base.
613
+ 2. Append new feature points after the existing ones. Keep all old FP-*, BR-*, BC-* intact.
614
+ 3. Update `需求来源` to add the new source entry.
615
+ 4. Update `当前功能切片` to list only the current feature's FP/BR/BC IDs, active `SL-*`, deferred slices, and any `depends_on` historical references.
616
+ 5. Add new entries to `原始需求追溯表` for the new feature only.
617
+ 6. Append to `业务规则` and `边界情况` only if the new feature introduces rules/cases not already covered.
618
+ 7. Update `与历史功能/里程碑的关联` to note the new feature's impact on existing modules.
619
+ 8. Update `代码现实对照` with source-backed current behavior and difference conclusions for the current feature.
620
+ 9. Append to `澄清与变更记录` with the new session's changes.
621
+ 10. Update `下游输入契约` to include the new feature's frontend/backend/test contracts and active slice constraints.
622
+ 11. Keep the `{功能名}` section for the **current** feature, but preserve all prior features' data.
623
+
624
+ **新建模式(baseline 不存在)**:
625
+
626
+ Read `assets/baseline-template.md`.
627
+
628
+ Generate `.planning/requirements/baseline.md` with:
629
+
630
+ - Requirement source summary
631
+ - Feature name and canonical output directory, using one stable `{功能名}` for all downstream `.planning/features/{功能名}/...` outputs
632
+ - Structured requirement summary
633
+ - Current feature slice with current FP/BR/BC IDs
634
+ - Slice plan with active `SL-*`, deferred slices, dependencies, and gates
635
+ - Cross-feature `depends_on` references for historical FP/BR/BC needed by the current feature
636
+ - Raw requirement traceability table
637
+ - Feature point list
638
+ - Per-feature-point details
639
+ - Business rules
640
+ - Boundary cases
641
+ - Historical impact
642
+ - Code reality comparison table with source-backed current behavior and difference conclusions
643
+ - Challenge review results and user decisions
644
+ - Frontend/backend/test input contract (功能点梳理为上游,测试指导书为可选下游)
645
+ - Pending questions
646
+ - Clarification and change log
647
+ - Review result
648
+
649
+ Create `.planning/requirements/` if needed.
650
+
651
+ Do not create synonym duplicate sections such as `需求来源汇总` or `历史影响` when the template section is named `需求来源` or `与历史功能/里程碑的关联`.
652
+
653
+ Write `.planning/requirements/baseline.meta.json` with the fields required by the workflow YAML. `review_status` must be `passed` only when the baseline review conclusion is `通过`; otherwise use `failed`. Count blocking items explicitly:
654
+
655
+ - `blocking_pending_count`: unanswered clarification items that block reliable baseline or downstream handoff
656
+ - `critical_image_missing_count`: missing or unclear `critical_image` items
657
+ - `challenge_pending_count`: unanswered CR decisions affecting scope, semantics, ownership, compatibility, implementation cost, or downstream contracts
658
+ - `code_reality_missing_count`: required code reality comparisons that were not completed
659
+
660
+ Completion gate: baseline and baseline.meta.json are written and contain no unresolved template placeholders. If updating an existing baseline, ALL prior feature points are still present.
661
+
662
+ ## Phase 7 — Final Review Gate (MANDATORY — do not skip)
663
+
664
+ **审查方法论来自 spec-writer 的"苏格拉底式反问 + 反向对照"模式。必须逐条执行,不得跳过。**
665
+
666
+ ### 7.1 反问审查(苏格拉底式)
667
+
668
+ 对每个 FP 问自己三个问题,发现缺失时回 Phase 5 向用户定向提问:
669
+
670
+ - **WHY 确认**:这个 FP 要解决的业务问题是否已说清?用户的目标和优先级是否已确认?
671
+ - **WHAT 确认**:功能边界是否清晰?必做 vs 可后做已区分?
672
+ - **边界确认**:异常/空数据/并发/权限边界是否已覆盖或标记待确认?
673
+
674
+ ### 7.1.5 跨层一致性检查
675
+
676
+ 不在反问审查里各层单独问,而是查**层与层之间的一致性**。不要在 Phase 7 为了查这个问题去问用户——Phase 7 只做检查不做追问,缺口记录到审查结论。每个 FP 检查以下四个维度:
677
+
678
+ | 层 | 检查 | 一致性要求 |
679
+ |----|------|-----------|
680
+ | WHY ↔ WHAT | WHY 的问题陈述中列出的痛点,在 WHAT 里是否都有对应的 FP 去解决? | 无遗漏,无无关 FP |
681
+ | WHAT ↔ HOW | WHAT 里的每个 FP,HOW 里是否有对应实现逻辑? | 100% 覆盖 |
682
+ | WHAT ↔ 衡量 | WHAT 里的每个核心 FP,衡量指标能否验证其效果? | 痛点→FP→指标一条线 |
683
+ | HOW ↔ 衡量 | HOW 的实现输出是否能被衡量指标采集到数据? | 可观测,有埋点或日志 |
684
+
685
+ 如果发现缺口,记录在审查结论中,不追问用户(Phase 7 只检查,缺口留到 Phase 5 或下一轮)。
686
+
687
+ ### 7.2 对抗式审查(需求级)
688
+
689
+ **逐 FP 从攻击者视角审视:不检查代码是否正确,而是检查需求本身是否定义了防御。**
690
+
691
+ 对每个 FP 追问:
692
+
693
+ | 攻击视角 | 检查问题 | 缺失时的处理 |
694
+ |---------|---------|------------|
695
+ | 输入攻击 | 接受用户/外部输入的字段是否有上限/格式校验定义? | 标记 BC-* 待补充 |
696
+ | 时序攻击 | 依赖时间戳排序/过滤的逻辑是否覆盖了未来/过期时间? | 标记 BC-* 待补充 |
697
+ | 状态攻击 | 状态流转规则是否封闭?能否从非相邻状态直接跳转? | 标记 BR-* 待补充 |
698
+ | 并发攻击 | 写入操作是否定义了幂等/去重规则? | 标记 BR-* 待补充 |
699
+ | 资源攻击 | 批量操作/文件上传/导出是否定义了资源上限? | 标记 BC-* 待补充 |
700
+ | 依赖攻击 | 外部服务调用失败/超时/返回异常格式时,需求中行为定义了吗? | 标记 BC-* 待补充 |
701
+
702
+ 审查结论:如果某个 FP 在 3 个以上攻击视角缺失 BC/BR 定义,该 FP 的审查结论不得为"通过"。
703
+
704
+ ### 7.3 反向对照审查(代码库对照)
705
+
706
+ 复用 Phase 4 的三级递进审查结果,逐 FP 复验:
707
+
708
+ | 嗅探 | 检查 | 数据来源 |
709
+ |------|------|---------|
710
+ | 复用嗅探 | 现有模块/接口/组件是否已经做了类似的事? | Phase 4 Level 2 源码比差结果 |
711
+ | 冲突嗅探 | 命名、流程、数据模型是否与现有约定矛盾? | Phase 4 Level 1 调用链契约分析 + Level 2 源码比差 |
712
+ | 重叠嗅探 | 是否会与某个已有功能形成"两套并存"? | Phase 4 Level 1 调用链重叠类型 |
713
+ | 历史嗅探 | 是否有类似功能曾被做过、废弃过、或刻意回避过? | Phase 4 Level 2 源码检查 + milestones/lessons 搜索 |
714
+
715
+ 发现冲突时,必须列出互斥选项 + 代价,让用户拍板。禁止自行选择。
716
+
717
+ **如果 Phase 4 未做 Level 2 源码侵入**,Phase 7 需要补做:对每个涉及已有模块的 FP,侵入调用链末端源码做比差后再下审查结论。
718
+
719
+ ### 7.4 产物完整性检查
720
+
721
+ ```markdown
722
+ - [ ] 每个原始需求映射到 FP-*/BR-*/BC-* 或 out-of-scope
723
+ - [ ] 追溯表完整,来源→FP 映射可验证
724
+ - [ ] 分片覆盖守恒:原始条目、FP/BR/BC、active/deferred/out-of-scope 计数可对齐,无消失项
725
+ - [ ] 每个 FP 有 ID/描述/流程/规则/边界/类型/优先级/状态
726
+ - [ ] 当前功能切片只包含本轮 FP/BR/BC,并列出必要的 `depends_on` 历史依赖
727
+ - [ ] 切片计划存在,当前 active slice 明确,后置 slice 未进入本轮下游实现范围
728
+ - [ ] 代码现实对照只包含源码现状、比差结论和需求影响,不含实现方案
729
+ - [ ] Challenge Review 结果已记录,待确认项绑定到 FP-ID
730
+ - [ ] 不存在阻塞待确认、缺失 critical 图片、或影响范围/契约但未拍板的 CR 决策
731
+ - [ ] 所有 FP 已通过 7.2 对抗式审查 — 每个 FP 在 3 个或更少的攻击视角缺失 BC/BR
732
+ - [ ] 下游契约(前端/后端/测试)已就绪
733
+ - [ ] 不含技术方案、DDL、代码任务
734
+ ```
735
+
736
+ ### 7.5 审查结论
737
+
738
+ 在 baseline.md 末尾写入审查结论(通过 / 不通过 + 未通过项)。
739
+
740
+ 审查结论必须为 `不通过` when:
741
+
742
+ - Any blocking clarification question remains unanswered.
743
+ - A `critical_image` is missing or unclear.
744
+ - A Challenge Review decision affects scope, semantics, ownership, compatibility, implementation cost, or downstream contracts and is not answered.
745
+ - Code reality comparison required for an existing-module impact was not completed.
746
+ - Coverage conservation fails: any source row, FP, BR, BC, deferred item, or out-of-scope item lacks an explicit disposition.
747
+
748
+ **Do not report "Step 2 complete" to the pipeline until 审查结论 = 通过.**