@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,219 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "date"
5
+ require "fileutils"
6
+ require "json"
7
+ require "optparse"
8
+ require "yaml"
9
+
10
+ options = {
11
+ state: nil,
12
+ select: false,
13
+ write_template: false,
14
+ title: nil,
15
+ source: nil,
16
+ next_step: nil,
17
+ write: false,
18
+ json: false
19
+ }
20
+
21
+ OptionParser.new do |opts|
22
+ opts.banner = "Usage: manage_lessons.rb [--select] [--write-template --title TITLE] [options]"
23
+ opts.on("--state PATH", "Read an alternate STATE.md file") { |path| options[:state] = path }
24
+ opts.on("--select", "Select relevant lessons from configured indexes") { options[:select] = true }
25
+ opts.on("--next-step STEP", "Target step ID for lesson matching") { |step| options[:next_step] = step }
26
+ opts.on("--write-template", "Create a new lesson template") { options[:write_template] = true }
27
+ opts.on("--title TITLE", "Lesson title for template creation") { |title| options[:title] = title }
28
+ opts.on("--source PATH", "Evidence/source artifact path") { |path| options[:source] = path }
29
+ opts.on("--write", "Persist template/index changes. Without this flag, preview only.") { options[:write] = true }
30
+ opts.on("--json", "Print JSON output") { options[:json] = true }
31
+ end.parse!
32
+
33
+ root = Dir.pwd
34
+ state_path = options[:state] ? File.expand_path(options[:state], root) : File.join(root, ".planning", "STATE.md")
35
+
36
+ def front_matter(markdown)
37
+ match = markdown.match(/\A---\n(.*?)\n---\n/m)
38
+ match && match[1]
39
+ end
40
+
41
+ def load_yaml_file(path)
42
+ YAML.safe_load(File.read(path), permitted_classes: [], aliases: false)
43
+ end
44
+
45
+ def load_state(path)
46
+ doc = File.read(path)
47
+ yaml = front_matter(doc)
48
+ raise "missing state front matter: #{path}" if yaml.nil?
49
+
50
+ YAML.safe_load(yaml, permitted_classes: [], aliases: false)
51
+ end
52
+
53
+ def workflow_path_for(state)
54
+ state["workflow_config"] || File.join(".planning", "workflows", "#{state.fetch("current_flow")}.yaml")
55
+ end
56
+
57
+ def configured_policy(workflow)
58
+ workflow["lessons_policy"] || {
59
+ "sources" => [
60
+ { "path" => ".context/lessons/README.md", "required" => false },
61
+ { "path" => ".planning/lessons/README.md", "required" => false }
62
+ ],
63
+ "selection" => { "max_candidates" => 5, "min_score" => 1 },
64
+ "write" => {
65
+ "default_dir" => ".context/lessons",
66
+ "index_path" => ".context/lessons/README.md"
67
+ }
68
+ }
69
+ end
70
+
71
+ def words(text)
72
+ text.to_s.downcase.scan(/[[:alnum:]_\-\p{Han}]{2,}/)
73
+ end
74
+
75
+ def parse_lesson_index(root, source)
76
+ path = source.fetch("path")
77
+ abs = File.join(root, path)
78
+ return { "path" => path, "exists" => false, "lessons" => [] } unless File.exist?(abs)
79
+
80
+ lessons = []
81
+ File.readlines(abs, chomp: true).each do |line|
82
+ line.scan(/\[([^\]]+)\]\(([^)]+)\)/).each do |title, href|
83
+ lessons << {
84
+ "title" => title,
85
+ "path" => href.start_with?(".") ? href : File.join(File.dirname(path), href),
86
+ "source_index" => path
87
+ }
88
+ end
89
+ if line.start_with?("#")
90
+ title = line.sub(/\A#+\s*/, "").strip
91
+ lessons << { "title" => title, "path" => path, "source_index" => path } unless title.empty?
92
+ end
93
+ end
94
+
95
+ { "path" => path, "exists" => true, "lessons" => lessons.uniq }
96
+ end
97
+
98
+ def selection_terms(state, workflow, source_path, next_step)
99
+ steps = Array(workflow["steps"])
100
+ step = steps.find { |item| item["id"] == (next_step || state["current_step"]) } || {}
101
+ terms = []
102
+ terms.concat(words(state["current_flow"]))
103
+ terms.concat(words(next_step || state["current_step"]))
104
+ terms.concat(words(state["status"]))
105
+ terms.concat(words(state["checkpoint"]))
106
+ terms.concat(words(state["checkpoint_decision"]))
107
+ terms.concat(words(step["label"]))
108
+ terms.concat(words(step["skill"]))
109
+ terms.concat(words(step["action"]))
110
+ terms.concat(words(source_path))
111
+ terms.uniq
112
+ end
113
+
114
+ def select_lessons(root, policy, state, workflow, source_path, next_step)
115
+ terms = selection_terms(state, workflow, source_path, next_step)
116
+ indexes = Array(policy["sources"]).map { |source| parse_lesson_index(root, source) }
117
+ min_score = policy.dig("selection", "min_score") || 1
118
+ max_candidates = policy.dig("selection", "max_candidates") || 5
119
+
120
+ candidates = indexes.flat_map { |index| index["lessons"] }.map do |lesson|
121
+ text = "#{lesson["title"]} #{lesson["path"]}".downcase
122
+ matched = terms.select { |term| text.include?(term) }
123
+ lesson.merge("score" => matched.length, "matched_terms" => matched)
124
+ end
125
+ candidates = candidates.select { |candidate| candidate["score"] >= min_score }
126
+ .sort_by { |candidate| [-candidate["score"], candidate["title"]] }
127
+ .first(max_candidates)
128
+
129
+ {
130
+ "terms" => terms,
131
+ "indexes" => indexes.map { |index| index.reject { |key, _| key == "lessons" } },
132
+ "candidates" => candidates
133
+ }
134
+ end
135
+
136
+ def slug_for(title)
137
+ slug = title.downcase.gsub(/[^a-z0-9]+/, "-").gsub(/\A-|-+\z/, "")
138
+ slug.empty? ? "lesson" : slug
139
+ end
140
+
141
+ def build_template(title, state, source)
142
+ <<~MD
143
+ # #{title}
144
+
145
+ - Date: #{Date.today}
146
+ - Workflow: #{state["current_flow"]}
147
+ - Step: #{state["current_step"]}
148
+ - Source: #{source || "TODO"}
149
+
150
+ ## Symptom
151
+
152
+ TODO
153
+
154
+ ## Root Cause
155
+
156
+ TODO
157
+
158
+ ## Fix
159
+
160
+ TODO
161
+
162
+ ## Prevention
163
+
164
+ TODO
165
+ MD
166
+ end
167
+
168
+ def write_template(root, policy, state, title, source, write)
169
+ write_config = policy["write"] || {}
170
+ dir = write_config["default_dir"] || ".context/lessons"
171
+ index_path = write_config["index_path"] || File.join(dir, "README.md")
172
+ file_name = "#{Date.today}-#{slug_for(title)}.md"
173
+ rel_path = File.join(dir, file_name)
174
+ abs_path = File.join(root, rel_path)
175
+ abs_index = File.join(root, index_path)
176
+ template = build_template(title, state, source)
177
+ index_entry = "- [#{title}](#{file_name})"
178
+
179
+ if write
180
+ FileUtils.mkdir_p(File.dirname(abs_path))
181
+ File.write(abs_path, template)
182
+ unless File.exist?(abs_index)
183
+ FileUtils.mkdir_p(File.dirname(abs_index))
184
+ File.write(abs_index, "# Lessons\n\n")
185
+ end
186
+ index = File.read(abs_index)
187
+ File.write(abs_index, "#{index.chomp}\n#{index_entry}\n") unless index.include?(index_entry)
188
+ end
189
+
190
+ {
191
+ "path" => rel_path,
192
+ "index_path" => index_path,
193
+ "written" => write,
194
+ "template" => template
195
+ }
196
+ end
197
+
198
+ state = load_state(state_path)
199
+ workflow_path = workflow_path_for(state)
200
+ workflow = load_yaml_file(File.join(root, workflow_path))
201
+ policy = configured_policy(workflow)
202
+
203
+ result = {
204
+ "state_path" => state_path,
205
+ "workflow_config" => workflow_path,
206
+ "policy" => policy
207
+ }
208
+
209
+ if options[:select]
210
+ result["selection"] = select_lessons(root, policy, state, workflow, options[:source], options[:next_step])
211
+ end
212
+
213
+ if options[:write_template]
214
+ raise "--title is required with --write-template" if options[:title].to_s.strip.empty?
215
+
216
+ result["write_template"] = write_template(root, policy, state, options[:title], options[:source], options[:write])
217
+ end
218
+
219
+ puts JSON.pretty_generate(result)
@@ -0,0 +1,168 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "date"
5
+ require "fileutils"
6
+ require "json"
7
+ require "optparse"
8
+ require "yaml"
9
+ require_relative "control_io"
10
+
11
+ options = {
12
+ state: ".planning/STATE.md",
13
+ workflow: nil,
14
+ output: nil,
15
+ write: false,
16
+ preserve: true,
17
+ json: false
18
+ }
19
+
20
+ OptionParser.new do |opts|
21
+ opts.banner = "Usage: sync_artifacts.rb [--write] [--state PATH] [--workflow PATH]"
22
+ opts.on("--state PATH", "STATE.md path") { |value| options[:state] = value }
23
+ opts.on("--workflow PATH", "Workflow YAML path") { |value| options[:workflow] = value }
24
+ opts.on("--output PATH", "Artifact registry path") { |value| options[:output] = value }
25
+ opts.on("--write", "Create/update artifact registry") { options[:write] = true }
26
+ opts.on("--no-preserve", "Do not preserve existing statuses") { options[:preserve] = false }
27
+ opts.on("--json", "Print JSON output") { options[:json] = true }
28
+ end.parse!
29
+
30
+ root = Dir.pwd
31
+
32
+ def front_matter(markdown)
33
+ match = markdown.match(/\A---\n(.*?)\n---\n/m)
34
+ match && match[1]
35
+ end
36
+
37
+ def load_yaml_file(path)
38
+ YAML.safe_load(File.read(path), permitted_classes: [], aliases: false)
39
+ end
40
+
41
+ def load_state(path)
42
+ doc = File.read(path)
43
+ yaml = front_matter(doc)
44
+ raise "missing state front matter: #{path}" if yaml.nil?
45
+
46
+ YAML.safe_load(yaml, permitted_classes: [], aliases: false)
47
+ end
48
+
49
+ def interpolate_path(path, state)
50
+ path
51
+ .gsub("{feature}", state.fetch("current_feature", "").to_s)
52
+ .gsub("{phase}", state.fetch("current_phase", "").to_s)
53
+ end
54
+
55
+ def collect_outputs(workflow)
56
+ Array(workflow["steps"]).flat_map do |step|
57
+ Array(step["outputs"]).map do |output|
58
+ [step, output]
59
+ end
60
+ end
61
+ end
62
+
63
+ project_lock = DevflowControlIO.acquire_project_lock(root) if options[:write]
64
+
65
+ begin
66
+ state = load_state(File.join(root, options[:state]))
67
+ workflow_path = options[:workflow] || state["workflow_config"] || ".planning/workflows/#{state.fetch("current_flow")}.yaml"
68
+ workflow = load_yaml_file(File.join(root, workflow_path))
69
+ registry_path = options[:output] || workflow.dig("artifact_registry", "source") || ".planning/artifacts/index.yaml"
70
+ existing_registry_path = File.join(root, registry_path)
71
+ existing_by_path = {}
72
+ if options[:preserve] && File.exist?(existing_registry_path)
73
+ existing = load_yaml_file(existing_registry_path)
74
+ existing_by_path = Array(existing["artifacts"]).to_h { |artifact| [artifact.fetch("path"), artifact] }
75
+ end
76
+
77
+ completed = Array(state["completed_steps"])
78
+ current_step = state["current_step"]
79
+ content_checks = workflow.dig("artifact_registry", "content_checks") || {}
80
+ preservable_statuses = %w[approved completed passed pending_rerun stale failed]
81
+
82
+ def content_validity(root, path, checks)
83
+ abs = File.join(root, path)
84
+ return { "valid" => false, "issues" => ["file_missing"] } unless File.exist?(abs)
85
+
86
+ issues = []
87
+ min_bytes = checks["min_bytes"]
88
+ required_header = checks["required_header"]
89
+
90
+ if min_bytes && File.size(abs) < min_bytes
91
+ issues << "below_min_bytes(#{File.size(abs)} < #{min_bytes})"
92
+ end
93
+
94
+ if required_header
95
+ head = File.read(abs, [required_header.length + 50, 200].min)
96
+ unless head.include?(required_header)
97
+ issues << "missing_required_header(#{required_header.inspect})"
98
+ end
99
+ end
100
+
101
+ { "valid" => issues.empty?, "issues" => issues }
102
+ end
103
+
104
+ artifacts = collect_outputs(workflow).map do |step, output|
105
+ path = interpolate_path(output.fetch("path"), state)
106
+ existing = existing_by_path[path] || {}
107
+ generated_status =
108
+ if completed.include?(step.fetch("id"))
109
+ step["checkpoint"] ? "approved" : "completed"
110
+ elsif step.fetch("id") == current_step && state["status"] == "waiting_checkpoint"
111
+ "generated"
112
+ else
113
+ "planned"
114
+ end
115
+
116
+ validity = content_validity(root, path, content_checks)
117
+ file_exists = File.exist?(File.join(root, path))
118
+ status = if options[:preserve] && preservable_statuses.include?(existing["status"])
119
+ existing["status"]
120
+ else
121
+ generated_status
122
+ end
123
+
124
+ {
125
+ "path" => path,
126
+ "type" => output["type"],
127
+ "workflow_step" => step.fetch("id"),
128
+ "produced_by" => step["skill"] || step["action"],
129
+ "status" => status,
130
+ "checkpoint" => existing["checkpoint"] || step["checkpoint"],
131
+ "covers" => Array(existing["covers"]),
132
+ "downstream_steps" => Array(existing["downstream_steps"]),
133
+ "exists" => file_exists,
134
+ "content_valid" => validity["valid"],
135
+ "content_issues" => validity["issues"].empty? ? nil : validity["issues"]
136
+ }.reject { |_, value| value.nil? || value == [] }
137
+ end
138
+
139
+ registry = {
140
+ "schema_version" => 1,
141
+ "state_revision" => state.fetch("revision", 0),
142
+ "updated_at" => Date.today.to_s,
143
+ "registry_scope" => {
144
+ "flow" => state["current_flow"],
145
+ "feature" => state["current_feature"],
146
+ "phase" => state["current_phase"]
147
+ },
148
+ "status_values" => %w[planned generated approved completed passed pending_rerun stale failed],
149
+ "artifacts" => artifacts
150
+ }
151
+
152
+ if options[:write]
153
+ DevflowControlIO.atomic_write(existing_registry_path, registry.to_yaml.sub(/\A---\n/, ""))
154
+ end
155
+
156
+ result = {
157
+ "ok" => true,
158
+ "written" => options[:write],
159
+ "path" => registry_path,
160
+ "artifact_count" => artifacts.length,
161
+ "missing_count" => artifacts.count { |artifact| !artifact["exists"] },
162
+ "registry" => registry
163
+ }
164
+ ensure
165
+ DevflowControlIO.release_lock(project_lock)
166
+ end
167
+
168
+ puts JSON.pretty_generate(result)
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "fileutils"
5
+ require "json"
6
+ require "optparse"
7
+ require "yaml"
8
+
9
+ ROUTE_NEXT_SKILL = {
10
+ "ready_for_wayfinder" => "workflow-wayfinder",
11
+ "ready_for_baseline" => "workflow-requirement-baseline",
12
+ "needs_demand_clarify" => "workflow-demand-clarify",
13
+ "needs_wayfinder" => "workflow-wayfinder",
14
+ "needs_info" => "none",
15
+ "ready_for_human" => "none",
16
+ "already_done" => "none",
17
+ "wontfix" => "none"
18
+ }.freeze
19
+
20
+ ROUTE_STATUS = {
21
+ "ready_for_wayfinder" => "routed",
22
+ "ready_for_baseline" => "routed",
23
+ "needs_demand_clarify" => "routed",
24
+ "needs_wayfinder" => "routed",
25
+ "needs_info" => "blocked",
26
+ "ready_for_human" => "blocked",
27
+ "already_done" => "blocked",
28
+ "wontfix" => "blocked"
29
+ }.freeze
30
+
31
+ options = {
32
+ feature: nil,
33
+ route: nil,
34
+ reason: nil,
35
+ blocking_question: nil,
36
+ state: ".planning/STATE.md",
37
+ write: false,
38
+ json: false
39
+ }
40
+
41
+ OptionParser.new do |opts|
42
+ opts.banner = "Usage: update_triage_route.rb --route ROUTE [--feature NAME] [--reason TEXT] [--write] [--json]"
43
+ opts.on("--feature NAME", "Feature name. Defaults to STATE.md current_feature") { |value| options[:feature] = value }
44
+ opts.on("--route ROUTE", "Triage route") { |value| options[:route] = value }
45
+ opts.on("--reason TEXT", "Route reason") { |value| options[:reason] = value }
46
+ opts.on("--blocking-question TEXT", "Blocking question when route requires user input") { |value| options[:blocking_question] = value }
47
+ opts.on("--state PATH", "STATE.md path") { |value| options[:state] = value }
48
+ opts.on("--write", "Persist meta update") { options[:write] = true }
49
+ opts.on("--json", "Print JSON output") { options[:json] = true }
50
+ end.parse!
51
+
52
+ root = Dir.pwd
53
+
54
+ def front_matter(markdown)
55
+ match = markdown.match(/\A---\n(.*?)\n---\n/m)
56
+ match && match[1]
57
+ end
58
+
59
+ def load_state(root, path)
60
+ abs = File.expand_path(path, root)
61
+ return {} unless File.exist?(abs)
62
+
63
+ yaml = front_matter(File.read(abs))
64
+ yaml ? YAML.safe_load(yaml, permitted_classes: [], aliases: false) : {}
65
+ end
66
+
67
+ def fail_result(reason, details = {})
68
+ { "ok" => false, "reason" => reason, "details" => details }
69
+ end
70
+
71
+ result = if !ROUTE_NEXT_SKILL.key?(options[:route].to_s)
72
+ fail_result("invalid_route", "route" => options[:route], "allowed_routes" => ROUTE_NEXT_SKILL.keys)
73
+ else
74
+ state = load_state(root, options[:state])
75
+ feature = options[:feature] || state["current_feature"]
76
+ if feature.to_s.empty?
77
+ fail_result("missing_feature", "message" => "Pass --feature or provide current_feature in STATE.md")
78
+ else
79
+ meta_path = File.join(root, ".planning", "requirements", feature, "入口分诊.meta.json")
80
+ meta = File.exist?(meta_path) ? JSON.parse(File.read(meta_path)) : { "feature_name" => feature }
81
+ route = options[:route]
82
+
83
+ meta["feature_name"] ||= feature
84
+ meta["status"] = ROUTE_STATUS.fetch(route)
85
+ meta["route"] = route
86
+ meta["route_reason"] = options[:reason] || meta["route_reason"] || ""
87
+ meta["blocking_question"] = options[:blocking_question] || meta["blocking_question"] || ""
88
+ meta["next_skill"] = ROUTE_NEXT_SKILL.fetch(route)
89
+ meta["request_type"] ||= "unknown"
90
+ meta["duplicate_count"] ||= 0
91
+ meta["prior_rejection_count"] ||= 0
92
+ meta["searched_sources"] ||= []
93
+ meta["related_code_paths"] ||= []
94
+ meta["related_history_paths"] ||= []
95
+
96
+ if options[:write]
97
+ FileUtils.mkdir_p(File.dirname(meta_path))
98
+ File.write(meta_path, JSON.pretty_generate(meta))
99
+ end
100
+
101
+ {
102
+ "ok" => true,
103
+ "written" => options[:write],
104
+ "path" => ".planning/requirements/#{feature}/入口分诊.meta.json",
105
+ "meta" => meta
106
+ }
107
+ end
108
+ end
109
+
110
+ puts JSON.pretty_generate(result)