@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,204 @@
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
+ ### 2.1 需求来源与功能点映射
18
+
19
+ | 基线对象 | 名称/摘要 | 前端处理方式 |
20
+ |----------|-----------|--------------|
21
+ | FP-001 | {{功能点名称}} | {{新增/修改/影响/不涉及前端}} |
22
+ | BR-001 | {{业务规则}} | {{前端展示/校验/交互承接方式}} |
23
+ | BC-001 | {{边界场景}} | {{前端状态或提示承接方式}} |
24
+
25
+ ### 2.2 反向审视与用户拍板承接
26
+
27
+ | CR ID | 维度 | 用户决策/状态 | 对前端方案的影响 |
28
+ |-------|------|---------------|------------------|
29
+ | CR-001 | {{冲突/复用/历史/过度工程/替代方案}} | {{已确认/待确认/不适用}} | {{方案如何承接;待确认则说明阻塞点}} |
30
+
31
+ ### 2.3 历史/里程碑依据
32
+
33
+ | 来源 | 结论 | 对本方案的影响 |
34
+ |------|------|----------------|
35
+ | `.planning/milestones/...` | {{结论}} | {{影响}} |
36
+ | `.planning/requirements/...` | {{结论}} | {{影响}} |
37
+ | `.planning/lessons/...` | {{结论}} | {{影响}} |
38
+
39
+ ## 三、页面结构
40
+
41
+ ### 3.1 路由变更
42
+
43
+ | 路径 | 页面组件 | 权限 | 说明 |
44
+ |------|---------|------|------|
45
+ | /xxx | XxxPage.vue | admin | 新增/修改 |
46
+
47
+ ### 3.2 组件树
48
+
49
+ ```mermaid
50
+ graph TD
51
+ Page[页面组件] --> Header[头部]
52
+ Page --> Filter[筛选区]
53
+ Page --> Table[表格区]
54
+ Page --> Dialog[弹窗]
55
+ Table --> Col1[列:字段A]
56
+ Table --> Col2[列:字段B]
57
+ Table --> ColOp[列:操作]
58
+ ColOp --> BtnEdit[编辑按钮]
59
+ ColOp --> BtnDel[删除按钮]
60
+ Dialog --> Form[表单]
61
+ Form --> Field1[字段A]
62
+ Form --> Field2[字段B]
63
+ ```
64
+
65
+ ### 3.3 新增/修改组件
66
+
67
+ | 组件名 | 状态 | 输入 Props | 输出 Events |
68
+ |--------|------|-----------|------------|
69
+ | XxxForm | 新增 | modelValue | @submit |
70
+
71
+ ## 四、交互流程
72
+
73
+ ### 4.1 用户操作流程
74
+
75
+ ```mermaid
76
+ sequenceDiagram
77
+ User->>Page: 点击新增按钮
78
+ Page->>Dialog: 打开新增弹窗
79
+ User->>Form: 填写表单
80
+ User->>Form: 点击提交
81
+ Form->>API: POST /api/xxx
82
+ API-->>Form: 返回成功
83
+ Form->>Table: 刷新列表
84
+ ```
85
+
86
+ ### 4.2 状态管理
87
+
88
+ | 状态 | 类型 | 说明 |
89
+ |------|------|------|
90
+ | loading | boolean | 加载态 |
91
+ | list | Array | 列表数据 |
92
+ | dialogVisible | boolean | 弹窗显隐 |
93
+
94
+ ## 五、接口依赖
95
+
96
+ ### 5.1 新增接口
97
+
98
+ | 接口 | 方法 | 请求参数 | 响应 |
99
+ |------|------|---------|------|
100
+ | /api/xxx | POST | {name} | {id, name} |
101
+
102
+ ### 5.2 修改接口
103
+
104
+ | 接口 | 变更点 | 兼容性 |
105
+ |------|--------|--------|
106
+ | /api/yyy | 响应新增字段 age | 向后兼容 |
107
+
108
+ ## 六、影响范围
109
+
110
+ | 现有页面/组件 | 影响点 | 影响程度 |
111
+ |-------------|--------|----------|
112
+ | 页面A | 新增筛选条件 | 低 |
113
+ | 组件B | 新增 props | 低 |
114
+
115
+ ## 七、前端规范影响
116
+
117
+ ### 7.1 已读取规则来源
118
+
119
+ | 规则来源 | 是否存在 | 影响说明 |
120
+ |----------|----------|----------|
121
+ | `.planning/rules/INDEX.md` | {{是/否}} | {{说明}} |
122
+ | `.planning/execution-contract.md` | {{是/否}} | {{说明}} |
123
+ | `.planning/toolchain.md` | {{是/否}} | {{说明}} |
124
+ | `.planning/lessons/README.md` | {{是/否}} | {{说明}} |
125
+ | `.context/spec/frontend/index.md` | {{是/否}} | {{说明}} |
126
+ | `.context/spec/frontend/` | {{是/否}} | {{说明}} |
127
+ | `.context/spec/design/` | {{是/否}} | {{说明}} |
128
+ | `.context/workflow/` | {{是/否}} | {{说明}} |
129
+ | `.context/lessons/README.md` | {{是/否}} | {{说明}} |
130
+ | `AGENTS.md` / `CLAUDE.md` | {{是/否}} | {{说明}} |
131
+
132
+ ### 7.2 适用设计系统与组件规范
133
+
134
+ | 场景 | 适用规范 | 对本功能的约束 |
135
+ |------|----------|----------------|
136
+ | {{页面/组件/表单/表格/弹窗/按钮/菜单/权限}} | {{规范文件或章节}} | {{组件选择、布局、文案、交互、样式约束}} |
137
+
138
+ ### 7.3 设计输入来源分层
139
+
140
+ | 来源类型 | 来源文件/章节 | 是否作为实现依据 | 处理方式 |
141
+ |----------|---------------|------------------|----------|
142
+ | 设计稿事实 | {{UI-SPEC 章节或设计稿}} | 是 | {{进入组件样式、变量、布局实现}} |
143
+ | 现有项目规范 | {{现有代码/.context/spec/design/tokens/project-tokens.md}} | 是 | {{复用变量、组件、样式模式}} |
144
+ | 推荐参考 | {{.context/spec/design/recommendations 或 ui-ux-pro-max 查询结果}} | 否 | {{仅进入风险、测试门禁或待确认事项}} |
145
+
146
+ 说明:UI-SPEC 中标记为“推荐 - 待拍板”的内容,未经用户确认不得作为组件 props、样式变量或实现常量直接落地。
147
+
148
+ ### 7.4 技术栈插槽
149
+
150
+ | 插槽 | 是否加载 | 触发依据 | 对本功能的约束 |
151
+ |------|----------|----------|----------------|
152
+ | Common Web | 是 | 所有前端项目 | {{通用页面、状态、交互、响应式、可访问性约束}} |
153
+ | React | {{是/否}} | {{package.json/入口文件}} | {{hooks/state/query/component 约束}} |
154
+ | Next.js | {{是/否}} | {{next.config/app/pages}} | {{server/client component、data fetching、cache、hydration 约束}} |
155
+ | Vue | {{是/否}} | {{vue 依赖/.vue 文件}} | {{SFC、Composition API、Pinia/router/composable 约束}} |
156
+ | Design Recommendations | {{是/否}} | `.context/spec/design/index.md` | {{UX/accessibility/responsive/stack 推荐如何补充,但不覆盖项目规则}} |
157
+ | ui-ux-pro-max | {{是/否}} | {{是否需要动态查询}} | {{查询命令、摘要、是否存在待确认项}} |
158
+ | 未覆盖框架 | {{框架名或无}} | {{触发依据}} | {{按 Common Web 处理并标记待扩展}} |
159
+
160
+ ### 7.5 状态与交互门禁
161
+
162
+ | 状态/交互 | 要求 | 验证方式 |
163
+ |-----------|------|----------|
164
+ | Loading | {{要求}} | {{验证方式}} |
165
+ | Empty | {{要求}} | {{验证方式}} |
166
+ | Error | {{要求}} | {{验证方式}} |
167
+ | Permission | {{要求}} | {{验证方式}} |
168
+ | Disabled | {{要求}} | {{验证方式}} |
169
+ | Duplicate Submit | {{要求}} | {{验证方式}} |
170
+ | Responsive | {{要求}} | {{验证方式}} |
171
+ | Accessibility | {{要求}} | {{验证方式}} |
172
+
173
+ ### 7.6 状态管理与 API 调用约束
174
+
175
+ | 项目 | 规则 | 对本功能的影响 |
176
+ |------|------|----------------|
177
+ | API Client | {{规则}} | {{影响}} |
178
+ | State / Store | {{规则}} | {{影响}} |
179
+ | Cache | {{规则}} | {{影响}} |
180
+ | Validation | {{规则}} | {{影响}} |
181
+ | Enum / Format | {{规则}} | {{影响}} |
182
+
183
+ ### 7.7 相关经验教训
184
+
185
+ | 教训ID/来源 | 内容摘要 | 本功能规避方式 |
186
+ |-------------|----------|----------------|
187
+ | {{L001/文档路径}} | {{摘要}} | {{如何避免}} |
188
+
189
+ ### 7.8 工具链与验证门禁
190
+
191
+ | 门禁 | 命令/工具 | 通过标准 |
192
+ |------|-----------|----------|
193
+ | Typecheck | {{命令}} | {{通过标准}} |
194
+ | Lint | {{命令}} | {{通过标准}} |
195
+ | Unit/Component Test | {{命令}} | {{通过标准}} |
196
+ | E2E/Browser Test | {{命令}} | {{通过标准}} |
197
+ | Build | {{命令}} | {{通过标准}} |
198
+ | Screenshot/Visual Check | {{命令或方式}} | {{通过标准}} |
199
+ | Accessibility Check | {{命令或方式}} | {{通过标准}} |
200
+
201
+ ## 八、待确认事项
202
+
203
+ 1. [ ] 确认 UI 设计稿
204
+ 2. [ ] 确认接口返回格式
@@ -0,0 +1,58 @@
1
+ # 被影响方探索指引(前端)
2
+
3
+ 在完成主功能方(需求直接对应的页面/组件)的代码探索后,**必须**对需求基线中"关联历史功能/模块"表格(baseline 第8.2节)列出的每个受影响的前端页面/组件,执行以下探索。探索产出直接填入输出文档的"影响范围"章节和组件树。
4
+
5
+ ## 核心原则
6
+
7
+ - **先读懂现有组件,再设计新组件**:不知道 `blind-box.vue` 现在的 props/emits/methods/API 调用,就无法正确决定从哪里切分、哪些保留哪些抽离。
8
+ - **被影响组件和新增组件同等重要**:支付相关的现有 API 封装、地址选择组件、必中卡组件等被影响方必须和新增组件一样被完整阅读。
9
+ - **探索产出必须来自代码**:组件树、状态流、API 调用方式必须来自实际读取的源码。
10
+
11
+ ## 探索清单
12
+
13
+ 对于每个受影响的前端页面/组件,按以下步骤执行:
14
+
15
+ ### 步骤1:定位关键文件
16
+
17
+ 优先使用 `.planning/code-index/` 定位候选 route/page/component/store/API symbols,以及 `routes_to`、`imports`、`calls` 关系;然后回读 `evidence_path:evidence_line` 附近源码。code-index 不存在或过期时,再按下表的目录约定和 `rg` 兜底。
18
+
19
+ | 层级 | 定位方式 | 最少读取 |
20
+ |------|----------|----------|
21
+ | 页面入口 | `src/pages/{page}/` 下的 .vue 文件 | template 结构、script setup 中的核心逻辑 |
22
+ | 业务组件 | `src/components/fan-superstar/{module}/` 下的 .vue 文件 | **完整读取** props/emits 定义、data/reactive 状态、computed、methods |
23
+ | API 调用 | `src/api/` 或 `src/components/fan-superstar/service/` 下的 .js/.ts 文件 | 现有方法签名、请求参数、响应结构 |
24
+ | 路由配置 | `src/pages.json` 或 `src/router/` | 现有路由路径、参数、meta |
25
+ | 状态管理 | `src/hooks/` 或 `src/store/` | 现有 reactive/ref 状态结构和共享 hook |
26
+ | 样式系统 | UnoCSS 配置、scss 变量文件 | 现有原子类命名规则和色值变量 |
27
+
28
+ **底线**:每个被影响组件至少读取 3 个文件(组件源码 + API 文件 + 父/入口组件),不能仅靠组件名、navigation 或 code-index 摘要推断。
29
+
30
+ ### 步骤2:回答三个问题
31
+
32
+ | 问题 | 产出 | 填入模板章节 |
33
+ |------|------|-------------|
34
+ | 现有组件长什么样? | 现有 props/emits/data/computed/methods 的结构化清单 | 影响范围章节中"现有文件"的描述 |
35
+ | 现有数据怎么流动? | 组件间的父子关系、API 调用链、状态共享方式 | 组件树和交互流程 |
36
+ | 现有交互怎么触发? | 现有的 @click/@change/watch/onLoad 等事件绑定 | 交互流程的现状部分 |
37
+
38
+ ### 步骤3:判断复用/重构/新增边界
39
+
40
+ 对每个被影响组件,明确以下决策:
41
+
42
+ | 决策类型 | 说明 | 示例 |
43
+ |----------|------|------|
44
+ | 保留不动 | 组件现有逻辑和模板不受影响 | 闲鱼模式下的获取兑奖码流程 |
45
+ | 新增分支 | 组件内部按 `participateMode` 或其他条件渲染不同模板 | `blind-box.vue` 按模式显示不同内容 |
46
+ | 抽离重构 | 部分现有逻辑提取到新组件,原组件变为组合入口 | 现金支付卡片独立为 `blind-box-cash-card.vue` |
47
+ | 新增组件 | 新增独立 .vue 组件 | `blind-box-pay-confirm.vue` 支付确认弹窗 |
48
+ | 扩展 API | 现有 API 文件新增方法 | `service/mall.js` 新增 `createPayOrder` |
49
+
50
+ ## 探索产出检查(Phase 2 完成前必须全部通过)
51
+
52
+ - [ ] 是否对每个受影响的现有页面/组件都执行了步骤1~3?
53
+ - [ ] 是否列出了每个受影响组件的**现有** props/emits/methods/API 调用?
54
+ - [ ] 是否明确了每个受影响组件是"保留"、"分支"、"抽离"还是"新增"?
55
+ - [ ] 是否实际读取了 .vue 组件源码和 .js API 文件(不是仅靠文件名推断)?
56
+ - [ ] 若 `.planning/code-index/` 存在,是否记录了用于定位的 symbol/relation evidence?
57
+
58
+ **此检查不通过,不得进入 Phase 3(生成文档)。**
@@ -0,0 +1,42 @@
1
+ # 前端组件模式参考
2
+
3
+ ## 页面结构模式
4
+
5
+ ### 后台标准页面
6
+ ```
7
+ Page
8
+ ├── PageHeader(标题 + 操作按钮)
9
+ ├── FilterBar(筛选条件)
10
+ ├── DataTable(数据列表)
11
+ └── Dialog/Modal(新增/编辑/详情弹窗)
12
+ ```
13
+
14
+ ### 表单页面
15
+ ```
16
+ FormPage
17
+ ├── PageHeader
18
+ ├── Form(表单项)
19
+ └── Footer(提交/取消按钮)
20
+ ```
21
+
22
+ ## 状态管理模式
23
+
24
+ ### 列表页 Store
25
+ ```javascript
26
+ state: {
27
+ list: [],
28
+ total: 0,
29
+ loading: false,
30
+ filters: {},
31
+ pagination: { page: 1, pageSize: 20 }
32
+ }
33
+ ```
34
+
35
+ ### 详情/表单 Store
36
+ ```javascript
37
+ state: {
38
+ detail: null,
39
+ loading: false,
40
+ submitting: false
41
+ }
42
+ ```
@@ -0,0 +1,28 @@
1
+ # 前端技术方案编写规范
2
+
3
+ ## 模板结构要求
4
+
5
+ 每次生成必须包含以下章节:
6
+ 1. 功能概述
7
+ 2. 页面结构(路由 + 组件树)
8
+ 3. 交互流程(用户操作 + 状态流转)
9
+ 4. 接口依赖(新增 + 修改)
10
+ 5. 影响范围
11
+ 6. 前端规范影响(规则来源 + 技术栈插槽 + 状态门禁 + 工具链验证)
12
+ 7. 待确认事项
13
+
14
+ ## 描述规则
15
+
16
+ - 组件名使用 PascalCase
17
+ - 路由路径使用 kebab-case
18
+ - 接口路径使用小写 + 斜杠
19
+ - 状态字段使用 camelCase
20
+
21
+ ## 质量要求
22
+
23
+ - 所有新增组件必须有 Props/Events 说明
24
+ - 所有接口必须有请求/响应格式
25
+ - 交互流程必须包含成功和失败两条路径
26
+ - 影响范围必须列出现有页面/组件的变更点
27
+ - 前端规范影响必须说明已加载的技术栈插槽,至少包含 Common Web;识别到 React、Next.js、Vue 时加载对应插槽
28
+ - 项目本地规则优先于技术栈插槽,插槽只补充项目未定义的默认规则
@@ -0,0 +1,53 @@
1
+ # Common Web Frontend Stack Slot
2
+
3
+ This slot applies to all browser-based frontend work, regardless of framework.
4
+
5
+ ## Applies When
6
+
7
+ Use this slot for HTML, CSS, JavaScript, TypeScript, React, Vue, Angular, Svelte, Next, Nuxt, and mobile WebView projects.
8
+
9
+ Always load this slot before framework-specific slots.
10
+
11
+ ## Planning Rules
12
+
13
+ - Identify the user-visible entry: route, page, panel, dialog, tab, drawer, or embedded widget.
14
+ - Preserve existing layout, component, naming, request, state, and style conventions.
15
+ - Do not introduce a new UI library, state manager, router, CSS framework, icon library, test runner, or data-fetching library unless explicitly required.
16
+ - Prefer existing components and patterns before creating new abstractions.
17
+ - Every user-facing control must have loading, disabled, permission, error, and success behavior when applicable.
18
+ - Every list or table must define empty state, loading state, error state, pagination or infinite-scroll behavior, and row operation permissions.
19
+ - Every form must define validation source, submit behavior, duplicate-submit protection, cancel/reset behavior, and error display.
20
+ - Every API dependency must define request parameters, response shape, error handling, and compatibility with existing callers.
21
+
22
+ ## Interaction States
23
+
24
+ Record these states in the technical plan:
25
+
26
+ - Loading.
27
+ - Empty.
28
+ - Error.
29
+ - Success.
30
+ - Permission denied or hidden actions.
31
+ - Disabled/read-only.
32
+ - Duplicate submit.
33
+ - Optimistic update or rollback, when applicable.
34
+ - Unsaved changes, when applicable.
35
+
36
+ ## Responsive And Accessibility
37
+
38
+ - Record required viewport classes or breakpoints when the project has them.
39
+ - Do not hide essential controls on small screens unless the requirement says so.
40
+ - Controls must have accessible names, focus behavior, keyboard reachability, and visible disabled/loading state.
41
+ - Text must not overflow buttons, labels, cards, table cells, dialogs, or sidebars.
42
+
43
+ ## Verification Gates
44
+
45
+ Use project commands when available. Otherwise record missing commands as pending.
46
+
47
+ - Typecheck or equivalent.
48
+ - Lint or equivalent.
49
+ - Unit/component tests when the project has a test setup.
50
+ - Build.
51
+ - Browser verification for changed routes or interactive flows.
52
+ - Screenshot or visual check for layout-sensitive changes.
53
+ - Accessibility check when the project has tooling or the feature affects forms, dialogs, menus, keyboard navigation, or permissions.
@@ -0,0 +1,40 @@
1
+ # Next.js Frontend Stack Slot
2
+
3
+ Use with `common-web.md` and `react.md`.
4
+
5
+ ## Detection
6
+
7
+ Load this slot when the project has:
8
+
9
+ - `next` dependency in `package.json`.
10
+ - `next.config.*`.
11
+ - `app/` or `pages/` routing.
12
+
13
+ ## Planning Rules
14
+
15
+ - Identify router mode: App Router, Pages Router, or mixed.
16
+ - For App Router, explicitly classify changed components as server components or client components.
17
+ - Add `"use client"` only when client state, effects, event handlers, browser APIs, or client-only libraries are required.
18
+ - Keep server-only data fetching and secrets out of client components.
19
+ - Respect existing data-fetching and cache strategy: static, dynamic, revalidate, route handler, server action, API route, query client, or client fetch.
20
+ - Record metadata, layout, loading, error, and not-found behavior when affected.
21
+ - Preserve route segment conventions, colocated files, and existing folder naming.
22
+
23
+ ## Required Technical Plan Details
24
+
25
+ - App Router vs Pages Router.
26
+ - Route segments or pages affected.
27
+ - Server/client component boundary.
28
+ - Data fetching location and cache/revalidation behavior.
29
+ - Loading/error/not-found files or component states.
30
+ - Route handlers, server actions, or API routes if affected.
31
+ - SEO metadata impact when user-facing pages change.
32
+
33
+ ## Verification Gates
34
+
35
+ - Typecheck.
36
+ - Lint.
37
+ - Build.
38
+ - Browser verification for affected routes.
39
+ - Check server/client boundary risks.
40
+ - Check hydration mismatch risk for dynamic data, dates, random values, browser-only APIs, and conditional rendering.
@@ -0,0 +1,41 @@
1
+ # React Frontend Stack Slot
2
+
3
+ Use with `common-web.md`.
4
+
5
+ ## Detection
6
+
7
+ Load this slot when the project has:
8
+
9
+ - `react` dependency in `package.json`.
10
+ - React entry files such as `src/main.tsx`, `src/App.tsx`, `src/index.tsx`.
11
+ - Vite, CRA, Remix, or another React-based setup.
12
+
13
+ If the project is Next.js, load `next.md` in addition to this slot.
14
+
15
+ ## Planning Rules
16
+
17
+ - Preserve existing component organization: pages/routes, feature modules, shared components, hooks, services, and stores.
18
+ - Prefer function components and existing hook conventions.
19
+ - Keep side effects in hooks or data-fetching utilities, not directly in render logic.
20
+ - Avoid introducing global state when local component state or existing server/cache state is sufficient.
21
+ - When global state is needed, use the project's existing store or query library.
22
+ - For API calls, use the existing API client, query hook, mutation hook, interceptor, error handler, and cache invalidation pattern.
23
+ - Memoization is a performance tool, not a default. Use it only for expensive derived values, stable callback contracts, or known rerender issues.
24
+
25
+ ## Required Technical Plan Details
26
+
27
+ - Component tree and ownership.
28
+ - Props and callback/event contracts.
29
+ - Hook usage and side-effect boundaries.
30
+ - State ownership: local state, query/cache state, or global store.
31
+ - API query/mutation flow and cache invalidation.
32
+ - Error boundary or fallback behavior if the project uses it.
33
+
34
+ ## Verification Gates
35
+
36
+ - Typecheck.
37
+ - Lint.
38
+ - Unit/component tests for nontrivial logic or components when test setup exists.
39
+ - Build.
40
+ - Browser verification for changed routes.
41
+ - Check React warnings in console when browser tooling is available.
@@ -0,0 +1,41 @@
1
+ # Vue Frontend Stack Slot
2
+
3
+ Use with `common-web.md`.
4
+
5
+ ## Detection
6
+
7
+ Load this slot when the project has:
8
+
9
+ - `vue` dependency in `package.json`.
10
+ - `vite.config.*` with Vue plugin, `vue.config.*`, or Nuxt-specific files.
11
+ - `.vue` single-file components.
12
+
13
+ If the project is Nuxt, use this slot plus a future Nuxt-specific slot when available.
14
+
15
+ ## Planning Rules
16
+
17
+ - Preserve existing single-file component structure and naming.
18
+ - Prefer Composition API when the project uses it; do not mix Options API and Composition API without a local precedent.
19
+ - Put reusable logic in existing composable patterns.
20
+ - Use existing router, route guard, permission, and layout conventions.
21
+ - Use the existing store pattern, such as Pinia or Vuex, only when local component state is insufficient.
22
+ - For API calls, use the existing request client, composable, interceptor, error handler, and loading pattern.
23
+ - Keep computed values pure and side effects in watchers, lifecycle hooks, or explicit handlers.
24
+
25
+ ## Required Technical Plan Details
26
+
27
+ - Routes/views affected.
28
+ - Component tree and SFC ownership.
29
+ - Props, emits, slots, and v-model contracts.
30
+ - Composables used or added.
31
+ - Store modules/state affected.
32
+ - API flow and error handling.
33
+ - Permission and route guard impact.
34
+
35
+ ## Verification Gates
36
+
37
+ - Typecheck (`vue-tsc` or project equivalent) when available.
38
+ - Lint.
39
+ - Unit/component tests when the project has a test setup.
40
+ - Build.
41
+ - Browser verification for changed routes and dialogs.
@@ -0,0 +1,95 @@
1
+ # Project Rule Package Contract
2
+
3
+ Use this contract when generating frontend technical plans. A project rule package is the project-specific source of truth for how frontend 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/frontend/{codebase}.md`
18
+ 10. `.context/spec/frontend/index.md`
19
+ 11. `.context/spec/frontend/`
20
+ 12. `.context/spec/design/`
21
+ 13. `.planning/code-index/` when source-level route/component/API/data-flow relation facts are needed
22
+ 14. `.context/workflow/tdd.md`
23
+ 15. `.context/workflow/verification.md`
24
+ 16. `.context/workflow/checklist.md`
25
+ 17. `.context/lessons/README.md`
26
+ 18. root `AGENTS.md`, `CLAUDE.md`, or equivalent project instruction files
27
+
28
+ If none exist, explicitly write `未发现项目规则包` and continue with code exploration and conservative assumptions.
29
+
30
+ History rule:
31
+
32
+ - Use `.planning/milestones/`, `.planning/requirements/`, `.planning/lessons/`, and phase `CONTEXT.md` files as the primary history model.
33
+ - Treat `.context/lessons/` and `features/` as compatible legacy/project-rule evidence only when present in the target project.
34
+ - Do not require outbound-call style history files.
35
+
36
+ Design rule loading:
37
+
38
+ - If `.context/spec/design/index.md` is missing, call `devflow_design_rule(args=[])` from the target repository, then re-check `.context/spec/design/index.md`.
39
+ - If `.context/spec/design/index.md` exists, read it before individual design files.
40
+ - Treat `.context/spec/design/tokens/project-tokens.md` as project-level confirmed tokens only when it explicitly marks values as confirmed.
41
+ - Treat `.context/spec/design/recommendations/` and `.context/spec/design/tools/ui-ux-pro-max/` as recommendation sources, not authoritative project facts.
42
+ - Recommendation sources can fill UX, accessibility, responsive, component and stack guidance gaps, but conflicts with design material, code, baseline decisions or project tokens must become risks or pending questions.
43
+
44
+ ## Stack Slot Loading
45
+
46
+ Load frontend stack slots after project rule discovery:
47
+
48
+ 1. Always read `references/frontend-stack-slots/common-web.md`.
49
+ 2. Detect the framework from `package.json`, config files, and entry files.
50
+ 3. Read the matching framework slots:
51
+ - React: `references/frontend-stack-slots/react.md`
52
+ - Next.js: `references/frontend-stack-slots/react.md` and `references/frontend-stack-slots/next.md`
53
+ - Vue: `references/frontend-stack-slots/vue.md`
54
+ 4. If the framework is unknown or unsupported, use only `common-web.md` and record the missing stack slot as a pending improvement.
55
+
56
+ Project-specific rules override stack slot defaults. Stack slots fill gaps only when the project does not define a stronger local rule.
57
+
58
+ ## What To Extract
59
+
60
+ Extract only frontend-relevant rules:
61
+
62
+ - Technology stack, framework, router, module boundaries, and package manager.
63
+ - Matching stack spec and codebase spec from `.context/spec/index.md` when available.
64
+ - Code-index symbols/relations for affected routes, pages, components, stores, API clients, imports and calls when `.planning/code-index/` exists.
65
+ - Design system, UI library, component hierarchy, reusable component rules, icon rules, and style/theming rules.
66
+ - Confirmed design tokens separately from recommendation-only UI/UX guidance.
67
+ - Page, route, layout, permission, menu, tab, dialog, form, table, empty state, loading state, error state, and confirmation interaction rules.
68
+ - State management, API client, cache, request/response transform, validation, enum, i18n, and date/number formatting rules.
69
+ - Accessibility, keyboard interaction, responsive layout, browser compatibility, and performance constraints.
70
+ - Required code generation, type generation, API schema sync, mock data, Storybook, visual regression, browser automation, or build commands.
71
+ - Unit, component, E2E, screenshot, accessibility, and manual verification expectations.
72
+ - Review checklist and historical lessons that apply to this feature.
73
+ - Confirmed requirement challenge decisions from baseline `反向审视与用户拍板`.
74
+ - Pending baseline decisions that block frontend planning.
75
+
76
+ Do not copy the entire rule source. Summarize the rules that affect the current feature.
77
+
78
+ ## Frontend Plan Output
79
+
80
+ The frontend technical plan must include a `前端规范影响` section with:
81
+
82
+ - Rule sources read.
83
+ - Stack slots loaded.
84
+ - Baseline challenge decisions consumed and pending blockers.
85
+ - Affected pages, routes, components, stores, API clients, and styles.
86
+ - Code-index evidence used or the reason it was unavailable.
87
+ - Applicable design system and component rules.
88
+ - Which design inputs are confirmed implementation sources and which are recommendation-only references.
89
+ - Interaction states that must be implemented.
90
+ - Related lessons.
91
+ - Toolchain and generated artifact requirements.
92
+ - Test and browser verification strategy.
93
+ - Review gates.
94
+
95
+ If a rule conflicts with the requested behavior, design material, or existing code, record it as a risk or pending question. Do not silently choose between conflicting rules.