devskill 2.0.6 → 2.0.7

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 (435) hide show
  1. package/meta.ts +9 -1
  2. package/package.json +1 -1
  3. package/scripts/cli.ts +55 -10
  4. package/skills/algorithmic-art/LICENSE.txt +202 -0
  5. package/skills/algorithmic-art/SKILL.md +405 -0
  6. package/skills/algorithmic-art/SYNC.md +5 -0
  7. package/skills/algorithmic-art/templates/generator_template.js +223 -0
  8. package/skills/algorithmic-art/templates/viewer.html +599 -0
  9. package/skills/brand-guidelines/LICENSE.txt +202 -0
  10. package/skills/brand-guidelines/SKILL.md +73 -0
  11. package/skills/brand-guidelines/SYNC.md +5 -0
  12. package/skills/canvas-design/LICENSE.txt +202 -0
  13. package/skills/canvas-design/SKILL.md +130 -0
  14. package/skills/canvas-design/SYNC.md +5 -0
  15. package/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
  16. package/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
  17. package/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
  18. package/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
  19. package/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
  20. package/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
  21. package/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
  22. package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  23. package/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  24. package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  25. package/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
  26. package/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
  27. package/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
  28. package/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
  29. package/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
  30. package/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
  31. package/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
  32. package/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
  33. package/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
  34. package/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
  35. package/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
  36. package/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
  37. package/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
  38. package/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
  39. package/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
  40. package/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
  41. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
  42. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
  43. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
  44. package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
  45. package/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  46. package/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  47. package/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  48. package/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  49. package/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  50. package/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  51. package/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  52. package/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
  53. package/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
  54. package/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  55. package/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  56. package/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  57. package/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
  58. package/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
  59. package/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
  60. package/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
  61. package/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
  62. package/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  63. package/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  64. package/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  65. package/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
  66. package/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  67. package/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
  68. package/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
  69. package/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
  70. package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  71. package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  72. package/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  73. package/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
  74. package/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  75. package/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
  76. package/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
  77. package/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
  78. package/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
  79. package/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
  80. package/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
  81. package/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
  82. package/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
  83. package/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
  84. package/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
  85. package/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
  86. package/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  87. package/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
  88. package/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  89. package/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
  90. package/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
  91. package/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
  92. package/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
  93. package/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
  94. package/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
  95. package/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  96. package/skills/claude-api/LICENSE.txt +202 -0
  97. package/skills/claude-api/SKILL.md +246 -0
  98. package/skills/claude-api/SYNC.md +5 -0
  99. package/skills/claude-api/csharp/claude-api.md +400 -0
  100. package/skills/claude-api/curl/examples.md +193 -0
  101. package/skills/claude-api/go/claude-api.md +404 -0
  102. package/skills/claude-api/java/claude-api.md +430 -0
  103. package/skills/claude-api/php/claude-api.md +241 -0
  104. package/skills/claude-api/python/agent-sdk/README.md +345 -0
  105. package/skills/claude-api/python/agent-sdk/patterns.md +359 -0
  106. package/skills/claude-api/python/claude-api/README.md +410 -0
  107. package/skills/claude-api/python/claude-api/batches.md +185 -0
  108. package/skills/claude-api/python/claude-api/files-api.md +165 -0
  109. package/skills/claude-api/python/claude-api/streaming.md +162 -0
  110. package/skills/claude-api/python/claude-api/tool-use.md +590 -0
  111. package/skills/claude-api/ruby/claude-api.md +92 -0
  112. package/skills/claude-api/shared/error-codes.md +206 -0
  113. package/skills/claude-api/shared/live-sources.md +121 -0
  114. package/skills/claude-api/shared/models.md +119 -0
  115. package/skills/claude-api/shared/tool-use-concepts.md +305 -0
  116. package/skills/claude-api/typescript/agent-sdk/README.md +296 -0
  117. package/skills/claude-api/typescript/agent-sdk/patterns.md +209 -0
  118. package/skills/claude-api/typescript/claude-api/README.md +321 -0
  119. package/skills/claude-api/typescript/claude-api/batches.md +106 -0
  120. package/skills/claude-api/typescript/claude-api/files-api.md +98 -0
  121. package/skills/claude-api/typescript/claude-api/streaming.md +178 -0
  122. package/skills/claude-api/typescript/claude-api/tool-use.md +527 -0
  123. package/skills/doc-coauthoring/SKILL.md +375 -0
  124. package/skills/doc-coauthoring/SYNC.md +5 -0
  125. package/skills/docx/LICENSE.txt +30 -0
  126. package/skills/docx/SKILL.md +590 -0
  127. package/skills/docx/SYNC.md +5 -0
  128. package/skills/docx/scripts/__init__.py +1 -0
  129. package/skills/docx/scripts/accept_changes.py +135 -0
  130. package/skills/docx/scripts/comment.py +318 -0
  131. package/skills/docx/scripts/office/helpers/__init__.py +0 -0
  132. package/skills/docx/scripts/office/helpers/merge_runs.py +199 -0
  133. package/skills/docx/scripts/office/helpers/simplify_redlines.py +197 -0
  134. package/skills/docx/scripts/office/pack.py +159 -0
  135. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  136. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  137. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  138. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  139. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  140. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  141. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  142. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  143. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  144. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  145. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  146. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  147. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  148. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  149. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  150. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  151. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  152. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  153. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  154. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  155. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  156. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  157. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  158. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  159. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  160. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  161. package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  162. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  163. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  164. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  165. package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  166. package/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
  167. package/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  168. package/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  169. package/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  170. package/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  171. package/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  172. package/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  173. package/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  174. package/skills/docx/scripts/office/soffice.py +183 -0
  175. package/skills/docx/scripts/office/unpack.py +132 -0
  176. package/skills/docx/scripts/office/validate.py +111 -0
  177. package/skills/docx/scripts/office/validators/__init__.py +15 -0
  178. package/skills/docx/scripts/office/validators/base.py +847 -0
  179. package/skills/docx/scripts/office/validators/docx.py +446 -0
  180. package/skills/docx/scripts/office/validators/pptx.py +275 -0
  181. package/skills/docx/scripts/office/validators/redlining.py +247 -0
  182. package/skills/docx/scripts/templates/comments.xml +3 -0
  183. package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  184. package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  185. package/skills/docx/scripts/templates/commentsIds.xml +3 -0
  186. package/skills/docx/scripts/templates/people.xml +3 -0
  187. package/skills/frontend-design/LICENSE.txt +177 -0
  188. package/skills/frontend-design/SKILL.md +42 -0
  189. package/skills/frontend-design/SYNC.md +5 -0
  190. package/skills/internal-comms/LICENSE.txt +202 -0
  191. package/skills/internal-comms/SKILL.md +32 -0
  192. package/skills/internal-comms/SYNC.md +5 -0
  193. package/skills/internal-comms/examples/3p-updates.md +47 -0
  194. package/skills/internal-comms/examples/company-newsletter.md +65 -0
  195. package/skills/internal-comms/examples/faq-answers.md +30 -0
  196. package/skills/internal-comms/examples/general-comms.md +16 -0
  197. package/skills/mcp-builder/LICENSE.txt +202 -0
  198. package/skills/mcp-builder/SKILL.md +236 -0
  199. package/skills/mcp-builder/SYNC.md +5 -0
  200. package/skills/mcp-builder/reference/evaluation.md +602 -0
  201. package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  202. package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
  203. package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
  204. package/skills/mcp-builder/scripts/connections.py +151 -0
  205. package/skills/mcp-builder/scripts/evaluation.py +373 -0
  206. package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  207. package/skills/mcp-builder/scripts/requirements.txt +2 -0
  208. package/skills/next-best-practices/SKILL.md +153 -0
  209. package/skills/next-best-practices/SYNC.md +5 -0
  210. package/skills/next-best-practices/async-patterns.md +87 -0
  211. package/skills/next-best-practices/bundling.md +180 -0
  212. package/skills/next-best-practices/data-patterns.md +297 -0
  213. package/skills/next-best-practices/debug-tricks.md +105 -0
  214. package/skills/next-best-practices/directives.md +73 -0
  215. package/skills/next-best-practices/error-handling.md +227 -0
  216. package/skills/next-best-practices/file-conventions.md +140 -0
  217. package/skills/next-best-practices/font.md +245 -0
  218. package/skills/next-best-practices/functions.md +108 -0
  219. package/skills/next-best-practices/hydration-error.md +91 -0
  220. package/skills/next-best-practices/image.md +173 -0
  221. package/skills/next-best-practices/metadata.md +301 -0
  222. package/skills/next-best-practices/parallel-routes.md +287 -0
  223. package/skills/next-best-practices/route-handlers.md +146 -0
  224. package/skills/next-best-practices/rsc-boundaries.md +159 -0
  225. package/skills/next-best-practices/runtime-selection.md +39 -0
  226. package/skills/next-best-practices/scripts.md +141 -0
  227. package/skills/next-best-practices/self-hosting.md +371 -0
  228. package/skills/next-best-practices/suspense-boundaries.md +67 -0
  229. package/skills/next-cache-components/SKILL.md +411 -0
  230. package/skills/next-cache-components/SYNC.md +5 -0
  231. package/skills/next-upgrade/SKILL.md +50 -0
  232. package/skills/next-upgrade/SYNC.md +5 -0
  233. package/skills/pdf/LICENSE.txt +30 -0
  234. package/skills/pdf/SKILL.md +314 -0
  235. package/skills/pdf/SYNC.md +5 -0
  236. package/skills/pdf/forms.md +294 -0
  237. package/skills/pdf/reference.md +612 -0
  238. package/skills/pdf/scripts/check_bounding_boxes.py +65 -0
  239. package/skills/pdf/scripts/check_fillable_fields.py +11 -0
  240. package/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
  241. package/skills/pdf/scripts/create_validation_image.py +37 -0
  242. package/skills/pdf/scripts/extract_form_field_info.py +122 -0
  243. package/skills/pdf/scripts/extract_form_structure.py +115 -0
  244. package/skills/pdf/scripts/fill_fillable_fields.py +98 -0
  245. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
  246. package/skills/pptx/LICENSE.txt +30 -0
  247. package/skills/pptx/SKILL.md +232 -0
  248. package/skills/pptx/SYNC.md +5 -0
  249. package/skills/pptx/editing.md +205 -0
  250. package/skills/pptx/pptxgenjs.md +420 -0
  251. package/skills/pptx/scripts/__init__.py +0 -0
  252. package/skills/pptx/scripts/add_slide.py +195 -0
  253. package/skills/pptx/scripts/clean.py +286 -0
  254. package/skills/pptx/scripts/office/helpers/__init__.py +0 -0
  255. package/skills/pptx/scripts/office/helpers/merge_runs.py +199 -0
  256. package/skills/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
  257. package/skills/pptx/scripts/office/pack.py +159 -0
  258. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  259. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  260. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  261. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  262. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  263. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  264. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  265. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  266. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  267. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  268. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  269. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  270. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  271. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  272. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  273. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  274. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  275. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  276. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  277. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  278. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  279. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  280. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  281. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  282. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  283. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  284. package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  285. package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  286. package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  287. package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  288. package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  289. package/skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
  290. package/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  291. package/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  292. package/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  293. package/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  294. package/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  295. package/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  296. package/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  297. package/skills/pptx/scripts/office/soffice.py +183 -0
  298. package/skills/pptx/scripts/office/unpack.py +132 -0
  299. package/skills/pptx/scripts/office/validate.py +111 -0
  300. package/skills/pptx/scripts/office/validators/__init__.py +15 -0
  301. package/skills/pptx/scripts/office/validators/base.py +847 -0
  302. package/skills/pptx/scripts/office/validators/docx.py +446 -0
  303. package/skills/pptx/scripts/office/validators/pptx.py +275 -0
  304. package/skills/pptx/scripts/office/validators/redlining.py +247 -0
  305. package/skills/pptx/scripts/thumbnail.py +289 -0
  306. package/skills/shadcn/LICENSE.md +21 -0
  307. package/skills/shadcn/SKILL.md +242 -0
  308. package/skills/shadcn/SYNC.md +5 -0
  309. package/skills/shadcn/agents/openai.yml +5 -0
  310. package/skills/shadcn/assets/shadcn-small.png +0 -0
  311. package/skills/shadcn/assets/shadcn.png +0 -0
  312. package/skills/shadcn/cli.md +257 -0
  313. package/skills/shadcn/customization.md +202 -0
  314. package/skills/shadcn/evals/evals.json +47 -0
  315. package/skills/shadcn/mcp.md +94 -0
  316. package/skills/shadcn/rules/base-vs-radix.md +306 -0
  317. package/skills/shadcn/rules/composition.md +195 -0
  318. package/skills/shadcn/rules/forms.md +192 -0
  319. package/skills/shadcn/rules/icons.md +101 -0
  320. package/skills/shadcn/rules/styling.md +162 -0
  321. package/skills/skill-creator/LICENSE.txt +202 -0
  322. package/skills/skill-creator/SKILL.md +485 -0
  323. package/skills/skill-creator/SYNC.md +5 -0
  324. package/skills/skill-creator/agents/analyzer.md +274 -0
  325. package/skills/skill-creator/agents/comparator.md +202 -0
  326. package/skills/skill-creator/agents/grader.md +223 -0
  327. package/skills/skill-creator/assets/eval_review.html +146 -0
  328. package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  329. package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  330. package/skills/skill-creator/references/schemas.md +430 -0
  331. package/skills/skill-creator/scripts/__init__.py +0 -0
  332. package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  333. package/skills/skill-creator/scripts/generate_report.py +326 -0
  334. package/skills/skill-creator/scripts/improve_description.py +247 -0
  335. package/skills/skill-creator/scripts/package_skill.py +136 -0
  336. package/skills/skill-creator/scripts/quick_validate.py +103 -0
  337. package/skills/skill-creator/scripts/run_eval.py +310 -0
  338. package/skills/skill-creator/scripts/run_loop.py +328 -0
  339. package/skills/skill-creator/scripts/utils.py +47 -0
  340. package/skills/slack-gif-creator/LICENSE.txt +202 -0
  341. package/skills/slack-gif-creator/SKILL.md +254 -0
  342. package/skills/slack-gif-creator/SYNC.md +5 -0
  343. package/skills/slack-gif-creator/core/easing.py +234 -0
  344. package/skills/slack-gif-creator/core/frame_composer.py +176 -0
  345. package/skills/slack-gif-creator/core/gif_builder.py +269 -0
  346. package/skills/slack-gif-creator/core/validators.py +136 -0
  347. package/skills/slack-gif-creator/requirements.txt +4 -0
  348. package/skills/theme-factory/LICENSE.txt +202 -0
  349. package/skills/theme-factory/SKILL.md +59 -0
  350. package/skills/theme-factory/SYNC.md +5 -0
  351. package/skills/theme-factory/theme-showcase.pdf +0 -0
  352. package/skills/theme-factory/themes/arctic-frost.md +19 -0
  353. package/skills/theme-factory/themes/botanical-garden.md +19 -0
  354. package/skills/theme-factory/themes/desert-rose.md +19 -0
  355. package/skills/theme-factory/themes/forest-canopy.md +19 -0
  356. package/skills/theme-factory/themes/golden-hour.md +19 -0
  357. package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
  358. package/skills/theme-factory/themes/modern-minimalist.md +19 -0
  359. package/skills/theme-factory/themes/ocean-depths.md +19 -0
  360. package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
  361. package/skills/theme-factory/themes/tech-innovation.md +19 -0
  362. package/skills/vue-best-practices/SYNC.md +1 -1
  363. package/skills/vue-jsx-best-practices/SYNC.md +1 -1
  364. package/skills/vue-options-api-best-practices/SYNC.md +1 -1
  365. package/skills/vue-pinia-best-practices/SYNC.md +1 -1
  366. package/skills/vue-router-best-practices/SYNC.md +1 -1
  367. package/skills/vue-testing-best-practices/SYNC.md +1 -1
  368. package/skills/web-artifacts-builder/LICENSE.txt +202 -0
  369. package/skills/web-artifacts-builder/SKILL.md +74 -0
  370. package/skills/web-artifacts-builder/SYNC.md +5 -0
  371. package/skills/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
  372. package/skills/web-artifacts-builder/scripts/init-artifact.sh +322 -0
  373. package/skills/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
  374. package/skills/webapp-testing/LICENSE.txt +202 -0
  375. package/skills/webapp-testing/SKILL.md +96 -0
  376. package/skills/webapp-testing/SYNC.md +5 -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/xlsx/LICENSE.txt +30 -0
  382. package/skills/xlsx/SKILL.md +292 -0
  383. package/skills/xlsx/SYNC.md +5 -0
  384. package/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
  385. package/skills/xlsx/scripts/office/helpers/merge_runs.py +199 -0
  386. package/skills/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
  387. package/skills/xlsx/scripts/office/pack.py +159 -0
  388. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  389. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  390. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  391. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  392. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  393. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  394. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  395. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  396. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  397. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  398. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  399. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  400. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  401. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  402. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  403. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  404. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  405. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  406. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  407. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  408. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  409. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  410. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  411. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  412. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  413. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  414. package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  415. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  416. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  417. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  418. package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  419. package/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
  420. package/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  421. package/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  422. package/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  423. package/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  424. package/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  425. package/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  426. package/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  427. package/skills/xlsx/scripts/office/soffice.py +183 -0
  428. package/skills/xlsx/scripts/office/unpack.py +132 -0
  429. package/skills/xlsx/scripts/office/validate.py +111 -0
  430. package/skills/xlsx/scripts/office/validators/__init__.py +15 -0
  431. package/skills/xlsx/scripts/office/validators/base.py +847 -0
  432. package/skills/xlsx/scripts/office/validators/docx.py +446 -0
  433. package/skills/xlsx/scripts/office/validators/pptx.py +275 -0
  434. package/skills/xlsx/scripts/office/validators/redlining.py +247 -0
  435. package/skills/xlsx/scripts/recalc.py +184 -0
@@ -0,0 +1,305 @@
1
+ # Tool Use Concepts
2
+
3
+ This file covers the conceptual foundations of tool use with the Claude API. For language-specific code examples, see the `python/`, `typescript/`, or other language folders.
4
+
5
+ ## User-Defined Tools
6
+
7
+ ### Tool Definition Structure
8
+
9
+ > **Note:** When using the Tool Runner (beta), tool schemas are generated automatically from your function signatures (Python), Zod schemas (TypeScript), annotated classes (Java), `jsonschema` struct tags (Go), or `BaseTool` subclasses (Ruby). The raw JSON schema format below is for the manual approach or SDKs without tool runner support.
10
+
11
+ Each tool requires a name, description, and JSON Schema for its inputs:
12
+
13
+ ```json
14
+ {
15
+ "name": "get_weather",
16
+ "description": "Get current weather for a location",
17
+ "input_schema": {
18
+ "type": "object",
19
+ "properties": {
20
+ "location": {
21
+ "type": "string",
22
+ "description": "City and state, e.g., San Francisco, CA"
23
+ },
24
+ "unit": {
25
+ "type": "string",
26
+ "enum": ["celsius", "fahrenheit"],
27
+ "description": "Temperature unit"
28
+ }
29
+ },
30
+ "required": ["location"]
31
+ }
32
+ }
33
+ ```
34
+
35
+ **Best practices for tool definitions:**
36
+
37
+ - Use clear, descriptive names (e.g., `get_weather`, `search_database`, `send_email`)
38
+ - Write detailed descriptions — Claude uses these to decide when to use the tool
39
+ - Include descriptions for each property
40
+ - Use `enum` for parameters with a fixed set of values
41
+ - Mark truly required parameters in `required`; make others optional with defaults
42
+
43
+ ---
44
+
45
+ ### Tool Choice Options
46
+
47
+ Control when Claude uses tools:
48
+
49
+ | Value | Behavior |
50
+ | --------------------------------- | --------------------------------------------- |
51
+ | `{"type": "auto"}` | Claude decides whether to use tools (default) |
52
+ | `{"type": "any"}` | Claude must use at least one tool |
53
+ | `{"type": "tool", "name": "..."}` | Claude must use the specified tool |
54
+ | `{"type": "none"}` | Claude cannot use tools |
55
+
56
+ Any `tool_choice` value can also include `"disable_parallel_tool_use": true` to force Claude to use at most one tool per response. By default, Claude may request multiple tool calls in a single response.
57
+
58
+ ---
59
+
60
+ ### Tool Runner vs Manual Loop
61
+
62
+ **Tool Runner (Recommended):** The SDK's tool runner handles the agentic loop automatically — it calls the API, detects tool use requests, executes your tool functions, feeds results back to Claude, and repeats until Claude stops calling tools. Available in Python, TypeScript, Java, Go, and Ruby SDKs (beta). The Python SDK also provides MCP conversion helpers (`anthropic.lib.tools.mcp`) to convert MCP tools, prompts, and resources for use with the tool runner — see `python/claude-api/tool-use.md` for details.
63
+
64
+ **Manual Agentic Loop:** Use when you need fine-grained control over the loop (e.g., custom logging, conditional tool execution, human-in-the-loop approval). Loop until `stop_reason == "end_turn"`, always append the full `response.content` to preserve tool_use blocks, and ensure each `tool_result` includes the matching `tool_use_id`.
65
+
66
+ **Stop reasons for server-side tools:** When using server-side tools (code execution, web search, etc.), the API runs a server-side sampling loop. If this loop reaches its default limit of 10 iterations, the response will have `stop_reason: "pause_turn"`. To continue, re-send the user message and assistant response and make another API request — the server will resume where it left off. Do NOT add an extra user message like "Continue." — the API detects the trailing `server_tool_use` block and knows to resume automatically.
67
+
68
+ ```python
69
+ # Handle pause_turn in your agentic loop
70
+ if response.stop_reason == "pause_turn":
71
+ messages = [
72
+ {"role": "user", "content": user_query},
73
+ {"role": "assistant", "content": response.content},
74
+ ]
75
+ # Make another API request — server resumes automatically
76
+ response = client.messages.create(
77
+ model="claude-opus-4-6", messages=messages, tools=tools
78
+ )
79
+ ```
80
+
81
+ Set a `max_continuations` limit (e.g., 5) to prevent infinite loops. For the full guide, see: `https://platform.claude.com/docs/en/build-with-claude/handling-stop-reasons`
82
+
83
+ > **Security:** The tool runner executes your tool functions automatically whenever Claude requests them. For tools with side effects (sending emails, modifying databases, financial transactions), validate inputs within your tool functions and consider requiring confirmation for destructive operations. Use the manual agentic loop if you need human-in-the-loop approval before each tool execution.
84
+
85
+ ---
86
+
87
+ ### Handling Tool Results
88
+
89
+ When Claude uses a tool, the response contains a `tool_use` block. You must:
90
+
91
+ 1. Execute the tool with the provided input
92
+ 2. Send the result back in a `tool_result` message
93
+ 3. Continue the conversation
94
+
95
+ **Error handling in tool results:** When a tool execution fails, set `"is_error": true` and provide an informative error message. Claude will typically acknowledge the error and either try a different approach or ask for clarification.
96
+
97
+ **Multiple tool calls:** Claude can request multiple tools in a single response. Handle them all before continuing — send all results back in a single `user` message.
98
+
99
+ ---
100
+
101
+ ## Server-Side Tools: Code Execution
102
+
103
+ The code execution tool lets Claude run code in a secure, sandboxed container. Unlike user-defined tools, server-side tools run on Anthropic's infrastructure — you don't execute anything client-side. Just include the tool definition and Claude handles the rest.
104
+
105
+ ### Key Facts
106
+
107
+ - Runs in an isolated container (1 CPU, 5 GiB RAM, 5 GiB disk)
108
+ - No internet access (fully sandboxed)
109
+ - Python 3.11 with data science libraries pre-installed
110
+ - Containers persist for 30 days and can be reused across requests
111
+ - Free when used with web search/web fetch tools; otherwise $0.05/hour after 1,550 free hours/month per organization
112
+
113
+ ### Tool Definition
114
+
115
+ The tool requires no schema — just declare it in the `tools` array:
116
+
117
+ ```json
118
+ {
119
+ "type": "code_execution_20260120",
120
+ "name": "code_execution"
121
+ }
122
+ ```
123
+
124
+ Claude automatically gains access to `bash_code_execution` (run shell commands) and `text_editor_code_execution` (create/view/edit files).
125
+
126
+ ### Pre-installed Python Libraries
127
+
128
+ - **Data science**: pandas, numpy, scipy, scikit-learn, statsmodels
129
+ - **Visualization**: matplotlib, seaborn
130
+ - **File processing**: openpyxl, xlsxwriter, pillow, pypdf, pdfplumber, python-docx, python-pptx
131
+ - **Math**: sympy, mpmath
132
+ - **Utilities**: tqdm, python-dateutil, pytz, sqlite3
133
+
134
+ Additional packages can be installed at runtime via `pip install`.
135
+
136
+ ### Supported File Types for Upload
137
+
138
+ | Type | Extensions |
139
+ | ------ | ---------------------------------- |
140
+ | Data | CSV, Excel (.xlsx/.xls), JSON, XML |
141
+ | Images | JPEG, PNG, GIF, WebP |
142
+ | Text | .txt, .md, .py, .js, etc. |
143
+
144
+ ### Container Reuse
145
+
146
+ Reuse containers across requests to maintain state (files, installed packages, variables). Extract the `container_id` from the first response and pass it to subsequent requests.
147
+
148
+ ### Response Structure
149
+
150
+ The response contains interleaved text and tool result blocks:
151
+
152
+ - `text` — Claude's explanation
153
+ - `server_tool_use` — What Claude is doing
154
+ - `bash_code_execution_tool_result` — Code execution output (check `return_code` for success/failure)
155
+ - `text_editor_code_execution_tool_result` — File operation results
156
+
157
+ > **Security:** Always sanitize filenames with `os.path.basename()` / `path.basename()` before writing downloaded files to disk to prevent path traversal attacks. Write files to a dedicated output directory.
158
+
159
+ ---
160
+
161
+ ## Server-Side Tools: Web Search and Web Fetch
162
+
163
+ Web search and web fetch let Claude search the web and retrieve page content. They run server-side — just include the tool definitions and Claude handles queries, fetching, and result processing automatically.
164
+
165
+ ### Tool Definitions
166
+
167
+ ```json
168
+ [
169
+ { "type": "web_search_20260209", "name": "web_search" },
170
+ { "type": "web_fetch_20260209", "name": "web_fetch" }
171
+ ]
172
+ ```
173
+
174
+ ### Dynamic Filtering (Opus 4.6 / Sonnet 4.6)
175
+
176
+ The `web_search_20260209` and `web_fetch_20260209` versions support **dynamic filtering** — Claude writes and executes code to filter search results before they reach the context window, improving accuracy and token efficiency. Dynamic filtering is built into these tool versions and activates automatically; you do not need to separately declare the `code_execution` tool or pass any beta header.
177
+
178
+ ```json
179
+ {
180
+ "tools": [
181
+ { "type": "web_search_20260209", "name": "web_search" },
182
+ { "type": "web_fetch_20260209", "name": "web_fetch" }
183
+ ]
184
+ }
185
+ ```
186
+
187
+ Without dynamic filtering, the previous `web_search_20250305` version is also available.
188
+
189
+ > **Note:** Only include the standalone `code_execution` tool when your application needs code execution for its own purposes (data analysis, file processing, visualization) independent of web search. Including it alongside `_20260209` web tools creates a second execution environment that can confuse the model.
190
+
191
+ ---
192
+
193
+ ## Server-Side Tools: Programmatic Tool Calling
194
+
195
+ Programmatic tool calling lets Claude execute complex multi-tool workflows in code, keeping intermediate results out of the context window. Claude writes code that calls your tools directly, reducing token usage for multi-step operations.
196
+
197
+ For full documentation, use WebFetch:
198
+
199
+ - URL: `https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling`
200
+
201
+ ---
202
+
203
+ ## Server-Side Tools: Tool Search
204
+
205
+ The tool search tool lets Claude dynamically discover tools from large libraries without loading all definitions into the context window. Useful when you have many tools but only a few are relevant to any given query.
206
+
207
+ For full documentation, use WebFetch:
208
+
209
+ - URL: `https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool`
210
+
211
+ ---
212
+
213
+ ## Tool Use Examples
214
+
215
+ You can provide sample tool calls directly in your tool definitions to demonstrate usage patterns and reduce parameter errors. This helps Claude understand how to correctly format tool inputs, especially for tools with complex schemas.
216
+
217
+ For full documentation, use WebFetch:
218
+
219
+ - URL: `https://platform.claude.com/docs/en/agents-and-tools/tool-use/implement-tool-use`
220
+
221
+ ---
222
+
223
+ ## Server-Side Tools: Computer Use
224
+
225
+ Computer use lets Claude interact with a desktop environment (screenshots, mouse, keyboard). It can be Anthropic-hosted (server-side, like code execution) or self-hosted (you provide the environment and execute actions client-side).
226
+
227
+ For full documentation, use WebFetch:
228
+
229
+ - URL: `https://platform.claude.com/docs/en/agents-and-tools/computer-use/overview`
230
+
231
+ ---
232
+
233
+ ## Client-Side Tools: Memory
234
+
235
+ The memory tool enables Claude to store and retrieve information across conversations through a memory file directory. Claude can create, read, update, and delete files that persist between sessions.
236
+
237
+ ### Key Facts
238
+
239
+ - Client-side tool — you control storage via your implementation
240
+ - Supports commands: `view`, `create`, `str_replace`, `insert`, `delete`, `rename`
241
+ - Operates on files in a `/memories` directory
242
+ - The Python, TypeScript, and Java SDKs provide helper classes/functions for implementing the memory backend
243
+
244
+ > **Security:** Never store API keys, passwords, tokens, or other secrets in memory files. Be cautious with personally identifiable information (PII) — check data privacy regulations (GDPR, CCPA) before persisting user data. The reference implementations have no built-in access control; in multi-user systems, implement per-user memory directories and authentication in your tool handlers.
245
+
246
+ For full implementation examples, use WebFetch:
247
+
248
+ - Docs: `https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool.md`
249
+
250
+ ---
251
+
252
+ ## Structured Outputs
253
+
254
+ Structured outputs constrain Claude's responses to follow a specific JSON schema, guaranteeing valid, parseable output. This is not a separate tool — it enhances the Messages API response format and/or tool parameter validation.
255
+
256
+ Two features are available:
257
+
258
+ - **JSON outputs** (`output_config.format`): Control Claude's response format
259
+ - **Strict tool use** (`strict: true`): Guarantee valid tool parameter schemas
260
+
261
+ **Supported models:** Claude Opus 4.6, Claude Sonnet 4.6, and Claude Haiku 4.5. Legacy models (Claude Opus 4.5, Claude Opus 4.1) also support structured outputs.
262
+
263
+ > **Recommended:** Use `client.messages.parse()` which automatically validates responses against your schema. When using `messages.create()` directly, use `output_config: {format: {...}}`. The `output_format` convenience parameter is also accepted by some SDK methods (e.g., `.parse()`), but `output_config.format` is the canonical API-level parameter.
264
+
265
+ ### JSON Schema Limitations
266
+
267
+ **Supported:**
268
+
269
+ - Basic types: object, array, string, integer, number, boolean, null
270
+ - `enum`, `const`, `anyOf`, `allOf`, `$ref`/`$def`
271
+ - String formats: `date-time`, `time`, `date`, `duration`, `email`, `hostname`, `uri`, `ipv4`, `ipv6`, `uuid`
272
+ - `additionalProperties: false` (required for all objects)
273
+
274
+ **Not supported:**
275
+
276
+ - Recursive schemas
277
+ - Numerical constraints (`minimum`, `maximum`, `multipleOf`)
278
+ - String constraints (`minLength`, `maxLength`)
279
+ - Complex array constraints
280
+ - `additionalProperties` set to anything other than `false`
281
+
282
+ The Python and TypeScript SDKs automatically handle unsupported constraints by removing them from the schema sent to the API and validating them client-side.
283
+
284
+ ### Important Notes
285
+
286
+ - **First request latency**: New schemas incur a one-time compilation cost. Subsequent requests with the same schema use a 24-hour cache.
287
+ - **Refusals**: If Claude refuses for safety reasons (`stop_reason: "refusal"`), the output may not match your schema.
288
+ - **Token limits**: If `stop_reason: "max_tokens"`, output may be incomplete. Increase `max_tokens`.
289
+ - **Incompatible with**: Citations (returns 400 error), message prefilling.
290
+ - **Works with**: Batches API, streaming, token counting, extended thinking.
291
+
292
+ ---
293
+
294
+ ## Tips for Effective Tool Use
295
+
296
+ 1. **Provide detailed descriptions**: Claude relies heavily on descriptions to understand when and how to use tools
297
+ 2. **Use specific tool names**: `get_current_weather` is better than `weather`
298
+ 3. **Validate inputs**: Always validate tool inputs before execution
299
+ 4. **Handle errors gracefully**: Return informative error messages so Claude can adapt
300
+ 5. **Limit tool count**: Too many tools can confuse the model — keep the set focused
301
+ 6. **Test tool interactions**: Verify Claude uses tools correctly in various scenarios
302
+
303
+ For detailed tool use documentation, use WebFetch:
304
+
305
+ - URL: `https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview`
@@ -0,0 +1,296 @@
1
+ # Agent SDK — TypeScript
2
+
3
+ The Claude Agent SDK provides a higher-level interface for building AI agents with built-in tools, safety features, and agentic capabilities.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @anthropic-ai/claude-agent-sdk
9
+ ```
10
+
11
+ ---
12
+
13
+ ## Quick Start
14
+
15
+ ```typescript
16
+ import { query } from "@anthropic-ai/claude-agent-sdk";
17
+
18
+ for await (const message of query({
19
+ prompt: "Explain this codebase",
20
+ options: { allowedTools: ["Read", "Glob", "Grep"] },
21
+ })) {
22
+ if ("result" in message) {
23
+ console.log(message.result);
24
+ }
25
+ }
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Built-in Tools
31
+
32
+ | Tool | Description |
33
+ | --------- | ------------------------------------ |
34
+ | Read | Read files in the workspace |
35
+ | Write | Create new files |
36
+ | Edit | Make precise edits to existing files |
37
+ | Bash | Execute shell commands |
38
+ | Glob | Find files by pattern |
39
+ | Grep | Search files by content |
40
+ | WebSearch | Search the web for information |
41
+ | WebFetch | Fetch and analyze web pages |
42
+ | AskUserQuestion | Ask user clarifying questions |
43
+ | Agent | Spawn subagents |
44
+
45
+ ---
46
+
47
+ ## Permission System
48
+
49
+ ```typescript
50
+ for await (const message of query({
51
+ prompt: "Refactor the authentication module",
52
+ options: {
53
+ allowedTools: ["Read", "Edit", "Write"],
54
+ permissionMode: "acceptEdits",
55
+ },
56
+ })) {
57
+ if ("result" in message) console.log(message.result);
58
+ }
59
+ ```
60
+
61
+ Permission modes:
62
+
63
+ - `"default"`: Prompt for dangerous operations
64
+ - `"plan"`: Planning only, no execution
65
+ - `"acceptEdits"`: Auto-accept file edits
66
+ - `"dontAsk"`: Don't prompt — **denies** anything not pre-approved (not an auto-approve mode)
67
+ - `"bypassPermissions"`: Skip all prompts (requires `allowDangerouslySkipPermissions: true` in options)
68
+
69
+ ---
70
+
71
+ ## MCP (Model Context Protocol) Support
72
+
73
+ ```typescript
74
+ for await (const message of query({
75
+ prompt: "Open example.com and describe what you see",
76
+ options: {
77
+ mcpServers: {
78
+ playwright: { command: "npx", args: ["@playwright/mcp@latest"] },
79
+ },
80
+ },
81
+ })) {
82
+ if ("result" in message) console.log(message.result);
83
+ }
84
+ ```
85
+
86
+ ### In-Process MCP Tools
87
+
88
+ You can define custom tools that run in-process using `tool()` and `createSdkMcpServer`:
89
+
90
+ ```typescript
91
+ import { query, tool, createSdkMcpServer } from "@anthropic-ai/claude-agent-sdk";
92
+ import { z } from "zod";
93
+
94
+ const myTool = tool("my-tool", "Description", { input: z.string() }, async (args) => {
95
+ return { content: [{ type: "text", text: "result" }] };
96
+ });
97
+
98
+ const server = createSdkMcpServer({ name: "my-server", tools: [myTool] });
99
+
100
+ // Pass to query
101
+ for await (const message of query({
102
+ prompt: "Use my-tool to do something",
103
+ options: { mcpServers: { myServer: server } },
104
+ })) {
105
+ if ("result" in message) console.log(message.result);
106
+ }
107
+ ```
108
+
109
+ ---
110
+
111
+ ## Hooks
112
+
113
+ ```typescript
114
+ import { query, HookCallback } from "@anthropic-ai/claude-agent-sdk";
115
+ import { appendFileSync } from "fs";
116
+
117
+ const logFileChange: HookCallback = async (input) => {
118
+ const filePath = (input as any).tool_input?.file_path ?? "unknown";
119
+ appendFileSync(
120
+ "./audit.log",
121
+ `${new Date().toISOString()}: modified ${filePath}\n`,
122
+ );
123
+ return {};
124
+ };
125
+
126
+ for await (const message of query({
127
+ prompt: "Refactor utils.py to improve readability",
128
+ options: {
129
+ allowedTools: ["Read", "Edit", "Write"],
130
+ permissionMode: "acceptEdits",
131
+ hooks: {
132
+ PostToolUse: [{ matcher: "Edit|Write", hooks: [logFileChange] }],
133
+ },
134
+ },
135
+ })) {
136
+ if ("result" in message) console.log(message.result);
137
+ }
138
+ ```
139
+
140
+ Hook event inputs for tool-lifecycle events (`PreToolUse`, `PostToolUse`, `PostToolUseFailure`) include `agent_id` and `agent_type` fields, allowing hooks to identify which agent (main or subagent) triggered the tool call.
141
+
142
+ Available hook events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `Notification`, `UserPromptSubmit`, `SessionStart`, `SessionEnd`, `Stop`, `SubagentStart`, `SubagentStop`, `PreCompact`, `PermissionRequest`, `Setup`, `TeammateIdle`, `TaskCompleted`, `ConfigChange`, `Elicitation`, `ElicitationResult`, `WorktreeCreate`, `WorktreeRemove`, `InstructionsLoaded`
143
+
144
+ ---
145
+
146
+ ## Common Options
147
+
148
+ `query()` takes a top-level `prompt` (string) and an `options` object:
149
+
150
+ ```typescript
151
+ query({ prompt: "...", options: { ... } })
152
+ ```
153
+
154
+ | Option | Type | Description |
155
+ | ----------------------------------- | ------ | -------------------------------------------------------------------------- |
156
+ | `cwd` | string | Working directory for file operations |
157
+ | `allowedTools` | array | Tools the agent can use (e.g., `["Read", "Edit", "Bash"]`) |
158
+ | `tools` | array \| preset | Built-in tools to make available (`string[]` or `{type:'preset', preset:'claude_code'}`) |
159
+ | `disallowedTools` | array | Tools to explicitly disallow |
160
+ | `permissionMode` | string | How to handle permission prompts |
161
+ | `allowDangerouslySkipPermissions` | bool | Must be `true` to use `permissionMode: "bypassPermissions"` |
162
+ | `mcpServers` | object | MCP servers to connect to |
163
+ | `hooks` | object | Hooks for customizing behavior |
164
+ | `systemPrompt` | string \| preset | Custom system prompt (`string` or `{type:'preset', preset:'claude_code', append?:string}`) |
165
+ | `maxTurns` | number | Maximum agent turns before stopping |
166
+ | `maxBudgetUsd` | number | Maximum budget in USD for the query |
167
+ | `model` | string | Model ID (default: determined by CLI) |
168
+ | `agents` | object | Subagent definitions (`Record<string, AgentDefinition>`) |
169
+ | `outputFormat` | object | Structured output schema |
170
+ | `thinking` | object | Thinking/reasoning control |
171
+ | `betas` | array | Beta features to enable (e.g., `["context-1m-2025-08-07"]`) |
172
+ | `settingSources` | array | Settings to load (e.g., `["project"]`). Default: none (no CLAUDE.md files) |
173
+ | `env` | object | Environment variables to set for the session |
174
+ | `agentProgressSummaries` | bool | Enable periodic AI-generated progress summaries on `task_progress` events |
175
+
176
+ ---
177
+
178
+ ## Subagents
179
+
180
+ ```typescript
181
+ for await (const message of query({
182
+ prompt: "Use the code-reviewer agent to review this codebase",
183
+ options: {
184
+ allowedTools: ["Read", "Glob", "Grep", "Agent"],
185
+ agents: {
186
+ "code-reviewer": {
187
+ description: "Expert code reviewer for quality and security reviews.",
188
+ prompt: "Analyze code quality and suggest improvements.",
189
+ tools: ["Read", "Glob", "Grep"],
190
+ },
191
+ },
192
+ },
193
+ })) {
194
+ if ("result" in message) console.log(message.result);
195
+ }
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Message Types
201
+
202
+ ```typescript
203
+ for await (const message of query({
204
+ prompt: "Find TODO comments",
205
+ options: { allowedTools: ["Read", "Glob", "Grep"] },
206
+ })) {
207
+ if ("result" in message) {
208
+ console.log(message.result);
209
+ console.log(`Stop reason: ${message.stop_reason}`); // e.g., "end_turn", "tool_use", "max_tokens"
210
+ } else if (message.type === "system" && message.subtype === "init") {
211
+ const sessionId = message.session_id; // Capture for resuming later
212
+ }
213
+ }
214
+ ```
215
+
216
+ Task-related system messages are also emitted for subagent operations:
217
+ - `task_started` — emitted when a subagent task is registered
218
+ - `task_progress` — real-time progress updates with cumulative usage metrics, tool counts, and duration (enable `agentProgressSummaries` option for periodic AI-generated summaries via the `summary` field)
219
+ - `task_notification` — task completion notifications (includes `tool_use_id` for correlating with originating tool calls)
220
+
221
+ ---
222
+
223
+ ## Session History
224
+
225
+ Retrieve past session data:
226
+
227
+ ```typescript
228
+ import { listSessions, getSessionMessages, getSessionInfo } from "@anthropic-ai/claude-agent-sdk";
229
+
230
+ // List all past sessions (supports pagination via limit/offset)
231
+ const sessions = await listSessions({ limit: 20, offset: 0 });
232
+ for (const session of sessions) {
233
+ console.log(`${session.sessionId}: ${session.cwd} (tag: ${session.tag})`);
234
+ }
235
+
236
+ // Get metadata for a single session
237
+ const sessionId = sessions[0]?.sessionId;
238
+ const info = await getSessionInfo(sessionId);
239
+ console.log(info.tag, info.createdAt);
240
+
241
+ // Get messages from a specific session (supports pagination via limit/offset)
242
+ const messages = await getSessionMessages(sessionId, { limit: 50, offset: 0 });
243
+ for (const msg of messages) {
244
+ console.log(msg);
245
+ }
246
+ ```
247
+
248
+ ### Session Mutations
249
+
250
+ Rename, tag, or fork sessions:
251
+
252
+ ```typescript
253
+ import { renameSession, tagSession, forkSession } from "@anthropic-ai/claude-agent-sdk";
254
+
255
+ // Rename a session
256
+ await renameSession(sessionId, "My refactoring session");
257
+
258
+ // Tag a session
259
+ await tagSession(sessionId, "experiment");
260
+
261
+ // Clear a tag
262
+ await tagSession(sessionId, null);
263
+
264
+ // Fork a session — branch a conversation from a specific point
265
+ const { sessionId: forkedId } = await forkSession(sessionId);
266
+ ```
267
+
268
+ ---
269
+
270
+ ## MCP Server Management
271
+
272
+ Manage MCP servers at runtime on a running query:
273
+
274
+ ```typescript
275
+ // Reconnect a disconnected MCP server
276
+ await queryHandle.reconnectMcpServer("my-server");
277
+
278
+ // Toggle an MCP server on/off
279
+ await queryHandle.toggleMcpServer("my-server", false); // (name, enabled) — both required
280
+
281
+ // Get status of ALL configured MCP servers — returns an ARRAY
282
+ const statuses: McpServerStatus[] = await queryHandle.mcpServerStatus();
283
+ for (const s of statuses) {
284
+ console.log(s.name, s.scope, s.tools.length, s.error);
285
+ }
286
+ ```
287
+
288
+ ---
289
+
290
+ ## Best Practices
291
+
292
+ 1. **Always specify allowedTools** — Explicitly list which tools the agent can use
293
+ 2. **Set working directory** — Always specify `cwd` for file operations
294
+ 3. **Use appropriate permission modes** — Start with `"default"` and only escalate when needed
295
+ 4. **Handle all message types** — Check for `result` property to get agent output
296
+ 5. **Limit maxTurns** — Prevent runaway agents with reasonable limits