@ultrakit/ultrakit 0.0.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 (704) hide show
  1. package/README.md +95 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.js +5991 -0
  4. package/dist/template/.opencode/.env.example +196 -0
  5. package/dist/template/.opencode/.template-manifest.json +718 -0
  6. package/dist/template/.opencode/.version +1 -0
  7. package/dist/template/.opencode/AGENTS.md +573 -0
  8. package/dist/template/.opencode/AGENT_ALIGNMENT.md +564 -0
  9. package/dist/template/.opencode/README.md +79 -0
  10. package/dist/template/.opencode/agent/build.md +447 -0
  11. package/dist/template/.opencode/agent/explore.md +114 -0
  12. package/dist/template/.opencode/agent/general.md +201 -0
  13. package/dist/template/.opencode/agent/painter.md +83 -0
  14. package/dist/template/.opencode/agent/plan.md +469 -0
  15. package/dist/template/.opencode/agent/review.md +235 -0
  16. package/dist/template/.opencode/agent/scout.md +142 -0
  17. package/dist/template/.opencode/agent/vision.md +169 -0
  18. package/dist/template/.opencode/command/compound.md +240 -0
  19. package/dist/template/.opencode/command/create.md +298 -0
  20. package/dist/template/.opencode/command/curate.md +299 -0
  21. package/dist/template/.opencode/command/design.md +130 -0
  22. package/dist/template/.opencode/command/explore.md +170 -0
  23. package/dist/template/.opencode/command/handoff.md +149 -0
  24. package/dist/template/.opencode/command/health.md +356 -0
  25. package/dist/template/.opencode/command/init-context.md +297 -0
  26. package/dist/template/.opencode/command/init-user.md +125 -0
  27. package/dist/template/.opencode/command/init.md +115 -0
  28. package/dist/template/.opencode/command/iterate.md +200 -0
  29. package/dist/template/.opencode/command/lfg.md +173 -0
  30. package/dist/template/.opencode/command/plan.md +436 -0
  31. package/dist/template/.opencode/command/pr.md +166 -0
  32. package/dist/template/.opencode/command/research.md +128 -0
  33. package/dist/template/.opencode/command/resume.md +78 -0
  34. package/dist/template/.opencode/command/review-codebase.md +135 -0
  35. package/dist/template/.opencode/command/ship.md +390 -0
  36. package/dist/template/.opencode/command/status.md +126 -0
  37. package/dist/template/.opencode/command/ui-review.md +111 -0
  38. package/dist/template/.opencode/command/ui-slop-check.md +169 -0
  39. package/dist/template/.opencode/command/verify.md +173 -0
  40. package/dist/template/.opencode/context/README.md +29 -0
  41. package/dist/template/.opencode/context/git-context.md +32 -0
  42. package/dist/template/.opencode/dcp-prompts/defaults/README.md +40 -0
  43. package/dist/template/.opencode/dcp-prompts/defaults/compress-message.md +42 -0
  44. package/dist/template/.opencode/dcp-prompts/defaults/compress-range.md +59 -0
  45. package/dist/template/.opencode/dcp-prompts/defaults/context-limit-nudge.md +15 -0
  46. package/dist/template/.opencode/dcp-prompts/defaults/iteration-nudge.md +3 -0
  47. package/dist/template/.opencode/dcp-prompts/defaults/system.md +31 -0
  48. package/dist/template/.opencode/dcp-prompts/defaults/turn-nudge.md +7 -0
  49. package/dist/template/.opencode/dcp-prompts/overrides/compress-message.md +71 -0
  50. package/dist/template/.opencode/dcp.jsonc +115 -0
  51. package/dist/template/.opencode/memory/README.md +89 -0
  52. package/dist/template/.opencode/memory/_templates/design.md +59 -0
  53. package/dist/template/.opencode/memory/_templates/prd.md +203 -0
  54. package/dist/template/.opencode/memory/_templates/project.md +58 -0
  55. package/dist/template/.opencode/memory/_templates/proposal.md +38 -0
  56. package/dist/template/.opencode/memory/_templates/roadmap.md +93 -0
  57. package/dist/template/.opencode/memory/_templates/state.md +89 -0
  58. package/dist/template/.opencode/memory/_templates/tasks.md +198 -0
  59. package/dist/template/.opencode/memory/_templates/tech-stack.md +85 -0
  60. package/dist/template/.opencode/memory/_templates/user.md +26 -0
  61. package/dist/template/.opencode/memory/project/gotchas.md +67 -0
  62. package/dist/template/.opencode/memory/project/project.md +92 -0
  63. package/dist/template/.opencode/memory/project/roadmap.md +142 -0
  64. package/dist/template/.opencode/memory/project/state.md +84 -0
  65. package/dist/template/.opencode/memory/project/tech-stack.md +53 -0
  66. package/dist/template/.opencode/memory/project/user.md +45 -0
  67. package/dist/template/.opencode/memory/research/benchmark-framework.md +162 -0
  68. package/dist/template/.opencode/memory/research/ccpm-analysis.md +334 -0
  69. package/dist/template/.opencode/memory/research/context-management-analysis.md +685 -0
  70. package/dist/template/.opencode/memory/research/effectiveness-audit.md +213 -0
  71. package/dist/template/.opencode/memory/research/opencode-mcp-bug-report.md +129 -0
  72. package/dist/template/.opencode/memory/research/openspec-analysis.md +226 -0
  73. package/dist/template/.opencode/memory/session-context.md +40 -0
  74. package/dist/template/.opencode/opencode.json +1148 -0
  75. package/dist/template/.opencode/opencodex-fast.jsonc +3 -0
  76. package/dist/template/.opencode/package.json +21 -0
  77. package/dist/template/.opencode/plugin/README.md +81 -0
  78. package/dist/template/.opencode/plugin/copilot-auth.ts +1285 -0
  79. package/dist/template/.opencode/plugin/lib/capture.ts +177 -0
  80. package/dist/template/.opencode/plugin/lib/compact.ts +194 -0
  81. package/dist/template/.opencode/plugin/lib/compile.ts +253 -0
  82. package/dist/template/.opencode/plugin/lib/context.ts +198 -0
  83. package/dist/template/.opencode/plugin/lib/curator.ts +234 -0
  84. package/dist/template/.opencode/plugin/lib/db/graph.ts +253 -0
  85. package/dist/template/.opencode/plugin/lib/db/maintenance.ts +312 -0
  86. package/dist/template/.opencode/plugin/lib/db/observations.ts +304 -0
  87. package/dist/template/.opencode/plugin/lib/db/pipeline.ts +520 -0
  88. package/dist/template/.opencode/plugin/lib/db/schema.ts +687 -0
  89. package/dist/template/.opencode/plugin/lib/db/types.ts +284 -0
  90. package/dist/template/.opencode/plugin/lib/distill.ts +376 -0
  91. package/dist/template/.opencode/plugin/lib/index-generator.ts +170 -0
  92. package/dist/template/.opencode/plugin/lib/inject.ts +126 -0
  93. package/dist/template/.opencode/plugin/lib/lint.ts +359 -0
  94. package/dist/template/.opencode/plugin/lib/memory-admin-tools.ts +277 -0
  95. package/dist/template/.opencode/plugin/lib/memory-db.ts +100 -0
  96. package/dist/template/.opencode/plugin/lib/memory-helpers.ts +141 -0
  97. package/dist/template/.opencode/plugin/lib/memory-hooks.ts +399 -0
  98. package/dist/template/.opencode/plugin/lib/memory-tools.ts +535 -0
  99. package/dist/template/.opencode/plugin/lib/notify.ts +89 -0
  100. package/dist/template/.opencode/plugin/lib/operation-log.ts +110 -0
  101. package/dist/template/.opencode/plugin/lib/validate.ts +243 -0
  102. package/dist/template/.opencode/plugin/memory.ts +90 -0
  103. package/dist/template/.opencode/plugin/package.json +7 -0
  104. package/dist/template/.opencode/plugin/prompt-leverage.ts +191 -0
  105. package/dist/template/.opencode/plugin/rtk.ts +43 -0
  106. package/dist/template/.opencode/plugin/sdk/copilot/chat/convert-to-openai-compatible-chat-messages.ts +172 -0
  107. package/dist/template/.opencode/plugin/sdk/copilot/chat/get-response-metadata.ts +15 -0
  108. package/dist/template/.opencode/plugin/sdk/copilot/chat/map-openai-compatible-finish-reason.ts +19 -0
  109. package/dist/template/.opencode/plugin/sdk/copilot/chat/openai-compatible-api-types.ts +72 -0
  110. package/dist/template/.opencode/plugin/sdk/copilot/chat/openai-compatible-chat-language-model.ts +835 -0
  111. package/dist/template/.opencode/plugin/sdk/copilot/chat/openai-compatible-chat-options.ts +30 -0
  112. package/dist/template/.opencode/plugin/sdk/copilot/chat/openai-compatible-metadata-extractor.ts +48 -0
  113. package/dist/template/.opencode/plugin/sdk/copilot/chat/openai-compatible-prepare-tools.ts +92 -0
  114. package/dist/template/.opencode/plugin/sdk/copilot/copilot-provider.ts +101 -0
  115. package/dist/template/.opencode/plugin/sdk/copilot/index.ts +5 -0
  116. package/dist/template/.opencode/plugin/sdk/copilot/openai-compatible-error.ts +30 -0
  117. package/dist/template/.opencode/plugin/sdk/copilot/responses/convert-to-openai-responses-input.ts +335 -0
  118. package/dist/template/.opencode/plugin/sdk/copilot/responses/map-openai-responses-finish-reason.ts +22 -0
  119. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-config.ts +18 -0
  120. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-error.ts +22 -0
  121. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-api-types.ts +214 -0
  122. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-language-model.ts +1770 -0
  123. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-prepare-tools.ts +173 -0
  124. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-settings.ts +1 -0
  125. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/code-interpreter.ts +87 -0
  126. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/file-search.ts +127 -0
  127. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/image-generation.ts +114 -0
  128. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/local-shell.ts +64 -0
  129. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/web-search-preview.ts +103 -0
  130. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/web-search.ts +102 -0
  131. package/dist/template/.opencode/plugin/sessions.ts +457 -0
  132. package/dist/template/.opencode/plugin/skill-mcp.ts +618 -0
  133. package/dist/template/.opencode/plugin/tsconfig.json +16 -0
  134. package/dist/template/.opencode/skill/accessibility-audit/SKILL.md +191 -0
  135. package/dist/template/.opencode/skill/agent-evals/SKILL.md +208 -0
  136. package/dist/template/.opencode/skill/agent-teams/SKILL.md +268 -0
  137. package/dist/template/.opencode/skill/anti-ai-slop/SKILL.md +76 -0
  138. package/dist/template/.opencode/skill/api-and-interface-design/SKILL.md +162 -0
  139. package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +122 -0
  140. package/dist/template/.opencode/skill/augment-context-engine/mcp.json +6 -0
  141. package/dist/template/.opencode/skill/beads/SKILL.md +182 -0
  142. package/dist/template/.opencode/skill/beads/references/BEST_PRACTICES.md +27 -0
  143. package/dist/template/.opencode/skill/beads/references/BOUNDARIES.md +219 -0
  144. package/dist/template/.opencode/skill/beads/references/DEPENDENCIES.md +124 -0
  145. package/dist/template/.opencode/skill/beads/references/EXAMPLES.md +45 -0
  146. package/dist/template/.opencode/skill/beads/references/FILE_CLAIMING.md +101 -0
  147. package/dist/template/.opencode/skill/beads/references/GIT_SYNC.md +25 -0
  148. package/dist/template/.opencode/skill/beads/references/HIERARCHY.md +71 -0
  149. package/dist/template/.opencode/skill/beads/references/MULTI_AGENT.md +40 -0
  150. package/dist/template/.opencode/skill/beads/references/RESUMABILITY.md +177 -0
  151. package/dist/template/.opencode/skill/beads/references/SESSION_PROTOCOL.md +61 -0
  152. package/dist/template/.opencode/skill/beads/references/TASK_CREATION.md +38 -0
  153. package/dist/template/.opencode/skill/beads/references/TROUBLESHOOTING.md +38 -0
  154. package/dist/template/.opencode/skill/beads/references/WORKFLOWS.md +226 -0
  155. package/dist/template/.opencode/skill/brainstorming/SKILL.md +114 -0
  156. package/dist/template/.opencode/skill/brand-asset-protocol/SKILL.md +222 -0
  157. package/dist/template/.opencode/skill/chrome-devtools/SKILL.md +76 -0
  158. package/dist/template/.opencode/skill/chrome-devtools/mcp.json +19 -0
  159. package/dist/template/.opencode/skill/ci-cd-and-automation/SKILL.md +202 -0
  160. package/dist/template/.opencode/skill/cloudflare/SKILL.md +253 -0
  161. package/dist/template/.opencode/skill/cloudflare/references/agents-sdk/README.md +35 -0
  162. package/dist/template/.opencode/skill/cloudflare/references/agents-sdk/api.md +100 -0
  163. package/dist/template/.opencode/skill/cloudflare/references/agents-sdk/configuration.md +99 -0
  164. package/dist/template/.opencode/skill/cloudflare/references/agents-sdk/gotchas.md +59 -0
  165. package/dist/template/.opencode/skill/cloudflare/references/agents-sdk/patterns.md +89 -0
  166. package/dist/template/.opencode/skill/cloudflare/references/ai-gateway/README.md +695 -0
  167. package/dist/template/.opencode/skill/cloudflare/references/ai-search/README.md +14 -0
  168. package/dist/template/.opencode/skill/cloudflare/references/ai-search/api.md +38 -0
  169. package/dist/template/.opencode/skill/cloudflare/references/ai-search/configuration.md +52 -0
  170. package/dist/template/.opencode/skill/cloudflare/references/ai-search/gotchas.md +41 -0
  171. package/dist/template/.opencode/skill/cloudflare/references/ai-search/patterns.md +45 -0
  172. package/dist/template/.opencode/skill/cloudflare/references/analytics-engine/README.md +14 -0
  173. package/dist/template/.opencode/skill/cloudflare/references/analytics-engine/api.md +27 -0
  174. package/dist/template/.opencode/skill/cloudflare/references/analytics-engine/configuration.md +45 -0
  175. package/dist/template/.opencode/skill/cloudflare/references/analytics-engine/gotchas.md +3 -0
  176. package/dist/template/.opencode/skill/cloudflare/references/analytics-engine/patterns.md +36 -0
  177. package/dist/template/.opencode/skill/cloudflare/references/api/README.md +21 -0
  178. package/dist/template/.opencode/skill/cloudflare/references/api/api.md +31 -0
  179. package/dist/template/.opencode/skill/cloudflare/references/api/configuration.md +20 -0
  180. package/dist/template/.opencode/skill/cloudflare/references/api/gotchas.md +28 -0
  181. package/dist/template/.opencode/skill/cloudflare/references/api/patterns.md +47 -0
  182. package/dist/template/.opencode/skill/cloudflare/references/api-shield/README.md +20 -0
  183. package/dist/template/.opencode/skill/cloudflare/references/api-shield/api.md +78 -0
  184. package/dist/template/.opencode/skill/cloudflare/references/api-shield/configuration.md +128 -0
  185. package/dist/template/.opencode/skill/cloudflare/references/api-shield/gotchas.md +51 -0
  186. package/dist/template/.opencode/skill/cloudflare/references/api-shield/patterns.md +145 -0
  187. package/dist/template/.opencode/skill/cloudflare/references/argo-smart-routing/README.md +16 -0
  188. package/dist/template/.opencode/skill/cloudflare/references/argo-smart-routing/api.md +50 -0
  189. package/dist/template/.opencode/skill/cloudflare/references/argo-smart-routing/configuration.md +53 -0
  190. package/dist/template/.opencode/skill/cloudflare/references/argo-smart-routing/gotchas.md +16 -0
  191. package/dist/template/.opencode/skill/cloudflare/references/argo-smart-routing/patterns.md +45 -0
  192. package/dist/template/.opencode/skill/cloudflare/references/bindings/README.md +14 -0
  193. package/dist/template/.opencode/skill/cloudflare/references/bindings/api.md +3 -0
  194. package/dist/template/.opencode/skill/cloudflare/references/bindings/configuration.md +58 -0
  195. package/dist/template/.opencode/skill/cloudflare/references/bindings/gotchas.md +35 -0
  196. package/dist/template/.opencode/skill/cloudflare/references/bindings/patterns.md +37 -0
  197. package/dist/template/.opencode/skill/cloudflare/references/bot-management/README.md +71 -0
  198. package/dist/template/.opencode/skill/cloudflare/references/bot-management/api.md +168 -0
  199. package/dist/template/.opencode/skill/cloudflare/references/bot-management/configuration.md +114 -0
  200. package/dist/template/.opencode/skill/cloudflare/references/bot-management/gotchas.md +99 -0
  201. package/dist/template/.opencode/skill/cloudflare/references/bot-management/patterns.md +125 -0
  202. package/dist/template/.opencode/skill/cloudflare/references/browser-rendering/README.md +16 -0
  203. package/dist/template/.opencode/skill/cloudflare/references/browser-rendering/api.md +54 -0
  204. package/dist/template/.opencode/skill/cloudflare/references/browser-rendering/configuration.md +47 -0
  205. package/dist/template/.opencode/skill/cloudflare/references/browser-rendering/gotchas.md +29 -0
  206. package/dist/template/.opencode/skill/cloudflare/references/browser-rendering/patterns.md +29 -0
  207. package/dist/template/.opencode/skill/cloudflare/references/c3/README.md +264 -0
  208. package/dist/template/.opencode/skill/cloudflare/references/cache-reserve/README.md +93 -0
  209. package/dist/template/.opencode/skill/cloudflare/references/cache-reserve/api.md +176 -0
  210. package/dist/template/.opencode/skill/cloudflare/references/cache-reserve/configuration.md +164 -0
  211. package/dist/template/.opencode/skill/cloudflare/references/cache-reserve/gotchas.md +203 -0
  212. package/dist/template/.opencode/skill/cloudflare/references/cache-reserve/patterns.md +180 -0
  213. package/dist/template/.opencode/skill/cloudflare/references/containers/README.md +16 -0
  214. package/dist/template/.opencode/skill/cloudflare/references/containers/api.md +43 -0
  215. package/dist/template/.opencode/skill/cloudflare/references/containers/configuration.md +56 -0
  216. package/dist/template/.opencode/skill/cloudflare/references/containers/gotchas.md +21 -0
  217. package/dist/template/.opencode/skill/cloudflare/references/containers/patterns.md +40 -0
  218. package/dist/template/.opencode/skill/cloudflare/references/cron-triggers/README.md +85 -0
  219. package/dist/template/.opencode/skill/cloudflare/references/cron-triggers/api.md +198 -0
  220. package/dist/template/.opencode/skill/cloudflare/references/cron-triggers/configuration.md +151 -0
  221. package/dist/template/.opencode/skill/cloudflare/references/cron-triggers/gotchas.md +129 -0
  222. package/dist/template/.opencode/skill/cloudflare/references/cron-triggers/patterns.md +122 -0
  223. package/dist/template/.opencode/skill/cloudflare/references/d1/README.md +92 -0
  224. package/dist/template/.opencode/skill/cloudflare/references/d1/api.md +141 -0
  225. package/dist/template/.opencode/skill/cloudflare/references/d1/configuration.md +127 -0
  226. package/dist/template/.opencode/skill/cloudflare/references/d1/gotchas.md +70 -0
  227. package/dist/template/.opencode/skill/cloudflare/references/d1/patterns.md +144 -0
  228. package/dist/template/.opencode/skill/cloudflare/references/ddos/README.md +34 -0
  229. package/dist/template/.opencode/skill/cloudflare/references/ddos/api.md +136 -0
  230. package/dist/template/.opencode/skill/cloudflare/references/ddos/configuration.md +67 -0
  231. package/dist/template/.opencode/skill/cloudflare/references/ddos/gotchas.md +114 -0
  232. package/dist/template/.opencode/skill/cloudflare/references/ddos/patterns.md +158 -0
  233. package/dist/template/.opencode/skill/cloudflare/references/do-storage/README.md +62 -0
  234. package/dist/template/.opencode/skill/cloudflare/references/do-storage/api.md +89 -0
  235. package/dist/template/.opencode/skill/cloudflare/references/do-storage/configuration.md +116 -0
  236. package/dist/template/.opencode/skill/cloudflare/references/do-storage/gotchas.md +93 -0
  237. package/dist/template/.opencode/skill/cloudflare/references/do-storage/patterns.md +112 -0
  238. package/dist/template/.opencode/skill/cloudflare/references/durable-objects/README.md +125 -0
  239. package/dist/template/.opencode/skill/cloudflare/references/durable-objects/api.md +152 -0
  240. package/dist/template/.opencode/skill/cloudflare/references/durable-objects/configuration.md +148 -0
  241. package/dist/template/.opencode/skill/cloudflare/references/durable-objects/gotchas.md +158 -0
  242. package/dist/template/.opencode/skill/cloudflare/references/durable-objects/patterns.md +255 -0
  243. package/dist/template/.opencode/skill/cloudflare/references/email-routing/README.md +18 -0
  244. package/dist/template/.opencode/skill/cloudflare/references/email-routing/api.md +46 -0
  245. package/dist/template/.opencode/skill/cloudflare/references/email-routing/configuration.md +63 -0
  246. package/dist/template/.opencode/skill/cloudflare/references/email-routing/gotchas.md +16 -0
  247. package/dist/template/.opencode/skill/cloudflare/references/email-routing/patterns.md +46 -0
  248. package/dist/template/.opencode/skill/cloudflare/references/email-workers/README.md +598 -0
  249. package/dist/template/.opencode/skill/cloudflare/references/hyperdrive/README.md +62 -0
  250. package/dist/template/.opencode/skill/cloudflare/references/hyperdrive/api.md +137 -0
  251. package/dist/template/.opencode/skill/cloudflare/references/hyperdrive/configuration.md +133 -0
  252. package/dist/template/.opencode/skill/cloudflare/references/hyperdrive/gotchas.md +184 -0
  253. package/dist/template/.opencode/skill/cloudflare/references/hyperdrive/patterns.md +176 -0
  254. package/dist/template/.opencode/skill/cloudflare/references/images/README.md +14 -0
  255. package/dist/template/.opencode/skill/cloudflare/references/images/api.md +3 -0
  256. package/dist/template/.opencode/skill/cloudflare/references/images/configuration.md +45 -0
  257. package/dist/template/.opencode/skill/cloudflare/references/images/gotchas.md +23 -0
  258. package/dist/template/.opencode/skill/cloudflare/references/images/patterns.md +31 -0
  259. package/dist/template/.opencode/skill/cloudflare/references/kv/README.md +60 -0
  260. package/dist/template/.opencode/skill/cloudflare/references/kv/api.md +114 -0
  261. package/dist/template/.opencode/skill/cloudflare/references/kv/configuration.md +92 -0
  262. package/dist/template/.opencode/skill/cloudflare/references/kv/gotchas.md +117 -0
  263. package/dist/template/.opencode/skill/cloudflare/references/kv/patterns.md +139 -0
  264. package/dist/template/.opencode/skill/cloudflare/references/miniflare/README.md +64 -0
  265. package/dist/template/.opencode/skill/cloudflare/references/miniflare/api.md +144 -0
  266. package/dist/template/.opencode/skill/cloudflare/references/miniflare/configuration.md +203 -0
  267. package/dist/template/.opencode/skill/cloudflare/references/miniflare/gotchas.md +187 -0
  268. package/dist/template/.opencode/skill/cloudflare/references/miniflare/patterns.md +211 -0
  269. package/dist/template/.opencode/skill/cloudflare/references/network-interconnect/README.md +60 -0
  270. package/dist/template/.opencode/skill/cloudflare/references/network-interconnect/api.md +240 -0
  271. package/dist/template/.opencode/skill/cloudflare/references/network-interconnect/configuration.md +127 -0
  272. package/dist/template/.opencode/skill/cloudflare/references/network-interconnect/gotchas.md +171 -0
  273. package/dist/template/.opencode/skill/cloudflare/references/network-interconnect/patterns.md +171 -0
  274. package/dist/template/.opencode/skill/cloudflare/references/observability/README.md +18 -0
  275. package/dist/template/.opencode/skill/cloudflare/references/observability/api.md +51 -0
  276. package/dist/template/.opencode/skill/cloudflare/references/observability/configuration.md +60 -0
  277. package/dist/template/.opencode/skill/cloudflare/references/observability/gotchas.md +36 -0
  278. package/dist/template/.opencode/skill/cloudflare/references/observability/patterns.md +42 -0
  279. package/dist/template/.opencode/skill/cloudflare/references/pages/README.md +76 -0
  280. package/dist/template/.opencode/skill/cloudflare/references/pages/api.md +200 -0
  281. package/dist/template/.opencode/skill/cloudflare/references/pages/configuration.md +228 -0
  282. package/dist/template/.opencode/skill/cloudflare/references/pages/gotchas.md +161 -0
  283. package/dist/template/.opencode/skill/cloudflare/references/pages/patterns.md +145 -0
  284. package/dist/template/.opencode/skill/cloudflare/references/pages-functions/README.md +57 -0
  285. package/dist/template/.opencode/skill/cloudflare/references/pages-functions/api.md +201 -0
  286. package/dist/template/.opencode/skill/cloudflare/references/pages-functions/configuration.md +159 -0
  287. package/dist/template/.opencode/skill/cloudflare/references/pages-functions/gotchas.md +151 -0
  288. package/dist/template/.opencode/skill/cloudflare/references/pages-functions/patterns.md +190 -0
  289. package/dist/template/.opencode/skill/cloudflare/references/pipelines/README.md +664 -0
  290. package/dist/template/.opencode/skill/cloudflare/references/pulumi/README.md +107 -0
  291. package/dist/template/.opencode/skill/cloudflare/references/pulumi/api.md +194 -0
  292. package/dist/template/.opencode/skill/cloudflare/references/pulumi/configuration.md +216 -0
  293. package/dist/template/.opencode/skill/cloudflare/references/pulumi/gotchas.md +223 -0
  294. package/dist/template/.opencode/skill/cloudflare/references/pulumi/patterns.md +139 -0
  295. package/dist/template/.opencode/skill/cloudflare/references/queues/README.md +69 -0
  296. package/dist/template/.opencode/skill/cloudflare/references/queues/api.md +138 -0
  297. package/dist/template/.opencode/skill/cloudflare/references/queues/configuration.md +125 -0
  298. package/dist/template/.opencode/skill/cloudflare/references/queues/gotchas.md +112 -0
  299. package/dist/template/.opencode/skill/cloudflare/references/queues/patterns.md +155 -0
  300. package/dist/template/.opencode/skill/cloudflare/references/r2/README.md +61 -0
  301. package/dist/template/.opencode/skill/cloudflare/references/r2/api.md +127 -0
  302. package/dist/template/.opencode/skill/cloudflare/references/r2/configuration.md +76 -0
  303. package/dist/template/.opencode/skill/cloudflare/references/r2/gotchas.md +94 -0
  304. package/dist/template/.opencode/skill/cloudflare/references/r2/patterns.md +127 -0
  305. package/dist/template/.opencode/skill/cloudflare/references/r2-data-catalog/README.md +18 -0
  306. package/dist/template/.opencode/skill/cloudflare/references/r2-data-catalog/api.md +29 -0
  307. package/dist/template/.opencode/skill/cloudflare/references/r2-data-catalog/configuration.md +39 -0
  308. package/dist/template/.opencode/skill/cloudflare/references/r2-data-catalog/gotchas.md +20 -0
  309. package/dist/template/.opencode/skill/cloudflare/references/r2-data-catalog/patterns.md +46 -0
  310. package/dist/template/.opencode/skill/cloudflare/references/r2-sql/README.md +512 -0
  311. package/dist/template/.opencode/skill/cloudflare/references/realtime-sfu/README.md +21 -0
  312. package/dist/template/.opencode/skill/cloudflare/references/realtime-sfu/api.md +135 -0
  313. package/dist/template/.opencode/skill/cloudflare/references/realtime-sfu/configuration.md +63 -0
  314. package/dist/template/.opencode/skill/cloudflare/references/realtime-sfu/gotchas.md +75 -0
  315. package/dist/template/.opencode/skill/cloudflare/references/realtime-sfu/patterns.md +102 -0
  316. package/dist/template/.opencode/skill/cloudflare/references/realtimekit/README.md +81 -0
  317. package/dist/template/.opencode/skill/cloudflare/references/realtimekit/api.md +164 -0
  318. package/dist/template/.opencode/skill/cloudflare/references/realtimekit/configuration.md +147 -0
  319. package/dist/template/.opencode/skill/cloudflare/references/realtimekit/gotchas.md +172 -0
  320. package/dist/template/.opencode/skill/cloudflare/references/realtimekit/patterns.md +155 -0
  321. package/dist/template/.opencode/skill/cloudflare/references/sandbox/README.md +90 -0
  322. package/dist/template/.opencode/skill/cloudflare/references/sandbox/api.md +178 -0
  323. package/dist/template/.opencode/skill/cloudflare/references/sandbox/configuration.md +131 -0
  324. package/dist/template/.opencode/skill/cloudflare/references/sandbox/gotchas.md +156 -0
  325. package/dist/template/.opencode/skill/cloudflare/references/sandbox/patterns.md +203 -0
  326. package/dist/template/.opencode/skill/cloudflare/references/secrets-store/README.md +58 -0
  327. package/dist/template/.opencode/skill/cloudflare/references/secrets-store/api.md +182 -0
  328. package/dist/template/.opencode/skill/cloudflare/references/secrets-store/configuration.md +140 -0
  329. package/dist/template/.opencode/skill/cloudflare/references/secrets-store/gotchas.md +129 -0
  330. package/dist/template/.opencode/skill/cloudflare/references/secrets-store/patterns.md +218 -0
  331. package/dist/template/.opencode/skill/cloudflare/references/smart-placement/README.md +91 -0
  332. package/dist/template/.opencode/skill/cloudflare/references/smart-placement/api.md +139 -0
  333. package/dist/template/.opencode/skill/cloudflare/references/smart-placement/configuration.md +129 -0
  334. package/dist/template/.opencode/skill/cloudflare/references/smart-placement/gotchas.md +87 -0
  335. package/dist/template/.opencode/skill/cloudflare/references/smart-placement/patterns.md +135 -0
  336. package/dist/template/.opencode/skill/cloudflare/references/snippets/README.md +15 -0
  337. package/dist/template/.opencode/skill/cloudflare/references/snippets/api.md +47 -0
  338. package/dist/template/.opencode/skill/cloudflare/references/snippets/configuration.md +33 -0
  339. package/dist/template/.opencode/skill/cloudflare/references/snippets/gotchas.md +21 -0
  340. package/dist/template/.opencode/skill/cloudflare/references/snippets/patterns.md +34 -0
  341. package/dist/template/.opencode/skill/cloudflare/references/spectrum/README.md +16 -0
  342. package/dist/template/.opencode/skill/cloudflare/references/spectrum/api.md +24 -0
  343. package/dist/template/.opencode/skill/cloudflare/references/spectrum/configuration.md +43 -0
  344. package/dist/template/.opencode/skill/cloudflare/references/spectrum/gotchas.md +42 -0
  345. package/dist/template/.opencode/skill/cloudflare/references/spectrum/patterns.md +40 -0
  346. package/dist/template/.opencode/skill/cloudflare/references/static-assets/README.md +14 -0
  347. package/dist/template/.opencode/skill/cloudflare/references/static-assets/api.md +3 -0
  348. package/dist/template/.opencode/skill/cloudflare/references/static-assets/configuration.md +47 -0
  349. package/dist/template/.opencode/skill/cloudflare/references/static-assets/gotchas.md +44 -0
  350. package/dist/template/.opencode/skill/cloudflare/references/static-assets/patterns.md +42 -0
  351. package/dist/template/.opencode/skill/cloudflare/references/stream/README.md +103 -0
  352. package/dist/template/.opencode/skill/cloudflare/references/stream/api.md +204 -0
  353. package/dist/template/.opencode/skill/cloudflare/references/stream/configuration.md +127 -0
  354. package/dist/template/.opencode/skill/cloudflare/references/stream/gotchas.md +131 -0
  355. package/dist/template/.opencode/skill/cloudflare/references/stream/patterns.md +152 -0
  356. package/dist/template/.opencode/skill/cloudflare/references/tail-workers/README.md +640 -0
  357. package/dist/template/.opencode/skill/cloudflare/references/terraform/README.md +76 -0
  358. package/dist/template/.opencode/skill/cloudflare/references/terraform/api.md +159 -0
  359. package/dist/template/.opencode/skill/cloudflare/references/terraform/configuration.md +156 -0
  360. package/dist/template/.opencode/skill/cloudflare/references/terraform/gotchas.md +207 -0
  361. package/dist/template/.opencode/skill/cloudflare/references/terraform/patterns.md +135 -0
  362. package/dist/template/.opencode/skill/cloudflare/references/tunnel/README.md +82 -0
  363. package/dist/template/.opencode/skill/cloudflare/references/tunnel/api.md +105 -0
  364. package/dist/template/.opencode/skill/cloudflare/references/tunnel/configuration.md +113 -0
  365. package/dist/template/.opencode/skill/cloudflare/references/tunnel/gotchas.md +115 -0
  366. package/dist/template/.opencode/skill/cloudflare/references/tunnel/patterns.md +157 -0
  367. package/dist/template/.opencode/skill/cloudflare/references/turn/README.md +699 -0
  368. package/dist/template/.opencode/skill/cloudflare/references/turnstile/README.md +14 -0
  369. package/dist/template/.opencode/skill/cloudflare/references/turnstile/api.md +3 -0
  370. package/dist/template/.opencode/skill/cloudflare/references/turnstile/configuration.md +19 -0
  371. package/dist/template/.opencode/skill/cloudflare/references/turnstile/gotchas.md +27 -0
  372. package/dist/template/.opencode/skill/cloudflare/references/turnstile/patterns.md +41 -0
  373. package/dist/template/.opencode/skill/cloudflare/references/vectorize/README.md +682 -0
  374. package/dist/template/.opencode/skill/cloudflare/references/waf/README.md +14 -0
  375. package/dist/template/.opencode/skill/cloudflare/references/waf/api.md +3 -0
  376. package/dist/template/.opencode/skill/cloudflare/references/waf/configuration.md +44 -0
  377. package/dist/template/.opencode/skill/cloudflare/references/waf/gotchas.md +24 -0
  378. package/dist/template/.opencode/skill/cloudflare/references/waf/patterns.md +29 -0
  379. package/dist/template/.opencode/skill/cloudflare/references/web-analytics/README.md +19 -0
  380. package/dist/template/.opencode/skill/cloudflare/references/web-analytics/api.md +52 -0
  381. package/dist/template/.opencode/skill/cloudflare/references/web-analytics/configuration.md +31 -0
  382. package/dist/template/.opencode/skill/cloudflare/references/web-analytics/gotchas.md +28 -0
  383. package/dist/template/.opencode/skill/cloudflare/references/web-analytics/patterns.md +52 -0
  384. package/dist/template/.opencode/skill/cloudflare/references/workerd/README.md +47 -0
  385. package/dist/template/.opencode/skill/cloudflare/references/workerd/api.md +199 -0
  386. package/dist/template/.opencode/skill/cloudflare/references/workerd/configuration.md +185 -0
  387. package/dist/template/.opencode/skill/cloudflare/references/workerd/gotchas.md +203 -0
  388. package/dist/template/.opencode/skill/cloudflare/references/workerd/patterns.md +216 -0
  389. package/dist/template/.opencode/skill/cloudflare/references/workers/README.md +96 -0
  390. package/dist/template/.opencode/skill/cloudflare/references/workers/api.md +137 -0
  391. package/dist/template/.opencode/skill/cloudflare/references/workers/configuration.md +147 -0
  392. package/dist/template/.opencode/skill/cloudflare/references/workers/gotchas.md +99 -0
  393. package/dist/template/.opencode/skill/cloudflare/references/workers/patterns.md +149 -0
  394. package/dist/template/.opencode/skill/cloudflare/references/workers-ai/README.md +116 -0
  395. package/dist/template/.opencode/skill/cloudflare/references/workers-for-platforms/README.md +48 -0
  396. package/dist/template/.opencode/skill/cloudflare/references/workers-for-platforms/api.md +169 -0
  397. package/dist/template/.opencode/skill/cloudflare/references/workers-for-platforms/configuration.md +136 -0
  398. package/dist/template/.opencode/skill/cloudflare/references/workers-for-platforms/gotchas.md +130 -0
  399. package/dist/template/.opencode/skill/cloudflare/references/workers-for-platforms/patterns.md +170 -0
  400. package/dist/template/.opencode/skill/cloudflare/references/workers-playground/README.md +16 -0
  401. package/dist/template/.opencode/skill/cloudflare/references/workers-playground/api.md +20 -0
  402. package/dist/template/.opencode/skill/cloudflare/references/workers-playground/configuration.md +3 -0
  403. package/dist/template/.opencode/skill/cloudflare/references/workers-playground/gotchas.md +35 -0
  404. package/dist/template/.opencode/skill/cloudflare/references/workers-playground/patterns.md +42 -0
  405. package/dist/template/.opencode/skill/cloudflare/references/workers-vpc/README.md +579 -0
  406. package/dist/template/.opencode/skill/cloudflare/references/workflows/README.md +62 -0
  407. package/dist/template/.opencode/skill/cloudflare/references/workflows/api.md +125 -0
  408. package/dist/template/.opencode/skill/cloudflare/references/workflows/configuration.md +177 -0
  409. package/dist/template/.opencode/skill/cloudflare/references/workflows/gotchas.md +136 -0
  410. package/dist/template/.opencode/skill/cloudflare/references/workflows/patterns.md +132 -0
  411. package/dist/template/.opencode/skill/cloudflare/references/wrangler/README.md +90 -0
  412. package/dist/template/.opencode/skill/cloudflare/references/wrangler/api.md +140 -0
  413. package/dist/template/.opencode/skill/cloudflare/references/wrangler/configuration.md +128 -0
  414. package/dist/template/.opencode/skill/cloudflare/references/wrangler/gotchas.md +93 -0
  415. package/dist/template/.opencode/skill/cloudflare/references/wrangler/patterns.md +150 -0
  416. package/dist/template/.opencode/skill/cloudflare/references/zaraz/README.md +360 -0
  417. package/dist/template/.opencode/skill/code-search-patterns/SKILL.md +253 -0
  418. package/dist/template/.opencode/skill/code-simplification/SKILL.md +211 -0
  419. package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +135 -0
  420. package/dist/template/.opencode/skill/condition-based-waiting/example.ts +158 -0
  421. package/dist/template/.opencode/skill/context-condensation/SKILL.md +149 -0
  422. package/dist/template/.opencode/skill/context-engineering/SKILL.md +176 -0
  423. package/dist/template/.opencode/skill/context-initialization/SKILL.md +69 -0
  424. package/dist/template/.opencode/skill/context-management/SKILL.md +390 -0
  425. package/dist/template/.opencode/skill/core-data-expert/SKILL.md +93 -0
  426. package/dist/template/.opencode/skill/core-data-expert/references/batch-operations.md +543 -0
  427. package/dist/template/.opencode/skill/core-data-expert/references/cloudkit-integration.md +259 -0
  428. package/dist/template/.opencode/skill/core-data-expert/references/concurrency.md +522 -0
  429. package/dist/template/.opencode/skill/core-data-expert/references/fetch-requests.md +643 -0
  430. package/dist/template/.opencode/skill/core-data-expert/references/glossary.md +233 -0
  431. package/dist/template/.opencode/skill/core-data-expert/references/migration.md +393 -0
  432. package/dist/template/.opencode/skill/core-data-expert/references/model-configuration.md +597 -0
  433. package/dist/template/.opencode/skill/core-data-expert/references/performance.md +300 -0
  434. package/dist/template/.opencode/skill/core-data-expert/references/persistent-history.md +553 -0
  435. package/dist/template/.opencode/skill/core-data-expert/references/project-audit.md +60 -0
  436. package/dist/template/.opencode/skill/core-data-expert/references/saving.md +574 -0
  437. package/dist/template/.opencode/skill/core-data-expert/references/stack-setup.md +625 -0
  438. package/dist/template/.opencode/skill/core-data-expert/references/testing.md +300 -0
  439. package/dist/template/.opencode/skill/core-data-expert/references/threading.md +589 -0
  440. package/dist/template/.opencode/skill/deep-research/SKILL.md +384 -0
  441. package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +176 -0
  442. package/dist/template/.opencode/skill/deprecation-and-migration/SKILL.md +189 -0
  443. package/dist/template/.opencode/skill/design-direction-advisor/SKILL.md +139 -0
  444. package/dist/template/.opencode/skill/design-system-audit/SKILL.md +153 -0
  445. package/dist/template/.opencode/skill/design-taste-frontend/SKILL.md +238 -0
  446. package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +320 -0
  447. package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +191 -0
  448. package/dist/template/.opencode/skill/documentation-and-adrs/SKILL.md +220 -0
  449. package/dist/template/.opencode/skill/executing-plans/SKILL.md +247 -0
  450. package/dist/template/.opencode/skill/figma/SKILL.md +224 -0
  451. package/dist/template/.opencode/skill/figma-go/SKILL.md +65 -0
  452. package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +357 -0
  453. package/dist/template/.opencode/skill/frontend-design/SKILL.md +235 -0
  454. package/dist/template/.opencode/skill/frontend-design/references/animation/motion-advanced.md +224 -0
  455. package/dist/template/.opencode/skill/frontend-design/references/animation/motion-core.md +181 -0
  456. package/dist/template/.opencode/skill/frontend-design/references/canvas/execution.md +90 -0
  457. package/dist/template/.opencode/skill/frontend-design/references/canvas/philosophy.md +94 -0
  458. package/dist/template/.opencode/skill/frontend-design/references/design/color-system.md +111 -0
  459. package/dist/template/.opencode/skill/frontend-design/references/design/interaction.md +149 -0
  460. package/dist/template/.opencode/skill/frontend-design/references/design/typography-rules.md +106 -0
  461. package/dist/template/.opencode/skill/frontend-design/references/design/ux-writing.md +99 -0
  462. package/dist/template/.opencode/skill/frontend-design/references/shadcn/accessibility.md +132 -0
  463. package/dist/template/.opencode/skill/frontend-design/references/shadcn/core-components.md +153 -0
  464. package/dist/template/.opencode/skill/frontend-design/references/shadcn/form-components.md +158 -0
  465. package/dist/template/.opencode/skill/frontend-design/references/shadcn/setup.md +69 -0
  466. package/dist/template/.opencode/skill/frontend-design/references/shadcn/theming.md +152 -0
  467. package/dist/template/.opencode/skill/frontend-design/references/tailwind/responsive.md +112 -0
  468. package/dist/template/.opencode/skill/frontend-design/references/tailwind/utilities-layout.md +134 -0
  469. package/dist/template/.opencode/skill/frontend-design/references/tailwind/utilities-styling.md +165 -0
  470. package/dist/template/.opencode/skill/frontend-design/references/tailwind/v4-config.md +147 -0
  471. package/dist/template/.opencode/skill/frontend-design/references/tailwind/v4-features.md +128 -0
  472. package/dist/template/.opencode/skill/full-output-enforcement/SKILL.md +62 -0
  473. package/dist/template/.opencode/skill/gemini-large-context/SKILL.md +216 -0
  474. package/dist/template/.opencode/skill/gh-address-comments/SKILL.md +29 -0
  475. package/dist/template/.opencode/skill/gh-address-comments/scripts/fetch_comments.py +237 -0
  476. package/dist/template/.opencode/skill/gh-fix-ci/SKILL.md +38 -0
  477. package/dist/template/.opencode/skill/gh-fix-ci/scripts/inspect_pr_checks.py +509 -0
  478. package/dist/template/.opencode/skill/hi-fi-prototype-html/SKILL.md +253 -0
  479. package/dist/template/.opencode/skill/high-end-visual-design/SKILL.md +111 -0
  480. package/dist/template/.opencode/skill/html-deck-export/SKILL.md +189 -0
  481. package/dist/template/.opencode/skill/incremental-implementation/SKILL.md +191 -0
  482. package/dist/template/.opencode/skill/index-knowledge/SKILL.md +413 -0
  483. package/dist/template/.opencode/skill/industrial-brutalist-ui/SKILL.md +105 -0
  484. package/dist/template/.opencode/skill/jira/SKILL.md +283 -0
  485. package/dist/template/.opencode/skill/jira/mcp.json +6 -0
  486. package/dist/template/.opencode/skill/memory-grounding/SKILL.md +68 -0
  487. package/dist/template/.opencode/skill/memory-system/SKILL.md +148 -0
  488. package/dist/template/.opencode/skill/minimalist-ui/SKILL.md +98 -0
  489. package/dist/template/.opencode/skill/mockup-to-code/SKILL.md +184 -0
  490. package/dist/template/.opencode/skill/opensrc/SKILL.md +284 -0
  491. package/dist/template/.opencode/skill/opensrc/references/architecture.md +176 -0
  492. package/dist/template/.opencode/skill/opensrc/references/cli-usage.md +176 -0
  493. package/dist/template/.opencode/skill/opensrc/references/registry-support.md +137 -0
  494. package/dist/template/.opencode/skill/pdf-extract/SKILL.md +438 -0
  495. package/dist/template/.opencode/skill/performance-optimization/SKILL.md +236 -0
  496. package/dist/template/.opencode/skill/playwright/SKILL.md +381 -0
  497. package/dist/template/.opencode/skill/playwright/mcp.json +16 -0
  498. package/dist/template/.opencode/skill/playwright/references/agent-browser-cli.md +405 -0
  499. package/dist/template/.opencode/skill/playwriter/SKILL.md +158 -0
  500. package/dist/template/.opencode/skill/polar/SKILL.md +102 -0
  501. package/dist/template/.opencode/skill/portless/SKILL.md +109 -0
  502. package/dist/template/.opencode/skill/prd/SKILL.md +146 -0
  503. package/dist/template/.opencode/skill/prd-task/SKILL.md +182 -0
  504. package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +124 -0
  505. package/dist/template/.opencode/skill/prompt-leverage/SKILL.md +90 -0
  506. package/dist/template/.opencode/skill/prompt-leverage/references/framework.md +91 -0
  507. package/dist/template/.opencode/skill/prompt-leverage/scripts/augment_prompt.py +157 -0
  508. package/dist/template/.opencode/skill/react-best-practices/AGENTS.md +2410 -0
  509. package/dist/template/.opencode/skill/react-best-practices/README.md +123 -0
  510. package/dist/template/.opencode/skill/react-best-practices/SKILL.md +133 -0
  511. package/dist/template/.opencode/skill/react-best-practices/metadata.json +15 -0
  512. package/dist/template/.opencode/skill/react-best-practices/rules/_sections.md +46 -0
  513. package/dist/template/.opencode/skill/react-best-practices/rules/_template.md +28 -0
  514. package/dist/template/.opencode/skill/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  515. package/dist/template/.opencode/skill/react-best-practices/rules/advanced-use-latest.md +49 -0
  516. package/dist/template/.opencode/skill/react-best-practices/rules/async-api-routes.md +38 -0
  517. package/dist/template/.opencode/skill/react-best-practices/rules/async-defer-await.md +80 -0
  518. package/dist/template/.opencode/skill/react-best-practices/rules/async-dependencies.md +36 -0
  519. package/dist/template/.opencode/skill/react-best-practices/rules/async-parallel.md +28 -0
  520. package/dist/template/.opencode/skill/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  521. package/dist/template/.opencode/skill/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  522. package/dist/template/.opencode/skill/react-best-practices/rules/bundle-conditional.md +31 -0
  523. package/dist/template/.opencode/skill/react-best-practices/rules/bundle-defer-third-party.md +49 -0
  524. package/dist/template/.opencode/skill/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  525. package/dist/template/.opencode/skill/react-best-practices/rules/bundle-preload.md +50 -0
  526. package/dist/template/.opencode/skill/react-best-practices/rules/client-event-listeners.md +74 -0
  527. package/dist/template/.opencode/skill/react-best-practices/rules/client-localstorage-schema.md +71 -0
  528. package/dist/template/.opencode/skill/react-best-practices/rules/client-passive-event-listeners.md +48 -0
  529. package/dist/template/.opencode/skill/react-best-practices/rules/client-swr-dedup.md +56 -0
  530. package/dist/template/.opencode/skill/react-best-practices/rules/js-batch-dom-css.md +82 -0
  531. package/dist/template/.opencode/skill/react-best-practices/rules/js-cache-function-results.md +80 -0
  532. package/dist/template/.opencode/skill/react-best-practices/rules/js-cache-property-access.md +28 -0
  533. package/dist/template/.opencode/skill/react-best-practices/rules/js-cache-storage.md +70 -0
  534. package/dist/template/.opencode/skill/react-best-practices/rules/js-combine-iterations.md +32 -0
  535. package/dist/template/.opencode/skill/react-best-practices/rules/js-early-exit.md +50 -0
  536. package/dist/template/.opencode/skill/react-best-practices/rules/js-hoist-regexp.md +45 -0
  537. package/dist/template/.opencode/skill/react-best-practices/rules/js-index-maps.md +37 -0
  538. package/dist/template/.opencode/skill/react-best-practices/rules/js-length-check-first.md +49 -0
  539. package/dist/template/.opencode/skill/react-best-practices/rules/js-min-max-loop.md +82 -0
  540. package/dist/template/.opencode/skill/react-best-practices/rules/js-set-map-lookups.md +24 -0
  541. package/dist/template/.opencode/skill/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  542. package/dist/template/.opencode/skill/react-best-practices/rules/rendering-activity.md +26 -0
  543. package/dist/template/.opencode/skill/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  544. package/dist/template/.opencode/skill/react-best-practices/rules/rendering-conditional-render.md +40 -0
  545. package/dist/template/.opencode/skill/react-best-practices/rules/rendering-content-visibility.md +38 -0
  546. package/dist/template/.opencode/skill/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  547. package/dist/template/.opencode/skill/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  548. package/dist/template/.opencode/skill/react-best-practices/rules/rendering-svg-precision.md +28 -0
  549. package/dist/template/.opencode/skill/react-best-practices/rules/rerender-defer-reads.md +39 -0
  550. package/dist/template/.opencode/skill/react-best-practices/rules/rerender-dependencies.md +45 -0
  551. package/dist/template/.opencode/skill/react-best-practices/rules/rerender-derived-state.md +29 -0
  552. package/dist/template/.opencode/skill/react-best-practices/rules/rerender-functional-setstate.md +74 -0
  553. package/dist/template/.opencode/skill/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  554. package/dist/template/.opencode/skill/react-best-practices/rules/rerender-memo.md +44 -0
  555. package/dist/template/.opencode/skill/react-best-practices/rules/rerender-transitions.md +40 -0
  556. package/dist/template/.opencode/skill/react-best-practices/rules/server-after-nonblocking.md +73 -0
  557. package/dist/template/.opencode/skill/react-best-practices/rules/server-cache-lru.md +41 -0
  558. package/dist/template/.opencode/skill/react-best-practices/rules/server-cache-react.md +76 -0
  559. package/dist/template/.opencode/skill/react-best-practices/rules/server-parallel-fetching.md +83 -0
  560. package/dist/template/.opencode/skill/react-best-practices/rules/server-serialization.md +38 -0
  561. package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +263 -0
  562. package/dist/template/.opencode/skill/reconcile/SKILL.md +183 -0
  563. package/dist/template/.opencode/skill/redesign-existing-projects/SKILL.md +191 -0
  564. package/dist/template/.opencode/skill/reflection-checkpoints/SKILL.md +183 -0
  565. package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +443 -0
  566. package/dist/template/.opencode/skill/requesting-code-review/references/specialist-profiles.md +108 -0
  567. package/dist/template/.opencode/skill/requesting-code-review/review.md +160 -0
  568. package/dist/template/.opencode/skill/resend/SKILL.md +177 -0
  569. package/dist/template/.opencode/skill/resend/references/react-email.md +287 -0
  570. package/dist/template/.opencode/skill/resend/references/receive-email.md +248 -0
  571. package/dist/template/.opencode/skill/resend/references/send-email.md +318 -0
  572. package/dist/template/.opencode/skill/root-cause-tracing/SKILL.md +192 -0
  573. package/dist/template/.opencode/skill/root-cause-tracing/find-polluter.sh +63 -0
  574. package/dist/template/.opencode/skill/rtk-command-compression/SKILL.md +134 -0
  575. package/dist/template/.opencode/skill/screenshot/SKILL.md +48 -0
  576. package/dist/template/.opencode/skill/screenshot/scripts/ensure_macos_permissions.sh +54 -0
  577. package/dist/template/.opencode/skill/screenshot/scripts/macos_display_info.swift +22 -0
  578. package/dist/template/.opencode/skill/screenshot/scripts/macos_permissions.swift +40 -0
  579. package/dist/template/.opencode/skill/screenshot/scripts/macos_window_info.swift +126 -0
  580. package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.ps1 +163 -0
  581. package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.py +585 -0
  582. package/dist/template/.opencode/skill/security-and-hardening/SKILL.md +296 -0
  583. package/dist/template/.opencode/skill/security-threat-model/SKILL.md +36 -0
  584. package/dist/template/.opencode/skill/security-threat-model/references/prompt-template.md +255 -0
  585. package/dist/template/.opencode/skill/security-threat-model/references/security-controls-and-assets.md +32 -0
  586. package/dist/template/.opencode/skill/sharing-skills/SKILL.md +214 -0
  587. package/dist/template/.opencode/skill/skill-creator/SKILL.md +181 -0
  588. package/dist/template/.opencode/skill/skill-installer/SKILL.md +58 -0
  589. package/dist/template/.opencode/skill/skill-installer/scripts/github_utils.py +21 -0
  590. package/dist/template/.opencode/skill/skill-installer/scripts/install-skill-from-github.py +313 -0
  591. package/dist/template/.opencode/skill/skill-installer/scripts/list-skills.py +106 -0
  592. package/dist/template/.opencode/skill/structured-edit/SKILL.md +191 -0
  593. package/dist/template/.opencode/skill/subagent-driven-development/SKILL.md +237 -0
  594. package/dist/template/.opencode/skill/supabase/SKILL.md +130 -0
  595. package/dist/template/.opencode/skill/supabase/mcp.json +27 -0
  596. package/dist/template/.opencode/skill/supabase-postgres-best-practices/AGENTS.md +1490 -0
  597. package/dist/template/.opencode/skill/supabase-postgres-best-practices/SKILL.md +65 -0
  598. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/advanced-full-text-search.md +55 -0
  599. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/advanced-jsonb-indexing.md +49 -0
  600. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/conn-idle-timeout.md +46 -0
  601. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/conn-limits.md +44 -0
  602. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/conn-pooling.md +41 -0
  603. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/conn-prepared-statements.md +46 -0
  604. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/data-batch-inserts.md +54 -0
  605. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/data-n-plus-one.md +53 -0
  606. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/data-pagination.md +50 -0
  607. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/data-upsert.md +50 -0
  608. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/lock-advisory.md +56 -0
  609. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/lock-deadlock-prevention.md +68 -0
  610. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/lock-short-transactions.md +50 -0
  611. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/lock-skip-locked.md +54 -0
  612. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/monitor-explain-analyze.md +45 -0
  613. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/monitor-pg-stat-statements.md +55 -0
  614. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/monitor-vacuum-analyze.md +55 -0
  615. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-composite-indexes.md +44 -0
  616. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-covering-indexes.md +40 -0
  617. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-index-types.md +45 -0
  618. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-missing-indexes.md +43 -0
  619. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-partial-indexes.md +45 -0
  620. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-data-types.md +46 -0
  621. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-foreign-key-indexes.md +59 -0
  622. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-lowercase-identifiers.md +55 -0
  623. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-partitioning.md +55 -0
  624. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-primary-keys.md +61 -0
  625. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/security-privileges.md +54 -0
  626. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/security-rls-basics.md +50 -0
  627. package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/security-rls-performance.md +57 -0
  628. package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +244 -0
  629. package/dist/template/.opencode/skill/swarm-coordination/references/architecture.md +39 -0
  630. package/dist/template/.opencode/skill/swarm-coordination/references/delegation-worker-protocol.md +145 -0
  631. package/dist/template/.opencode/skill/swarm-coordination/references/dependency-graph.md +50 -0
  632. package/dist/template/.opencode/skill/swarm-coordination/references/drift-check.md +90 -0
  633. package/dist/template/.opencode/skill/swarm-coordination/references/integration-beads.md +20 -0
  634. package/dist/template/.opencode/skill/swarm-coordination/references/launch-flow.md +186 -0
  635. package/dist/template/.opencode/skill/swarm-coordination/references/reconciler.md +172 -0
  636. package/dist/template/.opencode/skill/swarm-coordination/references/tier-enforcement.md +78 -0
  637. package/dist/template/.opencode/skill/swarm-coordination/references/tmux-integration.md +134 -0
  638. package/dist/template/.opencode/skill/swift-concurrency/SKILL.md +266 -0
  639. package/dist/template/.opencode/skill/swift-concurrency/references/actors.md +640 -0
  640. package/dist/template/.opencode/skill/swift-concurrency/references/async-algorithms.md +822 -0
  641. package/dist/template/.opencode/skill/swift-concurrency/references/async-await-basics.md +249 -0
  642. package/dist/template/.opencode/skill/swift-concurrency/references/async-sequences.md +670 -0
  643. package/dist/template/.opencode/skill/swift-concurrency/references/core-data.md +533 -0
  644. package/dist/template/.opencode/skill/swift-concurrency/references/glossary.md +128 -0
  645. package/dist/template/.opencode/skill/swift-concurrency/references/linting.md +142 -0
  646. package/dist/template/.opencode/skill/swift-concurrency/references/memory-management.md +542 -0
  647. package/dist/template/.opencode/skill/swift-concurrency/references/migration.md +1076 -0
  648. package/dist/template/.opencode/skill/swift-concurrency/references/performance.md +574 -0
  649. package/dist/template/.opencode/skill/swift-concurrency/references/sendable.md +578 -0
  650. package/dist/template/.opencode/skill/swift-concurrency/references/tasks.md +604 -0
  651. package/dist/template/.opencode/skill/swift-concurrency/references/testing.md +565 -0
  652. package/dist/template/.opencode/skill/swift-concurrency/references/threading.md +452 -0
  653. package/dist/template/.opencode/skill/swiftui-expert-skill/SKILL.md +329 -0
  654. package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-advanced.md +351 -0
  655. package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-basics.md +284 -0
  656. package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-transitions.md +326 -0
  657. package/dist/template/.opencode/skill/swiftui-expert-skill/references/image-optimization.md +286 -0
  658. package/dist/template/.opencode/skill/swiftui-expert-skill/references/layout-best-practices.md +312 -0
  659. package/dist/template/.opencode/skill/swiftui-expert-skill/references/liquid-glass.md +377 -0
  660. package/dist/template/.opencode/skill/swiftui-expert-skill/references/list-patterns.md +153 -0
  661. package/dist/template/.opencode/skill/swiftui-expert-skill/references/modern-apis.md +400 -0
  662. package/dist/template/.opencode/skill/swiftui-expert-skill/references/performance-patterns.md +377 -0
  663. package/dist/template/.opencode/skill/swiftui-expert-skill/references/scroll-patterns.md +305 -0
  664. package/dist/template/.opencode/skill/swiftui-expert-skill/references/sheet-navigation-patterns.md +292 -0
  665. package/dist/template/.opencode/skill/swiftui-expert-skill/references/state-management.md +447 -0
  666. package/dist/template/.opencode/skill/swiftui-expert-skill/references/text-formatting.md +285 -0
  667. package/dist/template/.opencode/skill/swiftui-expert-skill/references/view-structure.md +276 -0
  668. package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +402 -0
  669. package/dist/template/.opencode/skill/terse-output-mode/SKILL.md +95 -0
  670. package/dist/template/.opencode/skill/test-driven-development/SKILL.md +403 -0
  671. package/dist/template/.opencode/skill/testing-anti-patterns/SKILL.md +333 -0
  672. package/dist/template/.opencode/skill/think-in-code/SKILL.md +136 -0
  673. package/dist/template/.opencode/skill/using-git-worktrees/SKILL.md +259 -0
  674. package/dist/template/.opencode/skill/ux-quality-gates/SKILL.md +137 -0
  675. package/dist/template/.opencode/skill/v0/SKILL.md +158 -0
  676. package/dist/template/.opencode/skill/v1-run/SKILL.md +175 -0
  677. package/dist/template/.opencode/skill/v1-run/mcp.json +6 -0
  678. package/dist/template/.opencode/skill/vercel-deploy-claimable/SKILL.md +124 -0
  679. package/dist/template/.opencode/skill/vercel-deploy-claimable/scripts/deploy.sh +249 -0
  680. package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +357 -0
  681. package/dist/template/.opencode/skill/verification-before-completion/references/VERIFICATION_PROTOCOL.md +171 -0
  682. package/dist/template/.opencode/skill/verification-gates/SKILL.md +63 -0
  683. package/dist/template/.opencode/skill/visual-analysis/SKILL.md +154 -0
  684. package/dist/template/.opencode/skill/web-design-guidelines/SKILL.md +46 -0
  685. package/dist/template/.opencode/skill/webclaw/SKILL.md +155 -0
  686. package/dist/template/.opencode/skill/workspace-setup/SKILL.md +76 -0
  687. package/dist/template/.opencode/skill/writing-plans/SKILL.md +320 -0
  688. package/dist/template/.opencode/skill/writing-skills/SKILL.md +324 -0
  689. package/dist/template/.opencode/skill/writing-skills/anthropic-best-practices.md +1173 -0
  690. package/dist/template/.opencode/skill/writing-skills/graphviz-conventions.dot +172 -0
  691. package/dist/template/.opencode/skill/writing-skills/persuasion-principles.md +220 -0
  692. package/dist/template/.opencode/skill/writing-skills/references/anti-patterns.md +25 -0
  693. package/dist/template/.opencode/skill/writing-skills/references/claude-search-optimization.md +140 -0
  694. package/dist/template/.opencode/skill/writing-skills/references/discovery-workflow.md +11 -0
  695. package/dist/template/.opencode/skill/writing-skills/references/file-organization.md +32 -0
  696. package/dist/template/.opencode/skill/writing-skills/references/flowcharts-and-examples.md +57 -0
  697. package/dist/template/.opencode/skill/writing-skills/references/rationalization-hardening.md +75 -0
  698. package/dist/template/.opencode/skill/writing-skills/references/testing-methodology.md +397 -0
  699. package/dist/template/.opencode/skill/writing-skills/references/testing-skill-types.md +52 -0
  700. package/dist/template/.opencode/tool/context7.ts +191 -0
  701. package/dist/template/.opencode/tool/grepsearch.ts +143 -0
  702. package/dist/template/.opencode/tsconfig.json +21 -0
  703. package/dist/template/.opencode/tui.json +15 -0
  704. package/package.json +78 -0
@@ -0,0 +1,643 @@
1
+ # Fetch Requests and Querying
2
+
3
+ Optimizing fetch requests is crucial for app performance. This guide covers best practices for querying Core Data efficiently, from basic fetches to advanced aggregations.
4
+
5
+ ## Basic Fetch Request
6
+
7
+ ```swift
8
+ let fetchRequest: NSFetchRequest<Article> = Article.fetchRequest()
9
+ let articles = try context.fetch(fetchRequest)
10
+ ```
11
+
12
+ ## Optimization Strategies
13
+
14
+ ### 1. Limit Properties Fetched
15
+
16
+ Only fetch the properties you actually need:
17
+
18
+ ```swift
19
+ let fetchRequest = Article.fetchRequest()
20
+ fetchRequest.propertiesToFetch = ["name", "creationDate"]
21
+
22
+ // For list view, you might only need:
23
+ fetchRequest.propertiesToFetch = ["name", "categoryName", "views"]
24
+ ```
25
+
26
+ **SQL Impact:**
27
+ ```sql
28
+ -- Without propertiesToFetch
29
+ SELECT * FROM ZARTICLE
30
+
31
+ -- With propertiesToFetch
32
+ SELECT Z_PK, ZNAME, ZCREATIONDATE FROM ZARTICLE
33
+ ```
34
+
35
+ **Benefits:**
36
+ - Reduces memory usage
37
+ - Faster query execution
38
+ - Less data transferred from disk
39
+
40
+ ### 2. Use Batch Fetching
41
+
42
+ Fetch objects in batches to avoid loading everything at once:
43
+
44
+ ```swift
45
+ let fetchRequest = Article.fetchRequest()
46
+ fetchRequest.fetchBatchSize = 20
47
+ ```
48
+
49
+ **How it works:**
50
+ - Initially fetches only 20 objects
51
+ - Fetches next batch when needed (scrolling, iteration)
52
+ - Keeps memory usage predictable
53
+
54
+ **When to use:**
55
+ - List views (table/collection views)
56
+ - Large datasets
57
+ - Scrollable content
58
+
59
+ ### 3. Set Fetch Limit
60
+
61
+ When you only need a specific number of results:
62
+
63
+ ```swift
64
+ let fetchRequest = Article.fetchRequest()
65
+ fetchRequest.fetchLimit = 1 // Only fetch one result
66
+ ```
67
+
68
+ **Common use cases:**
69
+ ```swift
70
+ // Get newest article
71
+ fetchRequest.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
72
+ fetchRequest.fetchLimit = 1
73
+
74
+ // Get top 10 most viewed
75
+ fetchRequest.sortDescriptors = [NSSortDescriptor(key: "views", ascending: false)]
76
+ fetchRequest.fetchLimit = 10
77
+ ```
78
+
79
+ ### 4. Fetch Only Object IDs
80
+
81
+ For counting or checking existence, fetch only IDs:
82
+
83
+ ```swift
84
+ let fetchRequest = Article.fetchRequest()
85
+ fetchRequest.resultType = .managedObjectIDResultType
86
+
87
+ let objectIDs = try context.fetch(fetchRequest) as! [NSManagedObjectID]
88
+ ```
89
+
90
+ **Benefits:**
91
+ - Minimal memory usage
92
+ - Very fast
93
+ - No faulting overhead
94
+
95
+ **Use for:**
96
+ - Counting objects
97
+ - Checking existence
98
+ - Batch operations
99
+ - Validation
100
+
101
+ ## Sort Descriptors
102
+
103
+ Always specify sort descriptors for predictable results:
104
+
105
+ ```swift
106
+ let fetchRequest = Article.fetchRequest()
107
+ fetchRequest.sortDescriptors = [
108
+ NSSortDescriptor(key: "creationDate", ascending: false)
109
+ ]
110
+ ```
111
+
112
+ ### Multiple Sort Descriptors
113
+
114
+ ```swift
115
+ fetchRequest.sortDescriptors = [
116
+ NSSortDescriptor(key: "category.name", ascending: true),
117
+ NSSortDescriptor(key: "name", ascending: true)
118
+ ]
119
+ ```
120
+
121
+ ### Case-Insensitive Sorting
122
+
123
+ ```swift
124
+ let sortDescriptor = NSSortDescriptor(
125
+ key: "name",
126
+ ascending: true,
127
+ selector: #selector(NSString.caseInsensitiveCompare(_:))
128
+ )
129
+ fetchRequest.sortDescriptors = [sortDescriptor]
130
+ ```
131
+
132
+ ### Localized Sorting
133
+
134
+ ```swift
135
+ let sortDescriptor = NSSortDescriptor(
136
+ key: "name",
137
+ ascending: true,
138
+ selector: #selector(NSString.localizedStandardCompare(_:))
139
+ )
140
+ fetchRequest.sortDescriptors = [sortDescriptor]
141
+ ```
142
+
143
+ ## Predicates
144
+
145
+ Filter results using predicates:
146
+
147
+ ### Basic Predicates
148
+
149
+ ```swift
150
+ // Exact match
151
+ fetchRequest.predicate = NSPredicate(format: "name == %@", "SwiftLee")
152
+
153
+ // Contains
154
+ fetchRequest.predicate = NSPredicate(format: "name CONTAINS[cd] %@", "swift")
155
+ // [c] = case insensitive, [d] = diacritic insensitive
156
+
157
+ // Begins with
158
+ fetchRequest.predicate = NSPredicate(format: "name BEGINSWITH[c] %@", "Swift")
159
+
160
+ // Greater than
161
+ fetchRequest.predicate = NSPredicate(format: "views > %d", 100)
162
+
163
+ // Date range
164
+ let startDate = Calendar.current.startOfDay(for: Date())
165
+ let endDate = Calendar.current.date(byAdding: .day, value: 1, to: startDate)!
166
+ fetchRequest.predicate = NSPredicate(
167
+ format: "creationDate >= %@ AND creationDate < %@",
168
+ startDate as NSDate,
169
+ endDate as NSDate
170
+ )
171
+ ```
172
+
173
+ ### Compound Predicates
174
+
175
+ ```swift
176
+ // AND
177
+ let predicate1 = NSPredicate(format: "views > %d", 100)
178
+ let predicate2 = NSPredicate(format: "category.name == %@", "Swift")
179
+ fetchRequest.predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate1, predicate2])
180
+
181
+ // OR
182
+ fetchRequest.predicate = NSCompoundPredicate(orPredicateWithSubpredicates: [predicate1, predicate2])
183
+
184
+ // NOT
185
+ fetchRequest.predicate = NSCompoundPredicate(notPredicateWithSubpredicate: predicate1)
186
+ ```
187
+
188
+ ### Relationship Predicates
189
+
190
+ ```swift
191
+ // Articles with a specific category
192
+ fetchRequest.predicate = NSPredicate(format: "category.name == %@", "Swift")
193
+
194
+ // Articles with any attachments
195
+ fetchRequest.predicate = NSPredicate(format: "attachments.@count > 0")
196
+
197
+ // Articles with more than 5 attachments
198
+ fetchRequest.predicate = NSPredicate(format: "attachments.@count > 5")
199
+
200
+ // Using ANY
201
+ fetchRequest.predicate = NSPredicate(format: "ANY attachments.size > %d", 1000000)
202
+
203
+ // Using ALL
204
+ fetchRequest.predicate = NSPredicate(format: "ALL attachments.isDownloaded == YES")
205
+ ```
206
+
207
+ ### IN Predicate
208
+
209
+ ```swift
210
+ let names = ["Swift", "iOS", "Core Data"]
211
+ fetchRequest.predicate = NSPredicate(format: "name IN %@", names)
212
+ ```
213
+
214
+ ## NSFetchedResultsController
215
+
216
+ For table and collection views, use `NSFetchedResultsController` for automatic updates:
217
+
218
+ ```swift
219
+ class ArticlesViewController: UIViewController {
220
+ var fetchedResultsController: NSFetchedResultsController<Article>!
221
+
222
+ func setupFetchedResultsController() {
223
+ let fetchRequest = Article.fetchRequest()
224
+ fetchRequest.sortDescriptors = [
225
+ NSSortDescriptor(key: "creationDate", ascending: false)
226
+ ]
227
+ fetchRequest.fetchBatchSize = 20
228
+
229
+ fetchedResultsController = NSFetchedResultsController(
230
+ fetchRequest: fetchRequest,
231
+ managedObjectContext: viewContext,
232
+ sectionNameKeyPath: nil,
233
+ cacheName: "ArticlesCache"
234
+ )
235
+
236
+ fetchedResultsController.delegate = self
237
+
238
+ try? fetchedResultsController.performFetch()
239
+ }
240
+ }
241
+ ```
242
+
243
+ ### With Sections
244
+
245
+ ```swift
246
+ fetchedResultsController = NSFetchedResultsController(
247
+ fetchRequest: fetchRequest,
248
+ managedObjectContext: viewContext,
249
+ sectionNameKeyPath: "category.name", // Group by category
250
+ cacheName: "ArticlesByCategoryCache"
251
+ )
252
+ ```
253
+
254
+ ### Delegate Methods (UITableView)
255
+
256
+ ```swift
257
+ extension ArticlesViewController: NSFetchedResultsControllerDelegate {
258
+ func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
259
+ tableView.beginUpdates()
260
+ }
261
+
262
+ func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>,
263
+ didChange anObject: Any,
264
+ at indexPath: IndexPath?,
265
+ for type: NSFetchedResultsChangeType,
266
+ newIndexPath: IndexPath?) {
267
+ switch type {
268
+ case .insert:
269
+ if let indexPath = newIndexPath {
270
+ tableView.insertRows(at: [indexPath], with: .automatic)
271
+ }
272
+ case .delete:
273
+ if let indexPath = indexPath {
274
+ tableView.deleteRows(at: [indexPath], with: .automatic)
275
+ }
276
+ case .update:
277
+ if let indexPath = indexPath {
278
+ tableView.reloadRows(at: [indexPath], with: .automatic)
279
+ }
280
+ case .move:
281
+ if let indexPath = indexPath, let newIndexPath = newIndexPath {
282
+ tableView.deleteRows(at: [indexPath], with: .automatic)
283
+ tableView.insertRows(at: [newIndexPath], with: .automatic)
284
+ }
285
+ @unknown default:
286
+ break
287
+ }
288
+ }
289
+
290
+ func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
291
+ tableView.endUpdates()
292
+ }
293
+ }
294
+ ```
295
+
296
+ ## Diffable Data Sources (iOS 13+)
297
+
298
+ Modern approach using `NSDiffableDataSourceSnapshot`:
299
+
300
+ ```swift
301
+ class ArticlesViewController: UICollectionViewController {
302
+ private var dataSource: UICollectionViewDiffableDataSource<String, NSManagedObjectID>!
303
+ private var fetchedResultsController: NSFetchedResultsController<Article>!
304
+
305
+ func setupDataSource() {
306
+ dataSource = UICollectionViewDiffableDataSource<String, NSManagedObjectID>(
307
+ collectionView: collectionView
308
+ ) { collectionView, indexPath, objectID in
309
+ let cell = collectionView.dequeueReusableCell(
310
+ withReuseIdentifier: "ArticleCell",
311
+ for: indexPath
312
+ ) as! ArticleCell
313
+
314
+ if let article = try? self.viewContext.existingObject(with: objectID) as? Article {
315
+ cell.configure(with: article)
316
+ }
317
+
318
+ return cell
319
+ }
320
+ }
321
+
322
+ func setupFetchedResultsController() {
323
+ let fetchRequest = Article.fetchRequest()
324
+ fetchRequest.sortDescriptors = [NSSortDescriptor(key: "name", ascending: true)]
325
+
326
+ fetchedResultsController = NSFetchedResultsController(
327
+ fetchRequest: fetchRequest,
328
+ managedObjectContext: viewContext,
329
+ sectionNameKeyPath: nil,
330
+ cacheName: nil
331
+ )
332
+
333
+ fetchedResultsController.delegate = self
334
+ try? fetchedResultsController.performFetch()
335
+ }
336
+ }
337
+
338
+ extension ArticlesViewController: NSFetchedResultsControllerDelegate {
339
+ func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>,
340
+ didChangeContentWith snapshot: NSDiffableDataSourceSnapshotReference) {
341
+ let snapshot = snapshot as NSDiffableDataSourceSnapshot<String, NSManagedObjectID>
342
+ dataSource.apply(snapshot, animatingDifferences: true)
343
+ }
344
+ }
345
+ ```
346
+
347
+ ## Aggregate Fetching with NSExpression
348
+
349
+ For statistics and aggregations:
350
+
351
+ ### Count
352
+
353
+ ```swift
354
+ // Simple count
355
+ let count = try context.count(for: Article.fetchRequest())
356
+
357
+ // Count with predicate
358
+ let fetchRequest = Article.fetchRequest()
359
+ fetchRequest.predicate = NSPredicate(format: "views > %d", 100)
360
+ let count = try context.count(for: fetchRequest)
361
+ ```
362
+
363
+ ### Sum, Average, Min, Max
364
+
365
+ ```swift
366
+ let fetchRequest = Article.fetchRequest()
367
+ fetchRequest.resultType = .dictionaryResultType
368
+
369
+ // Sum of views
370
+ let sumExpression = NSExpression(format: "@sum.views")
371
+ let sumDescription = NSExpressionDescription()
372
+ sumDescription.name = "totalViews"
373
+ sumDescription.expression = sumExpression
374
+ sumDescription.expressionResultType = .integer64AttributeType
375
+
376
+ fetchRequest.propertiesToFetch = [sumDescription]
377
+
378
+ let results = try context.fetch(fetchRequest) as! [[String: Any]]
379
+ if let totalViews = results.first?["totalViews"] as? Int {
380
+ print("Total views: \(totalViews)")
381
+ }
382
+ ```
383
+
384
+ ### Group By with Aggregates
385
+
386
+ ```swift
387
+ let fetchRequest = Article.fetchRequest()
388
+ fetchRequest.resultType = .dictionaryResultType
389
+
390
+ // Category name
391
+ let categoryExpression = NSExpression(forKeyPath: "category.name")
392
+ let categoryDescription = NSExpressionDescription()
393
+ categoryDescription.name = "categoryName"
394
+ categoryDescription.expression = categoryExpression
395
+ categoryDescription.expressionResultType = .stringAttributeType
396
+
397
+ // Sum of views per category
398
+ let sumExpression = NSExpression(format: "@sum.views")
399
+ let sumDescription = NSExpressionDescription()
400
+ sumDescription.name = "totalViews"
401
+ sumDescription.expression = sumExpression
402
+ sumDescription.expressionResultType = .integer64AttributeType
403
+
404
+ fetchRequest.propertiesToFetch = [categoryDescription, sumDescription]
405
+ fetchRequest.propertiesToGroupBy = ["category.name"]
406
+ fetchRequest.sortDescriptors = [NSSortDescriptor(key: "categoryName", ascending: true)]
407
+
408
+ let results = try context.fetch(fetchRequest) as! [[String: Any]]
409
+ for result in results {
410
+ let category = result["categoryName"] as? String ?? "Unknown"
411
+ let views = result["totalViews"] as? Int ?? 0
412
+ print("\(category): \(views) views")
413
+ }
414
+ ```
415
+
416
+ ### Count Per Group
417
+
418
+ ```swift
419
+ let fetchRequest = Article.fetchRequest()
420
+ fetchRequest.resultType = .dictionaryResultType
421
+
422
+ let categoryExpression = NSExpression(forKeyPath: "category.name")
423
+ let categoryDescription = NSExpressionDescription()
424
+ categoryDescription.name = "categoryName"
425
+ categoryDescription.expression = categoryExpression
426
+ categoryDescription.expressionResultType = .stringAttributeType
427
+
428
+ let countExpression = NSExpression(forFunction: "count:", arguments: [NSExpression(forKeyPath: "objectID")])
429
+ let countDescription = NSExpressionDescription()
430
+ countDescription.name = "count"
431
+ countDescription.expression = countExpression
432
+ countDescription.expressionResultType = .integer64AttributeType
433
+
434
+ fetchRequest.propertiesToFetch = [categoryDescription, countDescription]
435
+ fetchRequest.propertiesToGroupBy = ["category.name"]
436
+
437
+ let results = try context.fetch(fetchRequest) as! [[String: Any]]
438
+ ```
439
+
440
+ ## Typed Fetch Requests with Managed Protocol
441
+
442
+ Create a protocol for type-safe fetch requests:
443
+
444
+ ```swift
445
+ protocol Managed: NSManagedObject {
446
+ static var entityName: String { get }
447
+ }
448
+
449
+ extension Managed {
450
+ static var entityName: String {
451
+ return String(describing: self)
452
+ }
453
+
454
+ static func fetchRequest<T: NSManagedObject>() -> NSFetchRequest<T> {
455
+ return NSFetchRequest<T>(entityName: entityName)
456
+ }
457
+ }
458
+
459
+ // Conform your entities
460
+ extension Article: Managed {}
461
+
462
+ // Usage
463
+ let fetchRequest: NSFetchRequest<Article> = Article.fetchRequest()
464
+ ```
465
+
466
+ ## Asynchronous Fetching
467
+
468
+ For large datasets, fetch asynchronously:
469
+
470
+ ```swift
471
+ let fetchRequest = Article.fetchRequest()
472
+ let asyncFetchRequest = NSAsynchronousFetchRequest(fetchRequest: fetchRequest) { result in
473
+ guard let articles = result.finalResult else { return }
474
+
475
+ DispatchQueue.main.async {
476
+ // Update UI with articles
477
+ }
478
+ }
479
+
480
+ try? context.execute(asyncFetchRequest)
481
+ ```
482
+
483
+ ## Faulting Control
484
+
485
+ ### Prefetching Relationships
486
+
487
+ ```swift
488
+ let fetchRequest = Article.fetchRequest()
489
+ fetchRequest.relationshipKeyPathsForPrefetching = ["category", "attachments"]
490
+ ```
491
+
492
+ **Benefits:**
493
+ - Reduces number of database trips
494
+ - Improves performance when accessing relationships
495
+ - Prevents N+1 query problem
496
+
497
+ ### Returning Faults
498
+
499
+ ```swift
500
+ fetchRequest.returnsObjectsAsFaults = false
501
+ ```
502
+
503
+ **When to use:**
504
+ - You know you'll access all properties immediately
505
+ - Small result sets
506
+ - Avoid for large datasets (high memory usage)
507
+
508
+ ## Common Patterns
509
+
510
+ ### Fetch Single Object by ID
511
+
512
+ ```swift
513
+ func fetchArticle(withID id: NSManagedObjectID) -> Article? {
514
+ return try? context.existingObject(with: id) as? Article
515
+ }
516
+ ```
517
+
518
+ ### Fetch or Create
519
+
520
+ ```swift
521
+ func fetchOrCreateArticle(withName name: String) -> Article {
522
+ let fetchRequest = Article.fetchRequest()
523
+ fetchRequest.predicate = NSPredicate(format: "name == %@", name)
524
+ fetchRequest.fetchLimit = 1
525
+
526
+ if let existing = try? context.fetch(fetchRequest).first {
527
+ return existing
528
+ }
529
+
530
+ let article = Article(context: context)
531
+ article.name = name
532
+ return article
533
+ }
534
+ ```
535
+
536
+ ### Check Existence
537
+
538
+ ```swift
539
+ func articleExists(withName name: String) -> Bool {
540
+ let fetchRequest = Article.fetchRequest()
541
+ fetchRequest.predicate = NSPredicate(format: "name == %@", name)
542
+ fetchRequest.fetchLimit = 1
543
+ fetchRequest.resultType = .countResultType
544
+
545
+ let count = (try? context.count(for: fetchRequest)) ?? 0
546
+ return count > 0
547
+ }
548
+ ```
549
+
550
+ ## Performance Tips
551
+
552
+ ### ❌ Don't Fetch Everything
553
+
554
+ ```swift
555
+ // Bad: Fetches all properties, all objects
556
+ let articles = try context.fetch(Article.fetchRequest())
557
+ let count = articles.count
558
+ ```
559
+
560
+ ### ✅ Use Count Request
561
+
562
+ ```swift
563
+ // Good: Only counts, doesn't fetch objects
564
+ let count = try context.count(for: Article.fetchRequest())
565
+ ```
566
+
567
+ ### ❌ Don't Access Relationships in Loops
568
+
569
+ ```swift
570
+ // Bad: Fires fault for each article
571
+ for article in articles {
572
+ print(article.category?.name) // Fault!
573
+ }
574
+ ```
575
+
576
+ ### ✅ Prefetch Relationships
577
+
578
+ ```swift
579
+ // Good: Prefetches all categories at once
580
+ let fetchRequest = Article.fetchRequest()
581
+ fetchRequest.relationshipKeyPathsForPrefetching = ["category"]
582
+ let articles = try context.fetch(fetchRequest)
583
+
584
+ for article in articles {
585
+ print(article.category?.name) // No fault!
586
+ }
587
+ ```
588
+
589
+ ### ❌ Don't Fetch in Loops
590
+
591
+ ```swift
592
+ // Bad: Multiple fetch requests
593
+ for name in names {
594
+ let fetchRequest = Article.fetchRequest()
595
+ fetchRequest.predicate = NSPredicate(format: "name == %@", name)
596
+ let articles = try? context.fetch(fetchRequest)
597
+ }
598
+ ```
599
+
600
+ ### ✅ Use IN Predicate
601
+
602
+ ```swift
603
+ // Good: Single fetch request
604
+ let fetchRequest = Article.fetchRequest()
605
+ fetchRequest.predicate = NSPredicate(format: "name IN %@", names)
606
+ let articles = try context.fetch(fetchRequest)
607
+ ```
608
+
609
+ ## Debugging Fetch Requests
610
+
611
+ ### Enable SQL Debug
612
+
613
+ Add launch argument:
614
+ ```
615
+ -com.apple.CoreData.SQLDebug 1
616
+ ```
617
+
618
+ **Output:**
619
+ ```sql
620
+ CoreData: sql: SELECT Z_PK, ZNAME, ZVIEWS FROM ZARTICLE WHERE ZVIEWS > ? ORDER BY ZCREATIONDATE DESC LIMIT 20
621
+ ```
622
+
623
+ ### Measure Fetch Performance
624
+
625
+ ```swift
626
+ let startTime = CFAbsoluteTimeGetCurrent()
627
+ let articles = try context.fetch(fetchRequest)
628
+ let timeElapsed = CFAbsoluteTimeGetCurrent() - startTime
629
+ print("Fetch took \(timeElapsed) seconds")
630
+ ```
631
+
632
+ ## Summary
633
+
634
+ 1. **Use `propertiesToFetch`** to limit fetched properties
635
+ 2. **Set `fetchBatchSize`** for large datasets (typically 20-50)
636
+ 3. **Use `fetchLimit`** when you only need a few results
637
+ 4. **Always specify sort descriptors** for predictable results
638
+ 5. **Use predicates** to filter at the database level
639
+ 6. **Use `NSFetchedResultsController`** for list views
640
+ 7. **Prefetch relationships** to avoid N+1 queries
641
+ 8. **Use count requests** instead of fetching for counts
642
+ 9. **Use aggregate expressions** for statistics
643
+ 10. **Enable SQL debug** to understand query performance