@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,155 @@
1
+ #!/usr/bin/env bash
2
+ # aTool - hooks/doc-sync-reminder
3
+ # PostToolUse hook: reminds AI to update docs after source file modifications
4
+ # Only triggers on Write|Edit of source files (not .md/.json/.css/.lock etc.)
5
+
6
+ set -euo pipefail
7
+
8
+ # Escape string for JSON embedding
9
+ escape_for_json() {
10
+ local s="$1"
11
+ s="${s//\\/\\\\}"
12
+ s="${s//\"/\\\"}"
13
+ s="${s//$'\n'/\\n}"
14
+ s="${s//$'\r'/\\r}"
15
+ s="${s//$'\t'/\\t}"
16
+ printf '%s' "$s"
17
+ }
18
+
19
+ main() {
20
+ # Read tool input from stdin (Claude Code provides JSON on stdin for PostToolUse)
21
+ local INPUT=""
22
+ if [[ ! -t 0 ]]; then
23
+ INPUT=$(cat)
24
+ fi
25
+
26
+ # ── Fast filter: extract file path from tool input (< 5ms) ───────────────
27
+
28
+ local TOOL_NAME=""
29
+ local FILE_PATH=""
30
+ if command -v jq &>/dev/null && [[ -n "$INPUT" ]]; then
31
+ TOOL_NAME=$(printf '%s' "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null || echo "")
32
+ FILE_PATH=$(printf '%s' "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null || echo "")
33
+ elif [[ -n "$INPUT" ]]; then
34
+ # Fallback: extract tool_name and file_path using grep/sed (jq not available)
35
+ TOOL_NAME=$(printf '%s' "$INPUT" | grep -oE '"tool_name"[[:space:]]*:[[:space:]]*"[^"]*"' 2>/dev/null | head -1 | sed 's/.*"tool_name"[[:space:]]*:[[:space:]]*"//;s/"$//' || echo "")
36
+ FILE_PATH=$(printf '%s' "$INPUT" | grep -oE '"file_path"[[:space:]]*:[[:space:]]*"[^"]*"' 2>/dev/null | head -1 | sed 's/.*"file_path"[[:space:]]*:[[:space:]]*"//;s/"$//' || echo "")
37
+ fi
38
+
39
+ # Only respond to Write/Edit
40
+ if [[ "$TOOL_NAME" != "Write" && "$TOOL_NAME" != "Edit" ]]; then
41
+ exit 0
42
+ fi
43
+
44
+ # No file path extracted — exit silently
45
+ if [[ -z "$FILE_PATH" ]]; then
46
+ exit 0
47
+ fi
48
+
49
+ # ── Source file detection: only trigger on actual source code ─────────────
50
+
51
+ local FILE_EXT="${FILE_PATH##*.}"
52
+ local FILE_BASE
53
+ FILE_BASE=$(basename "$FILE_PATH")
54
+
55
+ # Skip non-source files
56
+ case "$FILE_EXT" in
57
+ md|markdown|txt|rst) exit 0 ;;
58
+ json|yaml|yml|toml|xml) exit 0 ;;
59
+ css|scss|less|sass|styl) exit 0 ;;
60
+ lock|map|log) exit 0 ;;
61
+ svg|png|jpg|jpeg|gif|ico|webp|ttf|woff|woff2|eot) exit 0 ;;
62
+ gitignore|editorconfig|prettierrc|eslintrc) exit 0 ;;
63
+ esac
64
+
65
+ # Skip config files and dotfiles
66
+ case "$FILE_BASE" in
67
+ .*|*.config.*|tsconfig.*|jsconfig.*|vite.config.*|next.config.*|tailwind.config.*|postcss.config.*|webpack.config.*) exit 0 ;;
68
+ esac
69
+
70
+ # Only trigger on known source extensions
71
+ case "$FILE_EXT" in
72
+ ts|tsx|js|jsx|vue|svelte) ;; # Web
73
+ html) ;; # HTML templates
74
+ rs) ;; # Rust
75
+ py) ;; # Python
76
+ go) ;; # Go
77
+ java|kt|kts) ;; # Java/Kotlin
78
+ swift) ;; # Swift
79
+ dart) ;; # Dart
80
+ ets) ;; # HarmonyOS ArkTS
81
+ sh|bash) ;; # Shell
82
+ *) exit 0 ;; # Unknown extension, skip
83
+ esac
84
+
85
+ # ── Stale doc check: remind if any docs are actually stale ────────────────
86
+
87
+ local PROJECT_DIR="${PWD:-}"
88
+
89
+ # Source common.sh for count_stale_docs
90
+ local _LIB_FOUND=false
91
+ for _lib_dir in "$HOME/.claude/lib" "$HOME/.cursor/lib" "${ATOOL_ROOT:-}/lib"; do
92
+ if [[ -f "${_lib_dir}/common.sh" ]]; then
93
+ # shellcheck source=/dev/null
94
+ source "${_lib_dir}/common.sh"
95
+ _LIB_FOUND=true
96
+ break
97
+ fi
98
+ done
99
+
100
+ local STALE=false
101
+ if $_LIB_FOUND && declare -f count_stale_docs &>/dev/null; then
102
+ # Check against all common documentation files — any stale doc triggers reminder
103
+ local DOC_FILES=()
104
+ for doc in "README.md" "COMPONENT.md" "UI_STYLE.md" "ARCHITECTURE.md" "CODE_REVIEW.md"; do
105
+ [[ -f "$PROJECT_DIR/$doc" ]] && DOC_FILES+=("$doc")
106
+ done
107
+ # Also check docs/ directory markdown files (up to 20)
108
+ if [[ -d "$PROJECT_DIR/docs" ]]; then
109
+ while IFS= read -r doc; do
110
+ [[ -n "$doc" ]] && DOC_FILES+=("$doc")
111
+ done < <(find "$PROJECT_DIR/docs" -maxdepth 1 -name '*.md' -type f 2>/dev/null | head -20 | sed "s|^$PROJECT_DIR/||")
112
+ fi
113
+
114
+ if [[ ${#DOC_FILES[@]} -gt 0 ]]; then
115
+ local STALE_COUNT
116
+ STALE_COUNT=$(count_stale_docs "$PROJECT_DIR" "${DOC_FILES[@]}")
117
+ if [[ "$STALE_COUNT" -gt 0 ]]; then
118
+ STALE=true
119
+ fi
120
+ fi
121
+ fi
122
+
123
+ # If no stale doc detection available, always remind (conservative)
124
+ if ! $_LIB_FOUND; then
125
+ STALE=true
126
+ fi
127
+
128
+ if ! $STALE; then
129
+ exit 0 # Docs are up to date, no reminder needed
130
+ fi
131
+
132
+ # ── Output reminder ──────────────────────────────────────────────────────
133
+
134
+ local _REMINDER='<ATOOL-DOC-SYNC-REMINDER>
135
+ You just modified a source file. Documentation may now be stale.
136
+
137
+ IMMEDIATE actions required (do NOT defer):
138
+ 1. Update affected docs: README.md (architecture/structure), COMPONENT.md (API/usage), UI_STYLE.md (styles), docs/ (knowledge base).
139
+ 2. Before claiming this task done, invoke /verification-before-completion to verify doc freshness.
140
+ 3. For substantial doc updates, invoke /doc-coauthoring. For doc format validation, invoke /doc-standards-enforcer.
141
+
142
+ Gate rule: if any doc is stale, the task is NOT done.
143
+ </ATOOL-DOC-SYNC-REMINDER>'
144
+
145
+ # Use structured JSON output for Claude Code PostToolUse hooks
146
+ # Plain text stdout is only visible in verbose mode, NOT injected into conversation.
147
+ # The correct format is: {"hookSpecificOutput":{"hookEventName":"PostToolUse","additionalContext":"..."}}
148
+ local _ESCAPED
149
+ _ESCAPED=$(escape_for_json "$_REMINDER")
150
+ printf '{"hookSpecificOutput":{"hookEventName":"PostToolUse","additionalContext":"%s"}}\n' "$_ESCAPED"
151
+
152
+ exit 0
153
+ }
154
+
155
+ main "$@"
@@ -0,0 +1,37 @@
1
+ {
2
+ "hooks": {
3
+ "sessionStart": [
4
+ {
5
+ "matcher": "",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash ~/.cursor/hooks/atool-session-start"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "UserPromptSubmit": [
15
+ {
16
+ "matcher": "",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "bash ~/.cursor/hooks/atool-prompt-guard"
21
+ }
22
+ ]
23
+ }
24
+ ],
25
+ "PostToolUse": [
26
+ {
27
+ "matcher": "Write|Edit",
28
+ "hooks": [
29
+ {
30
+ "type": "command",
31
+ "command": "bash ~/.cursor/hooks/atool-doc-sync-reminder"
32
+ }
33
+ ]
34
+ }
35
+ ]
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash ~/.claude/hooks/atool-session-start"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "UserPromptSubmit": [
15
+ {
16
+ "matcher": "",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "bash ~/.claude/hooks/atool-prompt-guard"
21
+ }
22
+ ]
23
+ }
24
+ ],
25
+ "PostToolUse": [
26
+ {
27
+ "matcher": "Write|Edit",
28
+ "hooks": [
29
+ {
30
+ "type": "command",
31
+ "command": "bash ~/.claude/hooks/atool-doc-sync-reminder"
32
+ }
33
+ ]
34
+ }
35
+ ]
36
+ }
37
+ }
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env bash
2
+ # aTool - hooks/prompt-guard
3
+ # Lightweight UserPromptSubmit hook: reminds AI to clarify before implementing
4
+ # Skips short/trivial prompts, triggers on substantial implementation requests
5
+
6
+ set -euo pipefail
7
+
8
+ # Detect which IDE is running this hook
9
+ HOOK_IDE="claude"
10
+ if [[ -n "${CURSOR_PLUGIN_ROOT:-}" ]]; then
11
+ HOOK_IDE="cursor"
12
+ fi
13
+
14
+ # Escape string for JSON embedding
15
+ escape_for_json() {
16
+ local s="$1"
17
+ s="${s//\\/\\\\}"
18
+ s="${s//\"/\\\"}"
19
+ s="${s//$'\n'/\\n}"
20
+ s="${s//$'\r'/\\r}"
21
+ s="${s//$'\t'/\\t}"
22
+ printf '%s' "$s"
23
+ }
24
+
25
+ # Read JSON from stdin (Claude Code provides {"prompt": "..."} on stdin)
26
+ INPUT=""
27
+ if [[ ! -t 0 ]]; then
28
+ INPUT=$(cat)
29
+ fi
30
+
31
+ # Extract the prompt text using jq
32
+ PROMPT=""
33
+ if command -v jq &>/dev/null && [[ -n "$INPUT" ]]; then
34
+ PROMPT=$(printf '%s' "$INPUT" | jq -r '.prompt // empty' 2>/dev/null || echo "")
35
+ fi
36
+
37
+ # Fallback: if jq not available or parsing failed, try grep
38
+ if [[ -z "$PROMPT" && -n "$INPUT" ]]; then
39
+ PROMPT=$(printf '%s' "$INPUT" | grep -o '"prompt"[[:space:]]*:[[:space:]]*"[^"]*"' 2>/dev/null | head -1 | sed 's/.*"prompt"[[:space:]]*:[[:space:]]*"//;s/"$//' || echo "")
40
+ fi
41
+
42
+ # No prompt extracted — exit silently
43
+ if [[ -z "$PROMPT" ]]; then
44
+ exit 0
45
+ fi
46
+
47
+ # Normalize: lowercase for pattern matching
48
+ PROMPT_LOWER=$(printf '%s' "$PROMPT" | tr '[:upper:]' '[:lower:]')
49
+ PROMPT_LEN=${#PROMPT}
50
+
51
+ # ── Skip conditions (< 5ms exit) ──────────────────────────────────────────
52
+
53
+ # Detect CJK text (more information-dense, use lower threshold)
54
+ # Use LC_ALL=C to ensure byte-level matching works regardless of locale
55
+ HAS_CJK=false
56
+ if printf '%s' "$PROMPT" | LC_ALL=C grep -q '[一-龥]' 2>/dev/null; then
57
+ HAS_CJK=true
58
+ fi
59
+
60
+ # 1. Short messages
61
+ if $HAS_CJK && [[ "$PROMPT_LEN" -lt 8 ]]; then
62
+ exit 0
63
+ elif ! $HAS_CJK && [[ "$PROMPT_LEN" -lt 20 ]]; then
64
+ exit 0
65
+ fi
66
+
67
+ # 2. Follow-up replies (affirmative, no new intent)
68
+ FOLLOW_UP_PATTERNS="^(yes|ok|okay|好的|继续|继续做|go ahead|sure|yep|yeah|pls|please|go on|继续吧|对|嗯|是的|行|可以)$"
69
+ if printf '%s' "$PROMPT_LOWER" | grep -qE "$FOLLOW_UP_PATTERNS" 2>/dev/null; then
70
+ exit 0
71
+ fi
72
+
73
+ # 3. User asking a question (ends with ? or ?)
74
+ if printf '%s' "$PROMPT" | grep -qE '[??]$' 2>/dev/null; then
75
+ exit 0
76
+ fi
77
+
78
+ # 4. Meta-commands (non-implementation requests)
79
+ # Note: Ambiguous words like "build", "test", "deploy" are NOT listed here
80
+ # because they could be feature requests (e.g., "build a dashboard")
81
+ META_COMMANDS="^(commit|git |run |npm |yarn |pnpm |bun |cargo |go run|python |pytest|jest|vitest|explain|diff |show |list |check |lint |format |log |tail |grep |find |cat |head )"
82
+ if printf '%s' "$PROMPT_LOWER" | grep -qE "$META_COMMANDS" 2>/dev/null; then
83
+ exit 0
84
+ fi
85
+
86
+ # 5. Exit signals (user wants to skip clarification)
87
+ EXIT_SIGNALS="(别问了|不要问|别再问|直接做|直接实现|直接开始|不用确认|跳过提问|不要确认|just do it|stop asking|no questions|don.t ask|skip asking|go ahead and implement)"
88
+ if printf '%s' "$PROMPT_LOWER" | grep -qE "$EXIT_SIGNALS" 2>/dev/null; then
89
+ exit 0
90
+ fi
91
+
92
+ # ── Trigger conditions ───────────────────────────────────────────────────
93
+
94
+ # Count words: for CJK text (no spaces), count CJK chars as words;
95
+ # for Latin text, count whitespace-separated tokens
96
+ WORD_COUNT=0
97
+ if $HAS_CJK; then
98
+ # CJK: count CJK characters (use LC_ALL=C for locale safety)
99
+ CJK_COUNT=$(printf '%s' "$PROMPT" | LC_ALL=C grep -o '[一-龥]' 2>/dev/null | wc -l | tr -d '[:space:]')
100
+ WORD_COUNT=$((CJK_COUNT))
101
+ else
102
+ for word in $PROMPT; do
103
+ WORD_COUNT=$((WORD_COUNT + 1))
104
+ done
105
+ fi
106
+
107
+ # Trigger: sufficient length + enough words/CJK chars + implementation keyword
108
+ IMPLEMENT_KEYWORDS="(开发|创建|新增|实现|添加|加个|做一个|写一个|build|create|add|implement|make|develop|design|feature|refactor|extract|integrate|support|handle)"
109
+ LENGTH_OK=false
110
+ if $HAS_CJK && [[ "$PROMPT_LEN" -ge 8 ]]; then
111
+ LENGTH_OK=true
112
+ elif ! $HAS_CJK && [[ "$PROMPT_LEN" -ge 20 ]]; then
113
+ LENGTH_OK=true
114
+ fi
115
+
116
+ if $LENGTH_OK && [[ "$WORD_COUNT" -gt 5 ]] && \
117
+ printf '%s' "$PROMPT_LOWER" | grep -qE "$IMPLEMENT_KEYWORDS" 2>/dev/null; then
118
+ _REMINDER='<system-reminder>
119
+ Before implementing, classify task complexity and clarify requirements if needed:
120
+ - Tier 0 (direct): single-value change → just do it
121
+ - Tier 1 (1-2 questions): small change with ambiguity → ask key questions
122
+ - Tier 2 (3-5 questions): new feature → read project files first, then ask context-aware questions
123
+ - Tier 3: architecture-level → delegate to /brainstorming
124
+ See /clarify-before-build for full methodology.
125
+ </system-reminder>'
126
+
127
+ if [[ "$HOOK_IDE" == "cursor" ]]; then
128
+ _ESCAPED=$(escape_for_json "$_REMINDER")
129
+ printf '{\n "additional_context": "%s"\n}\n' "$_ESCAPED"
130
+ else
131
+ printf '%s' "$_REMINDER"
132
+ fi
133
+ fi
134
+
135
+ exit 0
@@ -0,0 +1,286 @@
1
+ #!/usr/bin/env bash
2
+ # aTool - hooks/session-start
3
+ # Dynamic context generator: injects skill catalog, project context, and doc-sync reminders
4
+ # Works with Claude Code, Cursor, and other IDEs
5
+
6
+ set -euo pipefail
7
+
8
+ # Locate aTool installation
9
+ if [[ -n "${CLAUDE_PLUGIN_ROOT:-}" ]]; then
10
+ SCRIPT_DIR="$CLAUDE_PLUGIN_ROOT"
11
+ elif [[ -n "${CURSOR_PLUGIN_ROOT:-}" ]]; then
12
+ SCRIPT_DIR="$CURSOR_PLUGIN_ROOT"
13
+ else
14
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
15
+ fi
16
+
17
+ # Detect which IDE is running this hook
18
+ HOOK_IDE="claude"
19
+ if [[ -n "${CURSOR_PLUGIN_ROOT:-}" ]]; then
20
+ HOOK_IDE="cursor"
21
+ fi
22
+
23
+ # Read version, stripping potential CRLF from Windows
24
+ ATOOL_VERSION="${ATOOL_VERSION:-$(cat "$SCRIPT_DIR/../VERSION" 2>/dev/null || cat "$SCRIPT_DIR/VERSION" 2>/dev/null || echo "0.1.0")}"
25
+ ATOOL_VERSION="${ATOOL_VERSION%$'\r'}"
26
+
27
+ # Source common functions (scan_skills_catalog, stack_to_conventions_skill, count_stale_docs)
28
+ # Try: PLUGIN_ROOT/lib/ → sibling lib/ → project .claude/lib/ → installed IDE lib/
29
+ # shellcheck source=../lib/common.sh
30
+ _LIB_FOUND=false
31
+ _PROJECT_LIB="${PWD}/.claude/lib"
32
+ for _lib_dir in "${SCRIPT_DIR}/lib" "${SCRIPT_DIR}/../lib" "$_PROJECT_LIB" "$HOME/.claude/lib" "$HOME/.cursor/lib"; do
33
+ if [[ -f "${_lib_dir}/common.sh" ]]; then
34
+ source "${_lib_dir}/common.sh"
35
+ _LIB_FOUND=true
36
+ break
37
+ fi
38
+ done
39
+
40
+ # Source detect-stack.sh for stack detection
41
+ # shellcheck source=../lib/detect-stack.sh
42
+ if [[ -f "${_lib_dir:-}/detect-stack.sh" ]]; then
43
+ source "${_lib_dir}/detect-stack.sh"
44
+ fi
45
+ unset _lib_dir _LIB_FOUND _PROJECT_LIB
46
+
47
+ # Escape string for JSON embedding (same approach as Superpowers)
48
+ escape_for_json() {
49
+ local s="$1"
50
+ s="${s//\\/\\\\}"
51
+ s="${s//\"/\\\"}"
52
+ s="${s//$'\n'/\\n}"
53
+ s="${s//$'\r'/\\r}"
54
+ s="${s//$'\t'/\\t}"
55
+ printf '%s' "$s"
56
+ }
57
+
58
+ # ═══════════════════════════════════════════════════════════════════════════
59
+ # 1. Inject using-superpowers skill content
60
+ # ═══════════════════════════════════════════════════════════════════════════
61
+
62
+ INJECTION=""
63
+ SUPERPOWERS_SKILLS=""
64
+ if [[ -n "${CLAUDE_PLUGIN_ROOT:-}" ]]; then
65
+ SUPERPOWERS_SKILLS="$CLAUDE_PLUGIN_ROOT/skills/using-superpowers"
66
+ elif [[ -n "${CURSOR_PLUGIN_ROOT:-}" ]]; then
67
+ SUPERPOWERS_SKILLS="$CURSOR_PLUGIN_ROOT/skills/using-superpowers"
68
+ fi
69
+
70
+ # Fallback: scan IDE-specific config dirs
71
+ if [[ -z "$SUPERPOWERS_SKILLS" || ! -d "$SUPERPOWERS_SKILLS" ]]; then
72
+ if [[ "$HOOK_IDE" == "cursor" ]] && declare -f get_cursor_config_dir &>/dev/null; then
73
+ _sp_config_dir=$(get_cursor_config_dir 2>/dev/null || echo "")
74
+ if [[ -d "$_sp_config_dir/skills/using-superpowers" ]]; then
75
+ SUPERPOWERS_SKILLS="$_sp_config_dir/skills/using-superpowers"
76
+ fi
77
+ fi
78
+ fi
79
+ if [[ -z "$SUPERPOWERS_SKILLS" || ! -d "$SUPERPOWERS_SKILLS" ]]; then
80
+ if [[ -d "$HOME/.claude/skills/using-superpowers" ]]; then
81
+ SUPERPOWERS_SKILLS="$HOME/.claude/skills/using-superpowers"
82
+ elif [[ -d "$HOME/.atool/cache/superpowers/skills/using-superpowers" ]]; then
83
+ SUPERPOWERS_SKILLS="$HOME/.atool/cache/superpowers/skills/using-superpowers"
84
+ fi
85
+ fi
86
+
87
+ if [[ -n "$SUPERPOWERS_SKILLS" && -d "$SUPERPOWERS_SKILLS" ]]; then
88
+ SKILL_FILE=""
89
+ if [[ -f "$SUPERPOWERS_SKILLS/SKILL.md" ]]; then
90
+ SKILL_FILE="$SUPERPOWERS_SKILLS/SKILL.md"
91
+ elif [[ -f "$SUPERPOWERS_SKILLS/skill.md" ]]; then
92
+ SKILL_FILE="$SUPERPOWERS_SKILLS/skill.md"
93
+ fi
94
+
95
+ if [[ -n "$SKILL_FILE" ]]; then
96
+ INJECTION+=$(cat "$SKILL_FILE")
97
+ INJECTION+=$'\n\n'
98
+ fi
99
+ fi
100
+
101
+ # ═══════════════════════════════════════════════════════════════════════════
102
+ # 2. Scan installed skills and generate catalog
103
+ # ═══════════════════════════════════════════════════════════════════════════
104
+
105
+ # Use IDE-appropriate skills directory
106
+ SKILLS_DIR="$HOME/.claude/skills"
107
+ if [[ "$HOOK_IDE" == "cursor" ]] && declare -f get_cursor_config_dir &>/dev/null; then
108
+ _cursor_skills=$(get_cursor_config_dir 2>/dev/null || echo "$HOME/.cursor")
109
+ _cursor_skills="$_cursor_skills/skills"
110
+ if [[ -d "$_cursor_skills" ]]; then
111
+ SKILLS_DIR="$_cursor_skills"
112
+ fi
113
+ fi
114
+ unset _cursor_skills _sp_config_dir 2>/dev/null || true
115
+
116
+ CATALOG=""
117
+ if declare -f scan_skills_catalog &>/dev/null; then
118
+ CATALOG=$(scan_skills_catalog "$SKILLS_DIR")
119
+ fi
120
+
121
+ # ═══════════════════════════════════════════════════════════════════════════
122
+ # 3. Detect project context (only when in a project directory)
123
+ # ═══════════════════════════════════════════════════════════════════════════
124
+
125
+ PROJECT_CONTEXT=""
126
+ DOC_SYNC=""
127
+ PROJECT_DIR="${PWD:-}"
128
+
129
+ # Only inject project context if we're in a real project (has .git or signal files)
130
+ IS_PROJECT=false
131
+ if [[ -d "$PROJECT_DIR/.git" ]] || [[ -f "$PROJECT_DIR/pom.xml" ]] || \
132
+ [[ -f "$PROJECT_DIR/package.json" ]] || [[ -f "$PROJECT_DIR/Cargo.toml" ]] || \
133
+ [[ -f "$PROJECT_DIR/go.mod" ]] || [[ -f "$PROJECT_DIR/pyproject.toml" ]] || \
134
+ [[ -f "$PROJECT_DIR/requirements.txt" ]] || [[ -f "$PROJECT_DIR/pubspec.yaml" ]] || \
135
+ [[ -f "$PROJECT_DIR/build.gradle" ]] || [[ -f "$PROJECT_DIR/build.gradle.kts" ]]; then
136
+ IS_PROJECT=true
137
+ fi
138
+
139
+ if $IS_PROJECT && declare -f detect_stack &>/dev/null; then
140
+ STACK=$(detect_stack "$PROJECT_DIR")
141
+ STACK_DESC=""
142
+ if declare -f get_stack_description &>/dev/null; then
143
+ STACK_DESC=$(get_stack_description "$STACK")
144
+ fi
145
+
146
+ CONVENTIONS_SKILL=""
147
+ if declare -f stack_to_conventions_skill &>/dev/null; then
148
+ CONVENTIONS_SKILL=$(stack_to_conventions_skill "$STACK")
149
+ fi
150
+
151
+ PROJECT_CONTEXT="<ATOOL-PROJECT-CONTEXT>"
152
+ PROJECT_CONTEXT+=$'\n'
153
+ PROJECT_CONTEXT+="Current project: ${STACK_DESC} (${STACK})"
154
+ PROJECT_CONTEXT+=$'\n'
155
+ if [[ -n "$CONVENTIONS_SKILL" ]]; then
156
+ PROJECT_CONTEXT+="Primary conventions: /${CONVENTIONS_SKILL}"
157
+ PROJECT_CONTEXT+=$'\n'
158
+ fi
159
+
160
+ # Check doc freshness against ALL documentation files
161
+ STALE_COUNT=0
162
+ _DOC_FILES=()
163
+ for _doc in "README.md" "COMPONENT.md" "UI_STYLE.md" "ARCHITECTURE.md" "CODE_REVIEW.md"; do
164
+ [[ -f "$PROJECT_DIR/$_doc" ]] && _DOC_FILES+=("$_doc")
165
+ done
166
+ if [[ -d "$PROJECT_DIR/docs" ]]; then
167
+ while IFS= read -r _doc; do
168
+ [[ -n "$_doc" ]] && _DOC_FILES+=("$_doc")
169
+ done < <(find "$PROJECT_DIR/docs" -maxdepth 1 -name '*.md' -type f 2>/dev/null | head -20 | sed "s|^$PROJECT_DIR/||")
170
+ fi
171
+ if declare -f count_stale_docs &>/dev/null && [[ ${#_DOC_FILES[@]} -gt 0 ]]; then
172
+ STALE_COUNT=$(count_stale_docs "$PROJECT_DIR" "${_DOC_FILES[@]}")
173
+ fi
174
+ if [[ "$STALE_COUNT" -gt 0 ]]; then
175
+ PROJECT_CONTEXT+="Doc status: STALE — ${STALE_COUNT} source files newer than docs (${#_DOC_FILES[@]} docs checked)"
176
+ PROJECT_CONTEXT+=$'\n'
177
+ else
178
+ PROJECT_CONTEXT+="Doc status: All docs up to date (${#_DOC_FILES[@]} docs checked)"
179
+ PROJECT_CONTEXT+=$'\n'
180
+ fi
181
+
182
+ # Check analysis status
183
+ if [[ -d "$PROJECT_DIR/.atool-docs" ]]; then
184
+ PROJECT_CONTEXT+="Analysis status: Project analyzed (see .atool-docs/)"
185
+ PROJECT_CONTEXT+=$'\n'
186
+ else
187
+ PROJECT_CONTEXT+="Analysis status: Not yet analyzed - consider running /project-analyze"
188
+ PROJECT_CONTEXT+=$'\n'
189
+ fi
190
+
191
+ PROJECT_CONTEXT+="</ATOOL-PROJECT-CONTEXT>"
192
+
193
+ # Doc sync reminder — hard rule with skill enforcement
194
+ DOC_SYNC="<ATOOL-DOC-SYNC>"
195
+ DOC_SYNC+=$'\n'
196
+ DOC_SYNC+="HARD RULE: Every time you modify a source file, you MUST update affected documentation BEFORE claiming the task is done."
197
+ DOC_SYNC+=$'\n\n'
198
+ DOC_SYNC+="Mandatory actions when source files change:"
199
+ DOC_SYNC+=$'\n'
200
+ DOC_SYNC+="1. Update affected docs: README.md (architecture/structure), COMPONENT.md (API/usage), UI_STYLE.md (styles), docs/ (knowledge base)."
201
+ DOC_SYNC+=$'\n'
202
+ DOC_SYNC+="2. BEFORE claiming task done, invoke /verification-before-completion — this skill checks doc freshness and blocks completion if docs are stale."
203
+ DOC_SYNC+=$'\n'
204
+ DOC_SYNC+="3. For doc writing, invoke /doc-coauthoring. For doc format validation, invoke /doc-standards-enforcer."
205
+ DOC_SYNC+=$'\n\n'
206
+ DOC_SYNC+="When writing plans: always include a Documentation Sync step as the final task."
207
+ DOC_SYNC+=$'\n'
208
+ DOC_SYNC+="Gate rule: if docs are stale, task is NOT done. No exceptions."
209
+ DOC_SYNC+=$'\n'
210
+ DOC_SYNC+="</ATOOL-DOC-SYNC>"
211
+ fi
212
+
213
+ # ═══════════════════════════════════════════════════════════════════════════
214
+ # 4. Assemble and output
215
+ # ═══════════════════════════════════════════════════════════════════════════
216
+
217
+ INJECTION+="<system-reminder>"
218
+ INJECTION+=$'\n'
219
+ INJECTION+="SessionStart: aTool v${ATOOL_VERSION} active. Skills, hooks, and MCP servers configured."
220
+ INJECTION+=$'\n'
221
+ INJECTION+="</system-reminder>"
222
+ INJECTION+=$'\n\n'
223
+ INJECTION+="<EXTREMELY_IMPORTANT>"
224
+ INJECTION+=$'\n'
225
+ INJECTION+="<ATOOL-SESSION>"
226
+ INJECTION+=$'\n'
227
+ INJECTION+="aTool v${ATOOL_VERSION} active."
228
+ INJECTION+=$'\n\n'
229
+
230
+ if [[ -n "$CATALOG" ]]; then
231
+ INJECTION+="<ATOOL-SKILL-CATALOG>"
232
+ INJECTION+=$'\n'
233
+ INJECTION+="$CATALOG"
234
+ INJECTION+=$'\n'
235
+ INJECTION+="Invoke skills with: /{skill-name}"
236
+ INJECTION+=$'\n'
237
+ INJECTION+="</ATOOL-SKILL-CATALOG>"
238
+ INJECTION+=$'\n\n'
239
+ fi
240
+
241
+ if [[ -n "$PROJECT_CONTEXT" ]]; then
242
+ INJECTION+="$PROJECT_CONTEXT"
243
+ INJECTION+=$'\n\n'
244
+ fi
245
+
246
+ if [[ -n "$DOC_SYNC" ]]; then
247
+ INJECTION+="$DOC_SYNC"
248
+ INJECTION+=$'\n\n'
249
+ fi
250
+
251
+ INJECTION+="<ATOOL-CLARIFY-RULE>"
252
+ INJECTION+=$'\n'
253
+ INJECTION+="Before implementing ANY feature, first classify task complexity:"
254
+ INJECTION+=$'\n'
255
+ INJECTION+="Tier 0 (direct): single-value change, typo, format fix -> just do it"
256
+ INJECTION+=$'\n'
257
+ INJECTION+="Tier 1 (1-2 questions): small change with ambiguity -> ask key questions"
258
+ INJECTION+=$'\n'
259
+ INJECTION+="Tier 2 (3-5 questions): new feature, medium complexity -> structured clarification"
260
+ INJECTION+=$'\n'
261
+ INJECTION+="Tier 3: architecture-level, vague requirements -> delegate to /brainstorming"
262
+ INJECTION+=$'\n'
263
+ INJECTION+="Rules: Read project files BEFORE asking (CLAUDE.md, package.json, source code). Never assume installed libs or existing patterns. Ask context-aware questions, not obvious ones."
264
+ INJECTION+=$'\n'
265
+ INJECTION+="Exit: If user says '别问了'/'直接做'/'just do it'/'stop asking' -> skip all questions, Tier 0."
266
+ INJECTION+=$'\n'
267
+ INJECTION+="See /clarify-before-build for full methodology."
268
+ INJECTION+=$'\n'
269
+ INJECTION+="</ATOOL-CLARIFY-RULE>"
270
+ INJECTION+=$'\n'
271
+ INJECTION+="</ATOOL-SESSION>"
272
+ INJECTION+=$'\n'
273
+ INJECTION+="</EXTREMELY_IMPORTANT>"
274
+
275
+ # Output in the format expected by the running IDE.
276
+ # Claude Code reads BOTH additional_context and hookSpecificOutput without deduplication,
277
+ # so we must emit only the appropriate field to avoid double injection.
278
+ if [[ "$HOOK_IDE" == "cursor" ]]; then
279
+ INJECTION_ESCAPED=$(escape_for_json "$INJECTION")
280
+ printf '{\n "additional_context": "%s"\n}\n' "$INJECTION_ESCAPED"
281
+ else
282
+ # Claude Code: plain text output (hook framework wraps it automatically)
283
+ printf '%s' "$INJECTION"
284
+ fi
285
+
286
+ exit 0