@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,123 @@
1
+ # Milestone Archive Template
2
+
3
+ This template is used by the complete-milestone workflow to create archive files in `.planning/milestones/`.
4
+
5
+ ---
6
+
7
+ ## File Template
8
+
9
+ # Milestone v{{VERSION}}: {{MILESTONE_NAME}}
10
+
11
+ **Status:** ✅ SHIPPED {{DATE}}
12
+ **Phases:** {{PHASE_START}}-{{PHASE_END}}
13
+ **Total Plans:** {{TOTAL_PLANS}}
14
+
15
+ ## Overview
16
+
17
+ {{MILESTONE_DESCRIPTION}}
18
+
19
+ ## Phases
20
+
21
+ {{PHASES_SECTION}}
22
+
23
+ [For each phase in this milestone, include:]
24
+
25
+ ### Phase {{PHASE_NUM}}: {{PHASE_NAME}}
26
+
27
+ **Goal**: {{PHASE_GOAL}}
28
+ **Depends on**: {{DEPENDS_ON}}
29
+ **Plans**: {{PLAN_COUNT}} plans
30
+
31
+ Plans:
32
+
33
+ - [x] {{PHASE}}-01: {{PLAN_DESCRIPTION}}
34
+ - [x] {{PHASE}}-02: {{PLAN_DESCRIPTION}}
35
+ [... all plans ...]
36
+
37
+ **Details:**
38
+ {{PHASE_DETAILS_FROM_ROADMAP}}
39
+
40
+ **For decimal phases, include (INSERTED) marker:**
41
+
42
+ ### Phase 2.1: Critical Security Patch (INSERTED)
43
+
44
+ **Goal**: Fix authentication bypass vulnerability
45
+ **Depends on**: Phase 2
46
+ **Plans**: 1 plan
47
+
48
+ Plans:
49
+
50
+ - [x] 02.1-01: Patch auth vulnerability
51
+
52
+ **Details:**
53
+ {{PHASE_DETAILS_FROM_ROADMAP}}
54
+
55
+ ---
56
+
57
+ ## Milestone Summary
58
+
59
+ **Decimal Phases:**
60
+
61
+ - Phase 2.1: Critical Security Patch (inserted after Phase 2 for urgent fix)
62
+ - Phase 5.1: Performance Hotfix (inserted after Phase 5 for production issue)
63
+
64
+ **Key Decisions:**
65
+ {{DECISIONS_FROM_PROJECT_STATE}}
66
+ [Example:]
67
+
68
+ - Decision: Use ROADMAP.md split (Rationale: Constant context cost)
69
+ - Decision: Decimal phase numbering (Rationale: Clear insertion semantics)
70
+
71
+ **Issues Resolved:**
72
+ {{ISSUES_RESOLVED_DURING_MILESTONE}}
73
+ [Example:]
74
+
75
+ - Fixed context overflow at 100+ phases
76
+ - Resolved phase insertion confusion
77
+
78
+ **Issues Deferred:**
79
+ {{ISSUES_DEFERRED_TO_LATER}}
80
+ [Example:]
81
+
82
+ - PROJECT-STATE.md tiering (deferred until decisions > 300)
83
+
84
+ **Technical Debt Incurred:**
85
+ {{SHORTCUTS_NEEDING_FUTURE_WORK}}
86
+ [Example:]
87
+
88
+ - Some workflows still have hardcoded paths (fix in Phase 5)
89
+
90
+ ---
91
+
92
+ _For current project status, see .planning/ROADMAP.md_
93
+
94
+ ---
95
+
96
+ ## Usage Guidelines
97
+
98
+ <guidelines>
99
+ **When to create milestone archives:**
100
+ - After completing all phases in a milestone (v1.0, v1.1, v2.0, etc.)
101
+ - Triggered by complete-milestone workflow
102
+ - Before planning next milestone work
103
+
104
+ **How to fill template:**
105
+
106
+ - Replace {{PLACEHOLDERS}} with actual values
107
+ - Extract phase details from ROADMAP.md
108
+ - Document decimal phases with (INSERTED) marker
109
+ - Include key decisions from PROJECT-STATE.md or SUMMARY files
110
+ - List issues resolved vs deferred
111
+ - Capture technical debt for future reference
112
+
113
+ **Archive location:**
114
+
115
+ - Save to `.planning/milestones/v{VERSION}-{NAME}.md`
116
+ - Example: `.planning/milestones/v1.0-mvp.md`
117
+
118
+ **After archiving:**
119
+
120
+ - Update ROADMAP.md to collapse completed milestone in `<details>` tag
121
+ - Update PROJECT.md to brownfield format with Current State section
122
+ - Continue phase numbering in next milestone (never restart at 01)
123
+ </guidelines>
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: workflow-generate-mainflow-cases
3
+ description: "Use after workflow-execute-phase when code is implemented and the OMP development agent must generate importable positive API/UI mainflow automation cases from planning artifacts, project specifications, navigation files, and actual code."
4
+ ---
5
+
6
+ # 主流程自动化用例生成
7
+
8
+ 在 `execute` 完成后运行本 skill,生成当前测试聚合平台可导入的正向主流程自动化用例。只生成 `api-mainflow` 和 `ui-mainflow` 用例,不生成异常、边界、权限、安全、性能专项。
9
+
10
+ ## Hard Rules
11
+
12
+ - MUST NOT hardcode `platform-backend` or `platform-frontend`.
13
+ - MUST derive code roots from `.planning/navigation` and `.context/spec`.
14
+ - MUST use `.planning/code-index/` for fine-grained entrypoint, route, component, API, call, import, and data-flow evidence when present.
15
+ - MUST only generate `api-mainflow` and `ui-mainflow` cases.
16
+ - MUST run `scripts/compile_dsl.py` before final output.
17
+ - MUST run `scripts/validate_case_payloads.py` before reporting success.
18
+ - MUST block if codebase discovery fails.
19
+ - MUST block if generated DSL fails validation.
20
+
21
+ ## Workflow Position
22
+
23
+ This step sits between code execution and verification. It runs after `execute` alongside `code-review`; `verify` depends on both gates:
24
+
25
+ `execute -> code-review + generate-mainflow-cases -> verify-work / UAT`
26
+
27
+ The workflow step id is `generate-mainflow-cases`, order `86`, and it depends on `execute`.
28
+
29
+ ## Required Outputs
30
+
31
+ Always create or update:
32
+
33
+ - `.planning/generated-cases/{feature}/source-map.md`
34
+ - `.planning/generated-cases/{feature}/mainflow-analysis.md`
35
+ - `.planning/generated-cases/{feature}/case-descriptions.json`
36
+ - `.planning/generated-cases/{feature}/case-import-payloads.json`
37
+ - `.planning/generated-cases/{feature}/validation-report.md`
38
+ - `.planning/phases/{phase}/MAINFLOW-CASES.md`
39
+
40
+ The discovery script also writes support artifact `.planning/generated-cases/{feature}/codebase-discovery.json`.
41
+
42
+ ## Resource Loading
43
+
44
+ Read these references before generating cases:
45
+
46
+ - `references/codebase-discovery.md` before scanning any source file.
47
+ - `references/mainflow-selection.md` before deciding which flows become cases.
48
+ - `references/intermediate-format.md` before writing `case-descriptions.json`.
49
+ - `references/api-mainflow-rules.md` before generating API cases.
50
+ - `references/ui-mainflow-rules.md` before generating UI cases.
51
+
52
+ ## Process
53
+
54
+ 1. Read `.planning/STATE.md` and resolve `{feature}` and `{phase}`.
55
+ 2. Run codebase discovery:
56
+
57
+ ```text
58
+ devflow_mainflow(action="discover", args=["--output", ".planning/generated-cases/{feature}/codebase-discovery.json"])
59
+ ```
60
+
61
+ Stop if it exits non-zero.
62
+
63
+ 3. Read planning inputs when present:
64
+ - `.planning/requirements/baseline.md`
65
+ - `.planning/features/{feature}/功能点梳理.md`
66
+ - `.planning/features/{feature}/UI-SPEC.md`
67
+ - `.planning/features/{feature}/前端技术方案.md`
68
+ - `.planning/features/{feature}/后端技术方案.md`
69
+ - `.planning/features/{feature}/变更清单.md`
70
+ - `.planning/features/{feature}/PROGRESS.md`
71
+ - `.planning/phases/{phase}/SUMMARY.md`
72
+
73
+ 4. Read discovery output, then read each discovered codebase's navigation and spec files. Select scan targets by codebase type:
74
+ - Backend: router/controller, service/usecase, schema/dto/request/response, model/entity, API entry.
75
+ - Frontend: router, pages/views, api/client, types/contracts, stores/hooks/components related to the feature.
76
+
77
+ 5. If `.planning/code-index/` exists, query symbols and relations for candidate entrypoints and mainflow paths:
78
+ - Backend/API: `routes_to`, `calls`, `reads`, `writes`, `config_uses`, `tested_by`.
79
+ - Frontend/UI: route/page/component symbols, `routes_to`, `imports`, `calls` into API clients, store/hook relations.
80
+ Read `evidence_path:evidence_line` before using an edge in case selection.
81
+ 6. Inspect actual code paths that are both relevant to `{feature}` and reachable from navigation/spec/code-index. Do not scan excluded historical modules.
82
+ 7. Write `source-map.md` with planning evidence, code-index evidence when used, source evidence, and selected source files for each candidate case.
83
+ 8. Write `mainflow-analysis.md` with included API/UI positive mainflows, excluded non-mainflows, assumptions, and traceability to source evidence.
84
+ 9. Write `case-descriptions.json` using the simplified format in `references/intermediate-format.md`. **Do NOT write raw DSL** — use locator strings like `"text:编辑"`, `"placeholder:请输入名称"`, `"css:.el-dialog__footer .el-button--primary"`.
85
+ 10. Compile descriptions into strict DSL:
86
+
87
+ ```text
88
+ devflow_mainflow(action="compile", args=[".planning/generated-cases/{feature}/case-descriptions.json", "--output", ".planning/generated-cases/{feature}/case-import-payloads.json"])
89
+ ```
90
+
91
+ Stop if it exits non-zero. The compiler owns all target key selection, strategy decisions, and assertion formatting.
92
+
93
+ 11. Validate compiled payloads:
94
+
95
+ ```text
96
+ devflow_mainflow(action="validate", args=[".planning/generated-cases/{feature}/case-import-payloads.json", "--discovery", ".planning/generated-cases/{feature}/codebase-discovery.json", "--output", ".planning/generated-cases/{feature}/validation-report.md"])
97
+ ```
98
+
99
+ Stop if it exits non-zero.
100
+
101
+ 11. Write `.planning/phases/{phase}/MAINFLOW-CASES.md` summarizing:
102
+ - Generated case count by tag.
103
+ - Import payload path.
104
+ - Validation status.
105
+ - Source evidence index.
106
+ - Any environment data needed before execution.
107
+
108
+ 12. Report success only after compilation and validation pass.
109
+
110
+ ## AI Scope
111
+
112
+ AI is responsible for semantic judgment only:
113
+
114
+ - Determine feature scope from `.planning`.
115
+ - Confirm implemented behavior from actual code.
116
+ - Identify positive API mainflows.
117
+ - Identify positive UI mainflows.
118
+ - Generate `case-descriptions.json` in simplified intermediate format.
119
+ - Record source evidence for each case.
120
+
121
+ AI is NOT responsible for DSL formatting. The `compile_dsl.py` script owns:
122
+ - Target key selection (`label`, `css`, `placeholder`, etc.)
123
+ - Strategy decisions (`structured_first` vs `ai_only`)
124
+ - Assertion type selection and formatting
125
+ - Auth step generation
126
+ - Step ID assignment and dependency wiring
@@ -0,0 +1,27 @@
1
+ # API Mainflow Rules
2
+
3
+ API cases validate successful backend behavior through importable DSL.
4
+
5
+ ## Step Rules
6
+
7
+ - Use `driver: "api"`.
8
+ - Use HTTP method as `action`: `get`, `post`, `put`, `patch`, `delete`, `head`, or `options`.
9
+ - Set `params.url` for every API step.
10
+ - Put query values under `params.params`.
11
+ - Put JSON request payloads under `params.json` or `params.body`.
12
+ - Add success assertions for status code and key response fields where code/planning provide them.
13
+ - Extract ids or tokens only into variables, never literal secrets.
14
+ - Use `depends_on` to model required execution order.
15
+
16
+ ## Source Evidence
17
+
18
+ Cite at least one planning artifact and one code artifact per case:
19
+
20
+ - Planning: backend tech spec, change list, feature breakdown, or requirement baseline.
21
+ - Code: router/controller and service/usecase, plus schema/model when they define the contract.
22
+
23
+ ## Positive Mainflow Boundary
24
+
25
+ Allowed: create/list/detail/update/execute success flow for the current feature.
26
+
27
+ Not allowed: invalid request, unauthorized access, missing resource, validation error, conflict, retry, timeout, or performance scenario.
@@ -0,0 +1,54 @@
1
+ # Codebase Discovery
2
+
3
+ Use discovery before reading feature source files. The goal is to make the skill portable across projects that have valid `.planning` and `.context/spec` initialization artifacts.
4
+
5
+ ## Required Sources
6
+
7
+ Read and cross-check:
8
+
9
+ - `.planning/STATE.md`
10
+ - `.planning/navigation/INDEX.md`
11
+ - `.context/spec/index.md`
12
+ - `.planning/navigation/{CODEBASE}.md`
13
+ - `.context/spec/{domain}/{CODEBASE}.md`
14
+
15
+ Do not infer code roots from common directory names. Treat the navigation/spec registry as the source of truth.
16
+
17
+ ## Script Contract
18
+
19
+ Run:
20
+
21
+ ```text
22
+ devflow_mainflow(action="discover", args=["--output", ".planning/generated-cases/{feature}/codebase-discovery.json"])
23
+ ```
24
+
25
+ The script must fail if:
26
+
27
+ - `.planning/navigation/INDEX.md` is missing.
28
+ - `.context/spec/index.md` is missing.
29
+ - A registered codebase lacks a root path, navigation path, or spec path.
30
+ - A registered root path does not exist.
31
+ - A registered navigation/spec file does not exist.
32
+
33
+ ## Discovery Output
34
+
35
+ Use `codebase-discovery.json` fields:
36
+
37
+ - `codebases[].name`
38
+ - `codebases[].type`
39
+ - `codebases[].domain`
40
+ - `codebases[].root`
41
+ - `codebases[].navigation`
42
+ - `codebases[].spec`
43
+ - `codebases[].stack_key`
44
+ - `codebases[].scan_profile`
45
+
46
+ Current project discovery should resolve `BACKEND` and `FRONTEND`, but this is an output fact, not a skill rule.
47
+
48
+ ## Scan Range By Type
49
+
50
+ Backend codebases: read navigation/spec sections or file lists that declare router/controller, service/usecase, schema/dto/request/response, model/entity, and API entry points. Prefer files mentioned in planning documents and change lists.
51
+
52
+ Frontend codebases: read navigation/spec sections or file lists that declare router, pages/views, api/client, types/contracts, and stores/hooks/components related to the feature. Prefer files mentioned in planning documents and change lists.
53
+
54
+ If navigation/spec uses different labels, map them semantically rather than by exact heading.
@@ -0,0 +1,244 @@
1
+ # Intermediate Case Description Format
2
+
3
+ AI 产出的简化用例描述格式。locator 用 `"type:value"` 字符串,不直接写 DSL target。
4
+
5
+ ## Hard Rule: Source-Backed Terminology
6
+
7
+ **All UI text in locators, step names, and descriptions MUST be exact strings extracted from source code.** Do not invent, translate, or guess.
8
+
9
+ | 来源 | 可以用的 | 不可以用的 |
10
+ |---|---|---|
11
+ | 源码模板/JSX中的button文本 | `"text:查询"` | 自己编的 `"text:搜索"` |
12
+ | 源码中的placeholder属性 | `"placeholder:请输入名称"` | 猜的 `"placeholder:搜索关键词"` |
13
+ | 源码中的dialog title | `"verify:创建成功"` | 改写的 `"verify:操作成功"` |
14
+ | 路由/菜单配置文件 | `name: "项目管理"` | `name: "项目列表页"` |
15
+
16
+ **Anti-pattern**: AI 看到列表页的查询表单,自己把"查询"按钮改叫"搜索"按钮。源码写的是什么,locator 和 step name 就写什么。
17
+
18
+ ### List Page Pattern Recognition
19
+
20
+ 列表页常见两种模式,必须根据源码区分:
21
+
22
+ | 模式 | 特征 | 按钮文本 | 行为 |
23
+ |---|---|---|---|
24
+ | **列表查询/筛选** | 输入框+按钮在表格上方,URL含 `/List` 或 `/list` | 通常为"查询"、"筛选" | 过滤当前列表,不跳转 |
25
+ | **全局搜索** | 搜索框在header/侧边栏,触发路由跳转 | 通常为"搜索" | 跳转到搜索页 |
26
+
27
+ 判断依据: **看源码中按钮的实际文本**,不要自己推断。
28
+
29
+ ## Top-level shape
30
+
31
+ ```json
32
+ {
33
+ "project_id": 6,
34
+ "name": "Case name",
35
+ "description": "Positive mainflow purpose",
36
+ "tags": ["ui-mainflow"],
37
+ "variables": { "base_url": "http://admin.test.example.com" },
38
+ "auth": { ... },
39
+ "steps": [ ... ]
40
+ }
41
+ ```
42
+
43
+ ## Auth (optional)
44
+
45
+ Only include if the case needs API login + token injection.
46
+
47
+ ```json
48
+ {
49
+ "auth": {
50
+ "method": "api_login",
51
+ "login_url": "http://auth.test.example.com/admin/auth/login_by_id",
52
+ "login_body": { "userid": "${userid}", "password": "${password}" },
53
+ "token_path": "headers.X-Jwt-Token",
54
+ "app_token_url": "http://auth.test.example.com/admin/app/access",
55
+ "app_id": 6
56
+ }
57
+ }
58
+ ```
59
+
60
+ The compiler auto-generates: login API step → app token step → web inject step.
61
+
62
+ ## Steps
63
+
64
+ ### Common fields
65
+
66
+ | Field | Required | Description |
67
+ |---|---|---|
68
+ | `name` | yes | Human-readable step name |
69
+ | `action` | yes | See action types below |
70
+ | `timeout_ms` | no | Default 30000 for navigation, 5000 for UI clicks, 15000 for wait/verify |
71
+
72
+ ### Action types
73
+
74
+ #### `navigate` — open a page
75
+
76
+ ```json
77
+ {
78
+ "name": "导航到页面",
79
+ "action": "navigate",
80
+ "url": "${base_url}/admin/page"
81
+ }
82
+ ```
83
+
84
+ Compiler output: `driver=web, action=goto`
85
+
86
+ #### `click` — click a UI element
87
+
88
+ ```json
89
+ {
90
+ "name": "点击编辑",
91
+ "action": "click",
92
+ "locator": "text:编辑",
93
+ "scope": "row:1"
94
+ }
95
+ ```
96
+
97
+ Compiler output: `driver=ui, action=click, strategy=structured_first`
98
+
99
+ `scope` values:
100
+ - (omit) — page-unique element, compiler adds `exact: true`
101
+ - `"row:N"` — table row N, compiler adds CSS row selector alongside label
102
+ - `"dialog"` — inside a dialog, compiler uses label as-is
103
+
104
+ #### `fill` — fill a form input
105
+
106
+ ```json
107
+ {
108
+ "name": "输入名称",
109
+ "action": "fill",
110
+ "locator": "placeholder:请输入名称",
111
+ "value": "填写的内容"
112
+ }
113
+ ```
114
+
115
+ Compiler output: `driver=ui, action=fill, strategy=structured_first`
116
+
117
+ #### `select` / `hover` — select option or hover
118
+
119
+ ```json
120
+ {
121
+ "name": "选择类型",
122
+ "action": "select",
123
+ "locator": "text:类型A",
124
+ "value": "option_value"
125
+ }
126
+ ```
127
+
128
+ #### `verify` — verify success/result
129
+
130
+ ```json
131
+ {
132
+ "name": "验证操作成功",
133
+ "action": "verify",
134
+ "locator": "text:操作成功",
135
+ "expect": "text:操作成功",
136
+ "timeout_ms": 15000
137
+ }
138
+ ```
139
+
140
+ Compiler output: `driver=ui, action=act, strategy=ai_only`, with auto-generated prompt.
141
+
142
+ `expect` values:
143
+ - `"text:xxx"` → check that text "xxx" appears on screen
144
+ - `"dialog_visible"` → check dialog is open
145
+ - `"dialog_closed"` → check dialog closed
146
+ - `"url_contains:xxx"` → check URL contains "xxx"
147
+
148
+ #### API steps
149
+
150
+ ```json
151
+ {
152
+ "name": "创建记录",
153
+ "action": "post",
154
+ "params": {
155
+ "url": "${base_url}/api/resource",
156
+ "json": { "name": "test" }
157
+ },
158
+ "assertions": [
159
+ { "type": "status_code", "expected": 200 },
160
+ { "type": "json_path_exists", "path": "body.data.id" }
161
+ ],
162
+ "extract_vars": {
163
+ "resource_id": { "path": "body.data.id", "source": "jsonpath" }
164
+ }
165
+ }
166
+ ```
167
+
168
+ Compiler output: `driver=api, action=post`
169
+
170
+ #### `wait` — wait for page/element
171
+
172
+ ```json
173
+ {
174
+ "name": "等待加载",
175
+ "action": "wait",
176
+ "wait_for": "load",
177
+ "timeout_ms": 5000
178
+ }
179
+ ```
180
+
181
+ Compiler output: `driver=web, action=wait`
182
+
183
+ #### `inject_token` — inject auth token
184
+
185
+ Rarely needed directly — prefer using `auth` config. Only use if auth pattern is non-standard.
186
+
187
+ ```json
188
+ {
189
+ "name": "注入Token",
190
+ "action": "inject_token",
191
+ "script": "localStorage.setItem('token', '${jwt_token}')"
192
+ }
193
+ ```
194
+
195
+ ## Locator Hard Rules — Zero Tolerance for Fabrication
196
+
197
+ **CSS 选择器和 XPath 是精确匹配器,必须来自源码实际存在的 class/结构。禁止 AI 编造任何 CSS class 名或 XPath 表达式。**
198
+
199
+ 编译器检测到以下特征会直接拒绝:
200
+ - CSS 含 `%`(编造的 utility class,如 `.w-100%`)
201
+ - 纯容器类(`.el-form-item`、`.el-form-item__content`)— 匹配所有字段而非特指
202
+ - 随机生成的 class 名模式
203
+ - 长度 < 10 字符的裸 class
204
+
205
+ ### fill 动作的硬决策链
206
+
207
+ fill 动作按此顺序选择 locator,禁止跳过:
208
+
209
+ 1. 字段有 placeholder? → `placeholder:xxx`
210
+ 2. 没有?字段前有 label 文本? → `near:label文本`
211
+ 3. 都不行? → `ai_only`(禁止编 CSS)
212
+
213
+ ### click 动作的决策链
214
+
215
+ 1. 页面唯一文本(按钮/菜单/tab) → `text:xxx`
216
+ 2. 表格行操作(每行重复) → `text:编辑` + `scope: "row:N"`
217
+ 3. ARIA 属性完整 → `role:button:确定`
218
+ 4. 对话框内确定/取消 → `css:.el-dialog__footer .el-button--primary`(Element Plus 标准结构,非编造)
219
+ 5. 源码中有明确的特定 class(须在 source-map.md 注明出处) → `css:xxx`
220
+ 6. 都不行 → `ai_only`
221
+
222
+ ## Locator Format Reference
223
+
224
+ | Format | Example | Compiler produces |
225
+ |---|---|---|
226
+ | `text:<text>` | `"text:新增项目库"` | `{"label": "新增项目库", "exact": true}` |
227
+ | `placeholder:<text>` | `"placeholder:请输入名称"` | `{"placeholder": "请输入名称"}` |
228
+ | `near:<text>` | `"near:项目介绍"` | `{"near_text": "项目介绍"}` |
229
+ | `css:<selector>` | `"css:.el-dialog__footer .el-button--primary"` | `{"css": ".el-dialog__footer ..."}` |
230
+ | `role:<role>:<name>` | `"role:button:确定"` | `{"role": "button", "name": "确定"}` |
231
+ | `xpath:<expr>` | `"xpath://button[text()='确定']"` | `{"xpath": "//button[text()='确定']"}` |
232
+
233
+ ### Anti-patterns
234
+
235
+ ```
236
+ // WRONG: 编造的 CSS class
237
+ "locator": "css:.w-100% .el-form-item__content"
238
+
239
+ // WRONG: 纯容器类,不特指字段
240
+ "locator": "css:.el-form-item__content"
241
+
242
+ // CORRECT: fill 用 near_text
243
+ "locator": "near:项目介绍"
244
+ ```
@@ -0,0 +1,36 @@
1
+ # Mainflow Selection
2
+
3
+ Generate only positive API/UI mainflows that represent normal user or system success paths.
4
+
5
+ ## Include
6
+
7
+ - P0/P1 positive scenarios explicitly implemented by the current feature.
8
+ - API flows that call public API entries in successful order with valid request data.
9
+ - UI flows that cover the primary happy path visible to users.
10
+ - UI flows may include API setup steps if needed to create prerequisites.
11
+ - Assertions that confirm success status, expected response fields, visible UI state, or navigation result.
12
+
13
+ ## Exclude
14
+
15
+ - Exceptions, error handling, invalid input, missing data, retry, timeout, conflict, and rollback cases.
16
+ - Boundary value tests.
17
+ - Permission/role/security tests.
18
+ - Performance, load, concurrency, soak, and stability tests.
19
+ - Migration-only checks and internal refactor checks.
20
+ - Flows not implemented in actual code, even if mentioned in planning.
21
+ - Historical modules excluded by navigation.
22
+
23
+ ## Selection Method
24
+
25
+ 1. Use planning documents to identify intended feature scope and FP/BR/CR IDs.
26
+ 2. Use code to confirm implemented endpoints, UI routes, components, and API client calls.
27
+ 3. Keep a case only when planning intent and code reality both support it.
28
+ 4. Prefer fewer complete mainflow cases over many shallow fragments.
29
+ 5. Record every inclusion and exclusion in `mainflow-analysis.md`.
30
+
31
+ ## Case Granularity
32
+
33
+ - One API case should cover one coherent backend success path.
34
+ - One UI case should cover one coherent user journey.
35
+ - Do not split a single user journey into multiple cases unless the platform requires independent setup.
36
+ - Do not combine unrelated features into one case.