incitaciones 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 (318) hide show
  1. package/LICENSE +395 -0
  2. package/README.md +410 -0
  3. package/content/distilled/abstraction-miner.md +32 -0
  4. package/content/distilled/adversarial-stakeholder-evaluation.md +121 -0
  5. package/content/distilled/anti-slop-prose.md +46 -0
  6. package/content/distilled/bias-audit.md +39 -0
  7. package/content/distilled/code-review/SKILL.md +53 -0
  8. package/content/distilled/code-review/references/criteria.md +50 -0
  9. package/content/distilled/code-review/references/templates.md +75 -0
  10. package/content/distilled/code-review/references/variants.md +32 -0
  11. package/content/distilled/commit/SKILL.md +41 -0
  12. package/content/distilled/commit/references/criteria.md +21 -0
  13. package/content/distilled/commit/references/templates.md +46 -0
  14. package/content/distilled/composability-diagnostician.md +67 -0
  15. package/content/distilled/context-guardian.md +20 -0
  16. package/content/distilled/create-handoff/SKILL.md +16 -0
  17. package/content/distilled/create-handoff/references/handoff-template.md +65 -0
  18. package/content/distilled/create-handoff/references/naming.md +7 -0
  19. package/content/distilled/create-issues/SKILL.md +72 -0
  20. package/content/distilled/create-issues/references/criteria.md +44 -0
  21. package/content/distilled/create-issues/references/templates.md +75 -0
  22. package/content/distilled/create-plan/SKILL.md +19 -0
  23. package/content/distilled/create-plan/references/plan-template.md +87 -0
  24. package/content/distilled/create-plan/references/scenarios.md +19 -0
  25. package/content/distilled/debug/SKILL.md +42 -0
  26. package/content/distilled/debug/references/criteria.md +27 -0
  27. package/content/distilled/debug/references/templates.md +39 -0
  28. package/content/distilled/describe-pr/SKILL.md +17 -0
  29. package/content/distilled/describe-pr/references/pr-template.md +62 -0
  30. package/content/distilled/design-practice.md +213 -0
  31. package/content/distilled/design-review/SKILL.md +29 -0
  32. package/content/distilled/design-review/references/combined-review.md +27 -0
  33. package/content/distilled/design-review/references/decision-matrix.md +122 -0
  34. package/content/distilled/design-review/references/problem-statement.md +141 -0
  35. package/content/distilled/design-review/references/report-template.md +36 -0
  36. package/content/distilled/design-review/references/scope-document.md +51 -0
  37. package/content/distilled/distill-prompt/SKILL.md +41 -0
  38. package/content/distilled/distill-prompt/references/criteria.md +26 -0
  39. package/content/distilled/distill-prompt/references/templates.md +30 -0
  40. package/content/distilled/doc-link-verifier/SKILL.md +212 -0
  41. package/content/distilled/doc-link-verifier/scripts/check_links.py +453 -0
  42. package/content/distilled/doc-link-verifier/scripts/extract_links.py +521 -0
  43. package/content/distilled/edge-case-discovery.md +123 -0
  44. package/content/distilled/error-handling-diagnostician.md +90 -0
  45. package/content/distilled/extract-prompt.md +220 -0
  46. package/content/distilled/formal-verification-evaluator.md +158 -0
  47. package/content/distilled/grill-me.md +24 -0
  48. package/content/distilled/guided-review.md +68 -0
  49. package/content/distilled/implement-documentation.md +68 -0
  50. package/content/distilled/implement-plan/SKILL.md +23 -0
  51. package/content/distilled/implement-plan/references/common-situations.md +36 -0
  52. package/content/distilled/implement-plan/references/verification-template.md +18 -0
  53. package/content/distilled/invalid-states-diagnostician.md +63 -0
  54. package/content/distilled/issue-review/SKILL.md +37 -0
  55. package/content/distilled/issue-review/references/convergence.md +19 -0
  56. package/content/distilled/issue-review/references/final-report.md +60 -0
  57. package/content/distilled/issue-review/references/pass-1-clarity.md +28 -0
  58. package/content/distilled/issue-review/references/pass-2-scope.md +22 -0
  59. package/content/distilled/issue-review/references/pass-3-dependencies.md +23 -0
  60. package/content/distilled/issue-review/references/pass-4-alignment.md +17 -0
  61. package/content/distilled/issue-review/references/pass-5-executability.md +17 -0
  62. package/content/distilled/issue-review/references/setup.md +25 -0
  63. package/content/distilled/iterate-plan/SKILL.md +24 -0
  64. package/content/distilled/iterate-plan/references/change-template.md +15 -0
  65. package/content/distilled/iterate-plan/references/common-scenarios.md +14 -0
  66. package/content/distilled/julia-performance-diagnostician.md +71 -0
  67. package/content/distilled/modularity-diagnostician.md +68 -0
  68. package/content/distilled/multi-agent-review.md +196 -0
  69. package/content/distilled/mutability-diagnostician.md +63 -0
  70. package/content/distilled/narrative-article.md +60 -0
  71. package/content/distilled/optionality-review.md +190 -0
  72. package/content/distilled/parallel-review/SKILL.md +49 -0
  73. package/content/distilled/parallel-review/references/criteria.md +34 -0
  74. package/content/distilled/parallel-review/references/templates.md +59 -0
  75. package/content/distilled/plan-review/SKILL.md +42 -0
  76. package/content/distilled/plan-review/references/criteria.md +51 -0
  77. package/content/distilled/plan-review/references/templates.md +67 -0
  78. package/content/distilled/pre-mortem.md +10 -0
  79. package/content/distilled/project-status-report.md +124 -0
  80. package/content/distilled/pwa-accessibility-review.md +81 -0
  81. package/content/distilled/rca-diagnostician/SKILL.md +30 -0
  82. package/content/distilled/rca-diagnostician/references/action-hierarchy.md +77 -0
  83. package/content/distilled/rca-diagnostician/references/bias-countermeasures.md +64 -0
  84. package/content/distilled/rca-diagnostician/references/evidence-timeline.md +49 -0
  85. package/content/distilled/rca-diagnostician/references/hypothesis-methods.md +53 -0
  86. package/content/distilled/rca-diagnostician/references/problem-definition.md +34 -0
  87. package/content/distilled/rca-diagnostician/references/report-template.md +75 -0
  88. package/content/distilled/rca-diagnostician/references/rigor-checklist.md +66 -0
  89. package/content/distilled/red-team-review.md +133 -0
  90. package/content/distilled/research-codebase/SKILL.md +22 -0
  91. package/content/distilled/research-codebase/references/report-template.md +75 -0
  92. package/content/distilled/research-codebase/references/search-patterns.md +27 -0
  93. package/content/distilled/research-documentation.md +79 -0
  94. package/content/distilled/research-review/SKILL.md +42 -0
  95. package/content/distilled/research-review/references/criteria.md +51 -0
  96. package/content/distilled/research-review/references/templates.md +73 -0
  97. package/content/distilled/resonant-refactor.md +45 -0
  98. package/content/distilled/resume-handoff/SKILL.md +19 -0
  99. package/content/distilled/resume-handoff/references/analysis-template.md +40 -0
  100. package/content/distilled/resume-handoff/references/locating.md +12 -0
  101. package/content/distilled/review-documentation.md +44 -0
  102. package/content/distilled/rigidity-diagnostician.md +70 -0
  103. package/content/distilled/rule-of-5-universal/SKILL.md +26 -0
  104. package/content/distilled/rule-of-5-universal/references/criteria.md +34 -0
  105. package/content/distilled/rule-of-5-universal/references/examples.md +69 -0
  106. package/content/distilled/rule-of-5-universal/references/templates.md +136 -0
  107. package/content/distilled/specification-evaluation-diagnostician.md +106 -0
  108. package/content/distilled/specification-review/SKILL.md +43 -0
  109. package/content/distilled/specification-review/references/criteria.md +51 -0
  110. package/content/distilled/specification-review/references/templates.md +67 -0
  111. package/content/distilled/systematic-housekeeping.md +27 -0
  112. package/content/distilled/tdd/SKILL.md +38 -0
  113. package/content/distilled/tdd/references/criteria.md +26 -0
  114. package/content/distilled/tdd/references/templates.md +53 -0
  115. package/content/distilled/test-abstraction-miner.md +43 -0
  116. package/content/distilled/test-friction.md +51 -0
  117. package/content/distilled/testability-implementability-evaluator.md +144 -0
  118. package/content/distilled/ui-align.md +32 -0
  119. package/content/distilled/ux-dx-evaluation-diagnostician/SKILL.md +21 -0
  120. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-1-product.md +20 -0
  121. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-2-engineering.md +20 -0
  122. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-3-interface.md +23 -0
  123. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-4-ecosystem.md +20 -0
  124. package/content/distilled/ux-dx-evaluation-diagnostician/references/layer-5-documentation.md +19 -0
  125. package/content/distilled/ux-dx-evaluation-diagnostician/references/report-template.md +36 -0
  126. package/content/distilled/verification-diagnostician.md +90 -0
  127. package/content/distilled/verify-prompt/SKILL.md +32 -0
  128. package/content/distilled/verify-prompt/references/criteria.md +21 -0
  129. package/content/manifest.json +3220 -0
  130. package/package.json +50 -0
  131. package/pi-package/README.md +9 -0
  132. package/pi-package/prompts/abstraction-miner.md +10 -0
  133. package/pi-package/prompts/adversarial-stakeholder-evaluation.md +10 -0
  134. package/pi-package/prompts/anti-slop-prose.md +10 -0
  135. package/pi-package/prompts/bias-audit.md +10 -0
  136. package/pi-package/prompts/code-review.md +10 -0
  137. package/pi-package/prompts/commit.md +10 -0
  138. package/pi-package/prompts/composability-diagnostician.md +10 -0
  139. package/pi-package/prompts/context-guardian.md +10 -0
  140. package/pi-package/prompts/create-handoff.md +10 -0
  141. package/pi-package/prompts/create-issues.md +10 -0
  142. package/pi-package/prompts/create-plan.md +10 -0
  143. package/pi-package/prompts/debug.md +10 -0
  144. package/pi-package/prompts/describe-pr.md +10 -0
  145. package/pi-package/prompts/design-practice.md +10 -0
  146. package/pi-package/prompts/design-review.md +10 -0
  147. package/pi-package/prompts/distill-prompt.md +10 -0
  148. package/pi-package/prompts/doc-link-verifier.md +10 -0
  149. package/pi-package/prompts/edge-case-discovery.md +10 -0
  150. package/pi-package/prompts/error-handling-diagnostician.md +10 -0
  151. package/pi-package/prompts/extract-prompt.md +10 -0
  152. package/pi-package/prompts/formal-verification-evaluator.md +10 -0
  153. package/pi-package/prompts/grill-me.md +10 -0
  154. package/pi-package/prompts/guided-review.md +10 -0
  155. package/pi-package/prompts/implement-documentation.md +10 -0
  156. package/pi-package/prompts/implement-plan.md +10 -0
  157. package/pi-package/prompts/invalid-states-diagnostician.md +10 -0
  158. package/pi-package/prompts/issue-review.md +10 -0
  159. package/pi-package/prompts/iterate-plan.md +10 -0
  160. package/pi-package/prompts/julia-performance-diagnostician.md +10 -0
  161. package/pi-package/prompts/modularity-diagnostician.md +10 -0
  162. package/pi-package/prompts/multi-agent-review.md +10 -0
  163. package/pi-package/prompts/mutability-diagnostician.md +10 -0
  164. package/pi-package/prompts/narrative-article.md +10 -0
  165. package/pi-package/prompts/optionality-review.md +10 -0
  166. package/pi-package/prompts/parallel-review.md +10 -0
  167. package/pi-package/prompts/plan-review.md +10 -0
  168. package/pi-package/prompts/pre-mortem.md +10 -0
  169. package/pi-package/prompts/project-status-report.md +10 -0
  170. package/pi-package/prompts/pwa-accessibility-review.md +10 -0
  171. package/pi-package/prompts/rca-diagnostician.md +10 -0
  172. package/pi-package/prompts/red-team-review.md +10 -0
  173. package/pi-package/prompts/research-codebase.md +10 -0
  174. package/pi-package/prompts/research-documentation.md +10 -0
  175. package/pi-package/prompts/research-review.md +10 -0
  176. package/pi-package/prompts/resonant-refactor.md +10 -0
  177. package/pi-package/prompts/resume-handoff.md +10 -0
  178. package/pi-package/prompts/review-documentation.md +10 -0
  179. package/pi-package/prompts/rigidity-diagnostician.md +10 -0
  180. package/pi-package/prompts/rule-of-5-universal.md +10 -0
  181. package/pi-package/prompts/specification-evaluation-diagnostician.md +10 -0
  182. package/pi-package/prompts/specification-review.md +10 -0
  183. package/pi-package/prompts/systematic-housekeeping.md +10 -0
  184. package/pi-package/prompts/tdd.md +10 -0
  185. package/pi-package/prompts/test-abstraction-miner.md +10 -0
  186. package/pi-package/prompts/test-friction.md +10 -0
  187. package/pi-package/prompts/testability-implementability-evaluator.md +10 -0
  188. package/pi-package/prompts/ui-align.md +10 -0
  189. package/pi-package/prompts/ux-dx-evaluation-diagnostician.md +10 -0
  190. package/pi-package/prompts/verification-diagnostician.md +10 -0
  191. package/pi-package/prompts/verify-prompt.md +10 -0
  192. package/pi-package/skills/abstraction-miner/SKILL.md +38 -0
  193. package/pi-package/skills/adversarial-stakeholder-evaluation/SKILL.md +127 -0
  194. package/pi-package/skills/anti-slop-prose/SKILL.md +52 -0
  195. package/pi-package/skills/bias-audit/SKILL.md +45 -0
  196. package/pi-package/skills/code-review/SKILL.md +59 -0
  197. package/pi-package/skills/code-review/references/criteria.md +50 -0
  198. package/pi-package/skills/code-review/references/templates.md +75 -0
  199. package/pi-package/skills/code-review/references/variants.md +32 -0
  200. package/pi-package/skills/commit/SKILL.md +47 -0
  201. package/pi-package/skills/commit/references/criteria.md +21 -0
  202. package/pi-package/skills/commit/references/templates.md +46 -0
  203. package/pi-package/skills/composability-diagnostician/SKILL.md +73 -0
  204. package/pi-package/skills/context-guardian/SKILL.md +26 -0
  205. package/pi-package/skills/create-handoff/SKILL.md +22 -0
  206. package/pi-package/skills/create-handoff/references/handoff-template.md +65 -0
  207. package/pi-package/skills/create-handoff/references/naming.md +7 -0
  208. package/pi-package/skills/create-issues/SKILL.md +78 -0
  209. package/pi-package/skills/create-issues/references/criteria.md +44 -0
  210. package/pi-package/skills/create-issues/references/templates.md +75 -0
  211. package/pi-package/skills/create-plan/SKILL.md +25 -0
  212. package/pi-package/skills/create-plan/references/plan-template.md +87 -0
  213. package/pi-package/skills/create-plan/references/scenarios.md +19 -0
  214. package/pi-package/skills/debug/SKILL.md +48 -0
  215. package/pi-package/skills/debug/references/criteria.md +27 -0
  216. package/pi-package/skills/debug/references/templates.md +39 -0
  217. package/pi-package/skills/describe-pr/SKILL.md +23 -0
  218. package/pi-package/skills/describe-pr/references/pr-template.md +62 -0
  219. package/pi-package/skills/design-practice/SKILL.md +219 -0
  220. package/pi-package/skills/design-review/SKILL.md +35 -0
  221. package/pi-package/skills/design-review/references/combined-review.md +27 -0
  222. package/pi-package/skills/design-review/references/decision-matrix.md +122 -0
  223. package/pi-package/skills/design-review/references/problem-statement.md +141 -0
  224. package/pi-package/skills/design-review/references/report-template.md +36 -0
  225. package/pi-package/skills/design-review/references/scope-document.md +51 -0
  226. package/pi-package/skills/distill-prompt/SKILL.md +47 -0
  227. package/pi-package/skills/distill-prompt/references/criteria.md +26 -0
  228. package/pi-package/skills/distill-prompt/references/templates.md +30 -0
  229. package/pi-package/skills/doc-link-verifier/SKILL.md +218 -0
  230. package/pi-package/skills/doc-link-verifier/scripts/check_links.py +453 -0
  231. package/pi-package/skills/doc-link-verifier/scripts/extract_links.py +521 -0
  232. package/pi-package/skills/edge-case-discovery/SKILL.md +129 -0
  233. package/pi-package/skills/error-handling-diagnostician/SKILL.md +96 -0
  234. package/pi-package/skills/extract-prompt/SKILL.md +226 -0
  235. package/pi-package/skills/formal-verification-evaluator/SKILL.md +164 -0
  236. package/pi-package/skills/grill-me/SKILL.md +30 -0
  237. package/pi-package/skills/guided-review/SKILL.md +74 -0
  238. package/pi-package/skills/implement-documentation/SKILL.md +74 -0
  239. package/pi-package/skills/implement-plan/SKILL.md +29 -0
  240. package/pi-package/skills/implement-plan/references/common-situations.md +36 -0
  241. package/pi-package/skills/implement-plan/references/verification-template.md +18 -0
  242. package/pi-package/skills/invalid-states-diagnostician/SKILL.md +69 -0
  243. package/pi-package/skills/issue-review/SKILL.md +43 -0
  244. package/pi-package/skills/issue-review/references/convergence.md +19 -0
  245. package/pi-package/skills/issue-review/references/final-report.md +60 -0
  246. package/pi-package/skills/issue-review/references/pass-1-clarity.md +28 -0
  247. package/pi-package/skills/issue-review/references/pass-2-scope.md +22 -0
  248. package/pi-package/skills/issue-review/references/pass-3-dependencies.md +23 -0
  249. package/pi-package/skills/issue-review/references/pass-4-alignment.md +17 -0
  250. package/pi-package/skills/issue-review/references/pass-5-executability.md +17 -0
  251. package/pi-package/skills/issue-review/references/setup.md +25 -0
  252. package/pi-package/skills/iterate-plan/SKILL.md +30 -0
  253. package/pi-package/skills/iterate-plan/references/change-template.md +15 -0
  254. package/pi-package/skills/iterate-plan/references/common-scenarios.md +14 -0
  255. package/pi-package/skills/julia-performance-diagnostician/SKILL.md +77 -0
  256. package/pi-package/skills/modularity-diagnostician/SKILL.md +74 -0
  257. package/pi-package/skills/multi-agent-review/SKILL.md +202 -0
  258. package/pi-package/skills/mutability-diagnostician/SKILL.md +69 -0
  259. package/pi-package/skills/narrative-article/SKILL.md +66 -0
  260. package/pi-package/skills/optionality-review/SKILL.md +196 -0
  261. package/pi-package/skills/parallel-review/SKILL.md +55 -0
  262. package/pi-package/skills/parallel-review/references/criteria.md +34 -0
  263. package/pi-package/skills/parallel-review/references/templates.md +59 -0
  264. package/pi-package/skills/plan-review/SKILL.md +48 -0
  265. package/pi-package/skills/plan-review/references/criteria.md +51 -0
  266. package/pi-package/skills/plan-review/references/templates.md +67 -0
  267. package/pi-package/skills/pre-mortem/SKILL.md +16 -0
  268. package/pi-package/skills/project-status-report/SKILL.md +130 -0
  269. package/pi-package/skills/pwa-accessibility-review/SKILL.md +87 -0
  270. package/pi-package/skills/rca-diagnostician/SKILL.md +36 -0
  271. package/pi-package/skills/rca-diagnostician/references/action-hierarchy.md +77 -0
  272. package/pi-package/skills/rca-diagnostician/references/bias-countermeasures.md +64 -0
  273. package/pi-package/skills/rca-diagnostician/references/evidence-timeline.md +49 -0
  274. package/pi-package/skills/rca-diagnostician/references/hypothesis-methods.md +53 -0
  275. package/pi-package/skills/rca-diagnostician/references/problem-definition.md +34 -0
  276. package/pi-package/skills/rca-diagnostician/references/report-template.md +75 -0
  277. package/pi-package/skills/rca-diagnostician/references/rigor-checklist.md +66 -0
  278. package/pi-package/skills/red-team-review/SKILL.md +139 -0
  279. package/pi-package/skills/research-codebase/SKILL.md +28 -0
  280. package/pi-package/skills/research-codebase/references/report-template.md +75 -0
  281. package/pi-package/skills/research-codebase/references/search-patterns.md +27 -0
  282. package/pi-package/skills/research-documentation/SKILL.md +85 -0
  283. package/pi-package/skills/research-review/SKILL.md +48 -0
  284. package/pi-package/skills/research-review/references/criteria.md +51 -0
  285. package/pi-package/skills/research-review/references/templates.md +73 -0
  286. package/pi-package/skills/resonant-refactor/SKILL.md +51 -0
  287. package/pi-package/skills/resume-handoff/SKILL.md +25 -0
  288. package/pi-package/skills/resume-handoff/references/analysis-template.md +40 -0
  289. package/pi-package/skills/resume-handoff/references/locating.md +12 -0
  290. package/pi-package/skills/review-documentation/SKILL.md +50 -0
  291. package/pi-package/skills/rigidity-diagnostician/SKILL.md +76 -0
  292. package/pi-package/skills/rule-of-5-universal/SKILL.md +32 -0
  293. package/pi-package/skills/rule-of-5-universal/references/criteria.md +34 -0
  294. package/pi-package/skills/rule-of-5-universal/references/examples.md +69 -0
  295. package/pi-package/skills/rule-of-5-universal/references/templates.md +136 -0
  296. package/pi-package/skills/specification-evaluation-diagnostician/SKILL.md +112 -0
  297. package/pi-package/skills/specification-review/SKILL.md +49 -0
  298. package/pi-package/skills/specification-review/references/criteria.md +51 -0
  299. package/pi-package/skills/specification-review/references/templates.md +67 -0
  300. package/pi-package/skills/systematic-housekeeping/SKILL.md +33 -0
  301. package/pi-package/skills/tdd/SKILL.md +44 -0
  302. package/pi-package/skills/tdd/references/criteria.md +26 -0
  303. package/pi-package/skills/tdd/references/templates.md +53 -0
  304. package/pi-package/skills/test-abstraction-miner/SKILL.md +49 -0
  305. package/pi-package/skills/test-friction/SKILL.md +57 -0
  306. package/pi-package/skills/testability-implementability-evaluator/SKILL.md +150 -0
  307. package/pi-package/skills/ui-align/SKILL.md +38 -0
  308. package/pi-package/skills/ux-dx-evaluation-diagnostician/SKILL.md +27 -0
  309. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-1-product.md +20 -0
  310. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-2-engineering.md +20 -0
  311. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-3-interface.md +23 -0
  312. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-4-ecosystem.md +20 -0
  313. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/layer-5-documentation.md +19 -0
  314. package/pi-package/skills/ux-dx-evaluation-diagnostician/references/report-template.md +36 -0
  315. package/pi-package/skills/verification-diagnostician/SKILL.md +96 -0
  316. package/pi-package/skills/verify-prompt/SKILL.md +38 -0
  317. package/pi-package/skills/verify-prompt/references/criteria.md +21 -0
  318. package/scripts/cli.mjs +453 -0
@@ -0,0 +1,36 @@
1
+ ## Common Situations
2
+
3
+ ### Tests already pass
4
+
5
+ - Verify the implementation really matches the plan.
6
+ - Mark the phase complete if it does.
7
+
8
+ ### The plan does not match reality
9
+
10
+ Report:
11
+
12
+ ```text
13
+ Issue in Phase [N]:
14
+
15
+ Expected (from plan): [What the plan says]
16
+ Found (in codebase): [Actual situation]
17
+ Why this matters: [Impact]
18
+
19
+ Options:
20
+ 1. Adapt implementation to current reality
21
+ 2. Update the plan
22
+ 3. Ask the user for guidance
23
+ ```
24
+
25
+ ### A better approach appears mid-implementation
26
+
27
+ - Explain the current plan.
28
+ - Explain the alternative.
29
+ - Summarize the tradeoffs.
30
+ - Ask whether to continue or update the plan.
31
+
32
+ ### External dependency is unavailable
33
+
34
+ - State what is blocked.
35
+ - Explain impact.
36
+ - List available workarounds, if any.
@@ -0,0 +1,18 @@
1
+ ```text
2
+ Phase [N] Complete - Ready for Verification
3
+
4
+ Automated verification:
5
+ - [x] All tests pass
6
+ - [x] Type checking passes
7
+ - [x] Build succeeds
8
+
9
+ Manual verification needed:
10
+ - [ ] [Manual step 1]
11
+ - [ ] [Manual step 2]
12
+
13
+ Changes made:
14
+ - [path:line] [What changed]
15
+ - [path:line] [What changed]
16
+
17
+ Let me know when verified so I can proceed to Phase [N+1].
18
+ ```
@@ -0,0 +1,63 @@
1
+ <!-- Full version: content/prompt-task-invalid-states-diagnostician.md -->
2
+ You are a Type Integrity Analyst. Diagnose locations where the type system permits business-invalid states — including primitive obsession, boolean blindness, implicit coupling, shotgun parsing, ad-hoc state machines, unconstrained optionality, exhaustiveness gaps, and monolithic records — and map each finding to a type-tightening refactoring pattern. Do NOT modify any files — advisory only.
3
+
4
+ **GUARD:** Do not apply to greenfield projects, codebases without static type checking and no gradual typing in use (plain JS without TS, Python without mypy/pyright), or when the problem is mutable state/side effects (use mutability-diagnostician), structural coupling/inheritance (use rigidity-diagnostician), or composition friction (use composability-diagnostician). Domain concepts that are genuinely unconstrained strings (free-text, user notes) are not primitive obsession — only flag primitives harboring hidden business rules.
5
+
6
+ **INPUT**
7
+ - Target files/directory: [SPECIFY]
8
+ - High-churn files (optional): [git log output OR "none"]
9
+ - Architecture reference (optional): [AGENTS.md rules OR "none"]
10
+ - Language/framework (optional): [e.g., "TypeScript/React" — or "infer"]
11
+
12
+ **PROTOCOL (Five-Step Pipeline)**
13
+
14
+ Step 1 — Detect State Integrity Signals: Read all files. Identify:
15
+ - Shotgun Parsing (Critical): validation (format checks, range checks, null guards) scattered across business logic instead of enforced at boundary; same validation duplicated in multiple locations
16
+ - Ad-hoc State Machine (Critical): lifecycle via string comparisons, boolean flag combinations, or enum checks without structural enforcement; functions callable in semantically invalid states
17
+ - Primitive Obsession (High): domain concepts (email, money, URL, coordinates) as raw strings/numbers without validation; implicit constraints enforced only at usage sites
18
+ - Boolean Blindness (High): bare boolean parameters/returns with invisible meaning at call site; boolean flag clusters whose combinations produce invalid states; boolean checks disconnected from guarded data
19
+ - Implicit Coupling (High): fields that must change together but exist independently — updating one without the other silently corrupts state
20
+ - Exhaustiveness Gap (High): switch/match with catch-all default on types that should be exhaustively handled; missing `never`/`assert_never` guards
21
+ - Unconstrained Optionality (High): implicit nullability without type-system-enforced null checks; Option/Maybe unwrapped deep in business logic instead of parsed at boundary
22
+ - Monolithic Record (Medium): large records grouping unrelated fields updated independently; domain transactions forced to instantiate more data than needed
23
+ Note file, line range, and description for each.
24
+
25
+ Step 2 — Classify State Space Gap: For each signal, assess:
26
+ - Scope: Type-local (single type too broad) / Cross-type (shared implicit coupling) / Boundary (external data enters unparsed) / System-wide (domain types exposed as API/DB schemas)
27
+ - Invalid state count: how many representable states are business-invalid (e.g., 3 booleans = 8 states, 3 valid → 5 invalid)
28
+ - Failure mode: silent corruption (Critical) / runtime exception (High) / logged warning (Low)
29
+ - Validation scattering: how many locations currently guard against this invalid state at runtime
30
+
31
+ Step 3 — Analyze State Space: For top 5-10 findings by severity:
32
+ - **Finite state spaces** (boolean clusters, enum combinations): Enumerate S_repr (all states type permits), S_valid (business-legal states), S_invalid = S_repr - S_valid (states to make unrepresentable)
33
+ - **Unbounded state spaces** (string for email, number for price): Characterize S_valid subset (e.g., "RFC 5322 email format") — do not enumerate infinite invalid space; count compensating runtime guards as primary severity metric
34
+ - For all findings: locate compensating validation for each invalid state — count guard locations
35
+
36
+ Step 4 — Map to Refactoring Pattern:
37
+ - Domain concepts as raw primitives → **Value Object (Tiny Type)**: self-validating, immutable; invalid data fails construction
38
+ - Bare booleans for domain states → **Semantic Enum / Discriminated Union**: `Permission.ReadOnly | Permission.ReadWrite` not `(bool, bool)`
39
+ - Coupled fields existing independently → **Atomic Record**: group into single type updated as transactional unit
40
+ - Unrelated fields over-grouped → **Context-Specific Decomposition**: split into bounded types per usage context
41
+ - Validation scattered across layers → **Parse at the Boundary**: "Parse, Don't Validate" — transform external data to strict domain types at edge
42
+ - Lifecycle managed by flags/strings → **Typestate Pattern**: distinct type per state; invalid transitions are compiler errors
43
+ - Missing exhaustive handling → **Exhaustiveness Enforcement**: remove defaults, add `never`/`assert_never`; omit `default` on sealed switches (Java)
44
+ - Implicit nullability → **Explicit Optionality with Boundary Parsing**: Option/Maybe with strict null checks; unwrap at boundary only
45
+
46
+ Native equivalents: Value Object → `record` (C#/Java), `data class` (Kotlin), newtype (Rust), branded types (TS); Discriminated Union → `enum` with data (Rust/Swift), `sealed interface` (Java/Kotlin), discriminated union (F#/TS); Typestate → `PhantomData` (Rust), sealed hierarchies (Kotlin/Java), discriminated union (TS — simple) or branded types (TS — advanced); Exhaustiveness → `never` (TS), `assert_never()` (Python), omit `default` on sealed switches (Java); Boundary Parsing → Zod/io-ts (TS), Pydantic (Python), serde (Rust), `System.Text.Json` (C#).
47
+
48
+ Step 5 — Prioritize: Score = State Space Gap (System-wide=3, Boundary/Cross-type=2, Type-local=1) x Failure Severity (Silent corruption/security=3, Runtime exception=2, Cosmetic=1) x Validation Scattering (3+ guards=3, 2 guards=2, Single/none=1). Sequence: Value Objects first (smallest, safest, collapses scattered validation), boundary parsing next (prevents new invalid data entering), semantic enums and exhaustiveness follow (eliminates boolean blindness), atomic records and decompositions next (structural grouping), typestate last (highest architectural impact). Each step independently deployable.
49
+
50
+ **OUTPUT**
51
+
52
+ Summary table:
53
+ | Location | State Integrity Signal | State Space Gap | S_invalid Count | Refactoring Pattern | Priority |
54
+
55
+ If multiple signals share root cause, consolidate. Then per finding: signal (files, lines, names), state space gap (S_repr vs S_valid — which states are invalid, how many guards compensate), recommended pattern (sketch, not full code), refactoring sequence (safe steps), success signals (domain types rejecting invalid state at construction, switch statements breaking at compile time on new variants, boundary parsers transforming chaos into axioms).
56
+
57
+ Enforcement recommendations per language: TS → `strictNullChecks`, `noUncheckedIndexedAccess`, Zod at boundaries, `never` default; Rust → `clippy::all` + `clippy::pedantic`, exhaustive match; Java → sealed interfaces, no `default` on sealed switches, ArchUnit for encapsulation; C#/.NET → NetArchTest (no parameterless constructors, no public setters on domain types), `record` with `init`; Python → `mypy --strict`, `assert_never()`, Pydantic at boundaries. Unlisted: Kotlin (`sealed class`, `when` exhaustiveness), Swift (exhaustive `switch`), F# (discriminated unions), Go (unexported fields + constructors).
58
+
59
+ Needs Human Review: list ambiguous cases — genuinely unconstrained strings (free-text, notes), boolean flags required by framework conventions (serialization, ORM), boundary schemas where strict typing conflicts with backwards compatibility (enforce internally via "Parse, Don't Validate", keep external schemas permissive), state machines in high-variance domains where bidirectional transitions are business requirements, unsigned vs signed integer choices (unsigned arithmetic can underflow to dangerous positive values), performance-critical hot paths where Value Object allocation overhead matters.
60
+
61
+ If no signals found: "No representable invalid states found. Domain types accurately constrain their business meaning, boundaries parse external data into strict types, and state transitions are structurally enforced." Do not fabricate findings.
62
+
63
+ Stop when all files analyzed. Do not modify anything.
@@ -0,0 +1,37 @@
1
+ # Tracer-Bullet Issue Review (Rule of 5)
2
+
3
+ Review an issue set in five passes, with special attention to whether tickets are true tracer-bullet vertical slices.
4
+
5
+ ## Setup
6
+
7
+ Read `references/setup.md` for tracker-specific collection commands before reviewing.
8
+
9
+ ## Procedure
10
+
11
+ 1. Gather the issue set to review plus the source plan/spec/parent issue when available.
12
+ 2. Run the passes in order:
13
+ - Pass 1: `references/pass-1-clarity.md`
14
+ - Pass 2: `references/pass-2-scope.md`
15
+ - Pass 3: `references/pass-3-dependencies.md`
16
+ - Pass 4: `references/pass-4-alignment.md`
17
+ - Pass 5: `references/pass-5-executability.md`
18
+ 3. After each pass starting with pass 2, evaluate convergence using `references/convergence.md`.
19
+ 4. If converged, stop.
20
+ 5. Produce the final report using `references/final-report.md`.
21
+
22
+ ## Review Lens
23
+
24
+ Treat the best issue sets as:
25
+ - thin vertical slices rather than layer tickets
26
+ - independently verifiable or demoable
27
+ - minimal but sufficient dependency graphs
28
+ - explicit about AFK vs HITL work
29
+ - traceable back to stories, plans, or specs
30
+
31
+ ## Rules
32
+
33
+ - Reference issue IDs precisely.
34
+ - Verify issue content before flagging a problem.
35
+ - Prioritize blockers over cosmetic cleanup.
36
+ - Suggest exact tracker edits or commands when practical.
37
+ - Call out horizontal decomposition explicitly: backend-only, schema-only, UI-only, or refactor-only tickets that should be folded into a tracer bullet.
@@ -0,0 +1,19 @@
1
+ ## Convergence Check
2
+
3
+ After each pass starting with pass 2, report:
4
+
5
+ ```text
6
+ Convergence Check After Pass [N]:
7
+
8
+ 1. New CRITICAL issues: [count]
9
+ 2. Total new issues this pass: [count]
10
+ 3. Total new issues previous pass: [count]
11
+ 4. Estimated false positive rate: [percentage]
12
+
13
+ Status: [CONVERGED | ITERATE | NEEDS_HUMAN]
14
+ ```
15
+
16
+ Criteria:
17
+ - `CONVERGED`: no new CRITICAL issues, <10% new issues vs previous pass, <20% false positives
18
+ - `ITERATE`: continue
19
+ - `NEEDS_HUMAN`: blocking judgment call required
@@ -0,0 +1,60 @@
1
+ ## Final Report Template
2
+
3
+ ```text
4
+ ## Issue Tracker Review Final Report
5
+
6
+ System: [Beads/GitHub/Linear/Jira]
7
+ Scope: [All issues / Milestone / Label set]
8
+ Source: [Plan/spec/parent issue if known]
9
+
10
+ ### Summary
11
+
12
+ Total Issues Reviewed: [count]
13
+
14
+ Issues Found by Severity:
15
+ - CRITICAL: [count]
16
+ - HIGH: [count]
17
+ - MEDIUM: [count]
18
+ - LOW: [count]
19
+
20
+ Convergence: Pass [N]
21
+
22
+ ### Tracer-Bullet Assessment
23
+
24
+ - Slice quality: [Excellent|Good|Fair|Poor]
25
+ - Horizontal-ticket leakage: [None|Low|Moderate|High]
26
+ - AFK/HITL clarity: [Excellent|Good|Fair|Poor]
27
+
28
+ ### Top 3 Most Critical Findings
29
+
30
+ 1. [ID] [Finding]
31
+ - Impact: [Why it blocks or degrades execution]
32
+ - Fix: [Exact command or edit]
33
+
34
+ 2. [ID] [Finding]
35
+ - Impact: [Why it matters]
36
+ - Fix: [Exact command or edit]
37
+
38
+ 3. [ID] [Finding]
39
+ - Impact: [Why it matters]
40
+ - Fix: [Exact command or edit]
41
+
42
+ ### Recommended Actions
43
+
44
+ - Provide exact tracker commands where practical.
45
+ - Collapse horizontal tickets into tracer bullets when possible.
46
+ - Include file paths, tests, and plan/story references when missing.
47
+
48
+ ### Verdict
49
+
50
+ [READY_TO_WORK | NEEDS_UPDATES | NEEDS_REPLANNING]
51
+
52
+ Rationale: [1-2 sentences]
53
+
54
+ ### Issue Quality Assessment
55
+
56
+ - Clarity: [Excellent|Good|Fair|Poor]
57
+ - Scope: [Excellent|Good|Fair|Poor]
58
+ - Dependencies: [Excellent|Good|Fair|Poor]
59
+ - Completeness: [Excellent|Good|Fair|Poor]
60
+ ```
@@ -0,0 +1,28 @@
1
+ ## Pass 1: Completeness and Clarity
2
+
3
+ Focus on:
4
+ - Clear title
5
+ - Sufficient context
6
+ - Concrete file paths and changes
7
+ - Success criteria or tests
8
+ - Unambiguous done criteria
9
+
10
+ Watch for:
11
+ - Vague titles
12
+ - Minimal descriptions
13
+ - "Implement X" without where or how
14
+ - Missing verification steps
15
+
16
+ Output:
17
+
18
+ ```text
19
+ PASS 1: Completeness & Clarity
20
+
21
+ Issues Found:
22
+
23
+ [CLRT-001] [CRITICAL|HIGH|MEDIUM|LOW] - Issue ID/Number
24
+ Title: [Issue title]
25
+ Description: [What's unclear or incomplete]
26
+ Evidence: [Why this is a problem]
27
+ Recommendation: [How to fix]
28
+ ```
@@ -0,0 +1,22 @@
1
+ ## Pass 2: Scope, Atomicity, and Tracer-Bullet Shape
2
+
3
+ Focus on:
4
+ - One logical capability per issue
5
+ - Thin vertical slices instead of horizontal layer tickets
6
+ - Issues small enough to finish in one focused session
7
+ - Clear boundaries with no overlap
8
+ - Independent demo or verification value
9
+
10
+ Watch for:
11
+ - Oversized epics disguised as issues
12
+ - Backend-only / schema-only / UI-only tickets that should be part of one slice
13
+ - Preparatory plumbing tickets with no standalone value
14
+ - Trivial issues that should be bundled into a slice
15
+ - Refactor + feature bundles with unclear boundaries
16
+
17
+ Questions to ask:
18
+ - If this issue lands alone, is anything real now possible or testable?
19
+ - Does it cut through the necessary layers for one outcome?
20
+ - Would splitting it by component create worse tickets?
21
+
22
+ Prefix findings with `SCOPE-`.
@@ -0,0 +1,23 @@
1
+ ## Pass 3: Dependencies and Ordering
2
+
3
+ Focus on:
4
+ - Correct dependency links
5
+ - Missing prerequisites
6
+ - Circular dependencies
7
+ - Avoidable serialization
8
+ - Sensible critical path
9
+ - Whether the issue graph reflects tracer bullets rather than phase gates
10
+
11
+ Watch for:
12
+ - Hidden blockers
13
+ - Cycles
14
+ - Artificial bottlenecks from horizontal decomposition
15
+ - Missing rationale for dependencies
16
+ - Tickets blocked only because the work was split by layer instead of by outcome
17
+
18
+ Questions to ask:
19
+ - Could these issues run in parallel if they were sliced vertically?
20
+ - Is a dependency real, or an artifact of poor decomposition?
21
+ - Are HITL issues isolated so AFK work can continue around them?
22
+
23
+ Prefix findings with `DEP-`.
@@ -0,0 +1,17 @@
1
+ ## Pass 4: Plan, Story, and Spec Alignment
2
+
3
+ Focus on:
4
+ - Traceability to plan/spec sections or user stories
5
+ - Coverage of the intended workflow end-to-end
6
+ - Alignment between the chosen issue breakdown and the source material
7
+ - Explicit tests before implementation
8
+ - AFK/HITL classification when relevant
9
+
10
+ Watch for:
11
+ - Missing plan or story references
12
+ - Gaps where a user story is only partially covered across layer tickets
13
+ - Specs with no corresponding issue
14
+ - Issues that contradict the intended implementation approach
15
+ - Breakdown by phase/component when the source material describes user outcomes
16
+
17
+ Prefix findings with `ALIGN-`.
@@ -0,0 +1,17 @@
1
+ ## Pass 5: Executability and Handoff
2
+
3
+ Focus on:
4
+ - Can another developer or agent pick this up immediately?
5
+ - Are verification steps concrete and end-to-end?
6
+ - Are priorities and labels sensible?
7
+ - Are HITL handoff points explicit?
8
+ - Is it clear what demo, test, or observable behavior proves completion?
9
+
10
+ Watch for:
11
+ - Hidden conversational context
12
+ - "You know what to do"
13
+ - Missing verification commands or test references
14
+ - HITL work masquerading as AFK
15
+ - Tickets that cannot be closed without information from another issue not listed as a blocker
16
+
17
+ Prefix findings with `EXEC-`.
@@ -0,0 +1,25 @@
1
+ ## Gathering Issues to Review
2
+
3
+ ### Beads
4
+
5
+ ```bash
6
+ bd list
7
+ bd ready
8
+ bd graph
9
+ bd show <id>
10
+ bd dep tree
11
+ bd dep cycles
12
+ ```
13
+
14
+ ### GitHub Issues
15
+
16
+ ```bash
17
+ gh issue list --label "needs-review" --json number,title,body,labels
18
+ gh issue view <number>
19
+ ```
20
+
21
+ ### Other systems
22
+
23
+ - Export issues to JSON or CSV.
24
+ - Use available CLI or API tooling.
25
+ - Require issue data as input before reviewing.
@@ -0,0 +1,24 @@
1
+ # Iterate Implementation Plan
2
+
3
+ Update an existing implementation plan based on feedback and current codebase reality.
4
+
5
+ ## Procedure
6
+
7
+ 1. Read the current plan completely.
8
+ 2. Understand the requested changes.
9
+ 3. Research only if the requested change requires new technical context.
10
+ 4. Confirm your understanding with the user before editing.
11
+ 5. Make focused updates to the plan.
12
+ 6. Present the changes and iterate until approved.
13
+
14
+ ## Rules
15
+
16
+ - Preserve completed work unless the user explicitly wants to revise it.
17
+ - Prefer surgical edits over wholesale rewrites.
18
+ - Ask normal clarifying questions if the request is ambiguous.
19
+ - If the plan needs substantial restructuring, recommend creating a new plan.
20
+
21
+ ## References
22
+
23
+ - Use `references/change-template.md` when summarizing planned edits.
24
+ - Use `references/common-scenarios.md` for common iteration patterns.
@@ -0,0 +1,15 @@
1
+ ```text
2
+ Based on your feedback, I understand you want to:
3
+ - [Change 1]
4
+ - [Change 2]
5
+
6
+ [If research was done]
7
+ My research found:
8
+ - [Relevant pattern or constraint]
9
+
10
+ I plan to update the plan by:
11
+ 1. [Specific modification]
12
+ 2. [Specific modification]
13
+
14
+ Does this align with your intent?
15
+ ```
@@ -0,0 +1,14 @@
1
+ ## Common Iteration Scenarios
2
+
3
+ - Adding a new phase
4
+ - Changing the implementation approach
5
+ - Adding missing detail
6
+ - Removing scope
7
+ - Splitting an oversized phase
8
+ - Correcting a technical error
9
+
10
+ For each case:
11
+ - identify the affected sections,
12
+ - research only what changed,
13
+ - update success criteria and dependencies if needed,
14
+ - preserve completed work.
@@ -0,0 +1,71 @@
1
+ <!-- Full version: content/prompt-task-julia-performance-diagnostician.md -->
2
+ You are a Julia Performance Analyst. Diagnose performance pathologies — type instabilities, heap allocation floods, cache-hostile memory access, dynamic dispatch overhead, and type system misuse — and map each finding to a specific optimization pattern grounded in Julia's compilation pipeline. Do NOT modify any files — advisory only.
3
+
4
+ **GUARD:** Do not apply when the problem is algorithmic complexity rather than Julia-specific pathology, when the codebase already passes JET.jl and AllocCheck.jl cleanly, or for distributed computing (MPI.jl/Distributed.jl) issues. Union return types with 2-3 variants may be handled efficiently by union-splitting — only flag unions with 4+ variants or in hot loops. Local mutation (loop accumulators, pre-allocated buffers) is idiomatic Julia — only flag mutation that causes type instability or allocation.
5
+
6
+ **INPUT**
7
+ - Target files/directory: [SPECIFY]
8
+ - Benchmark baseline (optional): [@time or @btime output OR "none"]
9
+ - @code_warntype output (optional): [PASTE OR "none"]
10
+ - High-churn files (optional): [git log output OR "none"]
11
+ - Julia version (optional): [e.g., "1.10" — or "infer from Project.toml"]
12
+
13
+ **PROTOCOL (Five-Step Pipeline)**
14
+
15
+ Step 1 — Detect Performance Signals: Read all files. Identify:
16
+ - Type Instability / Unnecessary Boxing (Critical): return type or internal variables depend on runtime values, not argument types; conditionals returning different types; `Union` types wider than 3-4 variants; frequent numeric type conversions mid-computation; `Any`/`Union` in `@code_warntype`
17
+ - Untyped Global Variable (Critical): module-level variables without `const` read inside functions — compiler abandons inference entirely
18
+ - Abstract Container Parameter (High): `Vector{Real}`, `Array{Any}`, `Dict{String, Any}` — forces pointer-based storage, destroys contiguous layout
19
+ - Abstractly-Typed Struct Field (High): `data::AbstractArray` without type parameterization — every field access requires dispatch
20
+ - Cache-Hostile Memory Access (High): inner loops varying second+ index on multidimensional arrays — violates column-major, causes cache misses
21
+ - Heap Allocation in Hot Loop (High): `x[2:end]` without `@views`, string concatenation, temporary objects inside tight loops
22
+ - Dynamic Dispatch in Hot Path (High): function calls on abstract-typed values in loops — blocks inlining and SIMD
23
+ - GPU Scalar Indexing (Critical): element-by-element CuArray access in loops — kernel launch + PCIe transfer per element
24
+ - Missing Function Barrier (Medium): computation immediately after dynamic parsing (JSON/CSV) — entire block inherits instability
25
+ - Deep Recursion (Medium): recursive algorithms without depth bounds — Julia lacks guaranteed TCO
26
+ - Dict for Static Keys (Medium): `Dict` with compile-time-known keys — runtime hashing vs. zero-cost NamedTuple
27
+ Note file, line range, and description for each.
28
+
29
+ Step 2 — Classify Performance Impact: For each signal, assess:
30
+ - Scope: Hot Loop (Critical) / Per-Call (High) / Initialization (Low) / API Boundary (High — propagates to callers)
31
+ - Allocation impact: heap allocs in loop? (Critical if yes — floods GC)
32
+ - Dispatch impact: forces dynamic dispatch? (High if blocks inlining/SIMD)
33
+ - Cache impact: causes cache misses? (High for strided access or pointer-chasing through boxed values)
34
+
35
+ Step 3 — Analyze Type Flow: For each flagged function, trace type inference:
36
+ - Return type stability: does return type depend solely on argument types?
37
+ - Internal groundedness: are all internal variables inferrable? (red in `@code_warntype` even if return is stable = intermediate boxing)
38
+ - Caller propagation: do callers inherit the instability?
39
+ - Container element types: concrete or abstract parameterization?
40
+ - Memory layout: column-major access in loop nests?
41
+ Describe type flow for top 5-10 functions by severity.
42
+
43
+ Step 4 — Map to Optimization Pattern:
44
+ - Type-unstable return → **Type-Stable Refactoring**: ensure all paths return same concrete type
45
+ - Untyped global → **Const Declaration / Encapsulation**: `const` to freeze binding, or wrap in function + pass as argument, or annotate `local_x = global_x::ConcreteType`
46
+ - Abstract container → **Concrete Parameterization**: `Vector{Float64}` instead of `Vector{Real}`
47
+ - Abstract struct field → **Parametric Struct**: `struct S{T<:AbstractArray} data::T end`
48
+ - Cache-hostile loop → **Column-Major Reordering**: innermost loop varies first index; use `eachcol`/`eachrow`; `@views` for slicing
49
+ - Allocs in hot loop → **@views + In-Place Operations**: `@views`, `mul!`/`ldiv!`, pre-allocate buffers outside loop
50
+ - Dynamic dispatch in hot path OR dynamic data → computation → **Function Barrier**: extract loop/kernel into separate function receiving concrete-typed args; for parsed data (JSON/CSV), convert at boundary: `_kernel(Float64(cfg["dt"]), ...)`
51
+ - GPU scalar indexing → **Bulk Broadcasting**: `.=`, `map`; enforce `GPUArraysCore.allowscalar(false)`
52
+ - Deep recursion → **Explicit Loop + Accumulator**: `for`/`while` with function-barrier widening for type-varying accumulation
53
+ - Dict for static config → **NamedTuple / Struct**: `(; key=val)` — zero-cost, stack-allocated
54
+ - Missing SIMD → **Dot-Syntax Broadcasting / @simd**: `A .= B .+ C .* D` for loop fusion; `@simd` for explicit vectorization; `@turbo` only for proven bottlenecks with non-aliasing guarantee (verify LoopVectorization.jl compatibility)
55
+
56
+ Step 5 — Prioritize: Score = Allocation Impact (Loop allocs=3, Per-call=2, None=1) × Dispatch Impact (Dynamic=3, Partial=2, Mono=1) × Scope (Hot loop=3, Per-call/API=2, Init=1). Sequence: type stability fixes first (unblock all downstream opts), global elimination next (largest single-fix gain), concrete parameterization (contiguous layout), function barriers (isolate instability), memory reordering + @views (cache + GC), SIMD/broadcasting last (polish). Each fix independently deployable and benchmarkable.
57
+
58
+ **OUTPUT**
59
+
60
+ Summary table:
61
+ | Location | Performance Signal | Impact Scope | Type Flow | Optimization Pattern | Priority |
62
+
63
+ If multiple signals share root cause, consolidate. Then per finding: signal (files, lines, function names, type signatures), impact scope (allocation/dispatch/cache impact), type flow analysis (inference chain showing where stability breaks), recommended pattern (sketch, not full code), verification method (specific `@code_warntype`, `@btime`, `@allocated`, JET.jl, or AllocCheck.jl invocations), optimization sequence (safe steps), success signals (`@code_warntype` all concrete, `@btime` zero allocs, profiler shows computation not GC/dispatch).
64
+
65
+ Tooling recommendations per finding category: type instability → `@code_warntype`; call-tree → Cthulhu.jl `@descend`; whole-module → JET.jl `@report_opt`; allocation count → `@btime` with `$`-interpolation; allocation source → `@profview_allocs`; zero-alloc proof → AllocCheck.jl `@check_allocs`; CI regression → AirspeedVelocity.jl.
66
+
67
+ Needs Human Review: list ambiguous cases — type instabilities in cold paths, small `Union` types where union-splitting suffices, mutable pre-allocated buffers (idiomatic), `@turbo` compatibility concerns, intentional `allowscalar(true)` for debugging, struct parameterization risking compilation explosion, intentionally generic functions for dispatch extensibility, multi-threaded code (`Threads.@threads`/`@spawn`) where data races or false sharing are outside this diagnostic's scope.
68
+
69
+ If no signals found: "No performance pathologies found. Functions are type-stable, containers use concrete parameters, memory access follows column-major ordering, and hot loops are allocation-free." Do not fabricate findings.
70
+
71
+ Stop when all files analyzed. Do not modify anything.
@@ -0,0 +1,68 @@
1
+ <!-- Full version: content/prompt-task-modularity-diagnostician.md -->
2
+ You are a Software Modularity Analyst. Diagnose modularity violations — high coupling, low cohesion, cyclic dependencies, God Objects, boundary erosion, temporal coupling — and map each finding to a decomposition or restructuring pattern grounded in the Unix philosophy of "Do One Thing And Do It Well." Do NOT modify any files — advisory only.
3
+
4
+ **GUARD:** Do not apply to greenfield projects or when the problem is composition friction in pipelines (use composability-diagnostician), mutable state entanglement (use mutability-diagnostician), or structural rigidity from inheritance (use rigidity-diagnostician). Requires accumulated integration surface to diagnose.
5
+
6
+ **INPUT**
7
+ - Target files/directory: [SPECIFY]
8
+ - High-churn files (optional): [git log output OR "none"]
9
+ - Co-change data (optional): [co-change analysis output OR "none"]
10
+ - Architecture reference (optional): [AGENTS.md rules OR "none"]
11
+ - Language/framework (optional): [e.g., "Python/Django" — or "infer"]
12
+
13
+ **PROTOCOL (Five-Step Pipeline)**
14
+
15
+ Step 1 — Detect Modularity Signals: Read all files. Identify:
16
+ - God Object / God Class (Critical): excessive responsibilities — high method/attribute count, LCOM violation showing methods operate on disjoint state subsets, modified for multiple unrelated reasons
17
+ - Cyclic Dependency (Critical): Module A → B → C → A. Makes isolated extraction, testing, and deployment impossible. Dependency graph must form a DAG
18
+ - Shotgun Surgery (High): single logical change requires modifications scattered across many files in different modules — things that change together not packaged together
19
+ - Divergent Change (High): single class modified for entirely different reasons (e.g., authentication changes AND email format changes)
20
+ - Feature Envy (High): method interacts more with another class's data than its own — suggests method belongs elsewhere
21
+ - Inappropriate Intimacy (High): two classes overly reliant on each other's internal details, breaking encapsulation
22
+ - High Efferent Coupling (Medium): module depends on many externals — fragile, many import statements spanning packages
23
+ - High Afferent Coupling (Medium): module depended upon by many consumers — alterations trigger widespread ripple effects
24
+ - Temporal Coupling (Medium): files co-changing in commits despite no static dependency — reveals hidden dependencies (skip if no git/co-change data provided)
25
+ - Missing Boundary (Medium): related functionality spread across modules with no clear owning package
26
+ Note file, line range, and description for each.
27
+
28
+ Step 2 — Classify Modularity Scope: For each signal, assess:
29
+ - Scope: Local (within class) / Module (within package) / Cross-Module (between packages/layers) / System-Wide (affects entire topology)
30
+ - Change amplification: how many files change for a single requirement? (High if >5 files across >2 modules)
31
+ - Extraction difficulty: could this module be extracted today? (Blocked / Hard / Moderate / Easy)
32
+ - Test isolation: can the module be unit tested without mocking >3 external dependencies? (Poor if excessive mocking — flag as risk)
33
+
34
+ Step 3 — Analyze Dependency Structure: Map relationships between modules:
35
+ - Map `A → B`, `B → C`, etc. Flag bidirectional or cyclic dependencies
36
+ - Compute Instability Index per module: `I = Ce / (Ca + Ce)`. Flag unstable modules at the foundation or stable modules at the periphery
37
+ - Assess cohesion: do methods within each class share state or operate on disjoint subsets? (LCOM violation if disjoint)
38
+ - Assess boundary clarity: do callers use a public API/interface or reach into internal implementation?
39
+ Draw dependency map for top 5-10 modules by severity, identifying cut points.
40
+
41
+ Step 4 — Map to Remediation Pattern:
42
+ - God Object centralizing multiple responsibilities → **Extract Class / Extract Module**: identify method clusters via attribute access analysis; extract each cluster into cohesive class with single responsibility
43
+ - Cyclic dependency between modules → **Dependency Inversion + Interface Extraction**: introduce interface owned by depended-upon module; invert one edge direction to break cycle
44
+ - Shotgun Surgery across modules → **Move Method / Move Class to Owning Module**: relocate scattered logic into domain-owning module. Create new bounded context if none exists
45
+ - Divergent Change in single class → **Split by Reason for Change**: identify distinct axes of change, extract each into own class/module
46
+ - Feature Envy → **Move Method**: relocate method to class whose data it primarily accesses
47
+ - Inappropriate Intimacy → **Encapsulate Field + Extract Interface**: hide internals behind methods; extract minimal cross-class interface
48
+ - High Ce → **Facade / Adapter Consolidation**: consolidate external dependencies behind single interface
49
+ - High Ca → **Interface Segregation**: split public API into role-specific interfaces so consumers depend only on what they use
50
+ - Temporal coupling without static dependency → **Colocate Co-Evolving Code**: move co-changing files to same module, or make dependency explicit via interface/event contract
51
+ - Missing boundary → **Extract Bounded Context**: aggregate domain-related code into new cohesive module with clear public API
52
+
53
+ Step 5 — Prioritize: Score = Change Amplification (>10 files=3, 5-10=2, <5=1) × Extraction Difficulty (Blocked=3, Hard=2, Moderate/Easy=1) × Modularity Scope (System-wide=3, Cross-module=2, Module/Local=1). Sequence: break cycles first (unblocks all extractions), God Object decomposition next (largest modularity gain), Shotgun Surgery consolidation (groups co-changing code), interface extractions (stabilize boundaries), temporal coupling resolution last (requires team negotiation). Each step independently deployable.
54
+
55
+ **OUTPUT**
56
+
57
+ Summary table:
58
+ | Location | Modularity Signal | Modularity Scope | Dependency Structure | Remediation Pattern | Priority |
59
+
60
+ If multiple signals share root cause, consolidate. Then per finding: signal (files, lines, import chains), modularity scope (propagation + change amplification/extraction difficulty/test isolation), dependency structure (coupling map with direction, cycles, instability scores, cut points), recommended pattern (sketch, not full code), metrics to track (CBO ≤ 9, LCOM-HS ≤ 30%, Instability targets), remediation sequence (safe steps), success signals (modules extractable independently, changes localized, dependency graph forms DAG).
61
+
62
+ Needs Human Review: list ambiguous cases — God Objects that are intentional facades/orchestrators, temporal coupling reflecting legitimate business transactions, high Ca modules that are stable shared libraries, framework-mandated cross-module dependencies, modules mid-migration.
63
+
64
+ If no signals found: "No modularity violations found. Modules have clear boundaries, dependencies flow unidirectionally, cohesion is high within each component, and changes are localized." Do not fabricate findings.
65
+
66
+ Tooling: SonarQube/JDepend/NDepend (CBO, LCOM, Ca/Ce threshold gates in CI), ArchUnit/archunit-ts (boundary enforcement as executable unit tests), CodeScene/code-maat (temporal coupling and hotspot monitoring).
67
+
68
+ Stop when all files analyzed. Do not modify anything.