@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,160 @@
1
+ <ui_patterns>
2
+
3
+ Visual patterns for user-facing workflow output. Orchestrators @-reference this file.
4
+
5
+ ## Stage Banners
6
+
7
+ Use for major workflow transitions.
8
+
9
+ ```
10
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
11
+ WORKFLOW ► {STAGE NAME}
12
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13
+ ```
14
+
15
+ **Stage names (uppercase):**
16
+ - `QUESTIONING`
17
+ - `RESEARCHING`
18
+ - `DEFINING REQUIREMENTS`
19
+ - `CREATING ROADMAP`
20
+ - `PLANNING PHASE {N}`
21
+ - `EXECUTING WAVE {N}`
22
+ - `VERIFYING`
23
+ - `PHASE {N} COMPLETE ✓`
24
+ - `MILESTONE COMPLETE 🎉`
25
+
26
+ ---
27
+
28
+ ## Checkpoint Boxes
29
+
30
+ User action required. 62-character width.
31
+
32
+ ```
33
+ ╔══════════════════════════════════════════════════════════════╗
34
+ ║ CHECKPOINT: {Type} ║
35
+ ╚══════════════════════════════════════════════════════════════╝
36
+
37
+ {Content}
38
+
39
+ ──────────────────────────────────────────────────────────────
40
+ → {ACTION PROMPT}
41
+ ──────────────────────────────────────────────────────────────
42
+ ```
43
+
44
+ **Types:**
45
+ - `CHECKPOINT: Verification Required` → `→ Type "approved" or describe issues`
46
+ - `CHECKPOINT: Decision Required` → `→ Select: option-a / option-b`
47
+ - `CHECKPOINT: Action Required` → `→ Type "done" when complete`
48
+
49
+ ---
50
+
51
+ ## Status Symbols
52
+
53
+ ```
54
+ ✓ Complete / Passed / Verified
55
+ ✗ Failed / Missing / Blocked
56
+ ◆ In Progress
57
+ ○ Pending
58
+ ⚡ Auto-approved
59
+ ⚠ Warning
60
+ 🎉 Milestone complete (only in banner)
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Progress Display
66
+
67
+ **Phase/milestone level:**
68
+ ```
69
+ Progress: ████████░░ 80%
70
+ ```
71
+
72
+ **Task level:**
73
+ ```
74
+ Tasks: 2/4 complete
75
+ ```
76
+
77
+ **Plan level:**
78
+ ```
79
+ Plans: 3/5 complete
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Spawning Indicators
85
+
86
+ ```
87
+ ◆ Spawning researcher...
88
+
89
+ ◆ Spawning 4 researchers in parallel...
90
+ → Stack research
91
+ → Features research
92
+ → Architecture research
93
+ → Pitfalls research
94
+
95
+ ✓ Researcher complete: STACK.md written
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Next Up Block
101
+
102
+ Always at end of major completions.
103
+
104
+ ```
105
+ ───────────────────────────────────────────────────────────────
106
+
107
+ ## ▶ Next Up
108
+
109
+ **{Identifier}: {Name}** — {one-line description}
110
+
111
+ `/clear` then:
112
+
113
+ `{copy-paste command}`
114
+
115
+ ───────────────────────────────────────────────────────────────
116
+
117
+ **Also available:**
118
+ - `/workflow-xxx` — description
119
+ - `/workflow-xxx` — description
120
+
121
+ ───────────────────────────────────────────────────────────────
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Error Box
127
+
128
+ ```
129
+ ╔══════════════════════════════════════════════════════════════╗
130
+ ║ ERROR ║
131
+ ╚══════════════════════════════════════════════════════════════╝
132
+
133
+ {Error description}
134
+
135
+ **To fix:** {Resolution steps}
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Tables
141
+
142
+ ```
143
+ | Phase | Status | Plans | Progress |
144
+ |-------|--------|-------|----------|
145
+ | 1 | ✓ | 3/3 | 100% |
146
+ | 2 | ◆ | 1/4 | 25% |
147
+ | 3 | ○ | 0/2 | 0% |
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Anti-Patterns
153
+
154
+ - Varying box/banner widths
155
+ - Mixing banner styles (`===`, `---`, `***`)
156
+ - Skipping `WORKFLOW ►` prefix in banners
157
+ - Random emoji (`🚀`, `✨`, `💫`)
158
+ - Missing Next Up block after completions
159
+
160
+ </ui_patterns>
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: project-scout
3
+ description: Read-only project explorer that locates implementation evidence, architecture boundaries, and affected files without proposing speculative changes.
4
+ tools:
5
+ - read
6
+ - grep
7
+ - find
8
+ - lsp
9
+ - devflow_code_index
10
+ model: "@smol"
11
+ thinkingLevel: medium
12
+ autoloadSkills:
13
+ - code-index-query
14
+ - workflow-code-index
15
+ ---
16
+
17
+ Act as a read-only evidence collector. Start from project indexes when they are fresh, then verify every material claim against LSP, search results, and source code. An index is an accelerator, never an authority.
18
+
19
+ Return:
20
+
21
+ 1. relevant entry points and symbols with paths;
22
+ 2. cross-layer call paths;
23
+ 3. conventions and tests that constrain the change;
24
+ 4. unknowns or stale evidence;
25
+ 5. the smallest defensible affected-file set.
26
+
27
+ Do not edit files, mutate workflow state, or widen the task beyond the supplied question.
@@ -0,0 +1,104 @@
1
+ import { existsSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ import type { ExtensionAPI } from "@oh-my-pi/pi-coding-agent";
6
+
7
+ type ProcessResult = { ok: boolean; exitCode: number; stdout: string; stderr: string };
8
+
9
+ function resolveSkillRoot(cwd: string): string {
10
+ const moduleDirectory = path.dirname(fileURLToPath(import.meta.url));
11
+ const candidates = [
12
+ process.env.DEVFLOW_KIT_ROOT,
13
+ path.join(cwd, ".skills"),
14
+ path.resolve(moduleDirectory, "../skills"),
15
+ path.resolve(moduleDirectory, "../../.."),
16
+ ].filter(Boolean) as string[];
17
+ for (const candidate of candidates) {
18
+ if (existsSync(path.join(candidate, "workflow-code-index/scripts/code_index.py"))) {
19
+ return path.resolve(candidate);
20
+ }
21
+ }
22
+ throw new Error("Devflow intel skills not found");
23
+ }
24
+
25
+ async function run(command: string[], cwd: string): Promise<ProcessResult> {
26
+ const child = Bun.spawn(command, { cwd, stdout: "pipe", stderr: "pipe" });
27
+ const [exitCode, stdout, stderr] = await Promise.all([
28
+ child.exited,
29
+ new Response(child.stdout).text(),
30
+ new Response(child.stderr).text(),
31
+ ]);
32
+ return { ok: exitCode === 0, exitCode, stdout: stdout.trim(), stderr: stderr.trim() };
33
+ }
34
+
35
+ function render(result: ProcessResult, details: Record<string, unknown>) {
36
+ return {
37
+ content: [
38
+ {
39
+ type: "text" as const,
40
+ text: result.stdout || result.stderr || `Process exited with ${result.exitCode}`,
41
+ },
42
+ ],
43
+ details: { ...details, exitCode: result.exitCode, stderr: result.stderr || undefined },
44
+ isError: !result.ok,
45
+ };
46
+ }
47
+
48
+ export default function devflowIntel(pi: ExtensionAPI) {
49
+ const { z } = pi.zod;
50
+
51
+ pi.registerTool({
52
+ name: "devflow_code_index",
53
+ label: "Devflow Code Index",
54
+ description: "Scan, validate, audit, or query the deterministic project code index.",
55
+ parameters: z.object({
56
+ action: z.enum(["scan", "validate", "audit", "query"]),
57
+ term: z.string().optional(),
58
+ limit: z.number().int().min(1).max(100).default(20),
59
+ changedFiles: z.array(z.string()).default([]),
60
+ }),
61
+ approval: (args) => {
62
+ const action = (args as { action?: string }).action;
63
+ // scan 写 .planning/code-index,按 exec 询问;validate/audit/query 只读,免确认。
64
+ return action === "scan" ? "exec" : "read";
65
+ },
66
+ async execute(_id, params, _signal, _onUpdate, ctx) {
67
+ const skillRoot = resolveSkillRoot(ctx.cwd);
68
+ const script = path.join(skillRoot, "workflow-code-index/scripts/code_index.py");
69
+ const args = ["python3", script, params.action];
70
+ if (params.action === "scan") {
71
+ args.push("--root", ctx.cwd, "--output", ".planning/code-index");
72
+ if (params.changedFiles.length > 0) args.push("--changed-files", ...params.changedFiles);
73
+ } else if (params.action === "validate") {
74
+ args.push("--index", ".planning/code-index");
75
+ } else if (params.action === "audit") {
76
+ args.push("--root", ctx.cwd, "--index", ".planning/code-index", "--skill-root", skillRoot);
77
+ } else {
78
+ if (!params.term) {
79
+ return render({ ok: false, exitCode: 2, stdout: "", stderr: "term is required" }, {});
80
+ }
81
+ args.push("--index", ".planning/code-index", "--term", params.term, "--limit", String(params.limit));
82
+ }
83
+ return render(await run(args, ctx.cwd), { action: params.action });
84
+ },
85
+ });
86
+
87
+ pi.registerTool({
88
+ name: "devflow_context_cursor",
89
+ label: "Devflow Context Cursor",
90
+ description: "Inspect or update repository cursors used by deterministic context reconciliation.",
91
+ parameters: z.object({ args: z.array(z.string()).default([]) }),
92
+ approval: "exec",
93
+ async execute(_id, params, _signal, _onUpdate, ctx) {
94
+ const skillRoot = resolveSkillRoot(ctx.cwd);
95
+ const script = path.join(
96
+ skillRoot,
97
+ "workflow-context-sync/scripts/context_sync_cursor.py",
98
+ );
99
+ return render(await run(["python3", script, ...params.args], ctx.cwd), {
100
+ action: "context-cursor",
101
+ });
102
+ },
103
+ });
104
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@devflow/omp-intel",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "peerDependencies": {
7
+ "@oh-my-pi/pi-coding-agent": "*"
8
+ },
9
+ "omp": {
10
+ "extensions": [
11
+ "./extensions/devflow-intel.ts"
12
+ ]
13
+ }
14
+ }
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: code-index-query
3
+ description: Query a generated .planning/code-index machine index to answer code structure questions. Use when the OMP development agent needs callers, callees, entrypoint flows, imports, resource reads/writes, tested_by links, or symbol locations before reading source evidence.
4
+ ---
5
+
6
+ # Code Index Query
7
+
8
+ Use this skill to answer source-structure questions from `.planning/code-index/`.
9
+
10
+ ## Required Flow
11
+
12
+ 1. Check that `.planning/code-index/index.sqlite` or JSONL sidecars exist.
13
+ 2. Search symbols or relations using the machine index.
14
+ 3. Expand relation edges as needed.
15
+ 4. Read source files at `evidence_path`.
16
+ 5. Answer with path, line, relation type, and confidence.
17
+
18
+ Do not answer source facts from Markdown alone.
19
+
20
+ ## Commands
21
+
22
+ Search symbols:
23
+
24
+ ```text
25
+ devflow_code_index(action="query", term="{term}")
26
+ ```
27
+
28
+ If the index is missing or stale:
29
+
30
+ ```text
31
+ devflow_code_index(action="scan")
32
+ devflow_code_index(action="audit")
33
+ ```
34
+
35
+ ## Query Patterns
36
+
37
+ For more detailed query patterns, read `references/query-patterns.md`.
@@ -0,0 +1,27 @@
1
+ # Query Patterns
2
+
3
+ ## Who Calls This Symbol
4
+
5
+ 1. Search `symbols` by name, qualified name, or path.
6
+ 2. Query `relations` where `to_id = target_symbol_id`.
7
+ 3. Read each `evidence_path`.
8
+ 4. Report callers grouped by confidence.
9
+
10
+ ## What Does This Entrypoint Call
11
+
12
+ 1. Search entrypoint symbols by name/path/kind.
13
+ 2. Expand `routes_to` and `calls`.
14
+ 3. Limit depth unless the user asks for full traversal.
15
+ 4. Read source evidence for each edge used in the answer.
16
+
17
+ ## Who Reads Or Writes This Resource
18
+
19
+ 1. Normalize target as `table:{name}`, `env:{name}`, `url:{value}`, or another external key.
20
+ 2. Query `relations.to_external`.
21
+ 3. Filter relation type: `reads`, `writes`, or `config_uses`.
22
+ 4. Read evidence lines before answering.
23
+
24
+ ## Missing Or Low Confidence
25
+
26
+ If results are missing or only heuristic, say that the index has low-confidence evidence and cite diagnostics or source lines instead of claiming certainty.
27
+
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: workflow-code-index
3
+ description: Build, refresh, validate, or audit a generic code intelligence index for any project. Use when the OMP development agent needs AST/LSP-style symbol, call, relation, JSONL/SQLite, incremental-change, or other machine-readable code facts before source tracing.
4
+ ---
5
+
6
+ # Workflow Code Index
7
+
8
+ Build a generic code intelligence index for the current project. This skill is project-agnostic: do not hardcode codebase names, business modules, paths, or language stacks.
9
+
10
+ ## Outputs
11
+
12
+ Write generated artifacts to the target project:
13
+
14
+ - `.planning/code-index/files.jsonl`
15
+ - `.planning/code-index/symbols.jsonl`
16
+ - `.planning/code-index/relations.jsonl`
17
+ - `.planning/code-index/diagnostics.jsonl`
18
+ - `.planning/code-index/index.sqlite`
19
+ - `.planning/code-index/INDEX.md`
20
+ - `.planning/code-index/SYMBOLS.md`
21
+ - `.planning/code-index/RELATIONS.md`
22
+ - `.planning/code-index/ENTRYPOINTS.md`
23
+ - `.planning/code-index/DATAFLOW.md`
24
+ - `.planning/code-index/AUDIT.md` when auditing
25
+
26
+ Markdown is a display layer only. JSONL/SQLite is the machine fact layer.
27
+
28
+ ## Required References
29
+
30
+ Read these references when modifying the skill or interpreting its outputs:
31
+
32
+ - `references/data-model.md` — File/Symbol/Relation/Diagnostic schema
33
+ - `references/adapter-contract.md` — adapter interface and output rules
34
+ - `references/confidence-rules.md` — exact/inferred/heuristic semantics
35
+ - `references/discovery.md` — project/codebase discovery order
36
+ - `references/query-guide.md` — query and source readback rules
37
+ - `references/audit-checklist.md` — required schema, evidence, freshness, and genericity checks
38
+
39
+ ## Command
40
+
41
+ Use the OMP runtime tool:
42
+
43
+ ```text
44
+ devflow_code_index(action="scan")
45
+ devflow_code_index(action="validate")
46
+ devflow_code_index(action="audit")
47
+ ```
48
+
49
+ For changed-file indexing:
50
+
51
+ ```text
52
+ devflow_code_index(action="scan", changedFiles=["path/to/file.ext"])
53
+ ```
54
+
55
+ ## Audit Gate
56
+
57
+ `audit` is part of this skill's normal lifecycle, not a separate workflow. Run `validate` before `audit` whenever index files were edited or refreshed, then review `.planning/code-index/AUDIT.md` against `references/audit-checklist.md`.
58
+
59
+ Blocking findings are stale file hashes, missing indexed files, dangling `to_id` relations, missing relation evidence, and invalid schema. Unresolved heuristic calls, low-confidence diagnostics, and possible project-bound examples in generic skills are non-blocking but must be reported.
60
+
61
+ ## Rules
62
+
63
+ - Do not use vectors as a fact source.
64
+ - Do not let LLM-authored Markdown create new facts.
65
+ - Do not write relations without `evidence_path`, `evidence_line`, and `confidence`.
66
+ - Do not mark dynamic or string-based matches as `exact`.
67
+ - If adapter support is missing, emit diagnostics and fall back to generic indexing.
68
+ - Query answers must read source files at evidence paths before making factual claims.
@@ -0,0 +1,38 @@
1
+ # Adapter Contract
2
+
3
+ Adapters convert files into the shared data model. They must not invent project-specific conventions unless the source files, manifests, navigation, or framework facts provide evidence.
4
+
5
+ ## Required Interface
6
+
7
+ Every adapter implements:
8
+
9
+ - `detect(codebase, files, manifests) -> score`
10
+ - `parse_file(codebase, file_record, text) -> ParseResult`
11
+ - `resolve_relations(codebase, symbols, relations) -> relations`
12
+ - `version() -> str`
13
+
14
+ ## ParseResult
15
+
16
+ The result contains:
17
+
18
+ - `symbols`
19
+ - `relations`
20
+ - `diagnostics`
21
+
22
+ ## Resolution Rules
23
+
24
+ - A parser may emit unresolved calls as `to_external: "call:{name}"`.
25
+ - Resolver may upgrade to `to_id` only when a unique symbol target is found.
26
+ - Unique AST/LSP matches can be `exact`.
27
+ - Naming or directory convention matches are `inferred`.
28
+ - String or regex matches are `heuristic`.
29
+
30
+ ## Adapter Types
31
+
32
+ - `generic-text`: fallback for all source files.
33
+ - `tree-sitter-*`: AST symbols/imports/basic calls when dependency is available.
34
+ - `lsp-*`: definition/reference/call hierarchy when language service is available.
35
+ - `framework-*`: routes, ORM/database, jobs, config, tests, components.
36
+
37
+ Core schema and writers must not change when a new adapter is added.
38
+
@@ -0,0 +1,10 @@
1
+ # Audit Checklist
2
+
3
+ - JSONL records satisfy schema.
4
+ - SQLite exists and can be queried.
5
+ - Every relation has evidence path, line, and confidence.
6
+ - Every `to_id` points to an existing symbol.
7
+ - `exact` is not used for unresolved dynamic calls.
8
+ - Indexed files exist and hashes match current source.
9
+ - Markdown files are generated from machine index.
10
+ - Generic skill references use placeholders instead of project-specific paths or business names.
@@ -0,0 +1,43 @@
1
+ # Confidence Rules
2
+
3
+ ## exact
4
+
5
+ Use only when the target is deterministically known:
6
+
7
+ - AST/LSP resolves a unique symbol.
8
+ - A manifest or route table maps an entry to one target.
9
+ - A parser can point to a single external entity.
10
+
11
+ ## inferred
12
+
13
+ Use when the target follows a project or framework convention:
14
+
15
+ - Route names map to handlers by naming convention.
16
+ - Import path and symbol name imply a unique local target.
17
+ - Test names conventionally map to implementation names.
18
+
19
+ Include the basis in relation metadata.
20
+
21
+ ## heuristic
22
+
23
+ Use when the relation comes from text patterns:
24
+
25
+ - Dynamic calls.
26
+ - String-built routes.
27
+ - SQL snippets.
28
+ - Environment variable names.
29
+ - Reflection, macros, decorators, framework magic, or template strings.
30
+
31
+ Heuristic relations are candidate evidence only. Query skills must read source before using them in an answer.
32
+
33
+ ## Invalid
34
+
35
+ Do not write relation records without:
36
+
37
+ - `evidence_path`
38
+ - `evidence_line`
39
+ - `confidence`
40
+ - `to_id` or `to_external`
41
+
42
+ Write diagnostics instead.
43
+
@@ -0,0 +1,74 @@
1
+ # Code Index Data Model
2
+
3
+ All adapters must emit these records. Examples use placeholders only; do not replace them with project-specific paths in this reference.
4
+
5
+ ## File
6
+
7
+ ```json
8
+ {
9
+ "id": "file:{codebase}:{relative_path}",
10
+ "codebase": "{codebase}",
11
+ "path": "{workspace_relative_path}",
12
+ "language": "{language_id}",
13
+ "size_bytes": 0,
14
+ "content_hash": "sha256:{hash}",
15
+ "indexed_at": "{iso8601_time}",
16
+ "parser": "{adapter}@{version}"
17
+ }
18
+ ```
19
+
20
+ ## Symbol
21
+
22
+ ```json
23
+ {
24
+ "id": "{language}:{codebase}:{stable_qualified_symbol_key}",
25
+ "codebase": "{codebase}",
26
+ "kind": "function|method|class|struct|interface|trait|route|file|table|config|test|component|module",
27
+ "name": "{short_name}",
28
+ "qualified_name": "{language_native_qualified_name}",
29
+ "container_id": "{optional_parent_symbol_id}",
30
+ "path": "{workspace_relative_path}",
31
+ "line_start": 1,
32
+ "line_end": 1,
33
+ "signature": "{optional_signature}",
34
+ "language": "{language_id}",
35
+ "content_hash": "sha256:{hash}",
36
+ "visibility": "{optional_visibility}",
37
+ "metadata": {}
38
+ }
39
+ ```
40
+
41
+ Symbol IDs must not depend on line numbers. Use language, codebase, stable qualified name, and signature hash when needed.
42
+
43
+ ## Relation
44
+
45
+ ```json
46
+ {
47
+ "from_id": "{source_symbol_id}",
48
+ "relation_type": "contains|imports|calls|extends|implements|routes_to|reads|writes|tested_by|config_uses",
49
+ "to_id": "{optional_target_symbol_id}",
50
+ "to_external": "{optional_external_target}",
51
+ "evidence_path": "{workspace_relative_path}",
52
+ "evidence_line": 1,
53
+ "confidence": "exact|inferred|heuristic",
54
+ "parser": "{adapter}@{version}",
55
+ "metadata": {}
56
+ }
57
+ ```
58
+
59
+ `to_id` and `to_external` are mutually compatible, but at least one must be present.
60
+
61
+ ## Diagnostic
62
+
63
+ ```json
64
+ {
65
+ "codebase": "{codebase}",
66
+ "path": "{workspace_relative_path}",
67
+ "line": 1,
68
+ "severity": "info|warning|error",
69
+ "kind": "parse_failed|adapter_missing|low_confidence|ambiguous_target|skipped_file|stale_index|project_binding",
70
+ "message": "{message}",
71
+ "parser": "{adapter}@{version}"
72
+ }
73
+ ```
74
+
@@ -0,0 +1,24 @@
1
+ # Discovery
2
+
3
+ Discover codebases in this order:
4
+
5
+ 1. Explicit CLI arguments: `--codebase name:path[:type]`.
6
+ 2. `.planning/navigation/INDEX.md` Codebase Registry.
7
+ 3. `.context/spec/index.md` codebase mapping.
8
+ 4. Current working directory fallback.
9
+
10
+ Normalize each codebase to:
11
+
12
+ ```json
13
+ {
14
+ "name": "{codebase}",
15
+ "root": "{absolute_root}",
16
+ "type_hint": "{optional}",
17
+ "stack_hint": "{optional}",
18
+ "navigation_path": "{optional}",
19
+ "spec_path": "{optional}"
20
+ }
21
+ ```
22
+
23
+ Never hardcode project names or directories in the skill. Project-specific names only appear in generated index artifacts for that project.
24
+
@@ -0,0 +1,20 @@
1
+ # Query Guide
2
+
3
+ Query flow:
4
+
5
+ 1. Load project rules and navigation if present.
6
+ 2. Check `.planning/code-index/index.sqlite` or JSONL sidecars.
7
+ 3. Search symbols using exact name, qualified name, path, or FTS.
8
+ 4. Expand relations by type and depth.
9
+ 5. Read source files at `evidence_path`.
10
+ 6. Answer with source path, line number, relation type, and confidence.
11
+
12
+ Do not answer source facts from Markdown alone.
13
+
14
+ Common queries:
15
+
16
+ - Who calls this symbol: find target symbol, then query `relations.to_id`.
17
+ - What does this entrypoint call: find entrypoint, then expand `routes_to` and `calls`.
18
+ - Who reads/writes an external resource: query `to_external` with `reads`, `writes`, or `config_uses`.
19
+ - Which tests cover this: query `tested_by` or diagnostics for unresolved test mapping.
20
+