@dtt_siye/atool 1.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 (463) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +235 -0
  3. package/VERSION +1 -0
  4. package/agents/code-reviewer.md +29 -0
  5. package/bin/atool.js +235 -0
  6. package/bin/postinstall.js +23 -0
  7. package/hooks/doc-sync-reminder +155 -0
  8. package/hooks/hooks-cursor.json +37 -0
  9. package/hooks/hooks.json +37 -0
  10. package/hooks/prompt-guard +135 -0
  11. package/hooks/session-start +286 -0
  12. package/install.sh +603 -0
  13. package/lib/analyze-source.sh +1265 -0
  14. package/lib/common.sh +1041 -0
  15. package/lib/compute-importance.sh +598 -0
  16. package/lib/detect-stack.sh +354 -0
  17. package/lib/generate-visualization.sh +266 -0
  18. package/lib/install-claude.sh +43 -0
  19. package/lib/install-cursor.sh +281 -0
  20. package/lib/install-hooks.sh +285 -0
  21. package/lib/install-kiro.sh +543 -0
  22. package/lib/install-mcp.sh +99 -0
  23. package/lib/install-skills.sh +129 -0
  24. package/lib/knowledge-graph.sh +1014 -0
  25. package/lib/multi-dimensional-analysis.sh +413 -0
  26. package/lib/pre-scan.sh +1045 -0
  27. package/lib/project-init.sh +552 -0
  28. package/lib/visualization-template.html +545 -0
  29. package/mcp/recommended.json +24 -0
  30. package/package.json +39 -0
  31. package/skills/_superpowers/.claude-plugin/marketplace.json +20 -0
  32. package/skills/_superpowers/.claude-plugin/plugin.json +20 -0
  33. package/skills/_superpowers/.codex/INSTALL.md +67 -0
  34. package/skills/_superpowers/.cursor-plugin/plugin.json +25 -0
  35. package/skills/_superpowers/.gitattributes +18 -0
  36. package/skills/_superpowers/.github/FUNDING.yml +3 -0
  37. package/skills/_superpowers/.github/ISSUE_TEMPLATE/bug_report.md +52 -0
  38. package/skills/_superpowers/.github/ISSUE_TEMPLATE/config.yml +5 -0
  39. package/skills/_superpowers/.github/ISSUE_TEMPLATE/feature_request.md +34 -0
  40. package/skills/_superpowers/.github/ISSUE_TEMPLATE/platform_support.md +23 -0
  41. package/skills/_superpowers/.github/PULL_REQUEST_TEMPLATE.md +87 -0
  42. package/skills/_superpowers/.opencode/INSTALL.md +83 -0
  43. package/skills/_superpowers/.opencode/plugins/superpowers.js +107 -0
  44. package/skills/_superpowers/CHANGELOG.md +13 -0
  45. package/skills/_superpowers/CODE_OF_CONDUCT.md +128 -0
  46. package/skills/_superpowers/GEMINI.md +2 -0
  47. package/skills/_superpowers/LICENSE +21 -0
  48. package/skills/_superpowers/README.md +187 -0
  49. package/skills/_superpowers/RELEASE-NOTES.md +1083 -0
  50. package/skills/_superpowers/agents/code-reviewer.md +48 -0
  51. package/skills/_superpowers/commands/brainstorm.md +5 -0
  52. package/skills/_superpowers/commands/execute-plan.md +5 -0
  53. package/skills/_superpowers/commands/write-plan.md +5 -0
  54. package/skills/_superpowers/docs/README.codex.md +126 -0
  55. package/skills/_superpowers/docs/README.opencode.md +130 -0
  56. package/skills/_superpowers/docs/plans/2025-11-22-opencode-support-design.md +294 -0
  57. package/skills/_superpowers/docs/plans/2025-11-22-opencode-support-implementation.md +1095 -0
  58. package/skills/_superpowers/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +711 -0
  59. package/skills/_superpowers/docs/plans/2026-01-17-visual-brainstorming.md +571 -0
  60. package/skills/_superpowers/docs/superpowers/plans/2026-01-22-document-review-system.md +301 -0
  61. package/skills/_superpowers/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +523 -0
  62. package/skills/_superpowers/docs/superpowers/plans/2026-03-11-zero-dep-brainstorm-server.md +479 -0
  63. package/skills/_superpowers/docs/superpowers/plans/2026-03-23-codex-app-compatibility.md +564 -0
  64. package/skills/_superpowers/docs/superpowers/specs/2026-01-22-document-review-system-design.md +136 -0
  65. package/skills/_superpowers/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +162 -0
  66. package/skills/_superpowers/docs/superpowers/specs/2026-03-11-zero-dep-brainstorm-server-design.md +118 -0
  67. package/skills/_superpowers/docs/superpowers/specs/2026-03-23-codex-app-compatibility-design.md +244 -0
  68. package/skills/_superpowers/docs/testing.md +303 -0
  69. package/skills/_superpowers/docs/windows/polyglot-hooks.md +212 -0
  70. package/skills/_superpowers/gemini-extension.json +6 -0
  71. package/skills/_superpowers/hooks/hooks-cursor.json +10 -0
  72. package/skills/_superpowers/hooks/hooks.json +16 -0
  73. package/skills/_superpowers/hooks/run-hook.cmd +46 -0
  74. package/skills/_superpowers/hooks/session-start +57 -0
  75. package/skills/_superpowers/package.json +6 -0
  76. package/skills/_superpowers/skills/brainstorming/SKILL.md +164 -0
  77. package/skills/_superpowers/skills/brainstorming/scripts/frame-template.html +214 -0
  78. package/skills/_superpowers/skills/brainstorming/scripts/helper.js +88 -0
  79. package/skills/_superpowers/skills/brainstorming/scripts/server.cjs +354 -0
  80. package/skills/_superpowers/skills/brainstorming/scripts/start-server.sh +148 -0
  81. package/skills/_superpowers/skills/brainstorming/scripts/stop-server.sh +56 -0
  82. package/skills/_superpowers/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  83. package/skills/_superpowers/skills/brainstorming/visual-companion.md +287 -0
  84. package/skills/_superpowers/skills/dispatching-parallel-agents/SKILL.md +182 -0
  85. package/skills/_superpowers/skills/executing-plans/SKILL.md +70 -0
  86. package/skills/_superpowers/skills/finishing-a-development-branch/SKILL.md +200 -0
  87. package/skills/_superpowers/skills/receiving-code-review/SKILL.md +213 -0
  88. package/skills/_superpowers/skills/requesting-code-review/SKILL.md +105 -0
  89. package/skills/_superpowers/skills/requesting-code-review/code-reviewer.md +146 -0
  90. package/skills/_superpowers/skills/subagent-driven-development/SKILL.md +277 -0
  91. package/skills/_superpowers/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  92. package/skills/_superpowers/skills/subagent-driven-development/implementer-prompt.md +113 -0
  93. package/skills/_superpowers/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  94. package/skills/_superpowers/skills/systematic-debugging/CREATION-LOG.md +119 -0
  95. package/skills/_superpowers/skills/systematic-debugging/SKILL.md +296 -0
  96. package/skills/_superpowers/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  97. package/skills/_superpowers/skills/systematic-debugging/condition-based-waiting.md +115 -0
  98. package/skills/_superpowers/skills/systematic-debugging/defense-in-depth.md +122 -0
  99. package/skills/_superpowers/skills/systematic-debugging/find-polluter.sh +63 -0
  100. package/skills/_superpowers/skills/systematic-debugging/root-cause-tracing.md +169 -0
  101. package/skills/_superpowers/skills/systematic-debugging/test-academic.md +14 -0
  102. package/skills/_superpowers/skills/systematic-debugging/test-pressure-1.md +58 -0
  103. package/skills/_superpowers/skills/systematic-debugging/test-pressure-2.md +68 -0
  104. package/skills/_superpowers/skills/systematic-debugging/test-pressure-3.md +69 -0
  105. package/skills/_superpowers/skills/test-driven-development/SKILL.md +371 -0
  106. package/skills/_superpowers/skills/test-driven-development/testing-anti-patterns.md +299 -0
  107. package/skills/_superpowers/skills/using-git-worktrees/SKILL.md +218 -0
  108. package/skills/_superpowers/skills/using-superpowers/SKILL.md +115 -0
  109. package/skills/_superpowers/skills/using-superpowers/references/codex-tools.md +100 -0
  110. package/skills/_superpowers/skills/using-superpowers/references/gemini-tools.md +33 -0
  111. package/skills/_superpowers/skills/verification-before-completion/SKILL.md +139 -0
  112. package/skills/_superpowers/skills/writing-plans/SKILL.md +152 -0
  113. package/skills/_superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  114. package/skills/_superpowers/skills/writing-skills/SKILL.md +655 -0
  115. package/skills/_superpowers/skills/writing-skills/anthropic-best-practices.md +1150 -0
  116. package/skills/_superpowers/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  117. package/skills/_superpowers/skills/writing-skills/graphviz-conventions.dot +172 -0
  118. package/skills/_superpowers/skills/writing-skills/persuasion-principles.md +187 -0
  119. package/skills/_superpowers/skills/writing-skills/render-graphs.js +168 -0
  120. package/skills/_superpowers/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  121. package/skills/_superpowers/tests/brainstorm-server/package-lock.json +36 -0
  122. package/skills/_superpowers/tests/brainstorm-server/package.json +10 -0
  123. package/skills/_superpowers/tests/brainstorm-server/server.test.js +427 -0
  124. package/skills/_superpowers/tests/brainstorm-server/windows-lifecycle.test.sh +351 -0
  125. package/skills/_superpowers/tests/brainstorm-server/ws-protocol.test.js +392 -0
  126. package/skills/_superpowers/tests/claude-code/README.md +158 -0
  127. package/skills/_superpowers/tests/claude-code/analyze-token-usage.py +168 -0
  128. package/skills/_superpowers/tests/claude-code/run-skill-tests.sh +187 -0
  129. package/skills/_superpowers/tests/claude-code/test-document-review-system.sh +177 -0
  130. package/skills/_superpowers/tests/claude-code/test-helpers.sh +202 -0
  131. package/skills/_superpowers/tests/claude-code/test-subagent-driven-development-integration.sh +314 -0
  132. package/skills/_superpowers/tests/claude-code/test-subagent-driven-development.sh +165 -0
  133. package/skills/_superpowers/tests/explicit-skill-requests/prompts/action-oriented.txt +3 -0
  134. package/skills/_superpowers/tests/explicit-skill-requests/prompts/after-planning-flow.txt +17 -0
  135. package/skills/_superpowers/tests/explicit-skill-requests/prompts/claude-suggested-it.txt +11 -0
  136. package/skills/_superpowers/tests/explicit-skill-requests/prompts/i-know-what-sdd-means.txt +8 -0
  137. package/skills/_superpowers/tests/explicit-skill-requests/prompts/mid-conversation-execute-plan.txt +3 -0
  138. package/skills/_superpowers/tests/explicit-skill-requests/prompts/please-use-brainstorming.txt +1 -0
  139. package/skills/_superpowers/tests/explicit-skill-requests/prompts/skip-formalities.txt +3 -0
  140. package/skills/_superpowers/tests/explicit-skill-requests/prompts/subagent-driven-development-please.txt +1 -0
  141. package/skills/_superpowers/tests/explicit-skill-requests/prompts/use-systematic-debugging.txt +1 -0
  142. package/skills/_superpowers/tests/explicit-skill-requests/run-all.sh +70 -0
  143. package/skills/_superpowers/tests/explicit-skill-requests/run-claude-describes-sdd.sh +100 -0
  144. package/skills/_superpowers/tests/explicit-skill-requests/run-extended-multiturn-test.sh +113 -0
  145. package/skills/_superpowers/tests/explicit-skill-requests/run-haiku-test.sh +144 -0
  146. package/skills/_superpowers/tests/explicit-skill-requests/run-multiturn-test.sh +143 -0
  147. package/skills/_superpowers/tests/explicit-skill-requests/run-test.sh +136 -0
  148. package/skills/_superpowers/tests/opencode/run-tests.sh +163 -0
  149. package/skills/_superpowers/tests/opencode/setup.sh +73 -0
  150. package/skills/_superpowers/tests/opencode/test-plugin-loading.sh +72 -0
  151. package/skills/_superpowers/tests/opencode/test-priority.sh +198 -0
  152. package/skills/_superpowers/tests/opencode/test-tools.sh +104 -0
  153. package/skills/_superpowers/tests/skill-triggering/prompts/dispatching-parallel-agents.txt +8 -0
  154. package/skills/_superpowers/tests/skill-triggering/prompts/executing-plans.txt +1 -0
  155. package/skills/_superpowers/tests/skill-triggering/prompts/requesting-code-review.txt +3 -0
  156. package/skills/_superpowers/tests/skill-triggering/prompts/systematic-debugging.txt +11 -0
  157. package/skills/_superpowers/tests/skill-triggering/prompts/test-driven-development.txt +7 -0
  158. package/skills/_superpowers/tests/skill-triggering/prompts/writing-plans.txt +10 -0
  159. package/skills/_superpowers/tests/skill-triggering/run-all.sh +60 -0
  160. package/skills/_superpowers/tests/skill-triggering/run-test.sh +88 -0
  161. package/skills/_superpowers/tests/subagent-driven-dev/go-fractals/design.md +81 -0
  162. package/skills/_superpowers/tests/subagent-driven-dev/go-fractals/plan.md +172 -0
  163. package/skills/_superpowers/tests/subagent-driven-dev/go-fractals/scaffold.sh +45 -0
  164. package/skills/_superpowers/tests/subagent-driven-dev/run-test.sh +106 -0
  165. package/skills/_superpowers/tests/subagent-driven-dev/svelte-todo/design.md +70 -0
  166. package/skills/_superpowers/tests/subagent-driven-dev/svelte-todo/plan.md +222 -0
  167. package/skills/_superpowers/tests/subagent-driven-dev/svelte-todo/scaffold.sh +46 -0
  168. package/skills/ai-project-architecture/SKILL.md +632 -0
  169. package/skills/ai-project-architecture/reference/structure-rules.md +406 -0
  170. package/skills/ai-project-architecture/templates/compliance-report.md +300 -0
  171. package/skills/ai-project-architecture/templates/migration-plan.md +433 -0
  172. package/skills/ai-project-architecture/templates/verification-checklist.md +408 -0
  173. package/skills/android-conventions/SKILL.md +125 -0
  174. package/skills/atool-init/SKILL.md +141 -0
  175. package/skills/clarify-before-build/SKILL.md +107 -0
  176. package/skills/code-review/SKILL.md +406 -0
  177. package/skills/code-review/rules/architecture.md +285 -0
  178. package/skills/code-review/rules/coupling-cohesion.md +309 -0
  179. package/skills/code-review/rules/dead-code.md +115 -0
  180. package/skills/code-review/rules/deprecation-debt.md +279 -0
  181. package/skills/code-review/rules/duplication.md +104 -0
  182. package/skills/code-review/rules/error-security.md +143 -0
  183. package/skills/code-review/rules/maintainability.md +203 -0
  184. package/skills/code-review/rules/quality.md +158 -0
  185. package/skills/devops-conventions/SKILL.md +205 -0
  186. package/skills/doc-coauthoring/SKILL.md +392 -0
  187. package/skills/doc-standards-enforcer/SKILL.md +290 -0
  188. package/skills/doc-standards-enforcer/examples/valid-document-example.md +67 -0
  189. package/skills/doc-standards-enforcer/references/101-standards-summary.md +318 -0
  190. package/skills/doc-standards-enforcer/scripts/check_references.py +175 -0
  191. package/skills/doc-standards-enforcer/scripts/fix_common_issues.py +303 -0
  192. package/skills/doc-standards-enforcer/scripts/validate_doc_standards.py +332 -0
  193. package/skills/docx/LICENSE.txt +30 -0
  194. package/skills/docx/SKILL.md +200 -0
  195. package/skills/docx/docx-js.md +350 -0
  196. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  197. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  198. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  199. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  200. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  201. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  202. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  203. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  204. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  205. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  206. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  207. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  208. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  209. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  210. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  211. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  212. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  213. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  214. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  215. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  216. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  217. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  218. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  219. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  220. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  221. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  222. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  223. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  224. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  225. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  226. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  227. package/skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
  228. package/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  229. package/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  230. package/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  231. package/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  232. package/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  233. package/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  234. package/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  235. package/skills/docx/ooxml/scripts/pack.py +159 -0
  236. package/skills/docx/ooxml/scripts/unpack.py +29 -0
  237. package/skills/docx/ooxml/scripts/validate.py +69 -0
  238. package/skills/docx/ooxml/scripts/validation/__init__.py +15 -0
  239. package/skills/docx/ooxml/scripts/validation/base.py +951 -0
  240. package/skills/docx/ooxml/scripts/validation/docx.py +274 -0
  241. package/skills/docx/ooxml/scripts/validation/pptx.py +315 -0
  242. package/skills/docx/ooxml/scripts/validation/redlining.py +279 -0
  243. package/skills/docx/ooxml.md +610 -0
  244. package/skills/docx/scripts/__init__.py +1 -0
  245. package/skills/docx/scripts/document.py +1276 -0
  246. package/skills/docx/scripts/templates/comments.xml +3 -0
  247. package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  248. package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  249. package/skills/docx/scripts/templates/commentsIds.xml +3 -0
  250. package/skills/docx/scripts/templates/people.xml +3 -0
  251. package/skills/docx/scripts/utilities.py +374 -0
  252. package/skills/flutter-conventions/SKILL.md +70 -0
  253. package/skills/go-conventions/SKILL.md +230 -0
  254. package/skills/harmony-conventions/SKILL.md +156 -0
  255. package/skills/java-conventions/SKILL.md +277 -0
  256. package/skills/pdf/LICENSE.txt +30 -0
  257. package/skills/pdf/SKILL.md +297 -0
  258. package/skills/pdf/forms.md +205 -0
  259. package/skills/pdf/reference.md +612 -0
  260. package/skills/pdf/scripts/check_bounding_boxes.py +70 -0
  261. package/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
  262. package/skills/pdf/scripts/check_fillable_fields.py +12 -0
  263. package/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
  264. package/skills/pdf/scripts/create_validation_image.py +41 -0
  265. package/skills/pdf/scripts/extract_form_field_info.py +152 -0
  266. package/skills/pdf/scripts/fill_fillable_fields.py +114 -0
  267. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
  268. package/skills/pptx/LICENSE.txt +30 -0
  269. package/skills/pptx/SKILL.md +487 -0
  270. package/skills/pptx/html2pptx.md +625 -0
  271. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  272. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  273. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  274. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  275. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  276. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  277. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  278. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  279. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  280. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  281. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  282. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  283. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  284. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  285. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  286. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  287. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  288. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  289. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  290. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  291. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  292. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  293. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  294. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  295. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  296. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  297. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  298. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  299. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  300. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  301. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  302. package/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
  303. package/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  304. package/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  305. package/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  306. package/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  307. package/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  308. package/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  309. package/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  310. package/skills/pptx/ooxml/scripts/pack.py +159 -0
  311. package/skills/pptx/ooxml/scripts/unpack.py +29 -0
  312. package/skills/pptx/ooxml/scripts/validate.py +69 -0
  313. package/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
  314. package/skills/pptx/ooxml/scripts/validation/base.py +951 -0
  315. package/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
  316. package/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
  317. package/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
  318. package/skills/pptx/ooxml.md +427 -0
  319. package/skills/pptx/scripts/html2pptx.js +979 -0
  320. package/skills/pptx/scripts/inventory.py +1020 -0
  321. package/skills/pptx/scripts/rearrange.py +231 -0
  322. package/skills/pptx/scripts/replace.py +385 -0
  323. package/skills/pptx/scripts/thumbnail.py +450 -0
  324. package/skills/project-analyze/SKILL.md +270 -0
  325. package/skills/project-analyze/phases/phase0-discovery.md +278 -0
  326. package/skills/project-analyze/phases/phase0.5-prescan.md +139 -0
  327. package/skills/project-analyze/phases/phase1-inventory.md +94 -0
  328. package/skills/project-analyze/phases/phase2-deep-analysis.md +249 -0
  329. package/skills/project-analyze/phases/phase2a-l4-analysis.md +94 -0
  330. package/skills/project-analyze/phases/phase2b-l5-analysis.md +97 -0
  331. package/skills/project-analyze/phases/phase3-knowledge-graph.md +120 -0
  332. package/skills/project-analyze/phases/phase3a-multi-dimensional.md +61 -0
  333. package/skills/project-analyze/phases/phase4-code-quality.md +81 -0
  334. package/skills/project-analyze/phases/phase5-synthesis.md +284 -0
  335. package/skills/project-analyze/phases/phase6-validation.md +179 -0
  336. package/skills/project-analyze/prompts/code-review-agent.md +122 -0
  337. package/skills/project-analyze/prompts/deep-analysis-agent.md +107 -0
  338. package/skills/project-analyze/prompts/inventory-agent.md +67 -0
  339. package/skills/project-analyze/prompts/l4-analysis-agent.md +98 -0
  340. package/skills/project-analyze/rules/android.md +282 -0
  341. package/skills/project-analyze/rules/devops.md +443 -0
  342. package/skills/project-analyze/rules/generic.md +243 -0
  343. package/skills/project-analyze/rules/go.md +289 -0
  344. package/skills/project-analyze/rules/harmony.md +257 -0
  345. package/skills/project-analyze/rules/java.md +507 -0
  346. package/skills/project-analyze/rules/mobile-flutter.md +315 -0
  347. package/skills/project-analyze/rules/mobile-react-native.md +283 -0
  348. package/skills/project-analyze/rules/mobile-swift.md +323 -0
  349. package/skills/project-analyze/rules/python.md +317 -0
  350. package/skills/project-analyze/rules/rust-tauri.md +243 -0
  351. package/skills/project-analyze/rules/rust.md +296 -0
  352. package/skills/project-analyze/rules/web-nextjs.md +364 -0
  353. package/skills/project-analyze/rules/web-react.md +298 -0
  354. package/skills/project-analyze/rules/web-vue.md +378 -0
  355. package/skills/project-analyze/rules/web.md +390 -0
  356. package/skills/project-query/SKILL.md +224 -0
  357. package/skills/project-query/rules/query-templates.md +212 -0
  358. package/skills/python-conventions/SKILL.md +169 -0
  359. package/skills/react-native-conventions/SKILL.md +73 -0
  360. package/skills/requirements-writer/README.md +153 -0
  361. package/skills/requirements-writer/SKILL.md +341 -0
  362. package/skills/requirements-writer/examples/prd-outline-example.md +217 -0
  363. package/skills/requirements-writer/templates/module-prd-template.md +362 -0
  364. package/skills/requirements-writer/templates/prd-outline-template.md +185 -0
  365. package/skills/requirements-writer/templates/user-story-template.md +1125 -0
  366. package/skills/rust-conventions/SKILL.md +361 -0
  367. package/skills/smart-dispatch/SKILL.md +296 -0
  368. package/skills/smart-dispatch/implementer-prompt.md +146 -0
  369. package/skills/smart-dispatch/reviewer-prompt.md +199 -0
  370. package/skills/software-architecture/SKILL.md +278 -0
  371. package/skills/swift-conventions/SKILL.md +72 -0
  372. package/skills/ui-ux-pro/SKILL.md +140 -0
  373. package/skills/verification-before-completion/SKILL.md +119 -0
  374. package/skills/web-conventions/SKILL.md +259 -0
  375. package/skills/webapp-testing/LICENSE.txt +202 -0
  376. package/skills/webapp-testing/SKILL.md +97 -0
  377. package/skills/webapp-testing/examples/console_logging.py +35 -0
  378. package/skills/webapp-testing/examples/element_discovery.py +40 -0
  379. package/skills/webapp-testing/examples/static_html_automation.py +33 -0
  380. package/skills/webapp-testing/scripts/with_server.py +106 -0
  381. package/skills/writing-plans/SKILL.md +144 -0
  382. package/skills/xlsx/LICENSE.txt +30 -0
  383. package/skills/xlsx/SKILL.md +292 -0
  384. package/skills/xlsx/recalc.py +178 -0
  385. package/templates/CLAUDE.md.android +57 -0
  386. package/templates/CLAUDE.md.devops +50 -0
  387. package/templates/CLAUDE.md.generic +34 -0
  388. package/templates/CLAUDE.md.go +67 -0
  389. package/templates/CLAUDE.md.harmony +54 -0
  390. package/templates/CLAUDE.md.java +56 -0
  391. package/templates/CLAUDE.md.mobile-flutter +38 -0
  392. package/templates/CLAUDE.md.mobile-react-native +37 -0
  393. package/templates/CLAUDE.md.mobile-swift +40 -0
  394. package/templates/CLAUDE.md.python +65 -0
  395. package/templates/CLAUDE.md.rust +68 -0
  396. package/templates/CLAUDE.md.rust-tauri +120 -0
  397. package/templates/CLAUDE.md.web +63 -0
  398. package/templates/COMPONENT.md.android +58 -0
  399. package/templates/COMPONENT.md.devops +54 -0
  400. package/templates/COMPONENT.md.generic +35 -0
  401. package/templates/COMPONENT.md.go +59 -0
  402. package/templates/COMPONENT.md.harmony +63 -0
  403. package/templates/COMPONENT.md.java +69 -0
  404. package/templates/COMPONENT.md.mobile-flutter +56 -0
  405. package/templates/COMPONENT.md.mobile-react-native +55 -0
  406. package/templates/COMPONENT.md.mobile-swift +56 -0
  407. package/templates/COMPONENT.md.python +67 -0
  408. package/templates/COMPONENT.md.rust +57 -0
  409. package/templates/COMPONENT.md.rust-tauri +66 -0
  410. package/templates/COMPONENT.md.web +39 -0
  411. package/templates/README.md.android +71 -0
  412. package/templates/README.md.devops +68 -0
  413. package/templates/README.md.generic +39 -0
  414. package/templates/README.md.go +70 -0
  415. package/templates/README.md.harmony +72 -0
  416. package/templates/README.md.java +73 -0
  417. package/templates/README.md.mobile-flutter +69 -0
  418. package/templates/README.md.mobile-react-native +65 -0
  419. package/templates/README.md.mobile-swift +69 -0
  420. package/templates/README.md.monorepo +59 -0
  421. package/templates/README.md.python +66 -0
  422. package/templates/README.md.rust +69 -0
  423. package/templates/README.md.rust-tauri +149 -0
  424. package/templates/README.md.web +94 -0
  425. package/templates/UI_STYLE.md.android +74 -0
  426. package/templates/UI_STYLE.md.devops +50 -0
  427. package/templates/UI_STYLE.md.generic +31 -0
  428. package/templates/UI_STYLE.md.go +49 -0
  429. package/templates/UI_STYLE.md.harmony +71 -0
  430. package/templates/UI_STYLE.md.java +61 -0
  431. package/templates/UI_STYLE.md.mobile-flutter +70 -0
  432. package/templates/UI_STYLE.md.mobile-react-native +71 -0
  433. package/templates/UI_STYLE.md.mobile-swift +71 -0
  434. package/templates/UI_STYLE.md.python +58 -0
  435. package/templates/UI_STYLE.md.rust +52 -0
  436. package/templates/UI_STYLE.md.rust-tauri +102 -0
  437. package/templates/UI_STYLE.md.web +92 -0
  438. package/templates/cursor-rules.android.mdc +33 -0
  439. package/templates/cursor-rules.devops.mdc +32 -0
  440. package/templates/cursor-rules.generic.mdc +25 -0
  441. package/templates/cursor-rules.go.mdc +34 -0
  442. package/templates/cursor-rules.harmony.mdc +30 -0
  443. package/templates/cursor-rules.java.mdc +30 -0
  444. package/templates/cursor-rules.mobile-flutter.mdc +42 -0
  445. package/templates/cursor-rules.mobile-react-native.mdc +43 -0
  446. package/templates/cursor-rules.mobile-swift.mdc +42 -0
  447. package/templates/cursor-rules.python.mdc +33 -0
  448. package/templates/cursor-rules.rust-tauri.mdc +67 -0
  449. package/templates/cursor-rules.rust.mdc +30 -0
  450. package/templates/cursor-rules.web.mdc +30 -0
  451. package/templates/kiro-steering.android.md +39 -0
  452. package/templates/kiro-steering.devops.md +32 -0
  453. package/templates/kiro-steering.generic.md +28 -0
  454. package/templates/kiro-steering.go.md +41 -0
  455. package/templates/kiro-steering.harmony.md +36 -0
  456. package/templates/kiro-steering.java.md +37 -0
  457. package/templates/kiro-steering.mobile-flutter.md +73 -0
  458. package/templates/kiro-steering.mobile-react-native.md +71 -0
  459. package/templates/kiro-steering.mobile-swift.md +62 -0
  460. package/templates/kiro-steering.python.md +34 -0
  461. package/templates/kiro-steering.rust-tauri.md +50 -0
  462. package/templates/kiro-steering.rust.md +36 -0
  463. package/templates/kiro-steering.web.md +41 -0
@@ -0,0 +1,354 @@
1
+ #!/usr/bin/env bash
2
+ # aTool - lib/detect-stack.sh
3
+ # Technology stack detection engine (10 categories)
4
+
5
+ set -euo pipefail
6
+
7
+ # Detect technology stack for a project directory
8
+ # Args: PROJECT_DIR
9
+ # Outputs: STACK_TYPE (e.g. "java-spring", "web-nextjs", "generic")
10
+ detect_stack() {
11
+ local project_dir="$1"
12
+ local stack=""
13
+ local confidence=0
14
+ local signals=""
15
+
16
+ # ── Java / Spring Boot ──────────────────────────────────────────────
17
+ if [[ -f "$project_dir/pom.xml" ]]; then
18
+ if grep -q "spring-boot" "$project_dir/pom.xml" 2>/dev/null; then
19
+ stack="java-spring"
20
+ confidence=95
21
+ signals="pom.xml + spring-boot"
22
+ elif ! grep -q "com.android" "$project_dir/pom.xml" 2>/dev/null; then
23
+ stack="java"
24
+ confidence=90
25
+ signals="pom.xml"
26
+ fi
27
+ fi
28
+
29
+ if [[ -f "$project_dir/build.gradle" || -f "$project_dir/build.gradle.kts" ]]; then
30
+ local gradle_file
31
+ gradle_file="$project_dir/build.gradle"
32
+ [[ -f "$project_dir/build.gradle.kts" ]] && gradle_file="$project_dir/build.gradle.kts"
33
+
34
+ if grep -q "com.android" "$gradle_file" 2>/dev/null; then
35
+ if [[ "$confidence" -lt 95 ]]; then
36
+ stack="android-kotlin"
37
+ confidence=95
38
+ signals="build.gradle + com.android"
39
+ fi
40
+ elif [[ "$stack" != "java-spring" && "$confidence" -lt 90 ]]; then
41
+ stack="java"
42
+ confidence=90
43
+ signals="build.gradle"
44
+ fi
45
+ fi
46
+
47
+ # ── Android / Kotlin ────────────────────────────────────────────────
48
+ if [[ -f "$project_dir/AndroidManifest.xml" ]]; then
49
+ if [[ "$confidence" -lt 95 ]]; then
50
+ stack="android-kotlin"
51
+ confidence=95
52
+ signals="AndroidManifest.xml"
53
+ fi
54
+ fi
55
+
56
+ if [[ -f "$project_dir/build.gradle" || -f "$project_dir/build.gradle.kts" ]]; then
57
+ local gradle_file2
58
+ gradle_file2="$project_dir/build.gradle"
59
+ [[ -f "$project_dir/build.gradle.kts" ]] && gradle_file2="$project_dir/build.gradle.kts"
60
+ if grep -q "android {" "$gradle_file2" 2>/dev/null || grep -q "android{" "$gradle_file2" 2>/dev/null; then
61
+ if [[ "$confidence" -lt 95 ]]; then
62
+ stack="android-kotlin"
63
+ confidence=95
64
+ signals="build.gradle + android plugin"
65
+ fi
66
+ fi
67
+ fi
68
+
69
+ # ── HarmonyOS / ArkTS ───────────────────────────────────────────────
70
+ if [[ -f "$project_dir/oh-package.json5" || -f "$project_dir/build-profile.json5" ]]; then
71
+ if [[ "$confidence" -lt 95 ]]; then
72
+ stack="harmony"
73
+ confidence=95
74
+ signals="oh-package.json5 / build-profile.json5"
75
+ fi
76
+ fi
77
+
78
+ # ── Tauri (Rust + Web Desktop) ──────────────────────────────────────
79
+ if [[ -d "$project_dir/src-tauri" ]] && [[ -f "$project_dir/src-tauri/Cargo.toml" ]]; then
80
+ if [[ "$confidence" -lt 98 ]]; then
81
+ stack="rust-tauri"
82
+ confidence=98
83
+ signals="src-tauri/Cargo.toml"
84
+ if [[ -f "$project_dir/package.json" ]]; then
85
+ if grep -q '"@tauri-apps/api"' "$project_dir/package.json" 2>/dev/null || \
86
+ grep -q '"@tauri-apps/cli"' "$project_dir/package.json" 2>/dev/null; then
87
+ signals="src-tauri/Cargo.toml + @tauri-apps"
88
+ fi
89
+ fi
90
+ fi
91
+ fi
92
+
93
+ # ── Web Frameworks ──────────────────────────────────────────────────
94
+ if [[ -f "$project_dir/package.json" ]]; then
95
+ local pkg_json="$project_dir/package.json"
96
+
97
+ if grep -q '"next"' "$pkg_json" 2>/dev/null; then
98
+ if [[ "$confidence" -lt 95 ]]; then
99
+ stack="web-nextjs"
100
+ confidence=95
101
+ signals="package.json + next"
102
+ fi
103
+ elif grep -q '"react"' "$pkg_json" 2>/dev/null; then
104
+ if [[ "$confidence" -lt 90 ]]; then
105
+ stack="web-react"
106
+ confidence=90
107
+ signals="package.json + react"
108
+ fi
109
+ elif grep -q '"vue"' "$pkg_json" 2>/dev/null || grep -q '"nuxt"' "$pkg_json" 2>/dev/null; then
110
+ if [[ "$confidence" -lt 90 ]]; then
111
+ stack="web-vue"
112
+ confidence=90
113
+ signals="package.json + vue/nuxt"
114
+ fi
115
+ elif grep -q '"svelte"' "$pkg_json" 2>/dev/null; then
116
+ if [[ "$confidence" -lt 90 ]]; then
117
+ stack="web-svelte"
118
+ confidence=90
119
+ signals="package.json + svelte"
120
+ fi
121
+ fi
122
+ fi
123
+
124
+ # ── Mobile ──────────────────────────────────────────────────────────
125
+ if [[ -f "$project_dir/package.json" ]] && grep -q "react-native" "$project_dir/package.json" 2>/dev/null; then
126
+ if [[ "$confidence" -lt 95 ]]; then
127
+ stack="mobile-react-native"
128
+ confidence=95
129
+ signals="package.json + react-native"
130
+ fi
131
+ fi
132
+
133
+ if [[ -f "$project_dir/pubspec.yaml" ]]; then
134
+ if [[ "$confidence" -lt 95 ]]; then
135
+ stack="mobile-flutter"
136
+ confidence=95
137
+ signals="pubspec.yaml"
138
+ fi
139
+ fi
140
+
141
+ if [[ -f "$project_dir/Package.swift" ]] || compgen -G "$project_dir/*.xcodeproj" &>/dev/null; then
142
+ if [[ "$confidence" -lt 95 ]]; then
143
+ stack="mobile-swift"
144
+ confidence=95
145
+ signals="Package.swift / .xcodeproj"
146
+ fi
147
+ fi
148
+
149
+ # ── Python ──────────────────────────────────────────────────────────
150
+ if [[ -f "$project_dir/requirements.txt" || -f "$project_dir/pyproject.toml" || -f "$project_dir/setup.py" ]]; then
151
+ if [[ "$confidence" -lt 85 ]]; then
152
+ stack="python"
153
+ confidence=85
154
+ signals="requirements.txt / pyproject.toml / setup.py"
155
+ fi
156
+ fi
157
+
158
+ # ── Rust ────────────────────────────────────────────────────────────
159
+ if [[ -f "$project_dir/Cargo.toml" ]]; then
160
+ if [[ "$confidence" -lt 95 ]]; then
161
+ stack="rust"
162
+ confidence=95
163
+ signals="Cargo.toml"
164
+ fi
165
+ fi
166
+
167
+ # ── Go ──────────────────────────────────────────────────────────────
168
+ if [[ -f "$project_dir/go.mod" ]]; then
169
+ if [[ "$confidence" -lt 95 ]]; then
170
+ stack="go"
171
+ confidence=95
172
+ signals="go.mod"
173
+ fi
174
+ fi
175
+
176
+ # ── DevOps ──────────────────────────────────────────────────────────
177
+ local devops_found=false
178
+ if [[ -f "$project_dir/Dockerfile" || -f "$project_dir/docker-compose.yml" || -f "$project_dir/docker-compose.yaml" ]]; then
179
+ devops_found=true
180
+ fi
181
+ if find_first "$project_dir" "*.tf" 2>/dev/null | grep -q .; then
182
+ devops_found=true
183
+ fi
184
+
185
+ if $devops_found && [[ "$confidence" -lt 80 ]]; then
186
+ stack="devops"
187
+ confidence=80
188
+ signals="Dockerfile / docker-compose / *.tf"
189
+ fi
190
+
191
+ if [[ -f "$project_dir/Chart.yaml" || -f "$project_dir/kustomization.yaml" ]]; then
192
+ if [[ "$confidence" -lt 90 ]]; then
193
+ stack="devops-k8s"
194
+ confidence=90
195
+ signals="Chart.yaml / kustomization.yaml"
196
+ fi
197
+ fi
198
+
199
+ # ── Generic fallback ────────────────────────────────────────────────
200
+ if [[ -z "$stack" ]]; then
201
+ stack="generic"
202
+ confidence=10
203
+ signals="no signal files detected"
204
+ fi
205
+
206
+ echo "$stack"
207
+ }
208
+
209
+ # Get stack confidence
210
+ # Args: PROJECT_DIR
211
+ get_stack_confidence() {
212
+ local project_dir="$1"
213
+ local stack
214
+ stack=$(detect_stack "$project_dir")
215
+
216
+ # Re-detect with confidence output (simplified)
217
+ case "$stack" in
218
+ java-spring) echo 95 ;;
219
+ java) echo 90 ;;
220
+ android-kotlin) echo 95 ;;
221
+ harmony) echo 95 ;;
222
+ web-nextjs) echo 95 ;;
223
+ web-react) echo 90 ;;
224
+ web-vue) echo 90 ;;
225
+ web-svelte) echo 90 ;;
226
+ mobile-react-native) echo 95 ;;
227
+ mobile-flutter) echo 95 ;;
228
+ mobile-swift) echo 95 ;;
229
+ python) echo 85 ;;
230
+ rust) echo 95 ;;
231
+ rust-tauri) echo 98 ;;
232
+ go) echo 95 ;;
233
+ devops) echo 80 ;;
234
+ devops-k8s) echo 90 ;;
235
+ *) echo 10 ;;
236
+ esac
237
+ }
238
+
239
+ # Map stack type to template name
240
+ # Args: STACK_TYPE
241
+ get_template_name() {
242
+ local stack="$1"
243
+ case "$stack" in
244
+ java-spring|java) echo "java" ;;
245
+ android-kotlin) echo "android" ;;
246
+ harmony) echo "harmony" ;;
247
+ web-nextjs|web-react|web-vue|web-svelte) echo "web" ;;
248
+ mobile-react-native) echo "mobile-react-native" ;;
249
+ mobile-flutter) echo "mobile-flutter" ;;
250
+ mobile-swift) echo "mobile-swift" ;;
251
+ python) echo "python" ;;
252
+ rust) echo "rust" ;;
253
+ rust-tauri) echo "rust-tauri" ;;
254
+ go) echo "go" ;;
255
+ devops|devops-k8s) echo "devops" ;;
256
+ *) echo "generic" ;;
257
+ esac
258
+ }
259
+
260
+ # Get human-readable stack description
261
+ # Args: STACK_TYPE
262
+ get_stack_description() {
263
+ local stack="$1"
264
+ case "$stack" in
265
+ java-spring) echo "Java / Spring Boot" ;;
266
+ java) echo "Java" ;;
267
+ android-kotlin) echo "Android / Kotlin" ;;
268
+ harmony) echo "HarmonyOS / ArkTS" ;;
269
+ web-nextjs) echo "Web / Next.js" ;;
270
+ web-react) echo "Web / React" ;;
271
+ web-vue) echo "Web / Vue / Nuxt" ;;
272
+ web-svelte) echo "Web / Svelte" ;;
273
+ mobile-react-native) echo "Mobile / React Native" ;;
274
+ mobile-flutter) echo "Mobile / Flutter" ;;
275
+ mobile-swift) echo "Mobile / Swift / iOS" ;;
276
+ python) echo "Python" ;;
277
+ rust) echo "Rust" ;;
278
+ rust-tauri) echo "Tauri 2 Desktop (Rust + Web)" ;;
279
+ go) echo "Go" ;;
280
+ devops) echo "DevOps / Docker / Terraform" ;;
281
+ devops-k8s) echo "DevOps / Kubernetes" ;;
282
+ *) echo "Generic (no specific stack detected)" ;;
283
+ esac
284
+ }
285
+
286
+ # ── Monorepo Detection ───────────────────────────────────────────────────────
287
+
288
+ # Detect if a project directory is a monorepo
289
+ # Returns sub-project paths (one per line) if monorepo, empty string if not
290
+ # Args: PROJECT_DIR
291
+ # Outputs: newline-separated list of sub-project directories (absolute paths)
292
+ detect_monorepo() {
293
+ local project_dir="$1"
294
+
295
+ # 1. Check explicit monorepo signals
296
+ local is_explicit_monorepo=false
297
+ if [[ -f "$project_dir/pnpm-workspace.yaml" ]] || \
298
+ [[ -f "$project_dir/lerna.json" ]] || \
299
+ [[ -f "$project_dir/nx.json" ]]; then
300
+ is_explicit_monorepo=true
301
+ fi
302
+
303
+ if [[ -f "$project_dir/package.json" ]]; then
304
+ local workspaces
305
+ workspaces=$(jq -r '.workspaces // empty' "$project_dir/package.json" 2>/dev/null || true)
306
+ if [[ -n "$workspaces" && "$workspaces" != "null" ]]; then
307
+ is_explicit_monorepo=true
308
+ fi
309
+ fi
310
+
311
+ # 2. Collect sub-projects (directories with their own package.json or other signal files)
312
+ local sub_projects=()
313
+ for subdir in "$project_dir"/*/; do
314
+ [[ ! -d "$subdir" ]] && continue
315
+ local sub_name
316
+ sub_name=$(basename "$subdir")
317
+
318
+ # Skip common non-project directories
319
+ case "$sub_name" in
320
+ node_modules|.git|dist|build|target|vendor|.atool-docs|coverage|.cache)
321
+ continue
322
+ ;;
323
+ esac
324
+
325
+ # Check if sub-directory has its own project signal
326
+ if [[ -f "$subdir/package.json" ]] || \
327
+ [[ -f "$subdir/pom.xml" ]] || \
328
+ [[ -f "$subdir/build.gradle" ]] || \
329
+ [[ -f "$subdir/Cargo.toml" ]] || \
330
+ [[ -f "$subdir/go.mod" ]] || \
331
+ [[ -f "$subdir/pubspec.yaml" ]] || \
332
+ [[ -f "$subdir/Package.swift" ]] || \
333
+ [[ -f "$subdir/pyproject.toml" ]] || \
334
+ [[ -f "$subdir/requirements.txt" ]]; then
335
+ sub_projects+=("$(cd "$subdir" && pwd)")
336
+ fi
337
+ done
338
+
339
+ # 3. Determine if this is a monorepo
340
+ if $is_explicit_monorepo && [[ ${#sub_projects[@]} -ge 1 ]]; then
341
+ # Explicit monorepo with sub-projects
342
+ printf '%s\n' "${sub_projects[@]}"
343
+ return 0
344
+ fi
345
+
346
+ if ! $is_explicit_monorepo && [[ ${#sub_projects[@]} -ge 2 ]]; then
347
+ # Implicit monorepo: no workspace config but 2+ sub-projects with their own package.json
348
+ printf '%s\n' "${sub_projects[@]}"
349
+ return 0
350
+ fi
351
+
352
+ # Not a monorepo
353
+ return 1
354
+ }
@@ -0,0 +1,266 @@
1
+ #!/usr/bin/env bash
2
+ # shellcheck source=lib/common.sh
3
+ # generate-visualization.sh — Generate interactive Cytoscape.js HTML from knowledge graph
4
+ #
5
+ # Usage: source lib/generate-visualization.sh
6
+ # generate_visualization <docs_dir>
7
+ #
8
+ # Reads .atool-docs/knowledge-graph.json and produces
9
+ # .atool-docs/visualization/index.html with embedded Cytoscape.js
10
+ set -euo pipefail
11
+
12
+ # shellcheck disable=SC1091
13
+ source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
14
+
15
+ # Cache JS libraries for offline use.
16
+ #
17
+ # Downloads each library on first use into $ATOOL_CACHE_DIR, then reads
18
+ # the cached content. Falls back to CDN <script> tags if download fails.
19
+ #
20
+ # Outputs:
21
+ # Sets global variables: _CYTOSCAPE_JS, _DAGRE_JS, _CYTOSCAPE_DAGRE_JS
22
+ cache_js_libraries() {
23
+ local cache_dir="${ATOOL_CACHE_DIR:-$HOME/.atool/cache}/visualization"
24
+ mkdir -p "$cache_dir"
25
+
26
+ local cytoscape_url="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.28.0/cytoscape.min.js"
27
+ local dagre_url="https://unpkg.com/dagre@0.8.5/dist/dagre.min.js"
28
+ local cytoscape_dagre_url="https://unpkg.com/cytoscape-dagre@2.5.0/cytoscape-dagre.js"
29
+
30
+ local cytoscape_file="$cache_dir/cytoscape-3.28.0.min.js"
31
+ local dagre_file="$cache_dir/dagre-0.8.5.min.js"
32
+ local cytoscape_dagre_file="$cache_dir/cytoscape-dagre-2.5.0.js"
33
+
34
+ # Download each library if not already cached
35
+ if [[ ! -f "$cytoscape_file" ]]; then
36
+ log_info "Caching cytoscape.js..."
37
+ if command -v curl &>/dev/null; then
38
+ curl -fsSL "$cytoscape_url" -o "$cytoscape_file" 2>/dev/null || true
39
+ elif command -v wget &>/dev/null; then
40
+ wget -q -O "$cytoscape_file" "$cytoscape_url" 2>/dev/null || true
41
+ fi
42
+ fi
43
+
44
+ if [[ ! -f "$dagre_file" ]]; then
45
+ log_info "Caching dagre.js..."
46
+ if command -v curl &>/dev/null; then
47
+ curl -fsSL "$dagre_url" -o "$dagre_file" 2>/dev/null || true
48
+ elif command -v wget &>/dev/null; then
49
+ wget -q -O "$dagre_file" "$dagre_url" 2>/dev/null || true
50
+ fi
51
+ fi
52
+
53
+ if [[ ! -f "$cytoscape_dagre_file" ]]; then
54
+ log_info "Caching cytoscape-dagre.js..."
55
+ if command -v curl &>/dev/null; then
56
+ curl -fsSL "$cytoscape_dagre_url" -o "$cytoscape_dagre_file" 2>/dev/null || true
57
+ elif command -v wget &>/dev/null; then
58
+ wget -q -O "$cytoscape_dagre_file" "$cytoscape_dagre_url" 2>/dev/null || true
59
+ fi
60
+ fi
61
+
62
+ # Read cached content into variables; fall back to empty string
63
+ _CYTOSCAPE_JS=""
64
+ _DAGRE_JS=""
65
+ _CYTOSCAPE_DAGRE_JS=""
66
+
67
+ if [[ -f "$cytoscape_file" ]]; then
68
+ _CYTOSCAPE_JS=$(cat "$cytoscape_file")
69
+ fi
70
+ if [[ -f "$dagre_file" ]]; then
71
+ _DAGRE_JS=$(cat "$dagre_file")
72
+ fi
73
+ if [[ -f "$cytoscape_dagre_file" ]]; then
74
+ _CYTOSCAPE_DAGRE_JS=$(cat "$cytoscape_dagre_file")
75
+ fi
76
+ }
77
+
78
+ # Replace a single-line placeholder comment in a file by building the file
79
+ # around it using head/tail. Avoids sed entirely for large content injection.
80
+ #
81
+ # Args:
82
+ # $1 - file: path to the HTML file to modify in-place
83
+ # $2 - placeholder: the exact placeholder string to match as a whole line
84
+ # $3 - replacement: content to insert in place of the placeholder line
85
+ _replace_placeholder_line() {
86
+ local file="$1"
87
+ local placeholder="$2"
88
+ local replacement="$3"
89
+
90
+ # Find the line number of the placeholder (match entire line)
91
+ local line_num
92
+ line_num=$(grep -n -F "$placeholder" "$file" | head -1 | cut -d: -f1)
93
+
94
+ if [[ -z "$line_num" ]]; then
95
+ return 1
96
+ fi
97
+
98
+ local tmp_file="${file}.tmp.$$"
99
+
100
+ # Lines before placeholder
101
+ local before=$((line_num - 1))
102
+
103
+ # head/tail combination: output [1..before], replacement, [after..end]
104
+ {
105
+ if [[ "$before" -gt 0 ]]; then
106
+ head -n "$before" "$file"
107
+ fi
108
+ printf '%s\n' "$replacement"
109
+ tail -n +"$((line_num + 1))" "$file"
110
+ } > "$tmp_file"
111
+
112
+ mv "$tmp_file" "$file"
113
+ }
114
+
115
+ # Generate interactive visualization HTML from knowledge graph JSON.
116
+ #
117
+ # Args:
118
+ # $1 - docs_dir: path to .atool-docs/ directory containing knowledge-graph.json
119
+ # Output: writes visualization/index.html in the docs directory
120
+ generate_visualization() {
121
+ local docs_dir="$1"
122
+ local graph_file="$docs_dir/knowledge-graph.json"
123
+ local output_dir="$docs_dir/visualization"
124
+ local output_file="$output_dir/index.html"
125
+ local template_file
126
+ template_file="$(dirname "${BASH_SOURCE[0]}")/visualization-template.html"
127
+
128
+ # Validate inputs
129
+ if [[ ! -f "$graph_file" ]]; then
130
+ log_warn "knowledge-graph.json not found at $graph_file, skipping visualization"
131
+ return 0
132
+ fi
133
+
134
+ if ! command -v jq &>/dev/null; then
135
+ log_warn "jq not available, skipping visualization generation"
136
+ return 0
137
+ fi
138
+
139
+ if [[ ! -f "$template_file" ]]; then
140
+ log_warn "visualization template not found at $template_file"
141
+ return 0
142
+ fi
143
+
144
+ # Create output directory
145
+ mkdir -p "$output_dir"
146
+
147
+ log_info "Generating interactive visualization..."
148
+
149
+ # Prepare graph data: extract only nodes and edges needed by the visualization
150
+ # Flatten to a compact format to reduce HTML size
151
+ local graph_data
152
+ graph_data=$(jq '{
153
+ nodes: (.nodes // [] | map({
154
+ id: .id,
155
+ type: .type,
156
+ label: .label,
157
+ path: .path,
158
+ importance: .importance,
159
+ metrics: .metrics,
160
+ tags: .tags,
161
+ layer: .layer,
162
+ parent: .parent
163
+ })),
164
+ edges: (.edges // [] | map({
165
+ source: .source,
166
+ target: .target,
167
+ type: .type,
168
+ weight: .weight,
169
+ confidence: .confidence,
170
+ line: .line
171
+ })),
172
+ layers: (.layers // {}),
173
+ version: .version
174
+ }' "$graph_file")
175
+
176
+ if [[ -z "$graph_data" || "$graph_data" == "null" ]]; then
177
+ log_warn "Failed to extract graph data for visualization"
178
+ return 0
179
+ fi
180
+
181
+ # --- Bug 1 Fix: Template splitting approach ---
182
+ # Find the line number of __GRAPH_DATA_PLACEHOLDER__ in the template
183
+ # and assemble the output using head/tail, avoiding sed delimiter/back-reference/ARG_MAX issues.
184
+ local placeholder_line
185
+ placeholder_line=$(grep -n -F '__GRAPH_DATA_PLACEHOLDER__' "$template_file" | head -1 | cut -d: -f1)
186
+
187
+ if [[ -z "$placeholder_line" ]]; then
188
+ log_warn "Template does not contain __GRAPH_DATA_PLACEHOLDER__"
189
+ return 0
190
+ fi
191
+
192
+ local before=$((placeholder_line - 1))
193
+
194
+ # Build output: lines before + graph_data assignment + lines after
195
+ {
196
+ if [[ "$before" -gt 0 ]]; then
197
+ head -n "$before" "$template_file"
198
+ fi
199
+ printf 'const GRAPH_DATA = %s;\n' "$graph_data"
200
+ tail -n +"$((placeholder_line + 1))" "$template_file"
201
+ } > "$output_file"
202
+
203
+ # --- Bug 2 Fix: Inline JS libraries ---
204
+ # Cache and embed JS libraries to support offline / firewall-restricted use.
205
+ cache_js_libraries
206
+
207
+ # Replace each placeholder comment with inline <script> or fallback CDN <script>
208
+ _inject_js_placeholder "$output_file" \
209
+ "<!-- __CYTOSCAPE_JS_PLACEHOLDER__ -->" \
210
+ "$_CYTOSCAPE_JS" \
211
+ "https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.28.0/cytoscape.min.js"
212
+
213
+ _inject_js_placeholder "$output_file" \
214
+ "<!-- __DAGRE_JS_PLACEHOLDER__ -->" \
215
+ "$_DAGRE_JS" \
216
+ "https://unpkg.com/dagre@0.8.5/dist/dagre.min.js"
217
+
218
+ _inject_js_placeholder "$output_file" \
219
+ "<!-- __CYTOSCAPE_DAGRE_JS_PLACEHOLDER__ -->" \
220
+ "$_CYTOSCAPE_DAGRE_JS" \
221
+ "https://unpkg.com/cytoscape-dagre@2.5.0/cytoscape-dagre.js"
222
+
223
+ # Verify the output
224
+ if [[ -f "$output_file" ]] && grep -q "cytoscape" "$output_file"; then
225
+ local node_count edge_count
226
+ node_count=$(echo "$graph_data" | jq '.nodes | length')
227
+ edge_count=$(echo "$graph_data" | jq '.edges | length')
228
+ log_info "Visualization generated: $output_file ($node_count nodes, $edge_count edges)"
229
+ else
230
+ log_warn "Visualization generation may have failed"
231
+ fi
232
+ }
233
+
234
+ # Inject a JS library into the HTML file by replacing a placeholder comment.
235
+ # If cached JS content is available, wrap it in <script>...</script>.
236
+ # Otherwise, fall back to a CDN <script src="..."> tag.
237
+ #
238
+ # Args:
239
+ # $1 - file: path to the HTML file to modify
240
+ # $2 - placeholder: the placeholder comment line
241
+ # $3 - js_content: cached JS content (may be empty)
242
+ # $4 - cdn_url: fallback CDN URL
243
+ _inject_js_placeholder() {
244
+ local file="$1"
245
+ local placeholder="$2"
246
+ local js_content="$3"
247
+ local cdn_url="$4"
248
+ local replacement
249
+
250
+ if [[ -n "$js_content" ]]; then
251
+ replacement="<script>${js_content}</script>"
252
+ else
253
+ # Fallback to CDN if caching failed
254
+ replacement="<script src=\"${cdn_url}\"></script>"
255
+ fi
256
+
257
+ if ! _replace_placeholder_line "$file" "$placeholder" "$replacement"; then
258
+ log_warn "Placeholder not found in output: $placeholder"
259
+ fi
260
+ }
261
+
262
+ # === Standalone Execution ===
263
+ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
264
+ DOCS_DIR="${1:-.atool-docs}"
265
+ generate_visualization "$DOCS_DIR"
266
+ fi
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env bash
2
+ # aTool - lib/install-claude.sh
3
+ # Claude Code CLI installation
4
+
5
+ set -euo pipefail
6
+
7
+ # These functions are sourced by the parent script, not run directly.
8
+ # common.sh must already be loaded.
9
+
10
+ install_claude() {
11
+ log_step "Installing to Claude Code CLI..."
12
+
13
+ # Check if claude is installed
14
+ if ! command -v claude &>/dev/null; then
15
+ log_warn "Claude Code CLI not found in PATH"
16
+ log_info "Install Claude Code first: https://docs.anthropic.com/en/docs/claude-code"
17
+ if ! confirm "Continue anyway?" "N"; then
18
+ return 0
19
+ fi
20
+ fi
21
+
22
+ local claude_config_dir
23
+ claude_config_dir=$(get_claude_config_dir)
24
+ local claude_skills_dir="$claude_config_dir/skills"
25
+
26
+ # 1. Install skills
27
+ install_skills "$claude_skills_dir"
28
+
29
+ # 2. Install hooks globally
30
+ install_hooks_global "claude"
31
+
32
+ # 3. Install MCP servers
33
+ install_mcp "claude"
34
+
35
+ log_success "Claude Code CLI installation complete!"
36
+ echo ""
37
+ log_info "Installed:"
38
+ log_info " Skills: $claude_skills_dir/"
39
+ log_info " Hooks: $claude_config_dir/hooks/atool-session-start"
40
+ log_info " MCP: $claude_config_dir/settings.json"
41
+ echo ""
42
+ log_info "Tip: Use /atool-init in a project to auto-detect tech stack"
43
+ }