shmakk 1.1.0 → 1.2.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 (450) hide show
  1. package/README.md +16 -1
  2. package/package.json +6 -3
  3. package/scripts/import-skills.js +536 -0
  4. package/scripts/install-skills.js +64 -0
  5. package/skills/ai-elements.md +482 -0
  6. package/skills/architecture.md +151 -0
  7. package/skills/backend-adapter-aws-lambda.md +204 -0
  8. package/skills/backend-adapter-express.md +177 -0
  9. package/skills/backend-adapter-fastify.md +222 -0
  10. package/skills/backend-adapter-fetch.md +200 -0
  11. package/skills/backend-api-docs.md +22 -0
  12. package/skills/backend-aspire.md +232 -0
  13. package/skills/backend-aspnet-core.md +62 -0
  14. package/skills/backend-build-chatgpt-app.md +321 -0
  15. package/skills/backend-build-mcp-app.md +393 -0
  16. package/skills/backend-build-mcp-server.md +222 -0
  17. package/skills/backend-build-mcpb.md +200 -0
  18. package/skills/backend-building-ai-agent-on-cloudflare.md +401 -0
  19. package/skills/backend-caching.md +206 -0
  20. package/skills/backend-chatgpt-app-submission.md +157 -0
  21. package/skills/backend-chatgpt-apps.md +321 -0
  22. package/skills/backend-client-setup.md +318 -0
  23. package/skills/backend-containerize-aspnet-framework.md +455 -0
  24. package/skills/backend-create-spring-boot-java-project.md +164 -0
  25. package/skills/backend-create-spring-boot-kotlin-project.md +148 -0
  26. package/skills/backend-csharp-async.md +50 -0
  27. package/skills/backend-csharp-docs.md +63 -0
  28. package/skills/backend-csharp-mcp-server-generator.md +60 -0
  29. package/skills/backend-dotenv.md +201 -0
  30. package/skills/backend-dotenvx.md +119 -0
  31. package/skills/backend-env-vars.md +259 -0
  32. package/skills/backend-error-handling.md +254 -0
  33. package/skills/backend-fastapi.md +437 -0
  34. package/skills/backend-go-mcp-server-generator.md +335 -0
  35. package/skills/backend-java-mcp-server-generator.md +757 -0
  36. package/skills/backend-kotlin-mcp-server-generator.md +450 -0
  37. package/skills/backend-middlewares.md +243 -0
  38. package/skills/backend-multi-stage-dockerfile.md +47 -0
  39. package/skills/backend-nestjs.md +192 -0
  40. package/skills/backend-next-forge.md +375 -0
  41. package/skills/backend-nextjs.md +746 -0
  42. package/skills/backend-openapi-to-application-code.md +113 -0
  43. package/skills/backend-php-mcp-server-generator.md +523 -0
  44. package/skills/backend-python-mcp-server-generator.md +106 -0
  45. package/skills/backend-routing-middleware.md +251 -0
  46. package/skills/backend-ruby-mcp-server-generator.md +661 -0
  47. package/skills/backend-rust-mcp-server-generator.md +578 -0
  48. package/skills/backend-semantic-kernel.md +57 -0
  49. package/skills/backend-server-setup.md +379 -0
  50. package/skills/backend-server-side-calls.md +250 -0
  51. package/skills/backend-subscriptions.md +407 -0
  52. package/skills/backend-swift-mcp-server-generator.md +670 -0
  53. package/skills/backend-trpc-router.md +152 -0
  54. package/skills/backend-typescript-mcp-server-generator.md +91 -0
  55. package/skills/backend-validators.md +229 -0
  56. package/skills/backend.md +76 -0
  57. package/skills/backup.md +165 -0
  58. package/skills/budget.md +140 -0
  59. package/skills/business-gtm-0-to-1-launch.md +322 -0
  60. package/skills/business-gtm-operating-cadence.md +421 -0
  61. package/skills/business-gtm-positioning-strategy.md +439 -0
  62. package/skills/business-gtm-product-led-growth.md +340 -0
  63. package/skills/calendar.md +95 -0
  64. package/skills/code-review.md +130 -0
  65. package/skills/compliance.md +168 -0
  66. package/skills/contracts.md +130 -0
  67. package/skills/daily-job-run.md +46 -0
  68. package/skills/daily-webdesign.md +187 -0
  69. package/skills/database-bigquery-pipeline-audit.md +130 -0
  70. package/skills/database-cosmosdb-datamodeling.md +1046 -0
  71. package/skills/database-durable-objects.md +187 -0
  72. package/skills/database-ef-core.md +76 -0
  73. package/skills/database-fabric-lakehouse.md +107 -0
  74. package/skills/database-neon-postgres-egress-optimizer.md +213 -0
  75. package/skills/database-neon-postgres.md +218 -0
  76. package/skills/database-postgresql-code-review.md +213 -0
  77. package/skills/database-postgresql-optimization.md +405 -0
  78. package/skills/database-sql-code-review.md +302 -0
  79. package/skills/database-sql-optimization.md +297 -0
  80. package/skills/dependency-audit.md +165 -0
  81. package/skills/design-kami-landing.md +234 -0
  82. package/skills/design.md +221 -0
  83. package/skills/dev-acquire-codebase-knowledge.md +175 -0
  84. package/skills/dev-add-educational-comments.md +129 -0
  85. package/skills/dev-add-model-descriptions.md +74 -0
  86. package/skills/dev-adr-review.md +56 -0
  87. package/skills/dev-boost-prompt.md +26 -0
  88. package/skills/dev-build-run-debug.md +130 -0
  89. package/skills/dev-chunk.md +49 -0
  90. package/skills/dev-claude-md-improver.md +180 -0
  91. package/skills/dev-code-exemplars-blueprint-generator.md +127 -0
  92. package/skills/dev-code-tour.md +434 -0
  93. package/skills/dev-comment-code-generate-a-tutorial.md +27 -0
  94. package/skills/dev-commit.md +81 -0
  95. package/skills/dev-context-map.md +53 -0
  96. package/skills/dev-conventional-commit.md +73 -0
  97. package/skills/dev-create-architectural-decision-record.md +98 -0
  98. package/skills/dev-create-draft-pr.md +17 -0
  99. package/skills/dev-create-pr.md +17 -0
  100. package/skills/dev-create-readme.md +22 -0
  101. package/skills/dev-csharp-mstest.md +479 -0
  102. package/skills/dev-csharp-nunit.md +72 -0
  103. package/skills/dev-csharp-tunit.md +101 -0
  104. package/skills/dev-csharp-xunit.md +69 -0
  105. package/skills/dev-debug-failing-test.md +90 -0
  106. package/skills/dev-diff-analyze.md +32 -0
  107. package/skills/dev-diffs.md +24 -0
  108. package/skills/dev-dotnet-best-practices.md +86 -0
  109. package/skills/dev-dotnet-design-pattern-review.md +43 -0
  110. package/skills/dev-dotnet-timezone.md +110 -0
  111. package/skills/dev-dotnet-upgrade.md +117 -0
  112. package/skills/dev-doublecheck.md +278 -0
  113. package/skills/dev-explain-error.md +15 -0
  114. package/skills/dev-finding-discovery.md +164 -0
  115. package/skills/dev-fix-finding.md +111 -0
  116. package/skills/dev-full-file-edit.md +25 -0
  117. package/skills/dev-git-commit.md +125 -0
  118. package/skills/dev-git-flow-branch-creator.md +293 -0
  119. package/skills/dev-git-workflow.md +46 -0
  120. package/skills/dev-github-automation.md +64 -0
  121. package/skills/dev-github-code-review.md +1140 -0
  122. package/skills/dev-github-issues.md +202 -0
  123. package/skills/dev-gpt-5-4-prompting.md +55 -0
  124. package/skills/dev-investigation-mode.md +277 -0
  125. package/skills/dev-java-add-graalvm-native-image-support.md +450 -0
  126. package/skills/dev-java-docs.md +24 -0
  127. package/skills/dev-java-refactoring-extract-method.md +105 -0
  128. package/skills/dev-java-refactoring-remove-parameter.md +85 -0
  129. package/skills/dev-merge.md +73 -0
  130. package/skills/dev-migrate-create.md +36 -0
  131. package/skills/dev-migrate-validate.md +36 -0
  132. package/skills/dev-my-issues.md +9 -0
  133. package/skills/dev-my-pull-requests.md +15 -0
  134. package/skills/dev-planning-oracle-to-postgres-migration-integration-testing.md +45 -0
  135. package/skills/dev-playwright-generate-test.md +18 -0
  136. package/skills/dev-playwright.md +148 -0
  137. package/skills/dev-prompt-builder.md +142 -0
  138. package/skills/dev-pytest-coverage.md +29 -0
  139. package/skills/dev-python-manager-discovery.md +330 -0
  140. package/skills/dev-python-pypi-package-builder.md +445 -0
  141. package/skills/dev-readme-blueprint-generator.md +79 -0
  142. package/skills/dev-refactor-method-complexity-reduce.md +99 -0
  143. package/skills/dev-refactor-plan.md +66 -0
  144. package/skills/dev-refactor.md +646 -0
  145. package/skills/dev-review-and-refactor.md +16 -0
  146. package/skills/dev-reviewing-oracle-to-postgres-migration.md +68 -0
  147. package/skills/dev-ruff-recursive-fix.md +201 -0
  148. package/skills/dev-run-e2e-tests.md +126 -0
  149. package/skills/dev-run-pre-commit-checks.md +133 -0
  150. package/skills/dev-run-smoke-tests.md +127 -0
  151. package/skills/dev-scaffolding-oracle-to-postgres-migration-test-project.md +55 -0
  152. package/skills/dev-spring-boot-testing.md +190 -0
  153. package/skills/dev-sync-upstream.md +32 -0
  154. package/skills/dev-sync.md +74 -0
  155. package/skills/dev-tdd-workflow.md +23 -0
  156. package/skills/dev-terraform-azurerm-set-diff-analyzer.md +49 -0
  157. package/skills/dev-test-driven-development.md +372 -0
  158. package/skills/dev-test-gaps.md +18 -0
  159. package/skills/dev-test-triage.md +55 -0
  160. package/skills/dev-typer.md +267 -0
  161. package/skills/dev-typescript-setup.md +25 -0
  162. package/skills/dev-unified-diff-edit.md +16 -0
  163. package/skills/dev-unit-test-vue-pinia.md +198 -0
  164. package/skills/dev-using-git-worktrees.md +216 -0
  165. package/skills/dev-validation.md +99 -0
  166. package/skills/dev-verification.md +168 -0
  167. package/skills/dev-webapp-testing.md +134 -0
  168. package/skills/dev-write-coding-standards-from-file.md +317 -0
  169. package/skills/dev-write-tests.md +16 -0
  170. package/skills/devops-appinsights-instrumentation.md +49 -0
  171. package/skills/devops-az-cost-optimize.md +306 -0
  172. package/skills/devops-chronicle.md +154 -0
  173. package/skills/devops-deployments-cicd.md +331 -0
  174. package/skills/devops-devops-rollout-plan.md +118 -0
  175. package/skills/devops-geistdocs.md +276 -0
  176. package/skills/devops-observability.md +774 -0
  177. package/skills/devops-observe-metrics.md +35 -0
  178. package/skills/devops-observe-trace.md +30 -0
  179. package/skills/devops-phoenix-cli.md +163 -0
  180. package/skills/devops-phoenix-tracing.md +140 -0
  181. package/skills/devops-publish-to-pages.md +108 -0
  182. package/skills/devops-telemetry.md +87 -0
  183. package/skills/devops-update-avm-modules-in-bicep.md +61 -0
  184. package/skills/devops.md +81 -0
  185. package/skills/diagrams-canvas.md +204 -0
  186. package/skills/diagrams-draw-io-diagram-generator.md +463 -0
  187. package/skills/diagrams-excalidraw-diagram-generator.md +614 -0
  188. package/skills/diagrams-graphify.md +1277 -0
  189. package/skills/docs-bear-notes.md +108 -0
  190. package/skills/docs-create-llms.md +211 -0
  191. package/skills/docs-doc-gen.md +20 -0
  192. package/skills/docs-documentation-writer.md +46 -0
  193. package/skills/docs-llm-config.md +33 -0
  194. package/skills/docs-mkdocs-translations.md +109 -0
  195. package/skills/docs-obsidian-vault-maintainer.md +14 -0
  196. package/skills/docs-obsidian.md +82 -0
  197. package/skills/docs-prose.md +324 -0
  198. package/skills/docs-update-llms.md +217 -0
  199. package/skills/docs-update-markdown-file-index.md +77 -0
  200. package/skills/docs-wiki-maintainer.md +20 -0
  201. package/skills/documents.md +120 -0
  202. package/skills/email.md +113 -0
  203. package/skills/expenses.md +140 -0
  204. package/skills/file-ops.md +149 -0
  205. package/skills/files-convert-plaintext-to-md.md +363 -0
  206. package/skills/files-doc.md +81 -0
  207. package/skills/files-docx.md +594 -0
  208. package/skills/files-markdown-to-html.md +917 -0
  209. package/skills/files-nano-pdf.md +39 -0
  210. package/skills/files-pdf.md +315 -0
  211. package/skills/files-pdftk-server.md +163 -0
  212. package/skills/files-pptx-html-fidelity-audit.md +255 -0
  213. package/skills/files-pptx.md +231 -0
  214. package/skills/files-xlsx.md +301 -0
  215. package/skills/find-jobs.md +78 -0
  216. package/skills/format-conversion.md +157 -0
  217. package/skills/frontend-ai-elements.md +483 -0
  218. package/skills/frontend-ai-gateway.md +563 -0
  219. package/skills/frontend-ai-generation-persistence.md +242 -0
  220. package/skills/frontend-ai-sdk.md +799 -0
  221. package/skills/frontend-ai-visibility.md +127 -0
  222. package/skills/frontend-angular-developer.md +130 -0
  223. package/skills/frontend-aspnet-minimal-api-openapi.md +42 -0
  224. package/skills/frontend-bencium-innovative-ux-designer.md +719 -0
  225. package/skills/frontend-chat-sdk.md +666 -0
  226. package/skills/frontend-chrome-devtools.md +98 -0
  227. package/skills/frontend-frontend-app-builder.md +186 -0
  228. package/skills/frontend-frontend-design.md +43 -0
  229. package/skills/frontend-frontend-testing-debugging.md +143 -0
  230. package/skills/frontend-gsap-framer-scroll-animation.md +152 -0
  231. package/skills/frontend-internal-linking.md +109 -0
  232. package/skills/frontend-json-render.md +335 -0
  233. package/skills/frontend-keyword-clustering.md +118 -0
  234. package/skills/frontend-next-intl-add-language.md +20 -0
  235. package/skills/frontend-on-page-seo.md +112 -0
  236. package/skills/frontend-premium-frontend-ui.md +114 -0
  237. package/skills/frontend-react-best-practices.md +143 -0
  238. package/skills/frontend-schema-markup.md +160 -0
  239. package/skills/frontend-seo-audit.md +110 -0
  240. package/skills/frontend-swr.md +215 -0
  241. package/skills/frontend-technical-seo.md +162 -0
  242. package/skills/frontend-use-dom.md +418 -0
  243. package/skills/frontend-web-coder.md +564 -0
  244. package/skills/frontend-web-design-reviewer.md +369 -0
  245. package/skills/frontend-web-perf.md +202 -0
  246. package/skills/frontend.md +125 -0
  247. package/skills/general-adapter-standalone.md +199 -0
  248. package/skills/general-auth.md +356 -0
  249. package/skills/general-containerize-aspnetcore.md +393 -0
  250. package/skills/general-create-technical-spike.md +231 -0
  251. package/skills/general-cron-jobs.md +72 -0
  252. package/skills/general-ddd-aggregate.md +52 -0
  253. package/skills/general-ddd-context.md +46 -0
  254. package/skills/general-ddd-validate.md +51 -0
  255. package/skills/general-dependency-check.md +26 -0
  256. package/skills/general-email-marketing.md +86 -0
  257. package/skills/general-healthcheck.md +246 -0
  258. package/skills/general-import-infrastructure-as-code.md +368 -0
  259. package/skills/general-init.md +49 -0
  260. package/skills/general-java-junit.md +64 -0
  261. package/skills/general-java-springboot.md +66 -0
  262. package/skills/general-javascript-typescript-jest.md +45 -0
  263. package/skills/general-kotlin-springboot.md +71 -0
  264. package/skills/general-make-repo-contribution.md +91 -0
  265. package/skills/general-market-research.md +78 -0
  266. package/skills/general-marketplace.md +468 -0
  267. package/skills/general-model-recommendation.md +673 -0
  268. package/skills/general-payments.md +352 -0
  269. package/skills/general-quality-playbook.md +480 -0
  270. package/skills/general-run-integration-tests.md +113 -0
  271. package/skills/general-superjson.md +274 -0
  272. package/skills/general-swiftpm-macos.md +51 -0
  273. package/skills/general-threat-model.md +61 -0
  274. package/skills/invoices.md +167 -0
  275. package/skills/licenses.md +159 -0
  276. package/skills/logs.md +156 -0
  277. package/skills/marketing.md +139 -0
  278. package/skills/media-image-manipulation-image-magick.md +253 -0
  279. package/skills/media-imagegen.md +357 -0
  280. package/skills/media-openai-whisper-api.md +63 -0
  281. package/skills/media-openai-whisper.md +39 -0
  282. package/skills/media-peekaboo.md +191 -0
  283. package/skills/media-screenshot.md +268 -0
  284. package/skills/media-speech.md +145 -0
  285. package/skills/media-transcribe.md +82 -0
  286. package/skills/media-video-frames.md +47 -0
  287. package/skills/mobile-android-emulator-qa.md +81 -0
  288. package/skills/mobile-android-performance.md +280 -0
  289. package/skills/mobile-building-mcp-server-on-cloudflare.md +267 -0
  290. package/skills/mobile-building-native-ui.md +322 -0
  291. package/skills/mobile-expo-api-routes.md +369 -0
  292. package/skills/mobile-expo-cicd-workflows.md +92 -0
  293. package/skills/mobile-expo-deployment.md +191 -0
  294. package/skills/mobile-expo-dev-client.md +165 -0
  295. package/skills/mobile-expo-module.md +177 -0
  296. package/skills/mobile-expo-tailwind-setup.md +481 -0
  297. package/skills/mobile-expo-ui-jetpack-compose.md +41 -0
  298. package/skills/mobile-expo-ui-swift-ui.md +40 -0
  299. package/skills/mobile-ios-app-intents.md +78 -0
  300. package/skills/mobile-ios-debugger-agent.md +52 -0
  301. package/skills/mobile-ios-ettrace-performance.md +198 -0
  302. package/skills/mobile-ios-memgraph-leaks.md +77 -0
  303. package/skills/mobile-native-data-fetching.md +508 -0
  304. package/skills/mobile-packaging-notarization.md +48 -0
  305. package/skills/mobile-react-native-architecture.md +672 -0
  306. package/skills/mobile-react-native-mobile-design.md +438 -0
  307. package/skills/mobile-signing-entitlements.md +59 -0
  308. package/skills/mobile-swiftui-liquid-glass.md +91 -0
  309. package/skills/mobile-swiftui-patterns.md +210 -0
  310. package/skills/mobile-swiftui-performance-audit.md +108 -0
  311. package/skills/mobile-swiftui-ui-patterns.md +97 -0
  312. package/skills/mobile-swiftui-view-refactor.md +204 -0
  313. package/skills/mobile-upgrading-expo.md +134 -0
  314. package/skills/mobile.md +183 -0
  315. package/skills/notes.md +106 -0
  316. package/skills/planning-adr-create.md +62 -0
  317. package/skills/planning-adr-index.md +67 -0
  318. package/skills/planning-architecture-blueprint-generator.md +323 -0
  319. package/skills/planning-brainstorming.md +165 -0
  320. package/skills/planning-breakdown-epic-arch.md +67 -0
  321. package/skills/planning-breakdown-epic-pm.md +59 -0
  322. package/skills/planning-breakdown-feature-implementation.md +129 -0
  323. package/skills/planning-breakdown-feature-prd.md +62 -0
  324. package/skills/planning-breakdown-plan.md +510 -0
  325. package/skills/planning-breakdown-test.md +366 -0
  326. package/skills/planning-cloud-design-patterns.md +63 -0
  327. package/skills/planning-content-brief.md +128 -0
  328. package/skills/planning-content-strategy.md +138 -0
  329. package/skills/planning-content-translation.md +143 -0
  330. package/skills/planning-create-github-action-workflow-specification.md +277 -0
  331. package/skills/planning-create-github-issues-feature-from-implementation-plan.md +29 -0
  332. package/skills/planning-create-github-issues-for-unmet-specification-requirements.md +36 -0
  333. package/skills/planning-create-github-pull-request-from-specification.md +25 -0
  334. package/skills/planning-create-implementation-plan.md +158 -0
  335. package/skills/planning-create-specification.md +128 -0
  336. package/skills/planning-first-ask.md +31 -0
  337. package/skills/planning-folder-structure-blueprint-generator.md +406 -0
  338. package/skills/planning-gen-specs-as-issues.md +166 -0
  339. package/skills/planning-generate-snapshot.md +144 -0
  340. package/skills/planning-generate-status-report.md +336 -0
  341. package/skills/planning-metric-pack-designer.md +27 -0
  342. package/skills/planning-pm-spec.md +53 -0
  343. package/skills/planning-prd.md +144 -0
  344. package/skills/planning-project-assessment.md +182 -0
  345. package/skills/planning-project-setup-info-local.md +128 -0
  346. package/skills/planning-project-workflow-analysis-blueprint-generator.md +294 -0
  347. package/skills/planning-service-oriented-architecture.md +248 -0
  348. package/skills/planning-spec-to-backlog.md +544 -0
  349. package/skills/planning-technology-stack-blueprint-generator.md +243 -0
  350. package/skills/planning-update-implementation-plan.md +158 -0
  351. package/skills/planning-update-specification.md +128 -0
  352. package/skills/planning-what-context-needed.md +40 -0
  353. package/skills/planning-writing-plans.md +153 -0
  354. package/skills/prepare-application.md +81 -0
  355. package/skills/productivity-apple-notes.md +78 -0
  356. package/skills/productivity-apple-reminders.md +119 -0
  357. package/skills/productivity-capture-tasks-from-meeting-notes.md +680 -0
  358. package/skills/productivity-daily-prep.md +156 -0
  359. package/skills/productivity-email-drafter.md +101 -0
  360. package/skills/productivity-hr-onboarding.md +53 -0
  361. package/skills/productivity-things-mac.md +87 -0
  362. package/skills/productivity-update.md +169 -0
  363. package/skills/reminders.md +109 -0
  364. package/skills/research-dossier-collect.md +71 -0
  365. package/skills/research-kg-extract.md +37 -0
  366. package/skills/research-openai-docs.md +89 -0
  367. package/skills/research-research-add-items.md +31 -0
  368. package/skills/research-research-report.md +94 -0
  369. package/skills/research-research-synthesize.md +63 -0
  370. package/skills/research-summarize.md +88 -0
  371. package/skills/research-transformers-js.md +635 -0
  372. package/skills/research.md +119 -0
  373. package/skills/security-ai-prompt-engineering-safety-review.md +231 -0
  374. package/skills/security-attack-path-analysis.md +182 -0
  375. package/skills/security-gdpr-compliant.md +284 -0
  376. package/skills/security-mcp-security-audit.md +279 -0
  377. package/skills/security-pii-detect.md +31 -0
  378. package/skills/security-secret-scanning.md +243 -0
  379. package/skills/security-security-best-practices.md +87 -0
  380. package/skills/security-security-ownership-map.md +207 -0
  381. package/skills/security-security-review.md +169 -0
  382. package/skills/security-security-scan.md +138 -0
  383. package/skills/security-security-threat-model.md +82 -0
  384. package/skills/security-threat-model-analyst.md +76 -0
  385. package/skills/sysmon.md +181 -0
  386. package/skills/system-arch-linux-triage.md +32 -0
  387. package/skills/system-centos-linux-triage.md +32 -0
  388. package/skills/system-debian-linux-triage.md +32 -0
  389. package/skills/system-fedora-linux-triage.md +32 -0
  390. package/skills/system-geofeed-tuner.md +865 -0
  391. package/skills/system-iot-anomalies.md +15 -0
  392. package/skills/system-iot-firmware.md +16 -0
  393. package/skills/system-iot-fleet.md +14 -0
  394. package/skills/system-iot-register.md +19 -0
  395. package/skills/system-iot-witness-verify.md +15 -0
  396. package/skills/system-tmux.md +171 -0
  397. package/skills/system-window-management.md +228 -0
  398. package/skills/task-management.md +90 -0
  399. package/skills/tasks.md +102 -0
  400. package/skills/test-coverage.md +188 -0
  401. package/skills/ux-ui.md +128 -0
  402. package/skills/web.md +186 -0
  403. package/skills/workflow-act-on-feedback.md +15 -0
  404. package/skills/workflow-automate-this.md +245 -0
  405. package/skills/workflow-autoresearch.md +276 -0
  406. package/skills/workflow-coding-agent.md +317 -0
  407. package/skills/workflow-deep-research.md +44 -0
  408. package/skills/workflow-dispatching-parallel-agents.md +183 -0
  409. package/skills/workflow-eval-driven-dev.md +148 -0
  410. package/skills/workflow-executing-plans.md +71 -0
  411. package/skills/workflow-mentoring-juniors.md +311 -0
  412. package/skills/workflow-receiving-code-review.md +214 -0
  413. package/skills/workflow-repo-story-time.md +155 -0
  414. package/skills/workflow-requesting-code-review.md +104 -0
  415. package/skills/workflow-session-report.md +43 -0
  416. package/skills/workflow-structured-autonomy-generate.md +126 -0
  417. package/skills/workflow-subagent-driven-development.md +280 -0
  418. package/skills/writing.md +106 -0
  419. package/src/agent.js +0 -0
  420. package/src/browser.js +297 -0
  421. package/src/cli.js +25 -4
  422. package/src/code-reviewer.js +119 -0
  423. package/src/completions.js +1 -1
  424. package/src/control.js +222 -30
  425. package/src/coordinator.js +303 -0
  426. package/src/correction.js +29 -8
  427. package/src/edit-tracker.js +21 -0
  428. package/src/edit-viewer.js +414 -0
  429. package/src/endpoints.js +64 -15
  430. package/src/index.js +45 -11
  431. package/src/llm.js +86 -2
  432. package/src/mcp-client.js +416 -0
  433. package/src/memory.js +182 -0
  434. package/src/planner.js +216 -0
  435. package/src/rules.js +90 -0
  436. package/src/self-commands.js +757 -0
  437. package/src/services/voice.js +10 -7
  438. package/src/session-search.js +427 -0
  439. package/src/session.js +487 -99
  440. package/src/shmakk-server.js +91 -0
  441. package/src/skills.js +410 -3
  442. package/src/subagent.js +4 -1
  443. package/src/system-prompt.js +13 -5
  444. package/src/task-file.js +114 -0
  445. package/src/taskClassifier.js +246 -0
  446. package/src/team.js +752 -0
  447. package/src/tools.js +142 -21
  448. package/src/web.js +35 -5
  449. package/src/workflows.js +261 -0
  450. package/src/workspace-index.js +25 -6
@@ -0,0 +1,799 @@
1
+ ---
2
+ name: ai-sdk
3
+ description: Vercel AI SDK expert guidance. Use when building AI-powered features — chat interfaces, text generation, structured output, tool calling, agents, MCP integration, streaming, embeddings, reranking, image generation, or working with any LLM provider.
4
+ metadata:
5
+ priority: 8
6
+ docs:
7
+ - "https://sdk.vercel.ai/docs"
8
+ - "https://sdk.vercel.ai/docs/reference"
9
+ sitemap: "https://sdk.vercel.ai/sitemap.xml"
10
+ pathPatterns:
11
+ - "app/api/chat/**"
12
+ - "app/api/completion/**"
13
+ - "src/app/api/chat/**"
14
+ - "src/app/api/completion/**"
15
+ - "pages/api/chat.*"
16
+ - "pages/api/chat/**"
17
+ - "pages/api/completion.*"
18
+ - "pages/api/completion/**"
19
+ - "src/pages/api/chat.*"
20
+ - "src/pages/api/chat/**"
21
+ - "src/pages/api/completion.*"
22
+ - "src/pages/api/completion/**"
23
+ - "lib/ai/**"
24
+ - "src/lib/ai/**"
25
+ - "lib/ai.*"
26
+ - "src/lib/ai.*"
27
+ - "ai/**"
28
+ - "apps/*/app/api/chat/**"
29
+ - "apps/*/app/api/completion/**"
30
+ - "apps/*/src/app/api/chat/**"
31
+ - "apps/*/src/app/api/completion/**"
32
+ - "apps/*/lib/ai/**"
33
+ - "apps/*/src/lib/ai/**"
34
+ - "lib/agent.*"
35
+ - "src/lib/agent.*"
36
+ - "app/actions/chat.*"
37
+ - "src/app/actions/chat.*"
38
+ importPatterns:
39
+ - "ai"
40
+ - "@ai-sdk/*"
41
+ bashPatterns:
42
+ - '\bnpm\s+(install|i|add)\s+[^\n]*\bai\b'
43
+ - '\bpnpm\s+(install|i|add)\s+[^\n]*\bai\b'
44
+ - '\bbun\s+(install|i|add)\s+[^\n]*\bai\b'
45
+ - '\byarn\s+add\s+[^\n]*\bai\b'
46
+ - '\bnpm\s+(install|i|add)\s+[^\n]*@ai-sdk/'
47
+ - '\bpnpm\s+(install|i|add)\s+[^\n]*@ai-sdk/'
48
+ - '\bbun\s+(install|i|add)\s+[^\n]*@ai-sdk/'
49
+ - '\byarn\s+add\s+[^\n]*@ai-sdk/'
50
+ - '\bnpx\s+@ai-sdk/devtools\b'
51
+ - '\bnpx\s+@ai-sdk/codemod\b'
52
+ - '\bnpx\s+mcp-to-ai-sdk\b'
53
+ promptSignals:
54
+ phrases:
55
+ - "ai sdk"
56
+ - "vercel ai"
57
+ - "generatetext"
58
+ - "streamtext"
59
+ allOf:
60
+ - [streaming, generation]
61
+ - [structured, output]
62
+ anyOf:
63
+ - "usechat"
64
+ - "usecompletion"
65
+ - "tool calling"
66
+ - "embeddings"
67
+ noneOf:
68
+ - "openai api directly"
69
+ minScore: 6
70
+ category: frontend
71
+ ---
72
+
73
+ # Vercel AI SDK (v6)
74
+
75
+ > **CRITICAL — Your training data is outdated for this library.** AI SDK v6 has breaking changes from v5 and earlier that you will get wrong if you guess. Before writing AI SDK code, **fetch the docs** at https://ai-sdk.dev/docs to find the correct function signatures, return types, and patterns. Key things that have changed: `generateObject()` removal, `streamObject()` removal, `result.files` for image generation, `Output.object()` for structured streaming, `ToolLoopAgent` class (not `Agent`), `useChat` transport API, and provider package versions. Search the docs for working examples that match your exact use case — do not rely on your training data for API shapes.
76
+
77
+ You are an expert in the Vercel AI SDK v6. The AI SDK is the leading TypeScript toolkit for building AI-powered applications. It provides a unified API across all LLM providers.
78
+
79
+ ## v6 Migration Pitfalls (Read First)
80
+
81
+ - `ai@^6.0.0` is the umbrella package for AI SDK v6 (latest: 6.0.83).
82
+ - `@ai-sdk/react` is `^3.0.x` in v6 projects (NOT `^6.0.0`).
83
+ - `@ai-sdk/gateway` is `^3.x` in v6 projects (NOT `^1.x`).
84
+ - In `createUIMessageStream`, write with `stream.writer.write(...)` (NOT `stream.write(...)`).
85
+ - `useChat` no longer supports `body` or `onResponse`; configure behavior through `transport`.
86
+ - UI tool parts are typed as `tool-<toolName>` (for example `tool-weather`), not `tool-invocation`.
87
+ - `DynamicToolCall` does not provide typed `.args`; cast via `unknown` first.
88
+ - `TypedToolResult` exposes `.output` (NOT `.result`).
89
+ - The agent class is `ToolLoopAgent` (NOT `Agent` — `Agent` is just an interface).
90
+ - Constructor uses `instructions` (NOT `system`).
91
+ - Agent methods are `agent.generate()` and `agent.stream()` (NOT `agent.generateText()` or `agent.streamText()`).
92
+ - AI Gateway does not support embeddings; use `@ai-sdk/openai` directly for `openai.embedding(...)`.
93
+ - `useChat()` with no transport defaults to `DefaultChatTransport({ api: '/api/chat' })` — explicit transport only needed for custom endpoints or `DirectChatTransport`.
94
+ - Default `stopWhen` for ToolLoopAgent is `stepCountIs(20)`, not `stepCountIs(1)` — override if you need fewer steps.
95
+ - `strict: true` on tools is opt-in per tool, not global — only set on tools with provider-compatible schemas.
96
+ - For agent API routes, use `createAgentUIStreamResponse({ agent, uiMessages })` instead of manual `streamText` + `toUIMessageStreamResponse()`.
97
+ - `@ai-sdk/azure` now uses the Responses API by default — use `azure.chat()` for the previous Chat Completions API behavior.
98
+ - `@ai-sdk/azure` uses `azure` (not `openai`) as the key for `providerMetadata` and `providerOptions`.
99
+ - `@ai-sdk/google-vertex` uses `vertex` (not `google`) as the key for `providerMetadata` and `providerOptions`.
100
+ - `@ai-sdk/anthropic` supports native structured outputs via `structuredOutputMode` option (Anthropic Sonnet 4.5+).
101
+
102
+ ## Installation
103
+
104
+ ```bash
105
+ npm install ai@^6.0.0 @ai-sdk/react@^3.0.0
106
+ npm install @ai-sdk/openai@^3.0.41 # Optional: required for embeddings
107
+ npm install @ai-sdk/anthropic@^3.0.58 # Optional: direct Anthropic provider access
108
+ npm install @ai-sdk/vercel@^2.0.37 # Optional: v0 model provider (v0-1.0-md)
109
+ ```
110
+
111
+ > **`@ai-sdk/react` is a separate package** — it is NOT included in the `ai` package. For v6 projects, install `@ai-sdk/react@^3.0.x` alongside `ai@^6.0.0`.
112
+
113
+ > **If you install `@ai-sdk/gateway` directly, use `@ai-sdk/gateway@^3.x`** (NOT `^1.x`).
114
+
115
+ > **Only install a direct provider SDK** (e.g., `@ai-sdk/anthropic`) if you need provider-specific features not exposed through the gateway.
116
+
117
+ ## What AI SDK Can Do
118
+
119
+ AI SDK is not just text — it handles **text, images, structured data, tool calling, and agents** through one unified API:
120
+
121
+ | Need | How |
122
+ |------|-----|
123
+ | Text generation / chat | `generateText()` or `streamText()` with `model: "openai/gpt-5.4"` |
124
+ | **Image generation** | `generateText()` with `model: "google/gemini-3.1-flash-image-preview"` — images in `result.files`. **Always use this model, never older gemini-2.x models** |
125
+ | Structured JSON output | `generateText()` with `output: Output.object({ schema })` |
126
+ | Tool calling / agents | `generateText()` with `tools: { ... }` or `ToolLoopAgent` |
127
+ | Embeddings | `embed()` / `embedMany()` with `@ai-sdk/openai` |
128
+
129
+ **If the product needs generated images** (portraits, posters, cover art, illustrations, comics, diagrams), use `generateText` with an image model — do NOT use placeholder images or skip image generation.
130
+
131
+ ## Setup for AI Projects
132
+
133
+ For the smoothest experience, link to a Vercel project so AI Gateway credentials are auto-provisioned via OIDC:
134
+
135
+ ```bash
136
+ vercel link # Connect to your Vercel project
137
+ # Enable AI Gateway at https://vercel.com/{team}/{project}/settings → AI Gateway
138
+ vercel env pull .env.local # Provisions VERCEL_OIDC_TOKEN automatically
139
+ npm install ai@^6.0.0 # Gateway is built in
140
+ npx ai-elements # Required: install AI text rendering components
141
+ ```
142
+
143
+ This gives you AI Gateway access with OIDC authentication, cost tracking, failover, and observability — no manual API keys needed.
144
+
145
+ **OIDC is the default auth**: `vercel env pull` provisions a `VERCEL_OIDC_TOKEN` (short-lived JWT, ~24h). The `@ai-sdk/gateway` reads it automatically via `@vercel/oidc`. On Vercel deployments, tokens auto-refresh. For local dev, re-run `vercel env pull` when the token expires. No `AI_GATEWAY_API_KEY` or provider-specific keys needed.
146
+
147
+ ## Global Provider System (AI Gateway — Default)
148
+
149
+ In AI SDK 6, pass a `"provider/model"` string to the `model` parameter — it automatically routes through the Vercel AI Gateway:
150
+
151
+ ```ts
152
+ import { generateText } from "ai";
153
+
154
+ const { text } = await generateText({
155
+ model: "openai/gpt-5.4", // plain string — routes through AI Gateway automatically
156
+ prompt: "Hello!",
157
+ });
158
+ ```
159
+
160
+ No `gateway()` wrapper needed — plain `"provider/model"` strings are the simplest approach and are what the official Vercel docs recommend. The `gateway()` function is an optional explicit wrapper (useful when you need `providerOptions.gateway` for routing, failover, or tags):
161
+
162
+ ```ts
163
+ import { gateway } from "ai";
164
+
165
+ // Explicit gateway() — only needed for advanced providerOptions
166
+ const { text } = await generateText({
167
+ model: gateway("openai/gpt-5.4"),
168
+ providerOptions: { gateway: { order: ["openai", "azure-openai"] } },
169
+ });
170
+ ```
171
+
172
+ Both approaches provide failover, cost tracking, and observability on Vercel.
173
+
174
+ **Model slug rules**: Always use `provider/model` format. Version numbers use **dots**, not hyphens: `anthropic/claude-sonnet-4.6` (not `claude-sonnet-4-6`). Default to `openai/gpt-5.4` or `anthropic/claude-sonnet-4.6`. Never use outdated models like `gpt-4o`.
175
+
176
+ > AI Gateway does not support embeddings. Use a direct provider SDK such as `@ai-sdk/openai` for embeddings.
177
+
178
+ > **Direct provider SDKs** (`@ai-sdk/openai`, `@ai-sdk/anthropic`, etc.) are only needed for provider-specific features not exposed through the gateway (e.g., Anthropic computer use, OpenAI fine-tuned model endpoints).
179
+
180
+ ## Core Functions
181
+
182
+ ### Text Generation
183
+
184
+ ```ts
185
+ import { generateText, streamText } from "ai";
186
+
187
+ // Non-streaming
188
+ const { text } = await generateText({
189
+ model: "openai/gpt-5.4",
190
+ prompt: "Explain quantum computing in simple terms.",
191
+ });
192
+
193
+ // Streaming
194
+ const result = streamText({
195
+ model: "openai/gpt-5.4",
196
+ prompt: "Write a poem about coding.",
197
+ });
198
+
199
+ for await (const chunk of result.textStream) {
200
+ process.stdout.write(chunk);
201
+ }
202
+ ```
203
+
204
+ ### Structured Output
205
+
206
+ **`generateObject` was removed in AI SDK v6.** Use `generateText` with `output: Output.object()` instead. Do NOT import `generateObject` — it does not exist.
207
+
208
+ ```ts
209
+ import { generateText, Output } from "ai";
210
+ import { z } from "zod";
211
+
212
+ const { output } = await generateText({
213
+ model: "openai/gpt-5.4",
214
+ output: Output.object({
215
+ schema: z.object({
216
+ recipe: z.object({
217
+ name: z.string(),
218
+ ingredients: z.array(
219
+ z.object({
220
+ name: z.string(),
221
+ amount: z.string(),
222
+ }),
223
+ ),
224
+ steps: z.array(z.string()),
225
+ }),
226
+ }),
227
+ }),
228
+ prompt: "Generate a recipe for chocolate chip cookies.",
229
+ });
230
+ ```
231
+
232
+ ### Tool Calling (MCP-Aligned)
233
+
234
+ In AI SDK 6, tools use `inputSchema` (not `parameters`) and `output`/`outputSchema` (not `result`), aligned with the MCP specification. Per-tool `strict` mode ensures providers only generate valid tool calls matching your schema.
235
+
236
+ ```ts
237
+ import { generateText, tool } from "ai";
238
+ import { z } from "zod";
239
+
240
+ const result = await generateText({
241
+ model: "openai/gpt-5.4",
242
+ tools: {
243
+ weather: tool({
244
+ description: "Get the weather for a location",
245
+ inputSchema: z.object({
246
+ city: z.string().describe("The city name"),
247
+ }),
248
+ outputSchema: z.object({
249
+ temperature: z.number(),
250
+ condition: z.string(),
251
+ }),
252
+ strict: true, // Providers generate only schema-valid tool calls
253
+ execute: async ({ city }) => {
254
+ const data = await fetchWeather(city);
255
+ return { temperature: data.temp, condition: data.condition };
256
+ },
257
+ }),
258
+ },
259
+ prompt: "What is the weather in San Francisco?",
260
+ });
261
+ ```
262
+
263
+ ### Dynamic Tools (MCP Integration)
264
+
265
+ For tools with schemas not known at compile time (e.g., MCP server tools):
266
+
267
+ ```ts
268
+ import { dynamicTool } from "ai";
269
+
270
+ const tools = {
271
+ unknownTool: dynamicTool({
272
+ description: "A tool discovered at runtime",
273
+ execute: async (input) => {
274
+ // Handle dynamically
275
+ return { result: "done" };
276
+ },
277
+ }),
278
+ };
279
+ ```
280
+
281
+ ### Agents
282
+
283
+ The `ToolLoopAgent` class wraps `generateText`/`streamText` with an agentic tool-calling loop.
284
+ Default `stopWhen` is `stepCountIs(20)` (up to 20 tool-calling steps).
285
+ `Agent` is an interface — `ToolLoopAgent` is the concrete implementation.
286
+
287
+ ```ts
288
+ import { ToolLoopAgent, stepCountIs, hasToolCall } from "ai";
289
+
290
+ const agent = new ToolLoopAgent({
291
+ model: "anthropic/claude-sonnet-4.6",
292
+ tools: { weather, search, calculator, finalAnswer },
293
+ instructions: "You are a helpful assistant.",
294
+ // Default: stepCountIs(20). Override to stop on a terminal tool or custom logic:
295
+ stopWhen: hasToolCall("finalAnswer"),
296
+ prepareStep: (context) => ({
297
+ // Customize each step — swap models, compress messages, limit tools
298
+ toolChoice: context.steps.length > 5 ? "none" : "auto",
299
+ }),
300
+ });
301
+
302
+ const { text } = await agent.generate({
303
+ prompt:
304
+ "Research the weather in Tokyo and calculate the average temperature this week.",
305
+ });
306
+ ```
307
+
308
+ ### MCP Client
309
+
310
+ Connect to any MCP server and use its tools:
311
+
312
+ ```ts
313
+ import { generateText } from "ai";
314
+ import { createMCPClient } from "@ai-sdk/mcp";
315
+
316
+ const mcpClient = await createMCPClient({
317
+ transport: {
318
+ type: "sse",
319
+ url: "https://my-mcp-server.com/sse",
320
+ },
321
+ });
322
+
323
+ const tools = await mcpClient.tools();
324
+
325
+ const result = await generateText({
326
+ model: "openai/gpt-5.4",
327
+ tools,
328
+ prompt: "Use the available tools to help the user.",
329
+ });
330
+
331
+ await mcpClient.close();
332
+ ```
333
+
334
+ MCP OAuth for remote servers is handled automatically by `@ai-sdk/mcp`.
335
+
336
+ ### Tool Approval (Human-in-the-Loop)
337
+
338
+ Set `needsApproval` on any tool to require user confirmation before execution. The tool pauses in `approval-requested` state until the client responds.
339
+
340
+ ```ts
341
+ import { streamText, tool } from "ai";
342
+ import { z } from "zod";
343
+
344
+ const result = streamText({
345
+ model: "openai/gpt-5.4",
346
+ tools: {
347
+ deleteUser: tool({
348
+ description: "Delete a user account",
349
+ inputSchema: z.object({ userId: z.string() }),
350
+ needsApproval: true, // Always require approval
351
+ execute: async ({ userId }) => {
352
+ await db.users.delete(userId);
353
+ return { deleted: true };
354
+ },
355
+ }),
356
+ processPayment: tool({
357
+ description: "Process a payment",
358
+ inputSchema: z.object({ amount: z.number(), recipient: z.string() }),
359
+ // Conditional: only approve large amounts
360
+ needsApproval: async ({ amount }) => amount > 1000,
361
+ execute: async ({ amount, recipient }) => {
362
+ return await processPayment(amount, recipient);
363
+ },
364
+ }),
365
+ },
366
+ prompt: "Delete user 123",
367
+ });
368
+ ```
369
+
370
+ **Client-side approval with `useChat`:**
371
+
372
+ ```tsx
373
+ "use client";
374
+ import { useChat } from "@ai-sdk/react";
375
+
376
+ function Chat() {
377
+ const { messages, addToolApprovalResponse } = useChat();
378
+
379
+ return messages.map((m) =>
380
+ m.parts?.map((part, i) => {
381
+ // Tool parts in approval-requested state need user action
382
+ if (part.type.startsWith("tool-") && part.approval?.state === "approval-requested") {
383
+ return (
384
+ <div key={i}>
385
+ <p>Tool wants to run: {JSON.stringify(part.args)}</p>
386
+ <button onClick={() => addToolApprovalResponse({ id: part.approval.id, approved: true })}>
387
+ Approve
388
+ </button>
389
+ <button onClick={() => addToolApprovalResponse({ id: part.approval.id, approved: false })}>
390
+ Deny
391
+ </button>
392
+ </div>
393
+ );
394
+ }
395
+ return null;
396
+ }),
397
+ );
398
+ }
399
+ ```
400
+
401
+ **Tool part states:** `input-streaming` → `input-available` → `approval-requested` (if `needsApproval`) → `output-available` | `output-error`
402
+
403
+ ### Embeddings & Reranking
404
+
405
+ Use a direct provider SDK for embeddings. AI Gateway does not support embedding models.
406
+
407
+ ```ts
408
+ import { embed, embedMany, rerank } from "ai";
409
+ import { openai } from "@ai-sdk/openai";
410
+
411
+ // Single embedding
412
+ const { embedding } = await embed({
413
+ model: openai.embedding("text-embedding-3-small"),
414
+ value: "The quick brown fox",
415
+ });
416
+
417
+ // Batch embeddings
418
+ const { embeddings } = await embedMany({
419
+ model: openai.embedding("text-embedding-3-small"),
420
+ values: ["text 1", "text 2", "text 3"],
421
+ });
422
+
423
+ // Rerank search results by relevance
424
+ const { results } = await rerank({
425
+ model: cohere.reranker("rerank-v3.5"),
426
+ query: "What is quantum computing?",
427
+ documents: searchResults,
428
+ });
429
+ ```
430
+
431
+ ### Image Generation & Editing
432
+
433
+ AI Gateway supports image generation. Use the **`google/gemini-3.1-flash-image-preview`** model — it is significantly better than older models like `gemini-2.0-flash-exp-image-generation` or `gemini-2.0-flash-001`.
434
+
435
+ **Always use `google/gemini-3.1-flash-image-preview`** for image generation. Do NOT use older models (`gemini-2.0-*`, `gemini-2.5-*`) — they produce much worse results and some do not support image output at all.
436
+
437
+ #### Multimodal LLMs (recommended — use `generateText`/`streamText`)
438
+
439
+ ```ts
440
+ import { generateText, streamText } from "ai";
441
+
442
+ // generateText — images returned in result.files
443
+ const result = await generateText({
444
+ model: "google/gemini-3.1-flash-image-preview",
445
+ prompt: "A futuristic cityscape at sunset",
446
+ });
447
+ const imageFiles = result.files.filter((f) => f.mediaType?.startsWith("image/"));
448
+
449
+ // Convert to data URL for display
450
+ const imageFile = imageFiles[0];
451
+ const dataUrl = `data:${imageFile.mediaType};base64,${Buffer.from(imageFile.data).toString("base64")}`;
452
+
453
+ // streamText — stream text, then access images after completion
454
+ const stream = streamText({
455
+ model: "google/gemini-3.1-flash-image-preview",
456
+ prompt: "A futuristic cityscape at sunset",
457
+ });
458
+ for await (const delta of stream.fullStream) {
459
+ if (delta.type === "text-delta") process.stdout.write(delta.text);
460
+ }
461
+ const finalResult = await stream;
462
+ console.log(`Generated ${finalResult.files.length} image(s)`);
463
+ ```
464
+
465
+ **Default image model**: `google/gemini-3.1-flash-image-preview` — fast, high-quality. This is the ONLY recommended model for image generation.
466
+
467
+ #### Image-only models (use `experimental_generateImage`)
468
+
469
+ ```ts
470
+ import { experimental_generateImage as generateImage } from "ai";
471
+
472
+ const { images } = await generateImage({
473
+ model: "google/imagen-4.0-generate-001",
474
+ prompt: "A futuristic cityscape at sunset",
475
+ aspectRatio: "16:9",
476
+ });
477
+ ```
478
+
479
+ Other image-only models: `google/imagen-4.0-ultra-generate-001`, `bfl/flux-2-pro`, `bfl/flux-kontext-max`, `xai/grok-imagine-image-pro`.
480
+
481
+ #### Saving generated images
482
+
483
+ ```ts
484
+ import fs from "node:fs";
485
+
486
+ // From multimodal LLMs (result.files)
487
+ for (const [i, file] of imageFiles.entries()) {
488
+ const ext = file.mediaType?.split("/")[1] || "png";
489
+ await fs.promises.writeFile(`output-${i}.${ext}`, file.uint8Array);
490
+ }
491
+
492
+ // From image-only models (result.images)
493
+ for (const [i, image] of images.entries()) {
494
+ const buffer = Buffer.from(image.base64, "base64");
495
+ await fs.promises.writeFile(`output-${i}.png`, buffer);
496
+ }
497
+ ```
498
+
499
+ ## UI Hooks (React)
500
+
501
+ **MANDATORY — Always use AI Elements for AI text**: AI SDK models always produce markdown — even short prose contains `**bold**`, `##` headings, `` `code` ``, and `---`. There is no "plain text" mode. Every AI-generated string displayed in a browser MUST be rendered through AI Elements.
502
+ - **Chat messages**: Use AI Elements `<Message message={message} />` — handles text, tool calls, code blocks, reasoning, streaming.
503
+ - **Any other AI text** (streaming panels, workflow events, reports, briefings, narratives, summaries, perspectives): Use `<MessageResponse>{text}</MessageResponse>` from `@/components/ai-elements/message`.
504
+ - `<MessageResponse>` wraps Streamdown with code highlighting, math, mermaid, and CJK plugins — works for any markdown string, including streamed text.
505
+ - **Never** render AI output as raw `{text}`, `<p>{content}</p>`, or `<div>{stream}</div>` — this always produces ugly unformatted output with visible markdown syntax.
506
+ - **No exceptions**: Even if you think the response will be "simple prose", models routinely add markdown formatting. Always use AI Elements.
507
+
508
+ ⤳ skill: ai-elements — Full component library, decision guidance, and troubleshooting for AI interfaces
509
+
510
+ ### Transport Options
511
+
512
+ `useChat` uses a transport-based architecture. Three built-in transports:
513
+
514
+ | Transport | Use Case |
515
+ |-----------|----------|
516
+ | `DefaultChatTransport` | HTTP POST to API routes (default — sends to `/api/chat`) |
517
+ | `DirectChatTransport` | In-process agent communication without HTTP (SSR, testing) |
518
+ | `TextStreamChatTransport` | Plain text stream protocol |
519
+
520
+ **Default behavior:** `useChat()` with no transport config defaults to `DefaultChatTransport({ api: '/api/chat' })`.
521
+
522
+ ### With AI Elements (Recommended)
523
+
524
+ ```tsx
525
+ "use client";
526
+ import { useChat } from "@ai-sdk/react";
527
+ import { Conversation } from "@/components/ai-elements/conversation";
528
+ import { Message } from "@/components/ai-elements/message";
529
+
530
+ function Chat() {
531
+ // No transport needed — defaults to DefaultChatTransport({ api: '/api/chat' })
532
+ const { messages, sendMessage, status } = useChat();
533
+
534
+ return (
535
+ <Conversation>
536
+ {messages.map((message) => (
537
+ <Message key={message.id} message={message} />
538
+ ))}
539
+ </Conversation>
540
+ );
541
+ }
542
+ ```
543
+
544
+ AI Elements handles UIMessage parts (text, tool calls, reasoning, images) automatically. Install with `npx ai-elements`.
545
+
546
+ ⤳ skill: ai-elements — Full component library for AI interfaces
547
+ ⤳ skill: json-render — Manual rendering patterns for custom UIs
548
+
549
+ ### With DirectChatTransport (No API Route Needed)
550
+
551
+ ```tsx
552
+ "use client";
553
+ import { useChat } from "@ai-sdk/react";
554
+ import { DirectChatTransport } from "ai";
555
+ import { myAgent } from "@/lib/agent"; // a ToolLoopAgent instance
556
+
557
+ function Chat() {
558
+ const { messages, sendMessage, status } = useChat({
559
+ transport: new DirectChatTransport({ agent: myAgent }),
560
+ });
561
+ // Same UI as above — no /api/chat route required
562
+ }
563
+ ```
564
+
565
+ Useful for SSR scenarios, testing without network, and single-process apps.
566
+
567
+ **v6 changes from v5:**
568
+
569
+ - `useChat({ api })` → `useChat({ transport: new DefaultChatTransport({ api }) })`
570
+ - `handleSubmit` → `sendMessage({ text })`
571
+ - `input` / `handleInputChange` → manage your own `useState`
572
+ - `body` / `onResponse` options were removed from `useChat`; use `transport` to configure requests/responses
573
+ - `isLoading` → `status === 'streaming' || status === 'submitted'`
574
+ - `message.content` → iterate `message.parts` (UIMessage format)
575
+
576
+ ### Choose the correct streaming response helper
577
+
578
+ - `toUIMessageStreamResponse()` is for `useChat` + `DefaultChatTransport` UIMessage-based chat UIs. Use it when you need tool calls, metadata, reasoning, and other rich message parts.
579
+ - `toTextStreamResponse()` is for **non-browser clients only** — CLI tools, server-to-server pipes, or programmatic consumers that process raw text without rendering it in a UI. If the text will be displayed in a browser, use `toUIMessageStreamResponse()` + AI Elements instead.
580
+ - Warning: Do **not** return `toUIMessageStreamResponse()` to a plain `fetch()` client unless that client intentionally parses the AI SDK UI message stream protocol.
581
+ - Warning: Do **not** use `toTextStreamResponse()` + manual `fetch()` stream reading as a way to skip AI Elements. If the output goes to a browser, use `useChat` + `<MessageResponse>` or `<Message>`.
582
+
583
+ ### Server-side for useChat (API Route)
584
+
585
+ ```ts
586
+ // app/api/chat/route.ts
587
+ import { streamText, convertToModelMessages, stepCountIs } from "ai";
588
+ import type { UIMessage } from "ai";
589
+
590
+ export async function POST(req: Request) {
591
+ const { messages }: { messages: UIMessage[] } = await req.json();
592
+ // IMPORTANT: convertToModelMessages is async in v6
593
+ const modelMessages = await convertToModelMessages(messages);
594
+ const result = streamText({
595
+ model: "openai/gpt-5.4",
596
+ messages: modelMessages,
597
+ tools: {
598
+ /* your tools */
599
+ },
600
+ // IMPORTANT: use stopWhen with stepCountIs for multi-step tool calling
601
+ // maxSteps was removed in v6 — use this instead
602
+ stopWhen: stepCountIs(5),
603
+ });
604
+ // Use toUIMessageStreamResponse (not toDataStreamResponse) for chat UIs
605
+ return result.toUIMessageStreamResponse();
606
+ }
607
+ ```
608
+
609
+ ### Server-side with ToolLoopAgent (Agent API Route)
610
+
611
+ Define a `ToolLoopAgent` and use `createAgentUIStreamResponse` for the API route:
612
+
613
+ ```ts
614
+ // lib/agent.ts
615
+ import { ToolLoopAgent, stepCountIs } from "ai";
616
+
617
+ export const myAgent = new ToolLoopAgent({
618
+ model: "openai/gpt-5.4",
619
+ instructions: "You are a helpful assistant.",
620
+ tools: { /* your tools */ },
621
+ stopWhen: stepCountIs(5),
622
+ });
623
+ ```
624
+
625
+ ```ts
626
+ // app/api/chat/route.ts — agent API route
627
+ import { createAgentUIStreamResponse } from "ai";
628
+ import { myAgent } from "@/lib/agent";
629
+
630
+ export async function POST(req: Request) {
631
+ const { messages } = await req.json();
632
+ return createAgentUIStreamResponse({ agent: myAgent, uiMessages: messages });
633
+ }
634
+ ```
635
+
636
+ Or use `DirectChatTransport` on the client to skip the API route entirely.
637
+
638
+ ### Server-side for text-only clients (non-browser only)
639
+
640
+ > **This pattern is for CLI tools, server-to-server pipes, and programmatic consumers.** If the response will be displayed in a browser UI, use `toUIMessageStreamResponse()` + AI Elements instead — even for "simple" streaming text panels.
641
+
642
+ ```ts
643
+ // app/api/generate/route.ts — for CLI or server consumers, NOT browser UIs
644
+ import { streamText } from "ai";
645
+
646
+ export async function POST(req: Request) {
647
+ const { prompt }: { prompt: string } = await req.json();
648
+ const result = streamText({
649
+ model: "openai/gpt-5.4",
650
+ prompt,
651
+ });
652
+
653
+ return result.toTextStreamResponse();
654
+ }
655
+ ```
656
+
657
+ ## Language Model Middleware
658
+
659
+ Intercept and transform model calls for RAG, guardrails, logging:
660
+
661
+ ```ts
662
+ import { wrapLanguageModel } from "ai";
663
+
664
+ const wrappedModel = wrapLanguageModel({
665
+ model: "openai/gpt-5.4",
666
+ middleware: {
667
+ transformParams: async ({ params }) => {
668
+ // Inject RAG context, modify system prompt, etc.
669
+ return { ...params, system: params.system + "\n\nContext: ..." };
670
+ },
671
+ wrapGenerate: async ({ doGenerate }) => {
672
+ const result = await doGenerate();
673
+ // Post-process, log, validate guardrails
674
+ return result;
675
+ },
676
+ },
677
+ });
678
+ ```
679
+
680
+ ## Provider Routing via AI Gateway
681
+
682
+ ```ts
683
+ import { generateText } from "ai";
684
+ import { gateway } from "ai";
685
+
686
+ const result = await generateText({
687
+ model: gateway("anthropic/claude-sonnet-4.6"),
688
+ prompt: "Hello!",
689
+ providerOptions: {
690
+ gateway: {
691
+ order: ["bedrock", "anthropic"], // Try Bedrock first
692
+ models: ["openai/gpt-5.4"], // Fallback model
693
+ only: ["anthropic", "bedrock"], // Restrict providers
694
+ user: "user-123", // Usage tracking
695
+ tags: ["feature:chat", "env:production"], // Cost attribution
696
+ },
697
+ },
698
+ });
699
+ ```
700
+
701
+ ## DevTools
702
+
703
+ ```bash
704
+ npx @ai-sdk/devtools
705
+ # Opens http://localhost:4983 — inspect LLM calls, agents, token usage, timing
706
+ ```
707
+
708
+ ## Key Patterns
709
+
710
+ 1. **Default to AI Gateway with OIDC** — pass `"provider/model"` strings (e.g., `model: "openai/gpt-5.4"`) to route through the gateway automatically. `vercel env pull` provisions OIDC tokens. No manual API keys needed. The `gateway()` wrapper is optional (only needed for `providerOptions.gateway`).
711
+ 2. **Set up a Vercel project for AI** — `vercel link` → enable AI Gateway at `https://vercel.com/{team}/{project}/settings` → **AI Gateway** → `vercel env pull` to get OIDC credentials. Never manually create `.env.local` with provider-specific API keys.
712
+ 3. **Always use AI Elements for any AI text in a browser** — `npx ai-elements` installs production-ready Message, Conversation, and Tool components. Use `<Message>` for chat and `<MessageResponse>` for any other AI-generated text (streaming panels, summaries, reports). AI models always produce markdown — there is no scenario where raw `{text}` rendering is correct. ⤳ skill: ai-elements
713
+ 4. **Always stream for user-facing AI** — use `streamText` + `useChat`, not `generateText`
714
+ 5. **UIMessage chat UIs** — `useChat()` defaults to `DefaultChatTransport({ api: '/api/chat' })`. On the server: `convertToModelMessages()` + `toUIMessageStreamResponse()`. For no-API-route setups: `DirectChatTransport` + Agent.
715
+ 6. **Text-only clients (non-browser)** — `toTextStreamResponse()` is only for CLI tools, server pipes, and programmatic consumers. If the text is displayed in a browser, use `toUIMessageStreamResponse()` + AI Elements
716
+ 7. **Use structured output** for extracting data — `generateText` with `Output.object()` and Zod schemas
717
+ 8. **Use `ToolLoopAgent`** for multi-step reasoning — not manual loops. Default `stopWhen` is `stepCountIs(20)`. Use `createAgentUIStreamResponse` for agent API routes.
718
+ 9. **Use DurableAgent** (from Workflow DevKit) for production agents that must survive crashes
719
+ 10. **Use `mcp-to-ai-sdk`** to generate static tool definitions from MCP servers for security
720
+ 11. **Use `needsApproval`** for human-in-the-loop — set on any tool to pause execution until user approves; supports conditional approval via async function
721
+ 12. **Use `strict: true`** per tool — opt-in strict mode ensures providers only generate schema-valid tool calls; set on individual tools, not globally
722
+
723
+ ## Common Pitfall: Structured Output Property Name
724
+
725
+ In v6, `generateText` with `Output.object()` returns the parsed result on the **`output`** property (NOT `object`):
726
+
727
+ ```ts
728
+ // CORRECT — v6
729
+ const { output } = await generateText({
730
+ model: 'openai/gpt-5.4',
731
+ output: Output.object({ schema: mySchema }),
732
+ prompt: '...',
733
+ })
734
+ console.log(output) // ✅ parsed object
735
+
736
+ // WRONG — v5 habit
737
+ const { object } = await generateText({ ... }) // ❌ undefined — `object` doesn't exist in v6
738
+ ```
739
+
740
+ This is one of the most common v5→v6 migration mistakes. The config key is `output` and the result key is also `output`.
741
+
742
+ ## Migration from AI SDK 5
743
+
744
+ Run `npx @ai-sdk/codemod upgrade` (or `npx @ai-sdk/codemod v6`) to auto-migrate. Preview with `npx @ai-sdk/codemod --dry upgrade`. Key changes:
745
+
746
+ - `generateObject` / `streamObject` → `generateText` / `streamText` with `Output.object()`
747
+ - `parameters` → `inputSchema`
748
+ - `result` → `output`
749
+ - `maxSteps` → `stopWhen: stepCountIs(N)` (import `stepCountIs` from `ai`)
750
+ - `CoreMessage` → `ModelMessage` (use `convertToModelMessages()` — now async)
751
+ - `ToolCallOptions` → `ToolExecutionOptions`
752
+ - `Experimental_Agent` → `ToolLoopAgent` (concrete class; `Agent` is just an interface)
753
+ - `system` → `instructions` (on `ToolLoopAgent`)
754
+ - `agent.generateText()` → `agent.generate()`
755
+ - `agent.streamText()` → `agent.stream()`
756
+ - `experimental_createMCPClient` → `createMCPClient` (stable)
757
+ - New: `createAgentUIStreamResponse({ agent, uiMessages })` for agent API routes
758
+ - New: `callOptionsSchema` + `prepareCall` for per-call agent configuration
759
+ - `useChat({ api })` → `useChat({ transport: new DefaultChatTransport({ api }) })`
760
+ - `useChat` `body` / `onResponse` options removed → configure with transport
761
+ - `handleSubmit` / `input` → `sendMessage({ text })` / manage own state
762
+ - `toDataStreamResponse()` → `toUIMessageStreamResponse()` (for chat UIs)
763
+ - `createUIMessageStream`: use `stream.writer.write(...)` (not `stream.write(...)`)
764
+ - text-only clients / text stream protocol → `toTextStreamResponse()`
765
+ - `message.content` → `message.parts` (tool parts use `tool-<toolName>`, not `tool-invocation`)
766
+ - UIMessage / ModelMessage types introduced
767
+ - `DynamicToolCall.args` is not strongly typed; cast via `unknown` first
768
+ - `TypedToolResult.result` → `TypedToolResult.output`
769
+ - `ai@^6.0.0` is the umbrella package
770
+ - `@ai-sdk/react` must be installed separately at `^3.0.x`
771
+ - `@ai-sdk/gateway` (if installed directly) is `^3.x`, not `^1.x`
772
+ - New: `needsApproval` on tools (boolean or async function) for human-in-the-loop approval
773
+ - New: `strict: true` per-tool opt-in for strict schema validation
774
+ - New: `DirectChatTransport` — connect `useChat` to an Agent in-process, no API route needed
775
+ - New: `addToolApprovalResponse` on `useChat` for client-side approval UI
776
+ - Default `stopWhen` changed from `stepCountIs(1)` to `stepCountIs(20)` for `ToolLoopAgent`
777
+ - New: `ToolCallOptions` type renamed to `ToolExecutionOptions`
778
+ - New: `Tool.toModelOutput` now receives `({ output })` object, not bare `output`
779
+ - New: `isToolUIPart` → `isStaticToolUIPart`; `isToolOrDynamicToolUIPart` → `isToolUIPart`
780
+ - New: `getToolName` → `getStaticToolName`; `getToolOrDynamicToolName` → `getToolName`
781
+ - New: `@ai-sdk/azure` defaults to Responses API; use `azure.chat()` for Chat Completions
782
+ - New: `@ai-sdk/anthropic` `structuredOutputMode` for native structured outputs (Anthropic Sonnet 4.5+)
783
+ - New: `@ai-sdk/langchain` rewritten — `toBaseMessages()`, `toUIMessageStream()`, `LangSmithDeploymentTransport`
784
+ - New: Provider-specific tools — Anthropic (memory, code execution), OpenAI (shell, patch), Google (maps, RAG), xAI (search, code)
785
+ - `unknown` finish reason removed → now returned as `other`
786
+ - Warning types consolidated into single `Warning` type exported from `ai`
787
+
788
+ ## Official Documentation
789
+
790
+ - [AI SDK Documentation](https://ai-sdk.dev/docs)
791
+ - [AI SDK Core](https://ai-sdk.dev/docs/ai-sdk-core)
792
+ - [AI SDK UI](https://ai-sdk.dev/docs/ai-sdk-ui)
793
+ - [Generating Text](https://ai-sdk.dev/docs/ai-sdk-core/generating-text)
794
+ - [Structured Data](https://ai-sdk.dev/docs/ai-sdk-core/generating-structured-data)
795
+ - [Tools and Tool Calling](https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling)
796
+ - [Agents](https://ai-sdk.dev/docs/ai-sdk-core/agents)
797
+ - [Providers and Models](https://ai-sdk.dev/docs/foundations/providers-and-models)
798
+ - [Provider Directory](https://ai-sdk.dev/providers)
799
+ - [GitHub: AI SDK](https://github.com/vercel/ai)