@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,303 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Documentation Issues Auto-Fixer
4
+
5
+ Automatically fixes common documentation standards issues.
6
+ Interactive mode asks before applying each fix.
7
+
8
+ Usage:
9
+ python fix_common_issues.py <file.md> --interactive
10
+ python fix_common_issues.py <file.md> --dry-run
11
+ """
12
+
13
+ import sys
14
+ import re
15
+ from pathlib import Path
16
+ from datetime import datetime
17
+ import argparse
18
+
19
+
20
+ class Colors:
21
+ RED = '\033[91m'
22
+ GREEN = '\033[92m'
23
+ YELLOW = '\033[93m'
24
+ BLUE = '\033[94m'
25
+ CYAN = '\033[96m'
26
+ RESET = '\033[0m'
27
+ BOLD = '\033[1m'
28
+
29
+
30
+ class DocumentationFixer:
31
+ """Auto-fixes common documentation standards issues."""
32
+
33
+ REQUIRED_FIELDS = ['doc_id', 'title', 'status', 'owner', 'last_updated', 'related_docs']
34
+ VALID_STATUSES = ['draft', 'review', 'approved', 'deprecated']
35
+
36
+ def __init__(self, filepath, interactive=False, dry_run=False):
37
+ self.filepath = Path(filepath)
38
+ self.interactive = interactive
39
+ self.dry_run = dry_run
40
+ self.content = None
41
+ self.fixes_applied = []
42
+
43
+ def fix(self):
44
+ """Run auto-fixes."""
45
+ if not self.filepath.exists():
46
+ self.print_error(f"File not found: {self.filepath}")
47
+ return False
48
+
49
+ try:
50
+ self.content = self.filepath.read_text(encoding='utf-8')
51
+ except Exception as e:
52
+ self.print_error(f"Error reading file: {e}")
53
+ return False
54
+
55
+ print(f"\n{Colors.BOLD}Checking: {self.filepath.name}{Colors.RESET}\n")
56
+
57
+ # Run fix checks
58
+ self.fix_missing_frontmatter()
59
+ self.fix_missing_version_history()
60
+ self.suggest_filename_correction()
61
+ self.normalize_date_format()
62
+
63
+ # Apply fixes
64
+ if self.fixes_applied and not self.dry_run:
65
+ if self.confirm_apply():
66
+ self.filepath.write_text(self.content, encoding='utf-8')
67
+ self.print_success(f"\n✓ Applied {len(self.fixes_applied)} fix(es) to {self.filepath.name}")
68
+ return True
69
+ elif self.dry_run and self.fixes_applied:
70
+ self.print_info(f"\n[Dry run] Would apply {len(self.fixes_applied)} fix(es)")
71
+
72
+ if not self.fixes_applied:
73
+ self.print_info("No issues found that can be auto-fixed")
74
+
75
+ return True
76
+
77
+ def fix_missing_frontmatter(self):
78
+ """Add missing frontmatter template."""
79
+ # Check if frontmatter exists
80
+ frontmatter_match = re.match(r'^---\n(.*?)\n---', self.content, re.DOTALL)
81
+
82
+ if not frontmatter_match:
83
+ # No frontmatter - add template
84
+ template = self.get_frontmatter_template()
85
+
86
+ if self.confirm_fix("Add missing frontmatter template"):
87
+ self.content = template + "\n\n" + self.content
88
+ self.fixes_applied.append("Added frontmatter template")
89
+
90
+ else:
91
+ # Frontmatter exists - check for missing fields
92
+ frontmatter_text = frontmatter_match.group(1)
93
+ frontmatter_dict = {}
94
+
95
+ for line in frontmatter_text.split('\n'):
96
+ if ':' in line and not line.strip().startswith('#'):
97
+ key, value = line.split(':', 1)
98
+ frontmatter_dict[key.strip()] = value.strip()
99
+
100
+ missing_fields = [f for f in self.REQUIRED_FIELDS if f not in frontmatter_dict]
101
+
102
+ if missing_fields:
103
+ print(f"{Colors.YELLOW}Missing frontmatter fields: {', '.join(missing_fields)}{Colors.RESET}")
104
+
105
+ if self.confirm_fix(f"Add missing fields: {', '.join(missing_fields)}"):
106
+ # Insert missing fields
107
+ new_frontmatter = self.update_frontmatter(frontmatter_dict, missing_fields)
108
+ self.content = re.sub(
109
+ r'^---\n.*?\n---',
110
+ new_frontmatter,
111
+ self.content,
112
+ flags=re.DOTALL,
113
+ count=1
114
+ )
115
+ self.fixes_applied.append(f"Added fields: {', '.join(missing_fields)}")
116
+
117
+ def fix_missing_version_history(self):
118
+ """Add version history table if missing."""
119
+ # Check if version history exists
120
+ content_lower = self.content.lower()
121
+ has_version = any(kw in content_lower for kw in ['version', 'history', '版本历史'])
122
+ has_table = '|' in self.content and '---' in self.content
123
+
124
+ if has_version and not has_table:
125
+ version_template = self.get_version_history_template()
126
+
127
+ if self.confirm_fix("Add version history table"):
128
+ # Append to end of content
129
+ self.content += "\n\n" + version_template
130
+ self.fixes_applied.append("Added version history table")
131
+
132
+ def suggest_filename_correction(self):
133
+ """Suggest filename correction if invalid."""
134
+ filename = self.filepath.name
135
+ pattern = r'^\d{3}-[a-z0-9-]+\.md$'
136
+
137
+ if not re.match(pattern, filename):
138
+ # Try to extract a doc_id from frontmatter
139
+ doc_id = None
140
+ frontmatter_match = re.match(r'^---\n(.*?)\n---', self.content, re.DOTALL)
141
+
142
+ if frontmatter_match:
143
+ for line in frontmatter_match.group(1).split('\n'):
144
+ if line.strip().startswith('doc_id:'):
145
+ doc_id = line.split(':', 1)[1].strip()
146
+ break
147
+
148
+ if doc_id:
149
+ # Extract 3-digit ID from doc_id
150
+ id_match = re.search(r'(\d{3})', doc_id)
151
+ if id_match:
152
+ prefix = id_match.group(1)
153
+ suggested_name = f"{prefix}-document.md"
154
+ print(f"{Colors.CYAN}Suggested filename: {suggested_name}{Colors.RESET}")
155
+ print(f" {Colors.YELLOW}Run: mv '{filename}' '{suggested_name}'{Colors.RESET}")
156
+ self.fixes_applied.append("Filename suggested (manual rename required)")
157
+
158
+ def normalize_date_format(self):
159
+ """Normalize date formats to YYYY-MM-DD."""
160
+ frontmatter_match = re.match(r'^---\n(.*?)\n---', self.content, re.DOTALL)
161
+
162
+ if frontmatter_match:
163
+ frontmatter_text = frontmatter_match.group(1)
164
+ modified = False
165
+
166
+ lines = frontmatter_text.split('\n')
167
+ new_lines = []
168
+
169
+ for line in lines:
170
+ if line.strip().startswith('last_updated:'):
171
+ date_str = line.split(':', 1)[1].strip()
172
+
173
+ # Try to parse and reformat
174
+ try:
175
+ # Try common formats
176
+ for fmt in ['%Y-%m-%d', '%Y/%m/%d', '%Y.%m.%d', '%d-%m-%Y']:
177
+ try:
178
+ parsed = datetime.strptime(date_str, fmt)
179
+ normalized = parsed.strftime('%Y-%m-%d')
180
+ if date_str != normalized:
181
+ if self.confirm_fix(f"Normalize date '{date_str}' to '{normalized}'"):
182
+ new_lines.append(f"last_updated: {normalized}")
183
+ modified = True
184
+ self.fixes_applied.append(f"Normalized date format")
185
+ continue
186
+ break
187
+ except ValueError:
188
+ continue
189
+ except:
190
+ pass
191
+
192
+ new_lines.append(line)
193
+
194
+ if modified:
195
+ new_frontmatter = '---\n' + '\n'.join(new_lines) + '\n---'
196
+ self.content = re.sub(
197
+ r'^---\n.*?\n---',
198
+ new_frontmatter,
199
+ self.content,
200
+ flags=re.DOTALL,
201
+ count=1
202
+ )
203
+
204
+ def get_frontmatter_template(self):
205
+ """Generate frontmatter template."""
206
+ return f"""---
207
+ doc_id: XXX-XXX-0100
208
+ title: Document Title
209
+ status: draft
210
+ owner: Your Name
211
+ last_updated: {datetime.now().strftime('%Y-%m-%d')}
212
+ related_docs:
213
+ - docs/100-standards/101-documentation-standards.md
214
+ ---"""
215
+
216
+ def get_version_history_template(self):
217
+ """Generate version history table."""
218
+ return """## Version History
219
+
220
+ | Version | Date | Owner | Change |
221
+ |---|---|---|---|
222
+ | v0.1 | {date} | Your Name | Initial version |
223
+ """.format(date=datetime.now().strftime('%Y-%m-%d'))
224
+
225
+ def update_frontmatter(self, existing_dict, missing_fields):
226
+ """Update frontmatter with missing fields."""
227
+ # Add missing fields with placeholder values
228
+ for field in missing_fields:
229
+ if field == 'doc_id':
230
+ existing_dict[field] = 'XXX-XXX-0100'
231
+ elif field == 'title':
232
+ existing_dict[field] = 'Document Title'
233
+ elif field == 'status':
234
+ existing_dict[field] = 'draft'
235
+ elif field == 'owner':
236
+ existing_dict[field] = 'Your Name'
237
+ elif field == 'last_updated':
238
+ existing_dict[field] = datetime.now().strftime('%Y-%m-%d')
239
+ elif field == 'related_docs':
240
+ existing_dict[field] = '[]'
241
+
242
+ # Rebuild frontmatter string
243
+ lines = ['---']
244
+ for key, value in existing_dict.items():
245
+ lines.append(f'{key}: {value}')
246
+ lines.append('---')
247
+
248
+ return '\n'.join(lines)
249
+
250
+ def confirm_fix(self, message):
251
+ """Ask user to confirm fix."""
252
+ if not self.interactive and not self.dry_run:
253
+ return True
254
+
255
+ if self.dry_run:
256
+ print(f" {Colors.CYAN}[Would fix] {message}{Colors.RESET}")
257
+ return False
258
+
259
+ response = input(f" {Colors.YELLOW}Fix: {message}? [Y/n]{Colors.RESET} ").strip().lower()
260
+ return response in ['', 'y', 'yes']
261
+
262
+ def confirm_apply(self):
263
+ """Ask user to confirm applying all fixes."""
264
+ if not self.interactive:
265
+ return True
266
+
267
+ print(f"\n{Colors.GREEN}Fixes to apply ({len(self.fixes_applied)}):{Colors.RESET}")
268
+ for i, fix in enumerate(self.fixes_applied, 1):
269
+ print(f" {i}. {fix}")
270
+
271
+ response = input(f"\n{Colors.BOLD}Apply these fixes? [Y/n]{Colors.RESET} ").strip().lower()
272
+ return response in ['', 'y', 'yes']
273
+
274
+ def print_error(self, message):
275
+ print(f"{Colors.RED}{message}{Colors.RESET}")
276
+
277
+ def print_info(self, message):
278
+ print(f"{Colors.BLUE}{message}{Colors.RESET}")
279
+
280
+ def print_success(self, message):
281
+ print(f"{Colors.GREEN}{message}{Colors.RESET}")
282
+
283
+
284
+ def main():
285
+ parser = argparse.ArgumentParser(
286
+ description='Auto-fix common documentation issues'
287
+ )
288
+ parser.add_argument('file', help='Markdown file to fix')
289
+ parser.add_argument('-i', '--interactive', action='store_true',
290
+ help='Interactive mode - ask before each fix')
291
+ parser.add_argument('-d', '--dry-run', action='store_true',
292
+ help='Dry run - show what would be fixed without applying')
293
+
294
+ args = parser.parse_args()
295
+
296
+ fixer = DocumentationFixer(args.file, interactive=args.interactive, dry_run=args.dry_run)
297
+ success = fixer.fix()
298
+
299
+ sys.exit(0 if success else 1)
300
+
301
+
302
+ if __name__ == '__main__':
303
+ main()
@@ -0,0 +1,332 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Documentation Standards Validator
4
+
5
+ Validates Markdown documents against the Inspection Agent project's
6
+ documentation standards defined in 100-standards/101-documentation-standards.md.
7
+
8
+ Usage:
9
+ python validate_doc_standards.py <file.md>
10
+ python validate_doc_standards.py <file.md> --verbose
11
+
12
+ Exit codes:
13
+ 0: All checks pass
14
+ 1: Validation fails
15
+ 2: File not found or other error
16
+ """
17
+
18
+ import sys
19
+ import re
20
+ import os
21
+ from pathlib import Path
22
+ from datetime import datetime
23
+ import argparse
24
+
25
+ # ANSI color codes for terminal output
26
+ class Colors:
27
+ RED = '\033[91m'
28
+ GREEN = '\033[92m'
29
+ YELLOW = '\033[93m'
30
+ BLUE = '\033[94m'
31
+ RESET = '\033[0m'
32
+ BOLD = '\033[1m'
33
+
34
+
35
+ class DocumentationValidator:
36
+ """Validates documentation standards compliance."""
37
+
38
+ # Required frontmatter fields
39
+ REQUIRED_FIELDS = ['doc_id', 'title', 'status', 'owner', 'last_updated', 'related_docs']
40
+
41
+ # Valid status values
42
+ VALID_STATUSES = ['draft', 'review', 'approved', 'deprecated']
43
+
44
+ # Required section keywords (can be English or Chinese)
45
+ REQUIRED_SECTIONS = [
46
+ 'purpose', 'scope', '目的', '范围', # Purpose/Scope
47
+ 'content', '主体内容', # Main Content
48
+ 'version', 'history', '版本历史' # Version History
49
+ ]
50
+
51
+ def __init__(self, filepath, verbose=False):
52
+ self.filepath = Path(filepath)
53
+ self.verbose = verbose
54
+ self.errors = []
55
+ self.warnings = []
56
+ self.content = None
57
+ self.frontmatter = {}
58
+
59
+ def validate(self):
60
+ """Run all validation checks."""
61
+ if not self.filepath.exists():
62
+ self.print_error(f"File not found: {self.filepath}")
63
+ return False
64
+
65
+ try:
66
+ self.content = self.filepath.read_text(encoding='utf-8')
67
+ except Exception as e:
68
+ self.print_error(f"Error reading file: {e}")
69
+ return False
70
+
71
+ # Run all validation checks
72
+ self.check_file_naming()
73
+ self.check_directory_structure()
74
+ self.check_frontmatter()
75
+ self.check_required_sections()
76
+ self.check_version_history()
77
+
78
+ # Print results
79
+ self.print_results()
80
+
81
+ return len(self.errors) == 0
82
+
83
+ def check_file_naming(self):
84
+ """Check if filename follows <3-digit-id>-<slug>.md pattern."""
85
+ filename = self.filepath.name
86
+
87
+ # Pattern: <3-digit-id>-<slug>.md
88
+ # Example: 201-project-brief.md
89
+ pattern = r'^\d{3}-[a-z0-9-]+\.md$'
90
+
91
+ if not re.match(pattern, filename):
92
+ self.errors.append({
93
+ 'check': 'FILE_NAMING',
94
+ 'message': f"File '{filename}' doesn't match pattern <3-digit-id>-<slug>.md",
95
+ 'example': 'Example: 201-project-brief.md'
96
+ })
97
+
98
+ # Check for lowercase kebab-case
99
+ if filename != filename.lower():
100
+ self.errors.append({
101
+ 'check': 'FILE_NAMING',
102
+ 'message': f"File '{filename}' must be lowercase",
103
+ 'fix': 'Convert to lowercase kebab-case'
104
+ })
105
+
106
+ # Check for Chinese characters in filename
107
+ if any('\u4e00' <= c <= '\u9fff' for c in filename):
108
+ self.errors.append({
109
+ 'check': 'FILE_NAMING',
110
+ 'message': f"File '{filename}' contains Chinese characters",
111
+ 'fix': 'Use only ASCII characters (lowercase, digits, hyphens)'
112
+ })
113
+
114
+ def check_directory_structure(self):
115
+ """Check if directory follows hundreds-based pattern."""
116
+ parent_dir = self.filepath.parent.name
117
+
118
+ # Pattern: <hundreds>-<slug>
119
+ # Example: 100-standards, 200-product
120
+ pattern = r'^\d{3}-[a-z0-9-]+$'
121
+
122
+ if not re.match(pattern, parent_dir):
123
+ self.errors.append({
124
+ 'check': 'DIRECTORY_STRUCTURE',
125
+ 'message': f"Directory '{parent_dir}' doesn't match pattern <hundreds>-<slug>",
126
+ 'example': 'Example: 100-standards, 200-product'
127
+ })
128
+
129
+ # Check if file ID matches directory hundreds
130
+ filename_id = self.filepath.name[:3] if len(self.filepath.name) >= 3 else ''
131
+ directory_hundreds = parent_dir[:3] if len(parent_dir) >= 3 else ''
132
+
133
+ if filename_id and directory_hundreds:
134
+ if filename_id[0] != directory_hundreds[0]:
135
+ self.warnings.append({
136
+ 'check': 'DIRECTORY_STRUCTURE',
137
+ 'message': f"File ID '{filename_id}' doesn't match directory hundreds '{directory_hundreds}'"
138
+ })
139
+
140
+ def check_frontmatter(self):
141
+ """Check frontmatter completeness and validity."""
142
+ # Extract frontmatter (YAML between --- markers)
143
+ frontmatter_match = re.match(r'^---\n(.*?)\n---', self.content, re.DOTALL)
144
+
145
+ if not frontmatter_match:
146
+ self.errors.append({
147
+ 'check': 'FRONTMATTER',
148
+ 'message': 'No frontmatter found',
149
+ 'fix': 'Add YAML frontmatter between --- markers'
150
+ })
151
+ return
152
+
153
+ # Parse frontmatter
154
+ frontmatter_text = frontmatter_match.group(1)
155
+ for line in frontmatter_text.split('\n'):
156
+ if ':' in line and not line.strip().startswith('#'):
157
+ key, value = line.split(':', 1)
158
+ self.frontmatter[key.strip()] = value.strip()
159
+
160
+ if self.verbose:
161
+ self.print_info(f"Found frontmatter with {len(self.frontmatter)} fields")
162
+
163
+ # Check required fields
164
+ for field in self.REQUIRED_FIELDS:
165
+ if field not in self.frontmatter:
166
+ self.errors.append({
167
+ 'check': 'FRONTMATTER',
168
+ 'message': f"Missing required field: {field}",
169
+ 'required_fields': ', '.join(self.REQUIRED_FIELDS)
170
+ })
171
+
172
+ # Check status validity
173
+ if 'status' in self.frontmatter:
174
+ status = self.frontmatter['status'].strip()
175
+ if status not in self.VALID_STATUSES:
176
+ self.errors.append({
177
+ 'check': 'STATUS',
178
+ 'message': f"Invalid status '{status}'",
179
+ 'valid_values': ', '.join(self.VALID_STATUSES)
180
+ })
181
+
182
+ # Check date format
183
+ if 'last_updated' in self.frontmatter:
184
+ date_str = self.frontmatter['last_updated'].strip()
185
+ try:
186
+ datetime.strptime(date_str, '%Y-%m-%d')
187
+ except ValueError:
188
+ self.errors.append({
189
+ 'check': 'DATE_FORMAT',
190
+ 'message': f"Invalid date format '{date_str}'",
191
+ 'expected': 'YYYY-MM-DD'
192
+ })
193
+
194
+ # Check related_docs format
195
+ if 'related_docs' in self.frontmatter:
196
+ related = self.frontmatter['related_docs']
197
+ if related == '[]' or related == '':
198
+ self.warnings.append({
199
+ 'check': 'FRONTMATTER',
200
+ 'message': 'related_docs is empty'
201
+ })
202
+
203
+ def check_required_sections(self):
204
+ """Check for required document sections."""
205
+ content_lower = self.content.lower()
206
+
207
+ found_sections = []
208
+ for section_keyword in self.REQUIRED_SECTIONS:
209
+ if section_keyword in content_lower:
210
+ found_sections.append(section_keyword)
211
+
212
+ # Check if we have at least one from each category
213
+ has_purpose_scope = any(kw in content_lower for kw in ['purpose', 'scope', '目的', '范围'])
214
+ has_content = any(kw in content_lower for kw in ['content', '主体内容'])
215
+ has_version = any(kw in content_lower for kw in ['version', 'history', '版本历史'])
216
+
217
+ if not has_purpose_scope:
218
+ self.errors.append({
219
+ 'check': 'REQUIRED_SECTIONS',
220
+ 'message': 'Missing Purpose/Scope section',
221
+ 'expected': 'Add section: ## Purpose (目的/范围)'
222
+ })
223
+
224
+ if not has_content:
225
+ self.warnings.append({
226
+ 'check': 'REQUIRED_SECTIONS',
227
+ 'message': 'Missing main content section'
228
+ })
229
+
230
+ if not has_version:
231
+ self.errors.append({
232
+ 'check': 'REQUIRED_SECTIONS',
233
+ 'message': 'Missing Version History section',
234
+ 'expected': 'Add section: ## Version History (版本历史)'
235
+ })
236
+
237
+ def check_version_history(self):
238
+ """Check for version history table."""
239
+ # Look for markdown table with version, date, owner, change columns
240
+ content_lower = self.content.lower()
241
+
242
+ # Check for table markers
243
+ has_table = '|' in self.content and '---' in self.content
244
+
245
+ # Check for version history keywords
246
+ has_version_section = any(kw in content_lower for kw in ['version', 'history', '版本历史'])
247
+
248
+ if has_version_section and has_table:
249
+ # Check for required columns
250
+ table_content = self.content.lower()
251
+ required_columns = ['version', 'date']
252
+ missing_columns = [col for col in required_columns if col not in table_content]
253
+
254
+ if missing_columns:
255
+ self.warnings.append({
256
+ 'check': 'VERSION_HISTORY',
257
+ 'message': f"Version history table may be missing columns: {', '.join(missing_columns)}",
258
+ 'expected': 'Table should have: Version | Date | Owner | Change'
259
+ })
260
+ elif has_version_section:
261
+ self.errors.append({
262
+ 'check': 'VERSION_HISTORY',
263
+ 'message': 'Version History section exists but no table found',
264
+ 'expected': 'Add version history table with columns: Version | Date | Owner | Change'
265
+ })
266
+
267
+ def print_results(self):
268
+ """Print validation results."""
269
+ if not self.errors and not self.warnings:
270
+ self.print_success(f"✓ All checks passed: {self.filepath}")
271
+ else:
272
+ self.print_error(f"✗ Validation failed: {self.filepath}")
273
+
274
+ # Print errors
275
+ for error in self.errors:
276
+ check = error['check']
277
+ message = error['message']
278
+ print(f"\n{Colors.RED}[ERROR] [{check}]{Colors.RESET} {message}")
279
+
280
+ if 'example' in error:
281
+ print(f" {Colors.BLUE}Example:{Colors.RESET} {error['example']}")
282
+ if 'fix' in error:
283
+ print(f" {Colors.BLUE}Fix:{Colors.RESET} {error['fix']}")
284
+ if 'expected' in error:
285
+ print(f" {Colors.BLUE}Expected:{Colors.RESET} {error['expected']}")
286
+ if 'valid_values' in error:
287
+ print(f" {Colors.BLUE}Valid values:{Colors.RESET} {error['valid_values']}")
288
+
289
+ # Print warnings
290
+ for warning in self.warnings:
291
+ check = warning['check']
292
+ message = warning['message']
293
+ print(f"\n{Colors.YELLOW}[WARNING] [{check}]{Colors.RESET} {message}")
294
+
295
+ # Summary
296
+ if self.errors:
297
+ print(f"\n{Colors.RED}{Colors.BOLD}Errors: {len(self.errors)}{Colors.RESET}")
298
+ if self.warnings:
299
+ print(f"{Colors.YELLOW}Warnings: {len(self.warnings)}{Colors.RESET}")
300
+
301
+ def print_error(self, message):
302
+ print(f"{Colors.RED}{message}{Colors.RESET}")
303
+
304
+ def print_warning(self, message):
305
+ print(f"{Colors.YELLOW}{message}{Colors.RESET}")
306
+
307
+ def print_success(self, message):
308
+ print(f"{Colors.GREEN}{message}{Colors.RESET}")
309
+
310
+ def print_info(self, message):
311
+ if self.verbose:
312
+ print(f"{Colors.BLUE}{message}{Colors.RESET}")
313
+
314
+
315
+ def main():
316
+ parser = argparse.ArgumentParser(
317
+ description='Validate documentation against project standards'
318
+ )
319
+ parser.add_argument('file', help='Markdown file to validate')
320
+ parser.add_argument('-v', '--verbose', action='store_true',
321
+ help='Enable verbose output')
322
+
323
+ args = parser.parse_args()
324
+
325
+ validator = DocumentationValidator(args.file, verbose=args.verbose)
326
+ valid = validator.validate()
327
+
328
+ sys.exit(0 if valid else 1)
329
+
330
+
331
+ if __name__ == '__main__':
332
+ main()
@@ -0,0 +1,30 @@
1
+ © 2025 Anthropic, PBC. All rights reserved.
2
+
3
+ LICENSE: Use of these materials (including all code, prompts, assets, files,
4
+ and other components of this Skill) is governed by your agreement with
5
+ Anthropic regarding use of Anthropic's services. If no separate agreement
6
+ exists, use is governed by Anthropic's Consumer Terms of Service or
7
+ Commercial Terms of Service, as applicable:
8
+ https://www.anthropic.com/legal/consumer-terms
9
+ https://www.anthropic.com/legal/commercial-terms
10
+ Your applicable agreement is referred to as the "Agreement." "Services" are
11
+ as defined in the Agreement.
12
+
13
+ ADDITIONAL RESTRICTIONS: Notwithstanding anything in the Agreement to the
14
+ contrary, users may not:
15
+
16
+ - Extract these materials from the Services or retain copies of these
17
+ materials outside the Services
18
+ - Reproduce or copy these materials, except for temporary copies created
19
+ automatically during authorized use of the Services
20
+ - Create derivative works based on these materials
21
+ - Distribute, sublicense, or transfer these materials to any third party
22
+ - Make, offer to sell, sell, or import any inventions embodied in these
23
+ materials
24
+ - Reverse engineer, decompile, or disassemble these materials
25
+
26
+ The receipt, viewing, or possession of these materials does not convey or
27
+ imply any license or right beyond those expressly granted above.
28
+
29
+ Anthropic retains all right, title, and interest in these materials,
30
+ including all copyrights, patents, and other intellectual property rights.