@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,119 @@
1
+ # 项目历史分析指引
2
+
3
+ ## 加载顺序
4
+
5
+ 1. `.planning/PROJECT.md` — 项目上下文和已上线能力
6
+ 2. `.planning/navigation/INDEX.md` — 代码库注册表(Codebase Registry),从中识别与需求相关的代码库
7
+ 3. `.planning/navigation/{name}.md` — 加载 INDEX.md 中标识的相关代码库的导航文件
8
+ 4. `.planning/milestones/` — 归档的里程碑记录,是本工作流的主要历史口径
9
+ 5. `.planning/requirements/` — 已确认或历史需求基线
10
+ 6. `.planning/lessons/` — 跨里程碑经验教训
11
+ 7. `.planning/*/CONTEXT.md` — 之前阶段的决策记录
12
+ 8. `features/`、`.context/lessons/`、`.context/workflow/` — 仅当目标项目存在时作为兼容历史或项目规则来源,不作为默认历史口径
13
+
14
+ ## 对比分析要点
15
+
16
+ ### 入口分诊证据复用
17
+
18
+ - 如果 `.planning/requirements/{功能名}/入口分诊.md` 存在,先读取其中的"已实现/重叠检查"和"历史拒绝/范围检查"。
19
+ - 分诊结果只能作为 Phase 4/4.5 的优先证据入口,不能替代源码比差。
20
+ - 当分诊结论为 `already_done`、`wontfix` 或 `ready_for_human` 时,baseline 不应继续生成通过状态,除非用户明确改变范围或推翻历史决策。
21
+ - 分诊已搜索的来源必须并入 baseline 的搜索来源记录,避免重复声明"未发现历史"。
22
+
23
+ ### 功能重叠检测
24
+ - 本次需求功能是否已存在于 milestones 中?
25
+ - 是修改还是全新功能?
26
+ - 历史功能中有无类似的流程可复用?
27
+
28
+ ### 影响分析
29
+ - 本次需求会修改哪些历史功能的流程?
30
+ - 影响的范围是什么(字段变更/逻辑调整/接口修改)?
31
+ - 是否需要兼容旧数据?
32
+
33
+ ### 遗漏检测
34
+ - 历史功能中是否有本次需求需要配套的场景?
35
+ - 例如:新增 XX 管理 → 是否需要在日志/权限/通知中体现?
36
+ - 例如:新增 XX 页面 → 是否需要考虑菜单/路由/权限配置?
37
+ - 项目导航中是否存在相关前端页面、组件、后端模块、服务、模型或接口?
38
+ - 本次需求是否影响导航中记录的入口、命令、组件约定或分层约定?
39
+
40
+ ### 历史口径映射
41
+
42
+ - outbound-call 中的 `features/*.spec.md` 对应本工作流里的 `.planning/milestones/`、`.planning/requirements/baseline.md` 和阶段 `CONTEXT.md`。
43
+ - outbound-call 中的 `.context/lessons/README.md` 对应本工作流里的 `.planning/lessons/README.md`;如果目标项目同时存在 `.context/lessons/`,将其标为项目规则/遗留经验来源。
44
+ - 输出时必须写清楚实际搜索了哪些目录或文件,不能只写"未发现历史"。
45
+
46
+ ## 三级递进审查
47
+
48
+ 项目历史分析不是一次性检查,而是三级递进。每一级无发现时进入下一级,有发现时触发需求回洗。
49
+
50
+ ### Level 1: 导航 Call Chain Map 对照(结构层)
51
+
52
+ **输入**:FP + 导航文件的 API Modules / Route-Component Map / Data Flow 表
53
+
54
+ **操作**:
55
+ 1. 对每个涉及已有代码的 FP,从导航 Call Chain Map 中提取受影响的文件清单:
56
+ - 前端:受影响的路由、页面组件、composable、API 模块
57
+ - 后端:受影响的 handler、service、repository、DAO
58
+ 2. 判断调用链重叠类型:在现有调用链上扩展(修改已有方法) vs 新建独立调用链
59
+ 3. 契约影响预判:如果修改已有查询参数、接口签名、响应结构或组件输入,检查 Call Chain Map 中是否有其他调用方
60
+ 4. 如果 navigation 没有候选路径,必须用需求关键词、API 路径、页面名、字段名、状态名通过 `rg` 查实际源码。navigation 只能引导查找,不能单独证明"无相关代码"。
61
+
62
+ **输出**:每个 FP 的受影响文件清单 + 调用链重叠类型
63
+
64
+ - **找到候选调用链或既有模块** → 必须进入 Level 2
65
+ - **仍找不到候选源码路径,且 FP 是明确全新、无既有模块重叠** → 记录搜索范围和"未找到候选路径",可跳过 Level 2
66
+ - **仍找不到候选源码路径,但 FP 是修改、影响或疑似重叠已有模块** → 记录 `code_reality_missing`,不得审查通过
67
+
68
+ ### Level 2: 源码逻辑侵入(逻辑层)
69
+
70
+ **触发条件**:Level 1 找到候选调用链、既有模块、相似接口、相似页面、相似服务、相似模型,或当前 FP 声称要修改/影响已有能力。
71
+
72
+ **操作**:侵入到调用链末端的源码,逐项比差:
73
+ 1. 读 model/domain/schema → 需求字段是否已存在?
74
+ 2. 读 DAO/repository/query → 筛选条件是否已支持?
75
+ 3. 读 service/engine/job → 校验/计算/状态机/异步规则是否已有?
76
+ 4. 读 response/view model/type → 前端是否已经拿到相关数据?
77
+ 5. 读 router/handler/API module → 是否有类似接口可以复用?
78
+
79
+ **比差结果分三类**:
80
+
81
+ | 结果 | 含义 | 后续动作 |
82
+ |------|------|---------|
83
+ | 已存在且一致 | 代码已有此能力 | 触发 Level 3:范围是否可缩小? |
84
+ | 已存在但冲突 | 命名/类型/逻辑不一致 | 触发 Level 3:修改现有还是新建?兼容性? |
85
+ | 不存在 | 确认是全新能力缺口 | 记录需求缺口和下游 tech-spec 评估点,进入下一 FP |
86
+
87
+ **没有足够源码证据完成比差时** → 记录 `code_reality_missing`,不得审查通过
88
+
89
+ ### Level 3: 需求回洗 + 定向重问
90
+
91
+ **触发条件**:Level 2 发现"已存在且一致"或"已存在但冲突"
92
+
93
+ **操作**:
94
+ 1. 将 Level 2 的比差结果转换为定向问题,每条问题带源码证据(文件路径 + 行号 + 当前逻辑)
95
+ 2. 重新审视原始需求:用户是否知道现状?知道后是否调整范围?
96
+ 3. 更新受影响的 FP、BR、BC,记录到 `澄清与变更记录`
97
+
98
+ **问题格式**:
99
+ ```
100
+ FP-005 涉及 user_dao.go:36 的 GetUserListParam 已有 CooperationTypes 筛选字段。
101
+ 需求提到的"新增合作类型筛选"是直接用这个字段、还是要新增不同的筛选维度?
102
+ ```
103
+
104
+ **规则**:
105
+ - 每个比差发现必须绑定到具体 FP-ID
106
+ - 问题必须带源码证据,不能泛泛问
107
+ - 用户回答后立即更新受影响的 FP/BR/BC/范围项
108
+ - 不得自行选择方案
109
+
110
+ ---
111
+
112
+ ## 输出要求
113
+
114
+ 每次分析后,在 baseline.md 中明确记录:
115
+ - 与历史功能的关联关系(新增/修改/影响)
116
+ - 兼容性要求
117
+ - 关联到的项目导航文件和模块路径
118
+ - **三级递进审查结果**:Level 1 受影响的调用链文件清单、Level 2 源码比差结论、Level 3 回洗决策
119
+ - 已搜索的里程碑、需求基线、lesson 或 legacy history 来源
@@ -0,0 +1,76 @@
1
+ # 需求澄清提问指南
2
+
3
+ ## 核心理念
4
+
5
+ 你是思考伙伴,不是面试官。帮助用户发现和表达他们真正需要的功能。
6
+
7
+ ## 提问前置条件
8
+
9
+ 不要一接收需求就泛泛提问。
10
+
11
+ 先完成最低限度的事实准备:
12
+
13
+ 1. 已读取项目上下文和 navigation registry
14
+ 2. 已处理 PRD 中可见图片;无法识别的图片已按 `critical_image` / `supporting_image` / `decorative_image` 分类并说明原因。无法判断用途时默认 `supporting_image` 且标 `推断,待确认`
15
+ 3. 已根据 navigation registry 做轻量代码路由扫描;navigation 只作为文件索引,不能作为行为结论的唯一依据
16
+ 4. 已形成代码路由摘要:可能相关模块、候选源码路径、映射到这些路径的需求词、需要 Phase 4 深查的问题
17
+ 5. 已将问题绑定到来源、现有模块、候选 FP/BR/BC/CR,或图片阻塞点
18
+
19
+ 如果只读了 `.planning/navigation/*.md` 或只做了 Phase 1.5 轻量路由扫描,不得声称“当前系统已支持/不支持某能力”。只能说“可能相关”,并在 Phase 4 Level 2 下钻源码后再产出行为结论。
20
+
21
+ 在 Phase 2 之前,只允许问会阻塞需求理解的输入澄清问题,例如 `critical_image` 无法识别、核心业务目标缺失、需求明显指向多个现有模块但无法判断边界。
22
+
23
+ Phase 5 的 Review/Challenge 提问必须围绕具体 FP/BR/BC/CR 或已有模块证据。
24
+
25
+ ## 提问节奏
26
+
27
+ - 先生成按优先级排序的问题队列,但每次只问一个问题。
28
+ - 每个问题按 `Q1`、`Q2`、`Q3` 编号;歧义追问使用 `Q2.1` 这类后缀。
29
+ - 每个问题前加一行 `已发现:...`,说明来自源码、需求来源或审查发现的具体依据;不要只引用 navigation 摘要作为行为事实。
30
+ - 先合并同类问题,再提问,确保一个回答尽量解决一个明确缺口。
31
+ - 获取用户回答后,先复查该回答是否影响之前已整理的需求、功能点、业务规则、边界场景、范围控制或下游契约。
32
+ - 如果回答影响之前内容,先更新对应需求项并记录变更,再继续问下一个问题。
33
+ - 非阻塞问题写入待确认事项,不打断用户。
34
+ - 阻塞问题必须提问并获得答案;不能仅写入待确认事项后继续标记基线通过。
35
+
36
+ ## 回答后复查
37
+
38
+ 每个回答都要分类:
39
+
40
+ - 确认原需求
41
+ - 修正原需求
42
+ - 新增需求
43
+ - 缩小范围
44
+ - 扩大范围
45
+ - 与之前内容冲突
46
+
47
+ 如果是修正、新增、缩小、扩大或冲突,必须更新受影响的 FP/BR/BC/范围项。不要只把回答追加到待确认事项。
48
+
49
+ ## 提问类型
50
+
51
+ ### 理解需求
52
+ - "已发现:当前后台已有 `ProjectService` 和项目列表入口,但需求未说明使用者范围。\n\nQ1: FP-001 的主要使用者是哪个角色?"
53
+ - "已发现:现有执行记录只保留运行结果,需求提到留痕但未说明业务目的。\n\nQ2: FP-002 解决的业务问题是减少人工处理,还是补齐数据留痕?"
54
+
55
+ ### 深入细节
56
+ - "已发现:需求中的 X 在现有模块里没有同名字段或枚举。\n\nQ3: FP-003 中提到的 X 具体是指什么?能举个例子吗?"
57
+ - "已发现:当前相关接口只返回成功状态,未看到失败状态映射。\n\nQ4: FP-004 的成功和失败情况分别怎么处理?"
58
+ - "已发现:现有列表仅展示名称和状态,需求提到导出但没有字段清单。\n\nQ5: FP-005 涉及哪些展示、存储、筛选或导出字段?"
59
+
60
+ ### 边界场景
61
+ - "已发现:现有页面对空数据使用 Ant Design Empty,但该需求未说明文案。\n\nQ6: FP-006 数据为空时应该展示什么?"
62
+ - "已发现:当前相关接口失败会展示通用错误提示,需求未说明是否允许重试。\n\nQ7: FP-006 接口超时或失败时用户看到什么?是否允许重试?"
63
+ - "已发现:现有服务没有频率限制或幂等记录。\n\nQ8: FP-007 操作频率有没有限制?"
64
+ - "已发现:当前权限不足的入口处理方式在不同页面不一致。\n\nQ9: FP-008 权限不足时隐藏入口还是展示无权限提示?"
65
+
66
+ ### 历史对比
67
+ - "已发现:现有 XX 模块已有相似流程,但入口和数据范围不同。\n\nQ10: FP-009 跟现有 XX 模块是什么关系?"
68
+ - "已发现:需求描述既像新增入口,也像扩展现有功能。\n\nQ11: FP-009 是修改现有功能还是全新添加?"
69
+ - "已发现:现有表中已有历史记录,需求未说明迁移或兼容策略。\n\nQ12: FP-010 是否需要兼容旧数据?"
70
+
71
+ ## 回避行为
72
+ - ❌ 按照清单机械提问
73
+ - ❌ 使用"利益相关者""成功标准"等术语
74
+ - ❌ 匆匆提问跳到输出
75
+ - ❌ 接受模糊答案不追问
76
+ - ❌ 没有功能点 ID 的泛泛提问
@@ -0,0 +1,115 @@
1
+ # Requirement Review Checklist
2
+
3
+ Use this checklist after feature point decomposition and before writing the baseline.
4
+
5
+ ## Severity
6
+
7
+ - `blocker`: cannot produce a reliable baseline without clarification
8
+ - `warning`: baseline can proceed but downstream technical docs may need follow-up
9
+ - `info`: useful improvement, not blocking
10
+
11
+ ## Checklist
12
+
13
+ ### Coverage
14
+
15
+ - Every raw requirement maps to a feature point, rule, boundary case, out-of-scope item, or pending question.
16
+ - The baseline includes a raw requirement traceability table.
17
+ - The baseline includes a current feature slice listing only this round's FP/BR/BC IDs.
18
+ - Cross-feature dependencies are listed in `depends_on` when current scope relies on historical FP/BR/BC behavior.
19
+ - Feature point IDs are stable and unique.
20
+ - Feature points include type and priority.
21
+ - Duplicates are merged.
22
+ - Mixed requirements are split.
23
+ - Every feature point, business rule, boundary case, dependency, and pending question has a source reference or is explicitly marked `推断,待确认`.
24
+
25
+ ### Clarity
26
+
27
+ - Each feature point has a clear actor, entry, action, expected result, and status.
28
+ - Inferred items are marked `推断,待确认`.
29
+ - Pending questions are concrete and tied to feature point IDs.
30
+ - Clarification answers are applied to affected existing items before new questions are asked.
31
+ - Requirement changes caused by clarification are recorded in `澄清与变更记录`.
32
+
33
+ ### Business Rules
34
+
35
+ - Required fields, validation, calculation, status, eligibility, and limits are recorded.
36
+ - Historical data handling is recorded when data structure or status changes.
37
+ - Import/export fields and formats are explicit when import/export appears.
38
+
39
+ ### Boundary Cases
40
+
41
+ - Empty data
42
+ - Invalid input
43
+ - Duplicate operation
44
+ - Permission denied
45
+ - Interface timeout/failure
46
+ - Partial success/failure
47
+ - Large data volume
48
+ - Old data compatibility
49
+
50
+ ### Project Impact(三级递进审查)
51
+
52
+ #### Level 1: 导航 Call Chain Map 对照(结构层)
53
+
54
+ - [ ] 每个涉及已有代码的 FP,已从导航 Call Chain Map 提取受影响的文件清单:
55
+ - 前端:受影响的路由、页面组件、composable、API 模块
56
+ - 后端:受影响的 handler、service、repository、DAO
57
+ - [ ] 如果 `.planning/code-index/` 存在,已通过 `code-index-query` 查询需求关键词、API 路径、页面名、字段名、状态名、表/配置/资源名,并记录使用到的 symbol/relation id
58
+ - [ ] 调用链重叠类型已判断:扩展已有调用链 vs 新建独立调用链
59
+ - [ ] 契约影响已预判:修改已有接口/参数时,已检查 Call Chain Map 中的其他调用方
60
+ - [ ] 受影响的调用链文件、路由、API 路径已写回 FP 的"关联已有模块"
61
+ - [ ] 如果 code-index 缺失、过期或无有效命中,已记录 fallback 原因和实际搜索范围
62
+
63
+ #### Level 2: 源码逻辑侵入(逻辑层)
64
+
65
+ Level 1 无明显冲突时启动;Level 1 有发现的 FP 必须过 Level 2。
66
+
67
+ - [ ] 对每个关联到已有调用链的 FP,已读源码做比差:
68
+ - model/domain/schema → 字段是否已存在
69
+ - DAO/repository/query → 筛选/排序是否已支持
70
+ - service/engine/job → 校验/计算/状态机/异步逻辑是否已有
71
+ - response/view model/type → 前端数据是否已拿到
72
+ - router/handler/API module → 是否有类似接口可复用
73
+ - [ ] 比差结果已分类:已存在且一致 / 已存在但冲突 / 不存在
74
+ - [ ] 比差结论已记录,每条带源码证据(文件路径 + 行号 + 当前行为)
75
+ - [ ] 使用 code-index relation 的结论,已回读 `evidence_path:evidence_line` 附近源码;未仅凭 Markdown 或 relation 摘要下结论
76
+ - [ ] 代码现实对照表只包含源码现状、比差结论、需求影响,不包含实现方案、DDL、API 设计、字段设计或代码任务
77
+
78
+ #### Level 3: 需求回洗
79
+
80
+ Level 2 发现"已存在且一致"或"已存在但冲突"时启动。
81
+
82
+ - [ ] 比差发现已转为定向问题,每条带源码证据 + 具体选项
83
+ - [ ] 用户回答后,受影响的 FP/BR/BC/范围项已更新
84
+ - [ ] 回洗结果已记录到 `澄清与变更记录`
85
+
86
+ #### 通用
87
+
88
+ - Historical feature overlap is classified as new, modify, replace, or affect.
89
+ - Compatibility requirements are recorded.
90
+ - Reuse opportunities are checked across business capability, installed library, and project pattern layers.
91
+ - Historical lessons or prior work are searched using the workflow history model first: `.planning/milestones/`, `.planning/requirements/`, `.planning/lessons/`, and `.planning/*/CONTEXT.md`.
92
+ - Legacy history such as `features/` or `.context/lessons/` is used only when present and is labeled as legacy/project-rule evidence.
93
+ - The searched sources are recorded before claiming no related history.
94
+
95
+ ### Challenge Review
96
+
97
+ - Over-engineering candidates are recorded or explicitly marked as not found.
98
+ - Important or expensive feature points include alternative-path rationale or a recorded pending decision.
99
+ - When alternatives are ruled out, the hard constraints and their source are recorded.
100
+ - User decisions are recorded for scope, reuse, priority, and alternative-path choices.
101
+ - Vague confirmations are not treated as decision rationale when a scope, reuse, priority, or alternative-path decision needs a reason.
102
+ - Challenge results appear in `反向审视与用户拍板`.
103
+
104
+ ### Downstream Readiness
105
+
106
+ - One canonical feature name and `.planning/features/{功能名}/` output directory are defined.
107
+ - Current feature slice and `depends_on` are sufficient for downstream skills to load current scope plus required historical context.
108
+ - Frontend has enough information to identify pages, interactions, states, and API dependencies.
109
+ - Backend has enough information to identify data, services, interfaces, rules, and risks.
110
+ - Test has enough information to write acceptance cases.
111
+
112
+ ### Scope Control
113
+
114
+ - Out-of-scope items are explicit.
115
+ - No implementation plan, code task, database DDL, or roadmap is included.
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: workflow-requirement-triage
3
+ description: "Use as the lightweight first step for a new request, bug report, PRD, or feature idea. Classify the request, check shallow duplicate and prior out-of-scope/rejected decisions, then route a viable request into workflow-wayfinder; do not perform deep requirement validation or route directly to baseline."
4
+ ---
5
+
6
+ # Workflow: Requirement Triage(需求入口分诊)
7
+
8
+ 在需求主链开始时,只判断:这个需求是否应该继续、是否已经实现、是否曾被拒绝。正常需求一律进入 `workflow-wayfinder`,由后续领域建模和可实现性审查决定是否可进入基线。
9
+
10
+ ## Outputs
11
+
12
+ Always create or update:
13
+
14
+ - `.planning/requirements/{功能名}/入口分诊.md`
15
+ - `.planning/requirements/{功能名}/入口分诊.meta.json`
16
+
17
+ `入口分诊.meta.json` minimum fields:
18
+
19
+ ```json
20
+ {
21
+ "feature_name": "",
22
+ "status": "checked | routed | blocked | superseded",
23
+ "request_type": "bug | enhancement | change | refactor | research | unknown",
24
+ "route": "ready_for_wayfinder | needs_info | ready_for_human | already_done | wontfix",
25
+ "route_reason": "",
26
+ "duplicate_count": 0,
27
+ "prior_rejection_count": 0,
28
+ "blocking_question": "",
29
+ "next_skill": "workflow-requirement-baseline | workflow-demand-clarify | workflow-wayfinder | none",
30
+ "searched_sources": [],
31
+ "related_code_paths": [],
32
+ "related_history_paths": []
33
+ }
34
+ ```
35
+
36
+ ## State Machine
37
+
38
+ Triage is a hard entry gate. It may be marked complete in the orchestrator only when:
39
+
40
+ - `status = routed`
41
+ - `route = ready_for_wayfinder`
42
+
43
+ Other routes stop normal workflow advancement until the requested human answer, clarification, wayfinding, or explicit override changes the route.
44
+
45
+ Allowed states:
46
+
47
+ | status | Meaning | May advance to baseline |
48
+ |--------|---------|-------------------------|
49
+ | `checked` | Triage report was written, but route has not been accepted or is still being evaluated | No |
50
+ | `routed` | Route is accepted and next step is known | Yes, only when route is `ready_for_wayfinder` |
51
+ | `blocked` | A missing answer or external action blocks route selection | No |
52
+ | `superseded` | A newer triage report or user override replaced this one | No |
53
+
54
+ Route handling:
55
+
56
+ | route | Required behavior |
57
+ |-------|-------------------|
58
+ | `ready_for_wayfinder` | Set `status=routed`, `next_skill=workflow-wayfinder`, then the workflow may complete this step. |
59
+ | `needs_info` | Set `status=blocked`, write exactly one `blocking_question`. |
60
+ | `ready_for_human` | Set `status=blocked`, report why the request cannot be agent-routed. |
61
+ | `already_done` | Set `status=blocked`, point to existing capability evidence; baseline only continues if the user reframes this as a change. |
62
+ | `wontfix` | Set `status=blocked`, point to prior rejection/out-of-scope evidence; baseline only continues if the user explicitly reverses it. |
63
+
64
+ If the user overrides a blocked route, update the same meta file with the override reason. Do not leave two active triage conclusions for one feature.
65
+
66
+ Prefer deterministic route updates:
67
+
68
+ ```bash
69
+ devflow_skill_script(script="orchestrator-update-triage", args=["--feature", "{功能名}", "--route", "ready_for_wayfinder", "--reason", "{reason}", "--write", "--json"])
70
+ ```
71
+
72
+ ## Phase 1 — Intake And Naming
73
+
74
+ 1. Parse the user's request, PRD, meeting note, issue text, or pasted description.
75
+ 2. Pick a short stable `{功能名}` path segment. If no reliable name can be inferred, use the clearest noun phrase and mark it `推断,待确认`.
76
+ 3. Classify request type:
77
+ - `bug`: observed behavior differs from expected behavior.
78
+ - `enhancement`: new user/business capability.
79
+ - `change`: adjustment to an existing capability.
80
+ - `refactor`: internal simplification or architecture change with no intended external behavior change.
81
+ - `research`: only asks for investigation or decision support.
82
+ - `unknown`: insufficient input.
83
+
84
+ If the input lacks actor, desired outcome, or concrete change, do not ask a long questionnaire. Record the gap and route to `needs_info` only when the topic itself cannot be understood; otherwise let Wayfinder create the appropriate Grilling ticket.
85
+
86
+ ## Phase 2 — Existing Capability Check
87
+
88
+ Search by domain concept, not just exact words.
89
+
90
+ Required sources:
91
+
92
+ 1. `.planning/requirements/baseline.md`
93
+ 2. `.planning/features/`
94
+ 3. `.planning/milestones/`
95
+ 4. `.planning/lessons/`
96
+ 5. `.planning/*/CONTEXT.md`
97
+ 6. `.planning/navigation/INDEX.md` and relevant navigation files
98
+ 7. `code-index-query` against `.planning/code-index/` when present, for shallow symbol/entrypoint/resource candidate lookup
99
+ 8. Actual source files only enough to confirm whether a likely capability exists
100
+
101
+ Search strategy:
102
+
103
+ - Extract 3-8 domain concepts from the request: object names, statuses, actions, roles, reports, APIs, pages, scheduled jobs, fields.
104
+ - For each concept, search Chinese terms, known synonyms, route/API names, table/model names, and status names.
105
+ - If code-index exists, use `code-index-query` to search symbols/relations first and treat results as shallow candidates only.
106
+ - If navigation points to likely source paths, open concise entry points and line ranges sufficient to establish current behavior.
107
+ - Record every searched source. Do not claim "未发现" from memory.
108
+
109
+ Depth limit:
110
+
111
+ - Read names, routes, menu entries, API declarations, models, enum/status constants, comments, and short surrounding line ranges.
112
+ - Do not perform full call-chain analysis, SQL/data-flow comparison, permission proof, or business-rule diff here. Those belong to `workflow-requirement-baseline` Phase 4.
113
+ - If confirming current behavior would require deep inspection, record `需 baseline 源码比差` and route based on the shallow evidence.
114
+
115
+ Result categories:
116
+
117
+ | Category | Meaning | Route |
118
+ |----------|---------|-------|
119
+ | 已实现且一致 | Current behavior already satisfies the request | `already_done` |
120
+ | 已实现但用户可能不知道 | Capability exists but may be hidden, permission-limited, or named differently | `ready_for_human` |
121
+ | 部分重叠 | Existing behavior covers part of request | `ready_for_baseline` with reuse note |
122
+ | 冲突 | Existing behavior contradicts requested behavior | `ready_for_baseline` with conflict note |
123
+ | 未发现 | No reliable overlap after searched sources | Continue triage |
124
+
125
+ ## Phase 3 — Prior Rejection / Out-Of-Scope Check
126
+
127
+ Search for prior decisions that intentionally avoided this request.
128
+
129
+ Required sources:
130
+
131
+ - `.planning/requirements/baseline.md`
132
+ - `.planning/features/**/需求梳理.md`
133
+ - `.planning/features/**/需求澄清记录.md`
134
+ - `.planning/features/**/PROGRESS.md`
135
+ - `.planning/milestones/`
136
+ - `.planning/lessons/`
137
+ - `.planning/*/CONTEXT.md`
138
+ - `.out-of-scope/` if present
139
+
140
+ Treat these as prior rejection signals:
141
+
142
+ - `wontfix`
143
+ - `out of scope` / `移出范围` / `暂不做` / `不做`
144
+ - `废弃`
145
+ - `后续再说` when the current request repeats the same reason
146
+ - historical decision that chose the opposite business rule
147
+
148
+ If found, route:
149
+
150
+ - `wontfix` when the current request exactly repeats a still-valid rejection.
151
+ - `ready_for_human` when the user may intentionally be reversing a prior decision.
152
+ - `ready_for_baseline` when the prior decision is related but not blocking; record it as context.
153
+
154
+ ## Phase 4 — Scale And Fog Routing
155
+
156
+ For every viable new or changed requirement, route to `workflow-wayfinder`. Do not decide that a request is “ready for baseline” here. Wayfinder owns fog/ticket decomposition; domain modeling owns terms and ownership; feasibility review owns the baseline gate. A focused clarification question may occur later as a Wayfinder Grilling ticket.
157
+
158
+ ## Phase 5 — Write Triage Report
159
+
160
+ `入口分诊.md` structure:
161
+
162
+ ```markdown
163
+ # 入口分诊:{功能名}
164
+
165
+ ## 原始输入
166
+ {source summary}
167
+
168
+ ## 分类
169
+ - 类型:{request_type}
170
+ - 推荐路由:{route}
171
+ - 下一技能:{next_skill}
172
+
173
+ ## 已实现/重叠检查
174
+ | 概念 | 搜索范围 | 发现 | 证据 | 结论 |
175
+ |------|----------|------|------|------|
176
+
177
+ ## 历史拒绝/范围检查
178
+ | 关键词 | 搜索范围 | 历史记录 | 影响 |
179
+ |--------|----------|----------|------|
180
+
181
+ ## 路由理由
182
+ {why this route is chosen}
183
+
184
+ ## 待用户确认
185
+ {only blocking or decision-changing questions}
186
+ ```
187
+
188
+ ## User Question Rule
189
+
190
+ Ask at most one question, only when route cannot be decided without it. If the next reasonable step is clear, do not ask; write the route and proceed.
191
+
192
+ ## Completion Rule
193
+
194
+ Only tell `workflow-orchestrator` to complete `requirement-triage` after writing:
195
+
196
+ ```json
197
+ {
198
+ "status": "routed",
199
+ "route": "ready_for_wayfinder",
200
+ "next_skill": "workflow-wayfinder"
201
+ }
202
+ ```
203
+
204
+ For every other route, stop after writing the report and explain the next action.