@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,114 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ UI/UX Pro Max Search - BM25 search engine for UI/UX style guides
5
+ Usage: python search.py "<query>" [--domain <domain>] [--stack <stack>] [--max-results 3]
6
+ python search.py "<query>" --design-system [-p "Project Name"]
7
+ python search.py "<query>" --design-system --persist [-p "Project Name"] [--page "dashboard"]
8
+
9
+ Domains: style, prompt, color, chart, landing, product, ux, typography
10
+ Stacks: html-tailwind, react, nextjs
11
+
12
+ Persistence (Master + Overrides pattern):
13
+ --persist Save design system to design-system/MASTER.md
14
+ --page Also create a page-specific override file in design-system/pages/
15
+ """
16
+
17
+ import argparse
18
+ import sys
19
+ import io
20
+ from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, search, search_stack
21
+ from design_system import generate_design_system, persist_design_system
22
+
23
+ # Force UTF-8 for stdout/stderr to handle emojis on Windows (cp1252 default)
24
+ if sys.stdout.encoding and sys.stdout.encoding.lower() != 'utf-8':
25
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
26
+ if sys.stderr.encoding and sys.stderr.encoding.lower() != 'utf-8':
27
+ sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
28
+
29
+
30
+ def format_output(result):
31
+ """Format results for Claude consumption (token-optimized)"""
32
+ if "error" in result:
33
+ return f"Error: {result['error']}"
34
+
35
+ output = []
36
+ if result.get("stack"):
37
+ output.append(f"## UI Pro Max Stack Guidelines")
38
+ output.append(f"**Stack:** {result['stack']} | **Query:** {result['query']}")
39
+ else:
40
+ output.append(f"## UI Pro Max Search Results")
41
+ output.append(f"**Domain:** {result['domain']} | **Query:** {result['query']}")
42
+ output.append(f"**Source:** {result['file']} | **Found:** {result['count']} results\n")
43
+
44
+ for i, row in enumerate(result['results'], 1):
45
+ output.append(f"### Result {i}")
46
+ for key, value in row.items():
47
+ value_str = str(value)
48
+ if len(value_str) > 300:
49
+ value_str = value_str[:300] + "..."
50
+ output.append(f"- **{key}:** {value_str}")
51
+ output.append("")
52
+
53
+ return "\n".join(output)
54
+
55
+
56
+ if __name__ == "__main__":
57
+ parser = argparse.ArgumentParser(description="UI Pro Max Search")
58
+ parser.add_argument("query", help="Search query")
59
+ parser.add_argument("--domain", "-d", choices=list(CSV_CONFIG.keys()), help="Search domain")
60
+ parser.add_argument("--stack", "-s", choices=AVAILABLE_STACKS, help="Stack-specific search (html-tailwind, react, nextjs)")
61
+ parser.add_argument("--max-results", "-n", type=int, default=MAX_RESULTS, help="Max results (default: 3)")
62
+ parser.add_argument("--json", action="store_true", help="Output as JSON")
63
+ # Design system generation
64
+ parser.add_argument("--design-system", "-ds", action="store_true", help="Generate complete design system recommendation")
65
+ parser.add_argument("--project-name", "-p", type=str, default=None, help="Project name for design system output")
66
+ parser.add_argument("--format", "-f", choices=["ascii", "markdown"], default="ascii", help="Output format for design system")
67
+ # Persistence (Master + Overrides pattern)
68
+ parser.add_argument("--persist", action="store_true", help="Save design system to design-system/MASTER.md (creates hierarchical structure)")
69
+ parser.add_argument("--page", type=str, default=None, help="Create page-specific override file in design-system/pages/")
70
+ parser.add_argument("--output-dir", "-o", type=str, default=None, help="Output directory for persisted files (default: current directory)")
71
+
72
+ args = parser.parse_args()
73
+
74
+ # Design system takes priority
75
+ if args.design_system:
76
+ result = generate_design_system(
77
+ args.query,
78
+ args.project_name,
79
+ args.format,
80
+ persist=args.persist,
81
+ page=args.page,
82
+ output_dir=args.output_dir
83
+ )
84
+ print(result)
85
+
86
+ # Print persistence confirmation
87
+ if args.persist:
88
+ project_slug = args.project_name.lower().replace(' ', '-') if args.project_name else "default"
89
+ print("\n" + "=" * 60)
90
+ print(f"✅ Design system persisted to design-system/{project_slug}/")
91
+ print(f" 📄 design-system/{project_slug}/MASTER.md (Global Source of Truth)")
92
+ if args.page:
93
+ page_filename = args.page.lower().replace(' ', '-')
94
+ print(f" 📄 design-system/{project_slug}/pages/{page_filename}.md (Page Overrides)")
95
+ print("")
96
+ print(f"📖 Usage: When building a page, check design-system/{project_slug}/pages/[page].md first.")
97
+ print(f" If exists, its rules override MASTER.md. Otherwise, use MASTER.md.")
98
+ print("=" * 60)
99
+ # Stack search
100
+ elif args.stack:
101
+ result = search_stack(args.query, args.stack, args.max_results)
102
+ if args.json:
103
+ import json
104
+ print(json.dumps(result, indent=2, ensure_ascii=False))
105
+ else:
106
+ print(format_output(result))
107
+ # Domain search
108
+ else:
109
+ result = search(args.query, args.domain, args.max_results)
110
+ if args.json:
111
+ import json
112
+ print(json.dumps(result, indent=2, ensure_ascii=False))
113
+ else:
114
+ print(format_output(result))
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env python3
2
+ """Install the workflow design rule pack into a target project."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import shutil
8
+ from pathlib import Path
9
+
10
+
11
+ def copy_tree(src: Path, dst: Path, overwrite: bool, include_index: bool) -> tuple[int, int]:
12
+ copied = 0
13
+ skipped = 0
14
+
15
+ for source_file in src.rglob("*"):
16
+ if source_file.is_dir():
17
+ continue
18
+
19
+ relative = source_file.relative_to(src)
20
+ if relative == Path("index.md") and not include_index:
21
+ skipped += 1
22
+ continue
23
+ target_file = dst / relative
24
+ target_file.parent.mkdir(parents=True, exist_ok=True)
25
+
26
+ if target_file.exists() and not overwrite:
27
+ skipped += 1
28
+ continue
29
+
30
+ shutil.copy2(source_file, target_file)
31
+ copied += 1
32
+
33
+ return copied, skipped
34
+
35
+
36
+ def main() -> int:
37
+ parser = argparse.ArgumentParser(description="Install .context/spec/design rule pack")
38
+ parser.add_argument("--target", default=".", help="Target repository root, default current directory")
39
+ parser.add_argument("--overwrite", action="store_true", help="Overwrite existing target files")
40
+ parser.add_argument(
41
+ "--without-index",
42
+ action="store_true",
43
+ help="Do not copy design/index.md when the caller owns the project design index",
44
+ )
45
+ args = parser.parse_args()
46
+
47
+ skill_root = Path(__file__).resolve().parents[1]
48
+ source = skill_root / "assets" / "design"
49
+ target_root = Path(args.target).resolve()
50
+ target = target_root / ".context" / "spec" / "design"
51
+
52
+ if not source.exists():
53
+ raise SystemExit(f"Source design rule pack not found: {source}")
54
+
55
+ copied, skipped = copy_tree(source, target, args.overwrite, not args.without_index)
56
+
57
+ print(f"Installed design rule pack into: {target}")
58
+ print(f"Copied files: {copied}")
59
+ print(f"Skipped existing files: {skipped}")
60
+ if skipped and not args.overwrite:
61
+ print("Run with --overwrite to replace existing files intentionally.")
62
+
63
+ return 0
64
+
65
+
66
+ if __name__ == "__main__":
67
+ raise SystemExit(main())
@@ -0,0 +1,370 @@
1
+ ---
2
+ name: workflow-feature-breakdown
3
+ description: "Use when a requirement baseline needs a test-readable feature breakdown across style, functionality, logic, pages, components, fields, actions, and dialogs."
4
+ ---
5
+
6
+ ## Legacy Command Metadata
7
+
8
+ Original slash-command metadata retained only as workflow invocation guidance.
9
+
10
+ ```yaml
11
+ argument-hint: <功能名> [--auto]
12
+ user-invocable: true
13
+ pattern: generator+reviewer
14
+ inputs:
15
+ - .planning/requirements/baseline.md
16
+ - .planning/features/{功能名}/UI-SPEC.md
17
+ - .planning/PROJECT.md
18
+ - .planning/navigation/INDEX.md
19
+ - .planning/navigation/*.md
20
+ - .planning/milestones/
21
+ - .planning/requirements/
22
+ - .planning/lessons/README.md
23
+ output: .planning/features/{功能名}/功能点梳理.md
24
+ allowed-tools:
25
+ - Read
26
+ - Write
27
+ - Bash
28
+ - Grep
29
+ - Glob
30
+ - ask
31
+ ```
32
+
33
+ # Feature Point Expansion
34
+
35
+ This skill consumes the requirement baseline and creates a test-readable feature expansion document. Do not re-discuss requirements, generate technical plans, write code change lists, or create implementation tasks.
36
+
37
+ ## Outputs
38
+
39
+ Always create or update:
40
+
41
+ - `.planning/features/{功能名}/功能点梳理.md`
42
+ - `.planning/features/{功能名}/功能点梳理.meta.json` — structured metadata (fp_count, dimension_counts, page_count). Schema in `feature-development.yaml` under `steps[feature-breakdown].meta_output.fields`.
43
+
44
+ Do not create by default:
45
+
46
+ - `.planning/features/{功能名}/前端技术方案.md`
47
+ - `.planning/features/{功能名}/后端技术方案.md`
48
+ - `.planning/features/{功能名}/变更清单.md`
49
+ - `.planning/requirements/baseline.md`
50
+
51
+ ## Argument Handling
52
+
53
+ Parse `$ARGUMENTS` before reading files:
54
+
55
+ - `<功能名>`: optional hint. When baseline exists, always use the baseline canonical 功能名 and output directory. If `$ARGUMENTS` provides a different name, record the mismatch in pending questions and do not change the output path.
56
+ - `--auto`: do not ask for supplementary UI/interface documents. Mark missing style, enum, interface, or data-dictionary details as `待确认`.
57
+
58
+ The canonical output directory must come from the baseline when available:
59
+
60
+ ```text
61
+ .planning/features/{功能名}/
62
+ ```
63
+
64
+ Do not invent another directory name from the project name, PRD title, or module name.
65
+ If an older baseline still points to `features/{功能名}/`, treat it as a legacy path and prefer `.planning/features/{功能名}/` for new output unless the user explicitly requests legacy compatibility.
66
+
67
+ ## Resource Loading
68
+
69
+ Load bundled resources only when needed:
70
+
71
+ - Read `references/writing-guide.md` before writing the three-dimensional descriptions.
72
+ - Read `references/bug-rules.md` before expanding permissions, read-only fields, calculations, enums, and frontend/backend grouping.
73
+ - Read `references/trace-integrity-guide.md` before expanding any migration, async job, notification, list/detail page, field replacement, permission, menu, external callback, or cross-codebase feature.
74
+ - Read `skill://workflow-pipeline/references/slice-safety-guide.md` when baseline has a slice plan or the current feature has more than 8 FP.
75
+ - Read `references/exception-checklist.md` when a feature involves user flows, payment, third-party callbacks, retries, async status, or data consistency.
76
+ - Read `assets/output-template.md` before writing the final document.
77
+ - Read `assets/admin-system-template.md` for backend/admin systems.
78
+ - Read `assets/c-end-system-template.md` for consumer-facing flows.
79
+ - Read `assets/api-service-template.md` for API/service-only features.
80
+
81
+ ## Phase 1 — Load Baseline And Context
82
+
83
+ Read:
84
+
85
+ 1. `.planning/requirements/baseline.md`
86
+ 2. `.planning/PROJECT.md` if present
87
+ 3. `.planning/navigation/INDEX.md` if present
88
+ 4. `.planning/navigation/INDEX.md` — identify relevant codebases from the Codebase Registry, then load their navigation files (`{name}.md`)
89
+ 5. `.planning/code-index/` when present and the feature breakdown needs existing route/component/API/data-flow relation facts
90
+ 6. `.planning/milestones/` only when baseline historical impact references prior milestones
91
+ 7. `.planning/requirements/` and `.planning/lessons/` only when baseline historical impact or challenge review references them
92
+ 8. `.context/lessons/README.md` when present; load only lesson files whose title or summary matches current FP/BR/BC keywords
93
+
94
+ The baseline is the source of truth. Use its:
95
+
96
+ - 功能名称 and 功能名 / output directory
97
+ - 当前执行切片 `SL-*` and slice plan
98
+ - 当前功能切片中的 Feature points `FP-*`
99
+ - 当前功能切片中的 Business rules `BR-*`
100
+ - 当前功能切片中的 Boundary cases `BC-*`
101
+ - `depends_on` 引用的历史 FP/BR/BC 详情(作为上下文、复用、兼容和约束来源,不默认展开为本轮范围)
102
+ - Pending questions
103
+ - Challenge review results and user decisions under `反向审视与用户拍板`
104
+ - Scope control
105
+ - Clarification and change log
106
+ - Downstream input contract
107
+
108
+ If baseline is missing, ask the user to run `workflow-requirement-baseline` first or provide an existing baseline path. Do not fall back to raw PRD parsing unless the user explicitly asks for it.
109
+
110
+ Baseline section mapping:
111
+
112
+ - `需求来源` -> source summary and canonical output directory.
113
+ - `需求整理摘要` -> system shape and page/module grouping.
114
+ - `当前功能切片` -> current scope. Expand only this section's current FP/BR/BC IDs.
115
+ - `当前功能切片.跨功能依赖` -> `depends_on` historical context. Load referenced historical FP/BR/BC details, but do not generate standalone nodes for them unless the current slice explicitly modifies or impacts them.
116
+ - `功能点拆解` and `功能点详情` -> lookup table for current slice and `depends_on` details.
117
+ - `业务规则汇总` -> `逻辑` dimension only for current slice or referenced `depends_on` constraints.
118
+ - `边界场景汇总` -> `功能` dimension exception and boundary handling for current slice or referenced `depends_on` constraints.
119
+ - `代码现实对照` -> reuse/conflict/current-behavior context. Do not convert it into implementation tasks.
120
+ - `与历史功能/里程碑的关联` -> compatibility, legacy behavior, milestone evidence, and affected-module notes.
121
+ - `反向审视与用户拍板` -> confirmed conflict/reuse/priority/alternative decisions; pending decisions must not become confirmed UI or service nodes.
122
+ - `下游输入契约` -> output directory and downstream consistency checks.
123
+ - `待确认事项` -> pending questions; never treat as confirmed behavior.
124
+ - `澄清与变更记录` -> source notes when an answer changed earlier requirements.
125
+ - `范围控制` -> do not generate nodes for excluded or deferred scope.
126
+
127
+ History model rule:
128
+
129
+ - Use `.planning/milestones/`, `.planning/requirements/`, `.planning/lessons/`, and phase `CONTEXT.md` as primary history.
130
+ - Treat `features/` or `.context/lessons/` as optional legacy/project-rule sources only when present and referenced by the baseline.
131
+ - Treat matching `.context/lessons/` files as regression guards for review. They do not expand scope by themselves, but any current FP touching the same seam must carry the lesson as a constraint or explain why it is not applicable.
132
+
133
+ Current slice rule:
134
+
135
+ - If `当前功能切片` exists, it is the only default expansion scope.
136
+ - If `当前功能切片` contains a slice plan, expand only `3.0a 当前执行切片范围`. Deferred slices are context only and must appear in the "不纳入/暂不处理" table.
137
+ - If the baseline is an older format without `当前功能切片`, derive scope from the canonical feature name/output directory and record the fallback in pending notes.
138
+ - Never expand all historical FP/BR/BC merely because they are present in the cumulative baseline.
139
+ - FP type must remain `新增` / `修改` / `影响`. Do not turn BR or BC rows into FP rows.
140
+
141
+ ## Phase 2 — Determine System Shape
142
+
143
+ Classify each feature point into one or more output sections:
144
+
145
+ - `后台`: admin, operation, management, configuration, review, data list, export, permission, audit, or internal workflow
146
+ - `C端`: consumer page, user journey, mobile/web user flow, payment, registration, result page, or external-facing interaction
147
+ - `API/服务`: non-UI capability. Include only when the requirement has no user-facing component; describe trigger, input/output, rule, status, and exception behavior instead of UI style.
148
+
149
+ Only include sections that apply. Delete unused `后台`, `C端`, or `API/服务` sections from the final document, or mark them `不适用`; never leave template placeholders in unused sections.
150
+
151
+ When a feature spans frontend and backend, place user-visible controls under `后台` or `C端`, and include backend-only logic in the component `逻辑` section only when the baseline explicitly supports it.
152
+
153
+ ## Phase 3 — Build Critical Trace Skeleton
154
+
155
+ Before detailed three-dimensional expansion, create a concise trace skeleton for each current-slice FP. Keep it short; this section exists to prevent long leaf-node output from hiding broken chains.
156
+
157
+ For every FP, record:
158
+
159
+ - User/business outcome
160
+ - Actor or system trigger
161
+ - Entry point or caller
162
+ - Write model / state changed
163
+ - Read model / downstream consumer
164
+ - State transition or side effect
165
+ - Primary exception/idempotency rule
166
+ - Affected codebases
167
+ - Test anchor
168
+
169
+ Use `references/trace-integrity-guide.md` to add a chain matrix for high-risk FPs:
170
+
171
+ - Migration from an old system
172
+ - Async job, scheduled task, callback, polling, or external platform side effect
173
+ - Notification, message center, homepage entry, or menu route
174
+ - Field/source replacement such as old field -> new field
175
+ - List/detail page migration with old entry parameters
176
+ - Permission or visibility rule
177
+ - Cross-codebase contract between backend, admin frontend, and mobile app
178
+
179
+ Rules:
180
+
181
+ - If a high-risk FP cannot produce a complete chain matrix from baseline and code reality, mark the missing seam as `阻塞待确认` or `接口/数据待确认`; do not bury it in fine-grained UI nodes.
182
+ - Do not expand broad placeholder modules into detailed CRUD nodes unless baseline explicitly confirms they are in this slice. Keep them as `范围占位` with source and downstream owner.
183
+ - For “整体迁移” scope, identify old runtime seams that must disappear and true external-platform seams that may remain.
184
+ - Preserve the active `SL-*` on trace cards and nodes. If a node belongs to a deferred slice, remove it from implementation scope and list it under out-of-scope/deferred.
185
+
186
+ ## Phase 3.5 — Expand Into Testable Nodes
187
+
188
+ For each current-slice `FP-*`, expand from feature capability into the smallest testable UI or behavior nodes.
189
+
190
+ Before writing nodes, use the examples in `references/writing-guide.md` as the required splitting pattern. In particular, apply its examples for:
191
+
192
+ - filter areas: split every input, selector, date range, and action button into separate nodes
193
+ - tables: split table-level behavior, every visible column, and every operation button
194
+ - dialogs/forms: split dialog shell, every field, and every confirm/cancel/action button
195
+ - buttons: give each button its own style and function nodes
196
+
197
+ Use this hierarchy when applicable:
198
+
199
+ ```text
200
+ # {功能名称}
201
+ - 后台 / C端 / API/服务
202
+ - 页面或模块
203
+ - 页面区域
204
+ - 组件/字段/按钮/表格列/弹窗/流程节点
205
+ - 样式
206
+ - 功能
207
+ - 逻辑(可选)
208
+ ```
209
+
210
+ Expansion rules:
211
+
212
+ - Keep the original `FP-*`, `BR-*`, and `BC-*` references on relevant nodes by appending IDs to the node title, e.g. `按钮:确定 (FP-001/BR-002)`. Do not add a separate child line like `来源:FP-001`, because that pollutes the Xmind tree.
213
+ - Keep related `CR-*` references when a node exists because of a conflict, reuse, over-engineering, history, or alternative-path decision.
214
+ - Split filters into individual inputs, selectors, date ranges, and action buttons.
215
+ - Split tables into table-level behavior, each visible column, and each operation button.
216
+ - Split forms and dialogs into dialog shell, every field, and every action button.
217
+ - Split consumer flows into entry, authorization, core action path, result states, cancellation, timeout, retry, and failure states when applicable.
218
+ - For API/service-only requirements, split by trigger, input validation, rule execution, state change, output, idempotency, retry, and failure handling.
219
+ - Do not aggregate lists of fields into one node when each field has different display, validation, source, or logic.
220
+ - Preserve the Phase 3 trace skeleton while expanding nodes. If a leaf node contradicts or skips a skeleton seam, fix the skeleton or mark the gap before continuing.
221
+
222
+ ## Phase 4 — Write Three Dimensions
223
+
224
+ Every leaf node must include:
225
+
226
+ - `样式`: visible text, position, component type, display format, empty state, read-only display, or `UI待确认`
227
+ - `功能`: user action, system response, validation, permission behavior, loading state, duplicate submission handling, exception handling
228
+ - `逻辑`: only when baseline provides business rules, calculations, status mappings, data sources, compatibility, or state transitions
229
+
230
+ Rules:
231
+
232
+ - Follow `references/writing-guide.md` examples for how to phrase style/function/logic under each component. If a generated node aggregates multiple fields, columns, or buttons into one description, split it before continuing.
233
+ - Unauthorized operation buttons are not displayed, unless baseline explicitly says otherwise.
234
+ - Fields are read-only unless baseline explicitly says they are editable.
235
+ - Calculations, amount signs, statistics, status transitions, and compatibility rules must cite baseline source. If missing, mark `待确认`.
236
+ - Dropdowns and status options must list concrete enum values. If missing, mark `枚举待确认`.
237
+ - Do not create business rules from UI guesses.
238
+
239
+ ## Phase 4.5 — 信息精简检查
240
+
241
+ 目标的:在进入 gap 处理之前,对已经展开的三维节点做一轮"必须性"检查,减少不必要的信息噪声。
242
+
243
+ 对着每个叶节点的 `样式` 和 `功能` 中的每项信息,问自己:
244
+
245
+ | 检查 | 条件 | 处理 |
246
+ |------|------|------|
247
+ | 这个信息用户需要吗? | 用户看到它时能据此决策或行动吗? | 否→标记为"冗余,建议删除" |
248
+ | 去掉影响决策吗? | 如果去掉,用户能否完成核心任务? | 不影响→标记为"非必要,建议移除" |
249
+ | 能不能合并? | 两个信息项内容相近或同时出现? | 是→建议合并为一项 |
250
+ | 是不是后台技术细节? | 字段值/状态/日志等对用户无意义的信息 | 是→标记为"仅内部可见" |
251
+
252
+ 只对**面向用户展示的节点**做此检查(后台 / C 端的页面、组件、字段、列),不对 API/服务类的输出做此检查。
253
+
254
+ 如果发现可精简的项,在展开节点中标注 `精简建议: [删除/合并/降级]` 和原因。不直接删减,让下游(PM 或用户)拍板。
255
+
256
+ ## Phase 5 — Handle Gaps
257
+
258
+ This skill should not restart workflow-requirement-baseline work.
259
+
260
+ Ask only when a gap blocks a useful feature expansion, and ask one question at a time. After each user answer:
261
+
262
+ 1. Check whether the answer changes the baseline assumptions, feature points, rules, boundary cases, scope, or output directory.
263
+ 2. If it changes baseline-level requirements, stop and tell the user the baseline should be updated by `workflow-requirement-baseline` before continuing.
264
+ 3. If it only adds presentation detail for this document, apply it and record it in the feature expansion notes.
265
+
266
+ In `--auto` mode, do not ask. Mark gaps as `待确认` in the output.
267
+
268
+ Pending classification:
269
+
270
+ - `阻塞待确认`: cannot produce a useful feature expansion without this answer.
271
+ - `非阻塞待确认`: document can be generated, but downstream technical docs or tests need confirmation.
272
+ - `UI待确认`: affects only visual layout, wording, or component choice.
273
+ - `枚举待确认`: affects dropdown/status values or validation test cases.
274
+ - `接口/数据待确认`: affects field source, API response, persistence, or data dictionary.
275
+
276
+ If stopping because a user answer changes baseline-level requirements, report:
277
+
278
+ - Source question and answer summary
279
+ - Affected `FP-*`, `BR-*`, `BC-*`, scope item, or output directory
280
+ - Why the baseline must be updated first
281
+ - Recommended next action: rerun or resume `workflow-requirement-baseline`
282
+
283
+ ## Phase 6 — Generate Document
284
+
285
+ Read `assets/output-template.md`.
286
+
287
+ Create `.planning/features/{功能名}/` if needed and write `.planning/features/{功能名}/功能点梳理.md`.
288
+
289
+ The document must include:
290
+
291
+ 1. Source summary: baseline path, feature name, output directory, generation date
292
+ 2. Scope summary: active Slice ID, included FP/BR/BC IDs, and excluded/deferred items
293
+ 3. Three-dimensional hierarchy by `后台`, `C端`, and/or `API/服务`
294
+ 4. Critical trace skeleton and high-risk chain matrices
295
+ 5. Pending UI/interface/data questions
296
+ 6. Traceability table mapping output sections back to FP/BR/BC IDs
297
+ 7. Challenge decision traceability mapping output sections back to confirmed `CR-*` decisions
298
+ 8. Trace-integrity review result
299
+ 9. Self-review result
300
+
301
+ ## Phase 7 — Review Gate (MANDATORY — do not skip)
302
+
303
+ **审查方法论:baseline → 功能点梳理的展开审查,沿用 spec-writer 反问 + 反向对照模式。**
304
+
305
+ ### 7.1 反问审查(覆盖完整性)
306
+
307
+ 对当前功能切片的每个 FP 自查,发现缺失时回查 baseline 或标记为待确认:
308
+
309
+ - 这个 FP 的三维展开(样式/功能/逻辑)是否完整?
310
+ - 涉及的页面、组件、字段、按钮、列、弹窗是否均已列明?
311
+ - 权限/状态/校验/计算是否均来自 baseline 规则,未捏造假设?
312
+
313
+ ### 7.2 反向对照审查(代码库对照)
314
+
315
+ 用 4 个嗅探检查展开后功能点与现有代码的关系:
316
+
317
+ | 嗅探 | 检查 |
318
+ |------|------|
319
+ | 复用嗅探 | 梳理中涉及的页面/组件/接口,是否已有现成实现可复用? |
320
+ | 冲突嗅探 | 新增的页面路由、API 路径、组件命名是否与现有约定冲突? |
321
+ | 重叠嗅探 | 梳理的功能是否会与某个已有功能形成"两套并存"? |
322
+ | 历史嗅探 | `features/` 中是否有类似功能曾被做过? |
323
+
324
+ 若 `.planning/code-index/` 存在,复用/冲突/重叠嗅探应优先查询 symbols/relations,再回读源码 evidence;缺失或过期时再用 navigation 和 `rg` 兜底。
325
+
326
+ ### 7.2a 链路完整性审查(MANDATORY)
327
+
328
+ Read `references/trace-integrity-guide.md` and run the applicable chain gates. At minimum, check:
329
+
330
+ - 写入点与读取点是否闭合:通知、消息、列表、卡片、详情使用同一真实数据流。
331
+ - 调用方矩阵是否完整:字段/契约替换覆盖所有旧入口、新入口、校验、DTO、落库、执行链路。
332
+ - 异步链路是否闭合:入口、命令、注册、数据库 seed、执行频率、运行状态、监控字段均有验收锚点。
333
+ - 迁移链路是否闭合:旧系统页面入口参数、数据主表、操作列、运行时依赖移除均已写清。
334
+ - 记录/任务/计划概念是否分清:平台作业记录和 CRM 业务记录不能混表。
335
+ - 权限/菜单是否可达:页面文件、动态菜单/权限、首页或消息直达入口、本地或灰度兜底均有处理。
336
+ - 外部调用是否幂等:重复回调、重复轮询、重复分析不会清空已有字段或重复消耗外部资源。
337
+
338
+ If a gate applies but the output lacks a corresponding node, pending question, or out-of-scope statement, the review must fail.
339
+
340
+ ### 7.3 产物完整性检查
341
+
342
+ ```markdown
343
+ - [ ] 每个当前切片 FP 均已展开或标记 out-of-scope
344
+ - [ ] 当前 Slice ID 已写入范围摘要、链路骨架和追溯表
345
+ - [ ] 未展开后置切片实现范围
346
+ - [ ] 与 baseline 分片覆盖守恒一致:active FP 全部展开;deferred/out-of-scope FP 全部列入不纳入/暂不处理;无未解释缺口
347
+ - [ ] 每个叶子节点有 样式 + 功能(逻辑仅在有规则/数据源时出现)
348
+ - [ ] 权限使用 `不显示`(非删除/禁用),只读/可编辑不捏造
349
+ - [ ] 下拉/状态值具体或标记待确认,计算/统计引用来源
350
+ - [ ] 前后端/C端分组符合 baseline
351
+ - [ ] 高风险 FP 已生成关键链路骨架和适用链路矩阵
352
+ - [ ] 写入点/读取点、调用方矩阵、异步 seed、迁移运行时、记录模型、权限菜单、外部幂等等适用门禁已检查
353
+ - [ ] 不存在 `阻塞待确认`
354
+ - [ ] 不含技术方案、DDL、接口设计、代码任务
355
+ ```
356
+
357
+ ### 7.4 审查结论
358
+
359
+ 在 `功能点梳理.md` 末尾写入审查结论(通过 / 不通过 + 未通过项)。
360
+
361
+ 审查结论必须为 `不通过` when:
362
+
363
+ - Any `阻塞待确认` remains.
364
+ - Any current-slice FP is not expanded and not explicitly out of scope.
365
+ - Any leaf node lacks `样式` or `功能`.
366
+ - A node writes unconfirmed BR/BC/pending information as fact.
367
+ - Any applicable trace-integrity gate has no output node, pending item, or explicit non-applicable reason.
368
+ - Slice coverage does not balance against baseline active/deferred/out-of-scope counts.
369
+
370
+ **Do not report "Step 3a complete" to the pipeline until 审查结论 = 通过.**
@@ -0,0 +1,57 @@
1
+ # 后台系统层级模板
2
+
3
+ ```
4
+ # 项目名称
5
+ - 后台
6
+ - 一级菜单
7
+ - 二级菜单(页面)
8
+ - 页面头部
9
+ - 标题文案
10
+ - 新增按钮
11
+ - 样式
12
+ - 功能
13
+ - 逻辑(可选)
14
+ - 导出按钮
15
+ - 样式
16
+ - 功能
17
+ - 逻辑(可选)
18
+ - 筛选区
19
+ - 筛选条件组
20
+ - 字段A输入框
21
+ - 样式
22
+ - 功能
23
+ - 逻辑(可选)
24
+ - 字段B下拉选择
25
+ - 样式
26
+ - 功能
27
+ - 逻辑(可选)
28
+ - 操作按钮组
29
+ - 查询按钮
30
+ - 重置按钮
31
+ - 数据汇总区(可选)
32
+ - 汇总指标A
33
+ - 样式
34
+ - 功能
35
+ - 逻辑
36
+ - 列表区(表格)
37
+ - 表格整体
38
+ - 样式
39
+ - 功能
40
+ - 列:字段A
41
+ - 样式
42
+ - 功能
43
+ - 逻辑(可选)
44
+ - 列:字段B
45
+ - 样式
46
+ - 功能
47
+ - 逻辑(可选)
48
+ - 列:操作
49
+ - 编辑按钮
50
+ - 删除按钮
51
+ - 新增/编辑弹窗
52
+ - 弹窗整体
53
+ - 表单字段:字段A
54
+ - 表单字段:字段B
55
+ - 按钮:确定
56
+ - 按钮:取消
57
+ ```
@@ -0,0 +1,42 @@
1
+ # API/服务能力层级模板
2
+
3
+ ```text
4
+ # 项目名称
5
+ - API/服务
6
+ - 服务能力或任务名称
7
+ - 触发方式
8
+ - 样式
9
+ - 不适用:非 UI 能力
10
+ - 功能
11
+ - 说明由接口调用、定时任务、消息、回调或人工触发
12
+ - 逻辑
13
+ - 触发条件来自 baseline 对应 FP/BR
14
+ - 输入与校验
15
+ - 样式
16
+ - 不适用:非 UI 能力
17
+ - 功能
18
+ - 校验必填、格式、权限、重复请求、非法状态
19
+ - 逻辑
20
+ - 字段来源、枚举值、校验规则
21
+ - 处理规则
22
+ - 样式
23
+ - 不适用:非 UI 能力
24
+ - 功能
25
+ - 执行业务规则并返回处理结果
26
+ - 逻辑
27
+ - 计算、状态流转、兼容旧数据、幂等规则
28
+ - 输出与状态
29
+ - 样式
30
+ - 不适用:非 UI 能力
31
+ - 功能
32
+ - 返回成功、失败、部分成功、处理中等结果
33
+ - 逻辑
34
+ - 状态映射、数据落库、事件发布
35
+ - 异常与重试
36
+ - 样式
37
+ - 不适用:非 UI 能力
38
+ - 功能
39
+ - 超时、回调失败、第三方失败、重试、补偿、告警
40
+ - 逻辑
41
+ - 重试次数、幂等键、补偿条件;无来源则标记待确认
42
+ ```
@@ -0,0 +1,25 @@
1
+ # C端系统层级模板
2
+
3
+ ```
4
+ # 项目名称
5
+ - C端
6
+ - 页面名称
7
+ - 页面头部
8
+ - 标题区
9
+ - 返回按钮
10
+ - 内容区
11
+ - 功能模块A
12
+ - UI组件1
13
+ - 样式
14
+ - 功能
15
+ - 逻辑(可选)
16
+ - UI组件2
17
+ - 样式
18
+ - 功能
19
+ - 逻辑(可选)
20
+ - 底部操作区
21
+ - 提交按钮
22
+ - 样式
23
+ - 功能
24
+ - 逻辑(可选)
25
+ ```