@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,57 @@
1
+ # ADR-{序号}: {决策主题}
2
+
3
+ ## 状态
4
+
5
+ [已确认 / 待定 / 已废弃]
6
+
7
+ ## 上下文
8
+
9
+ {当时面临的问题和约束。描述你试图解决的问题,以及什么因素限制了你。
10
+
11
+ 示例:
12
+ > 订单审批功能需要在现有 OrderService 上扩展。但 OrderService 当前有 3 个调用方(订单创建、退款处理、批量查询),每个调用方依赖不同的方法。如果在 OrderService 上新增 approval 方法,会使其接口膨胀到 12 个公开方法,且 approval 逻辑与现有方法无共享代码。}
13
+
14
+ ## 被否决的方案
15
+
16
+ {列出至少一个认真考虑过的替代方案,以及为什么被否决。
17
+
18
+ 示例:
19
+ > **方案 B:扩展 OrderService**
20
+ > - 在 OrderService 上新增 `ProcessApproval()` 方法
21
+ > - 优点:代码复用(跟 Order 相关的逻辑在一起)
22
+ > - 缺点:OrderService 的公开方法从 9 个增加到 12 个,接口变得更浅
23
+ > - Deletion Test 失败:删除 OrderService 时,approval 逻辑不会消失,而是分散到各调用方
24
+ > - 现有 3 个调用方理论上依赖整个 OrderService,修改风险增加}
25
+
26
+ ## 决策
27
+
28
+ {最终选择的方案及理由。
29
+
30
+ 示例:
31
+ > **方案 A:新建 OrderWorkflow 模块**
32
+ > - 新建 `internal/workflow/order_workflow.go`
33
+ > - 只暴露一个入口:`Process(orderId string, action Action) (OrderStatus, error)`
34
+ > - 内部封装:权限校验 → 状态机转换 → 通知 → 审计日志
35
+ > - 理由:符合 Deep Module 原则(小接口大实现),调用方只需要知道一个方法}
36
+
37
+ ## 后果
38
+
39
+ {列出这个决策的正面和负面后果。
40
+
41
+ 示例:
42
+ > - 正面:OrderService 保持稳定,新增功能不影响现有调用方
43
+ > - 负面:多一个模块,增加项目复杂度
44
+ > - 兼容性:无影响。旧功能继续使用 OrderService,新功能使用 OrderWorkflow
45
+ > - 迁移路径:后续可考虑将 OrderService 中与状态机相关的逻辑逐步迁移到 OrderWorkflow}
46
+
47
+ ---
48
+
49
+ ## ADR 创建检查清单
50
+
51
+ 创建前确认:
52
+
53
+ - [ ] **难逆转**:改主意代价大(是 → 才需要 ADR)
54
+ - [ ] **无上下文会困惑**:后人会问"为什么"(是 → 才需要 ADR)
55
+ - [ ] **有真实权衡**:存在替代方案(是 → 才需要 ADR)
56
+
57
+ 不满足任意一条 → 不要创建 ADR,把决策直接写在方案文档中即可。
@@ -0,0 +1,205 @@
1
+ # 后端技术方案:{{功能名称}}
2
+
3
+ ## 一、功能概述
4
+
5
+ {{简要描述功能目的和业务背景,2-3 句话}}
6
+
7
+ ### 1.1 当前执行切片
8
+
9
+ - **Slice ID**:{{SL-001}}
10
+ - **切片名称**:{{切片名称}}
11
+ - **纳入范围**:{{FP/BR/BC 列表}}
12
+ - **后置范围**:{{SL-002 等,仅作上下文}}
13
+ - **切片门禁**:{{本切片通过标准}}
14
+
15
+ ## 二、功能要点
16
+
17
+ 1. **功能点1**:描述
18
+ 2. **功能点2**:描述
19
+ 3. **功能点3**:描述
20
+
21
+ ## 三、需求基线衔接
22
+
23
+ ### 3.1 需求来源与功能点映射
24
+
25
+ | 基线对象 | 名称/摘要 | 后端处理方式 |
26
+ |----------|-----------|--------------|
27
+ | FP-001 | {{功能点名称}} | {{新增/修改/影响/不涉及后端}} |
28
+ | BR-001 | {{业务规则}} | {{后端规则承接方式}} |
29
+ | BC-001 | {{边界场景}} | {{后端边界承接方式}} |
30
+
31
+ ### 3.2 反向审视与用户拍板承接
32
+
33
+ | CR ID | 维度 | 用户决策/状态 | 对后端方案的影响 |
34
+ |-------|------|---------------|------------------|
35
+ | CR-001 | {{冲突/复用/历史/过度工程/替代方案}} | {{已确认/待确认/不适用}} | {{方案如何承接;待确认则说明阻塞点}} |
36
+
37
+ ### 3.3 历史/里程碑依据
38
+
39
+ | 来源 | 结论 | 对本方案的影响 |
40
+ |------|------|----------------|
41
+ | `.planning/milestones/...` | {{结论}} | {{影响}} |
42
+ | `.planning/requirements/...` | {{结论}} | {{影响}} |
43
+ | `.planning/lessons/...` | {{结论}} | {{影响}} |
44
+
45
+ ## 四、现有功能说明
46
+
47
+ ### 4.1 {{现有功能A}}流程(现状)
48
+
49
+ ```mermaid
50
+ flowchart TD
51
+ A[步骤1] --> B[步骤2]
52
+ B --> C[步骤3]
53
+ ```
54
+
55
+ **现有字段/配置说明:**
56
+ | 字段/配置 | 类型 | 说明 |
57
+ |-----------|------|------|
58
+ | field_a | string | 现有字段说明 |
59
+
60
+ **现有逻辑说明:**
61
+ - 如有 SQL,展示关键 SQL
62
+ - 如有 Job,说明调度频率
63
+ - 如有枚举值,列出现有枚举
64
+
65
+ ### 4.2 {{现有功能B}}(现状)
66
+
67
+ {{如有多个被影响的现有功能,分小节描述}}
68
+
69
+ ## 五、新增功能流程
70
+
71
+ ### 5.1 {{新功能A}}流程
72
+
73
+ ```mermaid
74
+ flowchart TD
75
+ A[开始] --> B{判断条件}
76
+ B -->|是| C[处理1]
77
+ B -->|否| D[处理2]
78
+ ```
79
+
80
+ ### 5.2 {{新功能B}}流程(如涉及对现有功能的扩展)
81
+
82
+ ```mermaid
83
+ flowchart TD
84
+ subgraph 数据采集
85
+ A1[原有数据] --> C[数据表]
86
+ A2[新增数据] --> C
87
+ end
88
+ subgraph 处理逻辑
89
+ D[Job/Service] --> E[处理]
90
+ E --> F[输出]
91
+ end
92
+ ```
93
+
94
+ ## 六、影响范围
95
+
96
+ ### 6.1 受影响的现有功能
97
+
98
+ | 功能模块 | 影响点 | 影响程度 |
99
+ |----------|--------|----------|
100
+ | 功能A | 需要新增字段/修改逻辑 | 高/中/低 |
101
+
102
+ ### 6.2 受影响的代码层级
103
+
104
+ | 层级 | 文件 | 影响点 |
105
+ |------|------|--------|
106
+ | {{领域/模型/服务/持久化/接口/任务/集成/配置/其他}} | {{项目实际路径}} | {{新增/修改/影响点}} |
107
+
108
+ ### 6.3 受影响的接口
109
+
110
+ | 接口 | 方法 | 影响点 |
111
+ |------|------|--------|
112
+ | /api/xxx | GET | 响应新增字段 |
113
+ | /api/yyy | POST | 请求新增参数 |
114
+
115
+ ## 七、库表设计
116
+
117
+ ### 7.1 新增表
118
+
119
+ ```sql
120
+ CREATE TABLE `表名` (
121
+ `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
122
+ `字段1` varchar(64) NOT NULL DEFAULT '' COMMENT '说明',
123
+ `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
124
+ `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
125
+ PRIMARY KEY (`id`),
126
+ KEY `idx_字段1` (`字段1`)
127
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='表说明';
128
+ ```
129
+
130
+ ### 7.2 表变更
131
+
132
+ ```sql
133
+ ALTER TABLE `表名` ADD COLUMN `新字段` int NOT NULL DEFAULT 0 COMMENT '说明';
134
+ ```
135
+
136
+ ### 7.3 ER 关系图
137
+
138
+ ```mermaid
139
+ erDiagram
140
+ TABLE_A ||--o{ TABLE_B : "1对多关系说明"
141
+ TABLE_A {
142
+ bigint id PK
143
+ varchar name
144
+ }
145
+ TABLE_B {
146
+ bigint id PK
147
+ bigint table_a_id FK
148
+ int status
149
+ }
150
+ ```
151
+
152
+ ## 八、风险点
153
+
154
+ | 风险点 | 说明 | 应对措施 |
155
+ |--------|------|----------|
156
+ | 数据迁移 | 现有数据需要处理 | 编写迁移脚本,分批执行 |
157
+ | 性能影响 | 新增查询可能影响 | 添加索引,控制查询范围 |
158
+ | 兼容性 | 老版本客户端 | 接口保持向后兼容 |
159
+
160
+ ## 九、后端规范影响
161
+
162
+ ### 9.1 已读取规则来源
163
+
164
+ | 规则来源 | 是否存在 | 影响说明 |
165
+ |----------|----------|----------|
166
+ | `.planning/rules/INDEX.md` | {{是/否}} | {{说明}} |
167
+ | `.planning/execution-contract.md` | {{是/否}} | {{说明}} |
168
+ | `.planning/toolchain.md` | {{是/否}} | {{说明}} |
169
+ | `.planning/lessons/README.md` | {{是/否}} | {{说明}} |
170
+ | `.context/spec/backend/index.md` | {{是/否}} | {{说明}} |
171
+ | `.context/workflow/` | {{是/否}} | {{说明}} |
172
+ | `.context/lessons/README.md` | {{是/否}} | {{说明}} |
173
+ | `AGENTS.md` / `CLAUDE.md` | {{是/否}} | {{说明}} |
174
+
175
+ ### 9.2 适用规范
176
+
177
+ | 层级/场景 | 适用规范 | 对本功能的约束 |
178
+ |-----------|----------|----------------|
179
+ | {{Domain/DAO/Repository/Service/Handler/Job/其他}} | {{规范文件或章节}} | {{命名/签名/错误/日志/事务/分页/权限等约束}} |
180
+
181
+ ### 9.3 相关经验教训
182
+
183
+ | 教训ID/来源 | 内容摘要 | 本功能规避方式 |
184
+ |-------------|----------|----------------|
185
+ | {{L001/文档路径}} | {{摘要}} | {{如何避免}} |
186
+
187
+ ### 9.4 工具链与生成物
188
+
189
+ | 类型 | 命令/生成物 | 触发条件 |
190
+ |------|-------------|----------|
191
+ | {{mock/codegen/di/build/test/migration}} | {{命令或文件}} | {{何时执行}} |
192
+
193
+ ### 9.5 测试与审查门禁
194
+
195
+ | 门禁 | 要求 | 通过标准 |
196
+ |------|------|----------|
197
+ | 单元测试 | {{要求}} | {{通过标准}} |
198
+ | 集成测试 | {{要求}} | {{通过标准}} |
199
+ | 构建检查 | {{要求}} | {{通过标准}} |
200
+ | 规范审查 | {{要求}} | {{通过标准}} |
201
+
202
+ ## 十、待确认事项
203
+
204
+ 1. [ ] 问题1
205
+ 2. [ ] 问题2
@@ -0,0 +1,59 @@
1
+ # 被影响方探索指引
2
+
3
+ 在完成主功能方(需求直接对应的模块)的代码探索后,**必须**对需求基线中"关联历史功能/模块"表格(baseline 第8.2节)列出的每个受影响模块,执行以下探索。探索产出直接填入输出文档的"现有功能说明"(第四章)和"影响范围"(第六章)章节。
4
+
5
+ ## 核心原则
6
+
7
+ - **先读懂现状,再分析影响**:不读代码就写"影响点"是在猜,不是在分析。
8
+ - **被影响方和主功能方同等重要**:支付服务、外部回调、已有抽奖服务等被影响方的代码必须和盲盒模块一样被完整阅读。
9
+ - **探索产出必须来自代码**:现状流程图、字段表、方法签名必须来自实际读取的文件。
10
+
11
+ ## 探索清单
12
+
13
+ 对于 baseline 8.2 节列出的每个关联历史模块,按以下步骤执行:
14
+
15
+ ### 步骤1:定位关键文件
16
+
17
+ 优先使用 `.planning/code-index/` 定位候选 symbol、entrypoint、calls、reads/writes 和 tested_by 关系;然后回读 `evidence_path:evidence_line` 附近源码。code-index 不存在或过期时,再按下表的目录约定和 `rg` 兜底。
18
+
19
+ | 层级 | 定位方式 | 最少读取 |
20
+ |------|----------|----------|
21
+ | Domain | 按模块名搜索 `internal/domain/{module}.go` 或相关命名 | 结构体定义、枚举常量、接口定义 |
22
+ | DAO Model | `internal/repository/dao/model/{module}.go` | 表结构体、字段 tag、TableName |
23
+ | Service | `internal/service/{module}_svc.go` | **完整读完 Interface 定义**(所有方法签名) |
24
+ | Repository | `internal/repository/{module}_repo.go` | Interface 定义和构造函数 |
25
+ | Handler | `internal/web/{module}_handler.go` | 路由注册部分(RegisterRoutes)和构造函数 |
26
+ | 外部集成 | `pkg/{client}/` 或 `ioc/{client}.go` | 客户端构造函数、可用方法 |
27
+ | DI 装配 | `wire.go` 中的对应 wire.Set | 已注册的依赖链 |
28
+
29
+ **底线**:每个被影响模块至少读取 3 个文件(核心模型/领域对象 + 服务/用例接口或实现 + 入口层),不能仅靠 baseline、navigation 或 code-index 摘要推断。
30
+
31
+ ### 步骤2:回答三个问题
32
+
33
+ | 问题 | 产出 | 填入模板章节 |
34
+ |------|------|-------------|
35
+ | 现有流程是什么? | mermaid 流程图(描述当前行为,不是新行为) | 第四章"现有功能说明" |
36
+ | 现有字段/方法/枚举有哪些? | 表格列出关键字段名、类型、含义 | 第四章"现有功能说明" |
37
+ | 集成点在哪里? | 列出现有接口路径、注册的回调路由、依赖注入链 | 第六章"影响范围" |
38
+
39
+ ### 步骤3:判断复用/扩展/新增边界
40
+
41
+ 对每个被影响模块,明确以下决策并记录:
42
+
43
+ | 决策类型 | 说明 | 示例 |
44
+ |----------|------|------|
45
+ | 可复用 | 现有方法/字段/接口可直接用或仅需传新参数 | 复用现有 `ExecuteDrawLotteryTransaction` 事务方法 |
46
+ | 需扩展 | 现有方法签名不变,但内部需要新增分支/字段 | `BlindBoxPlan` 新增字段,但 CreatePlan 流程不变 |
47
+ | 需新增 | 现有模块没有对应能力,需要新建方法/文件 | 新增 `BlindBoxPayOrderRepository` 接口和实现 |
48
+ | 需修改规则 | 现有校验/约束需要放宽或调整 | 移除组织时间冲突校验 |
49
+
50
+ ## 探索产出检查(Phase 2 完成前必须全部通过)
51
+
52
+ - [ ] 是否对 baseline 8.2 节列出的**每个**关联模块都执行了步骤1~3?
53
+ - [ ] 是否至少有一张基于现有代码绘制的现状流程图?
54
+ - [ ] 是否有现有字段/方法/枚举的结构化表格(不是从 PRD 复制)?
55
+ - [ ] 是否明确了每个模块是"复用"、"扩展"还是"新增"?
56
+ - [ ] 是否实际读取了代码文件(不是仅靠文件名推断)?
57
+ - [ ] 若 `.planning/code-index/` 存在,是否记录了用于定位的 symbol/relation evidence?
58
+
59
+ **此检查不通过,不得进入 Phase 3(生成文档)。**
@@ -0,0 +1,30 @@
1
+ # 后端技术方案编写规范
2
+
3
+ ## 模板结构要求
4
+
5
+ 每次生成必须包含以下章节:
6
+ 1. 功能概述
7
+ 2. 功能要点
8
+ 3. 需求基线衔接
9
+ 4. 现有功能说明(影响分析)
10
+ 5. 新增功能流程
11
+ 6. 影响范围(项目实际层级 + 接口/消费者)
12
+ 7. 库表设计(仅当涉及数据持久化)
13
+ 8. 风险点
14
+ 9. 后端规范影响
15
+ 10. 待确认事项
16
+
17
+ ## 描述规则
18
+
19
+ - 代码文件路径使用相对于项目根目录的路径
20
+ - 表名、接口路径、枚举、错误码等命名以项目规则包为准;缺少项目规则时采用保守、可读、兼容的命名
21
+ - 流程图使用 Mermaid 语法
22
+
23
+ ## 质量要求
24
+
25
+ - 涉及新增表时必须有完整建表或迁移说明
26
+ - 涉及表变更时必须有 ALTER/迁移说明和兼容性风险
27
+ - 影响范围必须标注项目实际层级(如 API/业务逻辑/持久化/任务/集成/配置)
28
+ - 风险点必须有应对措施
29
+ - 被影响的现有功能必须先描述现状再描述变更
30
+ - 已确认的 `CR-*` 决策必须在方案中承接;未确认项必须列为阻塞或待确认,不能自行转成技术方案
@@ -0,0 +1,40 @@
1
+ # 后端代码探索指引
2
+
3
+ Use this guide to explore the target backend without assuming outbound-call's Go directory layout. Project navigation and local rule packages are authoritative.
4
+
5
+ ## Exploration Order
6
+
7
+ 1. Read `.planning/navigation/INDEX.md` → filter backend/service-type codebases → load their `{name}.md` navigation files to identify root, framework, entry points, layers, persistence, jobs, integrations, config, and commands.
8
+ 2. Read the project rule package via `references/project-rule-contract.md`.
9
+ 3. Start from baseline `FP-*`, `BR-*`, `BC-*`, and confirmed `CR-*` decisions.
10
+ 4. Search only the relevant modules first; expand outward only when the call chain or data flow requires it.
11
+
12
+ ## Conceptual Layers
13
+
14
+ Map the project-specific files into these conceptual areas. Names vary by language and framework.
15
+
16
+ | Area | What To Find | Typical Examples |
17
+ |------|--------------|------------------|
18
+ | Entry/API | routes, controllers, handlers, resolvers, RPC endpoints | `routes/`, `controllers/`, `handlers/`, `api/`, `web/` |
19
+ | Business Logic | services, use cases, application layer, domain operations | `service/`, `usecase/`, `application/`, `domain/` |
20
+ | Data/Persistence | models, repositories, DAO, ORM mappings, migrations | `model/`, `repository/`, `dao/`, `migrations/`, `schema/` |
21
+ | Async/Jobs | scheduled jobs, queue producers/consumers, workers | `jobs/`, `worker/`, `queue/`, `cron/` |
22
+ | Integration | external clients, SDK wrappers, adapters | `client/`, `integration/`, `pkg/`, `adapter/` |
23
+ | Config/Auth | configuration, permissions, tenant/data-scope rules | `config/`, `auth/`, `permission/`, `middleware/` |
24
+
25
+ Use actual paths from navigation and code search. Do not invent these folders when the project uses different names.
26
+
27
+ ## Search Tactics
28
+
29
+ - Start from known identifiers in the requirement: entity names, API paths, field names, status names, permission keys, job names, integration names.
30
+ - For data changes, trace from schema/model/migration to business logic and outward to consumers.
31
+ - For behavior changes, trace from entry/API or user-facing trigger to business logic, persistence, async jobs, and integrations.
32
+ - For statistics/reporting, find source data, aggregation timing, cache/materialized tables, and downstream consumers.
33
+ - For compatibility, find old clients, response contracts, existing data, config defaults, and feature flags.
34
+
35
+ ## Reading Focus
36
+
37
+ - Current behavior and invariants before proposing changes.
38
+ - Reuse candidates across business capability, installed dependencies, and project patterns.
39
+ - Conflicts with confirmed baseline decisions or project rules.
40
+ - Required toolchain steps such as schema generation, mocks, DI, API client generation, migrations, build, lint, and tests.
@@ -0,0 +1,66 @@
1
+ # Project Rule Package Contract
2
+
3
+ Use this contract when generating backend technical plans. A project rule package is the project-specific source of truth for how backend work should be designed, implemented, tested, and reviewed.
4
+
5
+ ## Discovery Order
6
+
7
+ Look for rule sources in the target project, in this order:
8
+
9
+ 1. `.planning/rules/INDEX.md`
10
+ 2. `.planning/execution-contract.md`
11
+ 3. `.planning/toolchain.md`
12
+ 4. `.planning/lessons/README.md`
13
+ 5. `.planning/milestones/`
14
+ 6. `.planning/requirements/`
15
+ 7. `.context/spec/index.md`
16
+ 8. matching `.context/spec/stacks/{stack_key}.md`
17
+ 9. matching `.context/spec/backend/{codebase}.md`
18
+ 10. `.context/spec/backend/index.md`
19
+ 11. `.context/spec/backend/`
20
+ 12. `.planning/code-index/` when source-level relation facts are needed
21
+ 13. `.context/workflow/tdd.md`
22
+ 14. `.context/workflow/verification.md`
23
+ 15. `.context/workflow/checklist.md`
24
+ 16. `.context/lessons/README.md`
25
+ 17. root `AGENTS.md`, `CLAUDE.md`, or equivalent project instruction files
26
+
27
+ If none exist, explicitly write `未发现项目规则包` and continue with code exploration and conservative assumptions.
28
+
29
+ History rule:
30
+
31
+ - Use `.planning/milestones/`, `.planning/requirements/`, `.planning/lessons/`, and phase `CONTEXT.md` files as the primary history model.
32
+ - Treat `.context/lessons/` and `features/` as compatible legacy/project-rule evidence only when present in the target project.
33
+ - Do not require outbound-call style history files.
34
+
35
+ ## What To Extract
36
+
37
+ Extract only backend-relevant rules:
38
+
39
+ - Technology stack and framework.
40
+ - Matching stack spec and codebase spec from `.context/spec/index.md` when available.
41
+ - Code-index symbols/relations for affected entrypoints, callers, callees, data/resource reads and writes, tests, and external integrations when `.planning/code-index/` exists.
42
+ - Layer model and dependency direction.
43
+ - Naming, function signature, validation, error handling, logging, transaction, pagination, permission, and data access rules.
44
+ - Required code generation, mock generation, dependency injection, migration, or build commands.
45
+ - Unit test, integration test, and end-to-end verification expectations.
46
+ - Review checklist and historical lessons that apply to this feature.
47
+ - Confirmed requirement challenge decisions from baseline `反向审视与用户拍板`.
48
+ - Pending baseline decisions that block backend planning.
49
+
50
+ Do not copy the entire rule source. Summarize the rules that affect the current feature.
51
+
52
+ ## Backend Plan Output
53
+
54
+ The backend technical plan must include a `后端规范影响` section with:
55
+
56
+ - Rule sources read.
57
+ - Baseline challenge decisions consumed and pending blockers.
58
+ - Affected layers.
59
+ - Code-index evidence used or the reason it was unavailable.
60
+ - Applicable rules.
61
+ - Related lessons.
62
+ - Toolchain and generated artifact requirements.
63
+ - Test strategy contract.
64
+ - Review gates.
65
+
66
+ If a rule conflicts with the requested behavior or existing code, record it as a risk or pending question. Do not silently choose between conflicting rules.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: workflow-design-rule-pack
3
+ description: Use when workflow-ui-spec or workflow-frontend-tech-spec needs a reusable UI/UX design rule package, ui-ux-pro-max recommendations, or project installation of .context/spec/design across repositories.
4
+ ---
5
+
6
+ # Workflow Design Rule Pack
7
+
8
+ This skill provides the reusable source for the project design rule package consumed by `workflow-ui-spec` and `workflow-frontend-tech-spec`.
9
+
10
+ ## When to Use
11
+
12
+ Use this skill when:
13
+
14
+ - A project lacks `.context/spec/design/index.md`.
15
+ - UI workflow steps need the shared UI/UX recommendation pack.
16
+ - `ui-ux-pro-max` should be available in a project without copying it by hand.
17
+ - The same design rules need to be reused across repositories.
18
+
19
+ `workflow-project-context` is the default lifecycle owner for frontend projects: it invokes this installer after the code index is ready, records the result in the initialization manifest, and owns `.context/spec/design/index.md`. Call this skill directly only to repair or deliberately refresh the shared recommendation assets.
20
+
21
+ Do not use this skill as a replacement for `workflow-ui-spec` or `workflow-frontend-tech-spec`. It only installs and documents shared references; workflow skills still decide how to apply them.
22
+
23
+ ## Install Into Current Project
24
+
25
+ Run from the target repository root:
26
+
27
+ ```text
28
+ devflow_design_rule(args=[])
29
+ ```
30
+
31
+ Default behavior:
32
+
33
+ - Copies `assets/design/` into `.context/spec/design/`.
34
+ - Creates missing directories.
35
+ - Does not overwrite existing project files.
36
+ - Keeps project-specific confirmed tokens in the target project.
37
+
38
+ To overwrite shared recommendation files intentionally:
39
+
40
+ ```text
41
+ devflow_design_rule(args=["--overwrite"])
42
+ ```
43
+
44
+ When project initialization owns the design index, install only assets and tools:
45
+
46
+ ```text
47
+ devflow_design_rule(args=["--without-index"])
48
+ ```
49
+
50
+ To install into another repository:
51
+
52
+ ```text
53
+ devflow_design_rule(args=["--target", "/path/to/repo"])
54
+ ```
55
+
56
+ ## Executable Self-Check
57
+
58
+ Run this after a normal installation from the target repository root:
59
+
60
+ ```bash
61
+ for path in \
62
+ index.md \
63
+ tokens/project-tokens.md \
64
+ recommendations/accessibility.md \
65
+ recommendations/component-library.md \
66
+ tools/ui-ux-pro-max/SKILL.md; do
67
+ test -s ".context/spec/design/$path"
68
+ done
69
+ ```
70
+
71
+ For an installation using `--without-index`, run the same command without `index.md`.
72
+
73
+ Pass only when every expected file exists and is non-empty. A missing file, a zero-byte file, or an installation target other than the intended repository root is a failure: rerun the installer with the correct `--target`, and use `--overwrite` only when replacement is deliberate.
74
+
75
+ ## Source of Truth
76
+
77
+ - Skill source: `skill://workflow-design-rule-pack/assets/design/`
78
+ - Project installed copy: `.context/spec/design/`
79
+
80
+ Workflow skills must read the installed project copy. The project copy is the place where local overrides and confirmed project tokens live.
81
+
82
+ ## Boundary
83
+
84
+ Design conclusion priority remains:
85
+
86
+ 1. User decisions, design artifacts, confirmed requirement baseline
87
+ 2. Existing code, component library, current project tokens
88
+ 3. `.context/spec/design/tokens/project-tokens.md`
89
+ 4. `.context/spec/design/recommendations/` and `ui-ux-pro-max` query results
90
+
91
+ Recommendation sources are never authoritative project facts unless the user or project rules explicitly confirm them.
@@ -0,0 +1,71 @@
1
+ # Design Spec Index
2
+
3
+ 本目录提供项目级 UI/UX 规则入口。workflow skill 读取设计规则时,先读本文件,再按当前任务读取对应章节。
4
+
5
+ ## 读取顺序
6
+
7
+ 1. 先读取本项目已确认规范:
8
+ - `tokens/project-tokens.md`
9
+ 2. 再读取通用推荐规则:
10
+ - `recommendations/design-systems.md`
11
+ - `recommendations/component-library.md`
12
+ - `recommendations/responsive-grid.md`
13
+ - `recommendations/ux-patterns.md`
14
+ - `recommendations/accessibility.md`
15
+ - `recommendations/stack-guidelines.md`
16
+ 3. 如需要按产品类型、行业、风格或技术栈动态补充,调用:
17
+ - `tools/ui-ux-pro-max/scripts/search.py`
18
+
19
+ ## 优先级
20
+
21
+ 设计相关结论必须按以下优先级合并:
22
+
23
+ 1. 用户拍板、设计稿事实、已确认需求基线
24
+ 2. 现有代码、现有组件库、现有项目 token
25
+ 3. `tokens/project-tokens.md` 中的项目级已确认设计 token
26
+ 4. `recommendations/` 与 `ui-ux-pro-max` 动态查询结果
27
+
28
+ 推荐规则只能补充缺口,不得覆盖已确认事实。若推荐值与设计稿、代码或用户拍板冲突,写入待确认事项或风险,不得自行改判。
29
+
30
+ ## ui-ux-pro-max 动态查询
31
+
32
+ 工具位置:
33
+
34
+ ```bash
35
+ python3 .context/spec/design/tools/ui-ux-pro-max/scripts/search.py "<query>" --design-system -p "<Project Name>"
36
+ python3 .context/spec/design/tools/ui-ux-pro-max/scripts/search.py "<query>" --domain ux
37
+ python3 .context/spec/design/tools/ui-ux-pro-max/scripts/search.py "<query>" --stack react
38
+ ```
39
+
40
+ 常用域:
41
+
42
+ | Domain | 用途 |
43
+ |--------|------|
44
+ | `product` | 产品类型与 UI 模式推荐 |
45
+ | `style` | 视觉风格、效果、实现关键词 |
46
+ | `color` | 产品类型对应配色建议 |
47
+ | `typography` | 字体组合建议 |
48
+ | `landing` | 落地页结构与 CTA |
49
+ | `ux` | 可用性、交互、状态、动效、可访问性 |
50
+ | `chart` | 图表类型与可访问性 |
51
+ | `react` | React/Next 性能与实现建议 |
52
+ | `web` | Web 表单、语义、focus、键盘等规则 |
53
+
54
+ 常用技术栈:
55
+
56
+ `html-tailwind`, `react`, `nextjs`, `vue`, `svelte`, `swiftui`, `react-native`, `flutter`, `shadcn`, `jetpack-compose`
57
+
58
+ ## Workflow 接入点
59
+
60
+ ### workflow-ui-spec
61
+
62
+ 在“理解产品上下文”之后、“设计解析”之前读取本文件。若设计稿缺失或设计稿未覆盖配色、字体、布局、状态、响应式等细节,可调用 `ui-ux-pro-max` 生成推荐,并在 UI-SPEC 中分开输出:
63
+
64
+ - 设计稿事实
65
+ - 现有项目规范
66
+ - 推荐方案(待拍板)
67
+ - 待确认事项
68
+
69
+ ### workflow-frontend-tech-spec
70
+
71
+ 在“理解需求”和“探索现有前端代码”之后读取本文件。前端技术方案只能把已确认 token 和项目规则作为实现依据;推荐规则用于补充实现注意点、风险、测试门禁和待确认事项。
@@ -0,0 +1,31 @@
1
+ # Accessibility Recommendations
2
+
3
+ 本文件提供可访问性参考。项目已有 a11y 规范优先。
4
+
5
+ ## 基础门禁
6
+
7
+ - 正文文本对比度不低于 4.5:1,较大文本不低于 3:1。
8
+ - 交互元素必须有清晰 focus 状态。
9
+ - 图标按钮、仅图标链接必须有可访问名称。
10
+ - 表单输入必须有关联 label 或等效语义。
11
+ - 键盘 Tab 顺序应符合视觉和业务顺序。
12
+ - 颜色不能作为唯一状态表达。
13
+ - 图片按语义区分:有意义图片写 alt,装饰图可空 alt。
14
+ - 弹窗打开后焦点进入弹窗,关闭后焦点回到触发元素。
15
+
16
+ ## 前端技术方案输出
17
+
18
+ 前端技术方案必须在状态与交互门禁中写明:
19
+
20
+ - Focus 验证方式
21
+ - 表单 label 验证方式
22
+ - 键盘操作覆盖范围
23
+ - 色彩对比验证方式
24
+ - 图标按钮可访问名称检查
25
+
26
+ ## 查询辅助
27
+
28
+ ```bash
29
+ python3 .context/spec/design/tools/ui-ux-pro-max/scripts/search.py "accessibility aria focus keyboard form labels color contrast" --domain ux
30
+ python3 .context/spec/design/tools/ui-ux-pro-max/scripts/search.py "aria focus keyboard semantic form" --domain web
31
+ ```