@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,244 @@
1
+ # UI-SPEC 模板
2
+
3
+ > 本模板由 `workflow-ui-spec` 技能填充。所有 `{占位符}` 由技能自动替换,请勿手动编辑。
4
+
5
+ ---
6
+
7
+ # UI 设计规范 — {功能名}
8
+
9
+ **设计来源**: {设计稿路径/截图说明}
10
+ **解析日期**: {日期}
11
+ **上游依赖**: `.planning/features/{功能名}/功能点梳理.md`
12
+
13
+ ---
14
+
15
+ ## 1. 设计来源
16
+
17
+ | 项目 | 内容 |
18
+ |------|------|
19
+ | 设计稿来源 | {截图/Figma/蓝湖/手动描述} |
20
+ | 提供人 | {用户/设计师} |
21
+ | 设计版本 | {版本号或日期} |
22
+ | 解析方式 | {AI 视觉分析 / 用户口述 / PRD 文字提取} |
23
+
24
+ ---
25
+
26
+ ## 2. 页面清单与布局
27
+
28
+ <!-- 对每个页面/弹窗,输出布局结构 -->
29
+
30
+ ### 2.1 {页面1名称}
31
+
32
+ - **路由路径**: `{路径}`
33
+ - **页面类型**: {主页面 / 弹窗 / 抽屉 / 半屏}
34
+ - **布局模式**: {单列 / 双列 / 卡片列表 / 表单 / 自定义}
35
+
36
+ ```
37
+ {页面名称}
38
+ ├── 顶部导航区
39
+ │ ├── 返回按钮: {是否显示}
40
+ │ ├── 标题: "{标题文字}"
41
+ │ └── 右侧操作: {操作按钮}
42
+ ├── 主内容区 (scroll)
43
+ │ ├── 区域A: {名称}
44
+ │ │ ├── {子元素1}
45
+ │ │ └── {子元素2}
46
+ │ ├── 区域B: {名称}
47
+ │ │ └── ...
48
+ │ └── ...
49
+ ├── 底部操作区 (fixed)
50
+ │ └── {按钮/输入框等}
51
+ └── 弹窗/浮层
52
+ └── {弹窗名称}: {触发条件}
53
+ ```
54
+
55
+ ### 2.2 {页面2名称}
56
+
57
+ ...
58
+
59
+ ---
60
+
61
+ ## 3. 组件树与复用分析
62
+
63
+ ### 3.1 新增组件
64
+
65
+ | 组件名 | 层级 | 所属页面 | 类型 | 描述 |
66
+ |--------|------|---------|------|------|
67
+ | {ComponentName} | {父组件} | {页面} | {业务/基础} | {一句话描述} |
68
+
69
+ **组件详细设计**:
70
+
71
+ #### {ComponentName}
72
+ ```
73
+ {ComponentName}
74
+ ├── Props:
75
+ │ ├── {prop1}: {type} — {描述}
76
+ │ └── {prop2}: {type} — {描述}
77
+ ├── Emits:
78
+ │ ├── {event1}: {payload} — {触发时机}
79
+ │ └── {event2}: {payload} — {触发时机}
80
+ ├── Slots:
81
+ │ └── {slot1}: {用途}
82
+ ├── 状态:
83
+ │ ├── default: {描述}
84
+ │ ├── loading: {骨架屏/loading 动画}
85
+ │ ├── empty: {空数据插图+文案}
86
+ │ ├── error: {错误提示+重试按钮}
87
+ │ └── disabled: {置灰样式}
88
+ └── 依赖:
89
+ ├── 子组件: {组件列表}
90
+ └── API调用: {接口名称}
91
+ ```
92
+
93
+ ### 3.2 修改现有组件
94
+
95
+ | 现有组件 | 路径 | 修改内容 | 影响范围 |
96
+ |----------|------|---------|---------|
97
+ | {组件名} | `{文件路径}` | {具体修改点} | {受影响的页面} |
98
+
99
+ ### 3.3 复用现有组件
100
+
101
+ | 设计组件 | 复用代码组件 | 路径 | 匹配度 | 备注 |
102
+ |---------|------------|------|--------|------|
103
+ | {设计名} | {代码组件名} | `{路径}` | 完全/需扩展 | {差异说明} |
104
+
105
+ ---
106
+
107
+ ## 4. 设计 Token
108
+
109
+ ### 4.0 来源分层与优先级
110
+
111
+ | 来源类型 | 来源文件/依据 | 是否可直接用于实现 | 说明 |
112
+ |----------|---------------|--------------------|------|
113
+ | 设计稿事实 | {截图/Figma/蓝湖/用户已确认设计描述} | 是 | {明确来自设计稿的颜色、字号、间距、圆角、阴影等} |
114
+ | 现有项目规范 | {现有代码变量/组件库/.context/spec/design/tokens/project-tokens.md} | 是 | {与现有变量或组件规则对齐的 token} |
115
+ | 推荐 - 待拍板 | {.context/spec/design/recommendations 或 ui-ux-pro-max 查询结果} | 否 | {仅作为候选方案,需写入待确认事项} |
116
+
117
+ 合并优先级:用户拍板/设计稿事实/需求基线 > 现有代码与项目 token > 项目级已确认 token > 推荐 - 待拍板。
118
+
119
+ ### 4.1 颜色
120
+
121
+ | Token 名 | 色值 | 用途 | 来源类型 | 已有变量 | 新增 | 状态 |
122
+ |----------|------|------|----------|---------|------|------|
123
+ | `--color-primary` | `#XXX` | 主色调 | 设计稿事实/现有项目规范/推荐 - 待拍板 | `$primary-color` | 否 | 已确认/待确认 |
124
+ | `--color-xxx` | `#XXX` | {描述} | {来源类型} | — | **是** | {状态} |
125
+
126
+ ### 4.2 字体与字号
127
+
128
+ | Token 名 | 字号 | 字重 | 行高 | 用途 | 来源类型 | 已有变量 | 状态 |
129
+ |----------|------|------|------|------|----------|---------|------|
130
+ | `--font-title` | `18px` | `600` | `1.4` | 页面标题 | {来源类型} | `$font-size-lg` | {状态} |
131
+ | `--font-body` | `14px` | `400` | `1.5` | 正文 | {来源类型} | `$font-size-base` | {状态} |
132
+
133
+ ### 4.3 间距
134
+
135
+ | Token 名 | 值 | 用途 | 来源类型 | 已有变量 | 状态 |
136
+ |----------|----|----|----------|---------|------|
137
+ | `--spacing-xs` | `4px` | 极小间距 | {来源类型} | `$spacing-xs` | {状态} |
138
+ | `--spacing-sm` | `8px` | 小间距 | {来源类型} | `$spacing-sm` | {状态} |
139
+ | `--spacing-md` | `12px` | 中间距 | {来源类型} | `$spacing-md` | {状态} |
140
+ | `--spacing-lg` | `16px` | 大间距 | {来源类型} | `$spacing-lg` | {状态} |
141
+
142
+ ### 4.4 圆角与阴影
143
+
144
+ | Token 名 | 值 | 用途 | 来源类型 | 已有变量 | 状态 |
145
+ |----------|----|----|----------|---------|------|
146
+ | `--radius-sm` | `4px` | 小圆角 | {来源类型} | — | {状态} |
147
+ | `--radius-md` | `8px` | 按钮/卡片 | {来源类型} | `$border-radius-base` | {状态} |
148
+ | `--shadow-card` | `0 2px 8px rgba(...)` | 卡片投影 | {来源类型} | — | {状态} |
149
+
150
+ ### 4.5 动画/过渡
151
+
152
+ | 场景 | 属性 | 时长 | 缓动函数 | 描述 |
153
+ |------|------|------|---------|------|
154
+ | 弹窗打开 | `opacity, transform` | `300ms` | `ease-out` | 从底部滑入 |
155
+ | 按钮点击 | `transform: scale` | `150ms` | `ease` | 按压缩放反馈 |
156
+
157
+ ---
158
+
159
+ ## 5. 交互流程
160
+
161
+ ### 5.1 {流程1名称}
162
+
163
+ ```
164
+ 触发: {用户操作,如"点击'立即参与'按钮"}
165
+ ├── 步骤1: 按钮显示 loading 状态,防重复点击
166
+ │ └── 状态: 按钮 disabled + spinner
167
+ ├── 步骤2: 调用 API: {接口名}(来自功能点梳理 FP-XXX)
168
+ │ └── 状态: 全局 loading / 局部 loading
169
+ ├── 步骤3: 成功 → 跳转 {目标页面} / 弹窗 {弹窗名}
170
+ │ └── 动画: {过渡动画描述}
171
+ ├── 步骤3: 失败 → 显示错误提示
172
+ │ └── 状态: toast "{错误消息}" / 错误页面 + 重试按钮
173
+ └── 终态: {最终 UI 状态}
174
+ ```
175
+
176
+ ### 5.2 {流程2名称}
177
+
178
+ ...
179
+
180
+ ---
181
+
182
+ ## 6. 状态覆盖矩阵
183
+
184
+ | 页面/组件 | Loading | Empty | Error | Disabled | 权限限制 | 重复提交 | 网络异常 |
185
+ |----------|---------|-------|-------|----------|---------|---------|---------|
186
+ | {页面A} | 骨架屏 | "暂无数据"插图 | 错误页+重试 | — | 提示"无权限" | 按钮防抖 | 离线提示 |
187
+ | {组件X} | spinner | — | toast | 置灰 | — | loading | — |
188
+
189
+ 说明:
190
+ - `✓` / 具体方案 = 已覆盖
191
+ - `—` = 不适用(该组件无此状态)
192
+
193
+ ---
194
+
195
+ ## 7. 多端差异
196
+
197
+ <!-- 如果目标平台包含多端(小程序 + H5 + App),标注差异 -->
198
+
199
+ | 差异点 | 小程序 | H5 | App | 说明 |
200
+ |--------|--------|----|-----|------|
201
+ | {差异项} | {表现} | {表现} | {表现} | {备注} |
202
+
203
+ 如果仅单端,写:"本次仅涉及 {平台},无多端差异。"
204
+
205
+ ---
206
+
207
+ ## 8. 待确认事项
208
+
209
+ | 编号 | 事项 | 影响范围 | 优先级 | 阻塞 |
210
+ |------|------|---------|--------|------|
211
+ | UI-001 | {待确认内容} | {影响的页面/组件} | 高/中/低 | 是/否 |
212
+ | UI-REC-001 | {来自推荐源的候选颜色/字体/布局/状态是否采纳} | {影响范围} | 高/中/低 | 是/否 |
213
+
214
+ ---
215
+
216
+ ## 9. 下游输入契约
217
+
218
+ 本 UI-SPEC 为以下文档提供 UI 层面的确定输入:
219
+
220
+ | 下游文档 | 消费的章节 | 使用方法 |
221
+ |---------|-----------|---------|
222
+ | 前端技术方案 | 组件树、交互流程、设计 Token | 组件拆分、状态管理、样式方案 |
223
+ | 变更清单 | 组件树、复用分析 | 前端代码变更任务 |
224
+ | 测试指导书 | 交互流程、状态覆盖矩阵 | UI 测试用例 |
225
+
226
+ ---
227
+
228
+ ## 10. 审查结论
229
+
230
+ - [ ] 所有页面/弹窗布局已从设计稿提取(无凭感觉推测)
231
+ - [ ] 组件树嵌套 ≥3 层,每个组件标注了 Props/Emits/Slots/状态
232
+ - [ ] 设计 Token 覆盖颜色/字号/间距/圆角/阴影不少于 5 类
233
+ - [ ] 设计 Token 已按来源区分:设计稿事实 / 现有项目规范 / 推荐 - 待拍板
234
+ - [ ] 所有推荐 - 待拍板的 token 或交互已写入待确认事项,未作为已确认实现依据
235
+ - [ ] 关键交互流程覆盖完整链路(触发 → 反馈 → 状态变化 → 结果)
236
+ - [ ] 状态覆盖矩阵覆盖 Loading/Empty/Error/Disabled/权限/重复提交/网络异常
237
+ - [ ] 新增/修改组件已与现有代码做复用匹配
238
+ - [ ] 设计 Token 已与现有变量做对齐检查
239
+ - [ ] 功能点梳理中的所有功能点均有对应 UI 元素
240
+
241
+ **审查结论**: {通过 / 不通过}
242
+
243
+ **审查人**: AI (workflow-ui-spec)
244
+ **审查日期**: {日期}
@@ -0,0 +1,55 @@
1
+ # 被影响方探索指引(UI 规范)
2
+
3
+ 在生成 UI-SPEC 前,必须对需求基线中"关联历史功能/模块"表格列出的每个受影响前端页面、组件或交互区域进行探索。探索产出直接填入 UI-SPEC 的组件树、复用分析、设计 Token 对齐和交互流程章节。
4
+
5
+ ## 核心原则
6
+
7
+ - **先读现有界面,再写 UI 契约**:不知道现有页面布局、组件层级和状态流,就不能可靠判断复用、扩展或新增。
8
+ - **被影响页面和新增页面同等重要**:既要分析新设计稿,也要确认旧页面、共享组件、路由、状态管理和样式变量的影响。
9
+ - **探索产出必须来自代码或设计事实**:组件树、Token、交互状态和复用决策必须来自实际源码、已有 UI 或设计稿,不得只靠文件名推断。
10
+
11
+ ## 探索清单
12
+
13
+ 对每个受影响页面/组件,按以下步骤执行。
14
+
15
+ ### 步骤1:定位关键文件
16
+
17
+ | 层级 | 定位方式 | 最少读取 |
18
+ |------|----------|----------|
19
+ | 页面入口 | 前端路由表、`src/pages/`、`src/views/` 或同类目录 | 页面布局、入口状态、主要事件 |
20
+ | 业务组件 | `src/components/`、页面局部组件目录 | props、事件、状态、插槽、可见区域 |
21
+ | API 调用 | `src/api/`、service、store action | 请求方法、参数、响应字段、错误处理 |
22
+ | 路由配置 | router、menu、权限配置 | 路径、参数、meta、菜单入口 |
23
+ | 状态管理 | store、hooks、context、zustand/redux 等 | 共享状态、派生状态、加载/错误状态 |
24
+ | 样式系统 | CSS/LESS/SCSS 变量、主题配置、Ant Design token | 颜色、字号、间距、圆角、阴影 |
25
+
26
+ **底线**:每个被影响页面/组件至少读取 3 类文件:页面/组件源码、数据/API 来源、样式或主题来源。
27
+
28
+ ### 步骤2:回答四个问题
29
+
30
+ | 问题 | 产出 | 填入 UI-SPEC |
31
+ |------|------|-------------|
32
+ | 现有页面长什么样? | 页面区域、组件层级、关键字段/按钮/表格列 | 页面清单与布局、组件树 |
33
+ | 现有状态有哪些? | loading、empty、error、disabled、权限限制、重复提交 | 状态覆盖矩阵 |
34
+ | 现有交互怎么触发? | 点击、筛选、提交、弹窗、跳转、接口调用链 | 交互流程 |
35
+ | 现有样式如何约束? | 主题 Token、组件库规则、自定义样式变量 | 设计 Token |
36
+
37
+ ### 步骤3:判断复用/调整/新增边界
38
+
39
+ | 决策类型 | 说明 |
40
+ |----------|------|
41
+ | 复用不改 | 现有组件、Token、交互满足 UI-SPEC |
42
+ | 复用并扩展 | 保留现有组件结构,新增状态、字段、样式或事件 |
43
+ | 抽离重构 | 现有页面承担过多职责,需要拆出业务组件或共享组件 |
44
+ | 新增组件 | 现有组件无法覆盖新 UI 或新交互 |
45
+ | 替换方案 | 现有实现与需求/设计冲突,需要明确迁移策略和兼容影响 |
46
+
47
+ ## 探索产出检查
48
+
49
+ - [ ] 是否覆盖 baseline 第8.2节列出的每个受影响前端页面/组件?
50
+ - [ ] 是否实际读取页面/组件源码、数据来源和样式/主题来源?
51
+ - [ ] 是否列出现有布局、组件层级、状态、交互和 Token 约束?
52
+ - [ ] 是否明确每个受影响组件的复用、扩展、抽离、新增或替换决策?
53
+ - [ ] 是否把探索结论写入 UI-SPEC 的影响范围、组件树、Token 和交互章节?
54
+
55
+ **此检查不通过,不得生成最终 UI-SPEC。**
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: implementation-worker
3
+ description: Isolated implementation worker for an approved, bounded change plan; writes code and tests but never mutates Devflow control-plane state.
4
+ tools:
5
+ - read
6
+ - grep
7
+ - find
8
+ - lsp
9
+ - bash
10
+ - edit
11
+ - write
12
+ model: "@task"
13
+ thinkingLevel: high
14
+ autoloadSkills:
15
+ - workflow-execute-phase
16
+ ---
17
+
18
+ Implement only the assigned plan slice. Read the relevant project rules, source, tests, and approved design artifacts before editing. Preserve unrelated work and report deviations instead of silently expanding scope.
19
+
20
+ Run focused validation and return changed files, commands, results, residual risks, and any blocked dependency. Never edit `.planning/STATE.md`, `.planning/artifacts/index.yaml`, workflow definitions, or checkpoint decisions; the parent session owns those through Devflow tools.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@devflow/omp-implementation",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module"
6
+ }
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: workflow-bug-fix
3
+ description: "Use when a bug must be traced through workflow artifacts, root-caused, fixed, verified, and captured as a lesson when needed."
4
+ ---
5
+
6
+ ## Legacy Command Metadata
7
+
8
+ ```yaml
9
+ argument-hint: <bug描述 | @bug-report.md>
10
+ user-invocable: true
11
+ pattern: debugger+reviewer
12
+ allowed-tools: [Read, Write, Edit, Bash, Glob, Grep]
13
+ ```
14
+
15
+ # Workflow: Bug Fix
16
+
17
+ ## Objective
18
+
19
+ Trace a reported bug from workflow artifacts to implementation, identify the **first broken layer**, make the smallest correct repair, verify it, and preserve a reusable lesson when appropriate.
20
+
21
+ Do not stop at “the code now works.” Every completed diagnosis must explain why the bug was possible: an undefined requirement, missed breakdown, incomplete specification, missing change-list task, incorrect implementation, or regression.
22
+
23
+ ## Input, Outputs, and References
24
+
25
+ Input: `$ARGUMENTS` — a bug description or `@bug-report.md`.
26
+
27
+ Required outputs:
28
+
29
+ - Root-cause diagnosis containing the fields in `references/root-cause-ladder.md`.
30
+ - Code and/or workflow-artifact repair consistent with that diagnosis.
31
+ - Verification evidence and a context-sync result.
32
+ - A lesson under `.context/lessons/` when the finding is reusable; if the directory or index is absent, record that limitation and do not fail solely for its absence.
33
+
34
+ Read references only at their designated phase. [references/INDEX.md](references/INDEX.md) is the routing contract; it is not optional.
35
+
36
+ ## Non-Negotiable Rules
37
+
38
+ 1. Find the first broken layer and stop root-cause traversal there. Do not call a downstream symptom the root cause.
39
+ 2. Before classifying the cause, read `references/first-principles.md` and `references/adversarial-review.md`.
40
+ 3. Any source-level claim based on `.planning/code-index/` requires source readback at its evidence path and line. Navigation or index summaries alone are insufficient.
41
+ 4. `requirement-gap`, `breakdown-gap`, `spec-gap`, and `change-list-gap` require documentation repair before code repair. `implementation-bug` and `regression` do not require speculative document rewrites.
42
+ 5. Keep the repair scoped to the violated invariant. Do not slip in unrelated refactors or new feature scope.
43
+ 6. Complete verification and `workflow-context-sync --after-bugfix` before declaring success, unless the user explicitly approves an exception and its residual risk is recorded.
44
+
45
+ ## Context Loading Order
46
+
47
+ Load only what exists and is relevant, in this order:
48
+
49
+ 1. `.planning/STATE.md` for the active feature and phase.
50
+ 2. `.planning/requirements/baseline.md`.
51
+ 3. `.planning/features/{功能名}/功能点梳理.md`.
52
+ 4. `.planning/features/{功能名}/前端技术方案.md` and `后端技术方案.md`.
53
+ 5. `.planning/features/{功能名}/*变更清单.md`.
54
+ 6. `.planning/code-index/` and then evidence source files, when source tracing is needed.
55
+
56
+ If an upstream artifact is absent, record it as evidence for the corresponding gap rather than silently skipping it.
57
+
58
+ ## Phase 1 — Understand and Frame the Bug
59
+
60
+ 1. Extract abnormal behavior, expected behavior, actual behavior, reproduction, and impact.
61
+ 2. Read `STATE.md` to identify the active feature and phase.
62
+ 3. Ask only the minimum targeted question when a fact essential to reproduction or impact is unknown; do not turn a bug report into a full requirement interview.
63
+ 4. Read `references/first-principles.md` and record the function’s purpose, violated invariant, and failed assumption.
64
+ 5. Read `references/adversarial-review.md` and record the likely attack perspective, full path, and comparable unexposed paths.
65
+
66
+ Gate: a bug frame must distinguish observed symptoms from the intended invariant before Phase 2 starts.
67
+
68
+ ## Phase 2 — Locate the First Broken Layer
69
+
70
+ Read `references/root-cause-ladder.md` and inspect the layers in this exact order:
71
+
72
+ 1. Requirement baseline → `requirement-gap`
73
+ 2. Feature breakdown → `breakdown-gap`
74
+ 3. Technical specification → `spec-gap`
75
+ 4. Change list → `change-list-gap`
76
+ 5. Implementation → `implementation-bug`
77
+ 6. Relevant history → `regression`
78
+
79
+ At the first layer that does not support the intended invariant, record the exact artifact section or source location, classify the root cause, and stop traversal. The reference defines the evidence tests and repair route for every classification.
80
+
81
+ Gate: the diagnosis names one root-cause type, one first broken location, and the proof that all earlier applicable layers were sufficient.
82
+
83
+ ## Phase 3 — Diagnose and Plan
84
+
85
+ Write the diagnosis using the required template in `references/root-cause-ladder.md`. It must include:
86
+
87
+ - bug, root-cause type, first broken location, and why it happened;
88
+ - function purpose, violated invariant, and failed assumption;
89
+ - attack perspective, full attack path, and comparable risks;
90
+ - code repair, invariant hardening, entry defense, and documentation writeback.
91
+
92
+ Use the repair route from Phase 2. Scope the plan to the root cause and all directly necessary defenses.
93
+
94
+ ## Phase 4 — Repair and Verify
95
+
96
+ 1. Repair upstream artifacts first when the type requires it.
97
+ 2. Make the code repair.
98
+ 3. Run the applicable targeted tests and project toolchain checks.
99
+ 4. Confirm the implementation now matches the repaired change list and baseline when those artifacts changed.
100
+ 5. When the cause could be a boundary mistake, read `references/seam-analysis.md`; record only a substantiated seam finding.
101
+
102
+ Gate: verification demonstrates the original reproduction is fixed and the identified invariant is protected against the relevant comparable path.
103
+
104
+ ## Phase 5 — Preserve Knowledge and Synchronize Context
105
+
106
+ 1. Read `references/lesson-format.md`. Write a lesson when the finding is reusable beyond this single line fix; otherwise record why no lesson is needed.
107
+ 2. If `.context/lessons/README.md` exists, append the lesson to its index. If it does not exist, retain the lesson file and report that no index was available.
108
+ 3. Run `workflow-context-sync --after-bugfix`.
109
+ - Ordinary implementation repairs refresh code-index and run validate/audit.
110
+ - Changes to routes, API clients, handlers, jobs, service boundaries, toolchain, or manifests may require a Medium sync with navigation/spec/toolchain updates.
111
+ - If a Full sync needs user authorization, explain why and wait; record the resulting residual risk.
112
+
113
+ ## Completion Report and Success Criteria
114
+
115
+ Report: root cause; invariant/assumption; attack perspective and path; changed files; document writeback; lesson outcome; context-sync result; and whether any workflow step should be rerun.
116
+
117
+ Success requires all of the following:
118
+
119
+ - A specific first broken artifact or source location, not a generic label.
120
+ - Minimal scoped repair with verification evidence.
121
+ - Required workflow artifacts updated for documentation-originated causes.
122
+ - Lesson outcome recorded and indexed when the index exists.
123
+ - Context-sync completed, or an explicit user-approved exception and residual risk recorded.
124
+ - `STATE.md` updated when phase state changed.
@@ -0,0 +1,13 @@
1
+ # Bug-Fix Reference Routing
2
+
3
+ This index defines the only authoritative routing for stable bug-fix details. The main `SKILL.md` owns workflow state, mandatory gates, outputs, and failure routing. References provide procedures and templates; they must not introduce a new mandatory phase.
4
+
5
+ | Reference | Read when | Authority |
6
+ |---|---|---|
7
+ | `first-principles.md` | Phase 1, before root-cause classification | Function purpose, invariants, assumptions |
8
+ | `adversarial-review.md` | Phase 1 and implementation/history analysis | Attack perspectives and full-path review |
9
+ | `root-cause-ladder.md` | Phase 2 and Phase 3 | Evidence tests, classifications, repair routes, diagnosis template |
10
+ | `seam-analysis.md` | Phase 4 only when a module boundary may be causal | Seam retrospective and recording format |
11
+ | `lesson-format.md` | Phase 5 when deciding or writing a reusable lesson | Lesson decision rule, template, and indexing behavior |
12
+
13
+ Do not load every reference eagerly. Read the one mapped to the active phase.
@@ -0,0 +1,35 @@
1
+ # Adversarial Review
2
+
3
+ Functional tests prove a normal path. This review asks how abnormal input, timing, state, or dependencies can violate the same invariant.
4
+
5
+ ## Attack Perspectives
6
+
7
+ | Perspective | Probe |
8
+ |---|---|
9
+ | Oversized input | Does size, batch count, or concurrency exhaust memory, queues, or connections? |
10
+ | Time anomalies | Are future, stale, timezone-shifted, or invalid timestamps ordered and validated safely? |
11
+ | Encoding and special characters | Can null bytes, emoji, RTL markers, or malformed text bypass validation or break serialization? |
12
+ | Concurrency | Can duplicate actions create double writes, payments, or conflicting state? |
13
+ | Dependency failure | Are timeout, empty, malformed, or non-JSON responses bounded and handled? |
14
+ | State interruption | Can restart, retry, partial persistence, or idempotency leave an unrecoverable state? |
15
+ | Type and boundary confusion | Are null, strings-for-numbers, empty collections, zero, negative, and maximum values validated? |
16
+ | Re-entry and loops | Can events or callbacks recursively re-trigger the operation? |
17
+
18
+ ## Full-Path Procedure
19
+
20
+ Pick the perspective most related to the report, then trace:
21
+
22
+ `entry → middleware/validation → business logic → data access → external calls → response/observability`
23
+
24
+ At every boundary, state whether the abnormal condition is rejected, contained, retried with a bound, recovered, or silently propagated. Trace at least one comparable path when the issue reaches production-facing behavior.
25
+
26
+ ## Required Findings
27
+
28
+ The diagnosis must state:
29
+
30
+ - the attack perspective that first exposes the defect;
31
+ - the complete path from entry to symptom;
32
+ - comparable unexposed paths; and
33
+ - the boundary where the invariant will be enforced.
34
+
35
+ Do not “fix” only the triggering input when the same class can enter through another boundary. Use bounded validation, idempotency, transaction/locking, timeout/circuit-breaking, recovery, or observability as appropriate to the actual invariant.
@@ -0,0 +1,26 @@
1
+ # First-Principles Review
2
+
3
+ Pipeline artifacts are evidence, not truth. Use this review before assigning a root-cause type.
4
+
5
+ ## Required Questions
6
+
7
+ For every bug, record:
8
+
9
+ 1. **Function purpose** — What problem must this module solve if rebuilt from zero?
10
+ 2. **Invariant** — What must always remain true for data integrity, state consistency, authorization, or temporal causality?
11
+ 3. **Assumption** — Which caller, dependency, ordering, transaction, or data-shape assumption no longer holds?
12
+
13
+ ## Phase Prompts
14
+
15
+ | Layer | Challenge |
16
+ |---|---|
17
+ | Baseline | Is the stated FP/BR/BC itself consistent with the function purpose and failure paths? |
18
+ | Breakdown | Did the style/function/logic expansion omit an invariant or a negative path? |
19
+ | Technical spec | Does the seam align with the module’s responsibility and protect the invariant? |
20
+ | Change list | Does a task couple unrelated modules or merely patch a symptom? |
21
+ | Implementation | Does data, state, or timing violate a basic constraint or leak an internal assumption? |
22
+ | History | Did a recent change remove a prior guarantee? |
23
+
24
+ ## Decision Rule
25
+
26
+ Do not accept “the reported expected behavior” as sufficient proof. If the expected behavior conflicts with the function purpose or invariant, classify the upstream artifact as incorrect and repair it before implementation. A repair is complete only when it makes the failed assumption explicit, removes it, or defends it at the correct boundary.
@@ -0,0 +1,28 @@
1
+ # Bug-Fix Lesson Format
2
+
3
+ Write a lesson when the cause, invariant, boundary defense, or regression pattern is likely to prevent future work from repeating the failure. Do not create one for a self-evident isolated typo unless project rules require it.
4
+
5
+ Write `.context/lessons/{YYYY-MM-DD}-{slug}.md`:
6
+
7
+ ```markdown
8
+ # {Bug title}
9
+
10
+ - **Date**: {YYYY-MM-DD}
11
+ - **Root-cause type**: {type}
12
+ - **First broken location**: {file:section}
13
+ - **Scenario**: {when it occurs}
14
+ - **Symptom**: {what happened}
15
+ - **Cause**: {why it happened}
16
+ - **Function purpose**: {purpose}
17
+ - **Violated invariant**: {invariant}
18
+ - **Failed assumption**: {assumption}
19
+ - **Attack perspective**: {perspective}
20
+ - **Attack path**: {entry → … → symptom}
21
+ - **Comparable risks**: {unexposed paths}
22
+ - **Repair**: {what changed}
23
+ - **Invariant hardening**: {how recurrence is prevented}
24
+ - **Entry defense**: {defensive boundary}
25
+ - **Rule for future work**: {reusable guidance}
26
+ ```
27
+
28
+ If `.context/lessons/README.md` exists, add a concise linked entry. If it does not exist, do not fail the bug fix; retain the lesson file and report that the index was unavailable.
@@ -0,0 +1,51 @@
1
+ # Root-Cause Ladder
2
+
3
+ Inspect in order and stop at the first broken layer. Earlier applicable layers must be evidenced as sufficient before moving down.
4
+
5
+ | Order | Evidence test | Type when broken | Repair route |
6
+ |---:|---|---|---|
7
+ | 1 | Baseline has a confirmed FP/BR/BC that defines the intended and failure behavior. | `requirement-gap` | Update baseline, then rerun downstream planning needed by the change. |
8
+ | 2 | Feature breakdown expands the relevant behavior into page/component/field/validation or equivalent logic. | `breakdown-gap` | Complete the breakdown, then repair dependent plan/code. |
9
+ | 3 | Technical spec covers the interface, field, component, seam, and boundary behavior. | `spec-gap` | Update the technical spec, then the change list and code. |
10
+ | 4 | Change list has an executable task for every required change and dependency. | `change-list-gap` | Add the task, then implement it. |
11
+ | 5 | Source faithfully implements the approved task and preserves boundaries. | `implementation-bug` | Repair code and tests; do not invent document changes. |
12
+ | 6 | The behavior previously worked and a later relevant change removed the guarantee. | `regression` | Repair code, add regression coverage, and update documents only when they were also wrong. |
13
+
14
+ ## Evidence Details
15
+
16
+ - Use `.planning/code-index/` to locate symbols, callers, imports, reads/writes, and tests when present; read the cited source evidence before asserting a fact.
17
+ - If code-index is missing, stale, or has no result, use navigation and targeted source inspection, and say that machine relation facts were unavailable.
18
+ - For implementation analysis, check completed change-list tasks, boundary/error handling, and obvious omissions such as type errors, logic reversal, or missed validation.
19
+ - For regression analysis, run `git log --oneline -10 -- <relevant-file>` from the owning repository and inspect the relevant diff.
20
+
21
+ ## Diagnosis Template
22
+
23
+ ```markdown
24
+ ## Bug Root-Cause Diagnosis
25
+
26
+ **Bug**: {one sentence}
27
+ **Root-cause type**: `requirement-gap` | `breakdown-gap` | `spec-gap` | `change-list-gap` | `implementation-bug` | `regression`
28
+ **First broken location**: {artifact section or file:line}
29
+ **Why it happened**: {concise causal explanation}
30
+
31
+ ### First-Principles Analysis
32
+
33
+ - **Function purpose**: {purpose}
34
+ - **Violated invariant**: {always-true condition}
35
+ - **Failed assumption**: {assumption}
36
+
37
+ ### Adversarial Analysis
38
+
39
+ - **Attack perspective**: {perspective}
40
+ - **Full path**: {entry → … → symptom}
41
+ - **Comparable risks**: {other paths}
42
+
43
+ ### Repair Plan
44
+
45
+ - **Artifact repair**: {required update or none}
46
+ - **Code repair**: {files and intent}
47
+ - **Invariant hardening**: {test/constraint/contract}
48
+ - **Entry defense**: {where and how}
49
+ ```
50
+
51
+ The diagnosis is invalid if it names a downstream type while an earlier applicable artifact is missing, pending, contradictory, or insufficient.
@@ -0,0 +1,30 @@
1
+ # Seam Retrospective
2
+
3
+ Use only after the repair when a module boundary, not merely a local mistake, may have enabled the bug.
4
+
5
+ ## When to Apply
6
+
7
+ Review seams for `spec-gap`, `change-list-gap`, and `regression`; consider it for `breakdown-gap` or `implementation-bug`. It is normally not relevant to a pure `requirement-gap`.
8
+
9
+ ## Questions
10
+
11
+ 1. Where is the bug: module and method?
12
+ 2. What interface does that module expose, and who consumes it?
13
+ 3. Was an internal detail exposed, a dependency omitted, or a new module forced into an unrelated existing seam?
14
+ 4. Would a different boundary prevent this class of defect without broad refactoring?
15
+
16
+ Record a finding only with evidence. “No seam issue” is valid for a local logic error.
17
+
18
+ ## Recording Format
19
+
20
+ Append this to the lesson when a seam issue is substantiated:
21
+
22
+ ```markdown
23
+ ## Seam Analysis
24
+
25
+ - **Bug location**: {module.method}
26
+ - **Seam issue**: {yes/no and evidence}
27
+ - **Recommendation**: {future boundary or module action}
28
+ ```
29
+
30
+ This retrospective does not authorize unrelated refactoring in the current bug fix.