skillfullstack 0.0.0-stage → 1.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 (775) hide show
  1. package/.skillsRegistry/catalog.json +231 -0
  2. package/AGENTS.md +89 -0
  3. package/README.md +210 -2
  4. package/bin/index.js +508 -0
  5. package/package.json +57 -4
  6. package/skills/backend/apiEngineering/SKILL.md +102 -0
  7. package/skills/backend/apiEngineering/evals/evalApiEngineering.py +81 -0
  8. package/skills/backend/apiEngineering/evals/fixtures/invalid/sampleInvalidOpenApi.json +40 -0
  9. package/skills/backend/apiEngineering/evals/fixtures/valid/sampleValidOpenApi.json +47 -0
  10. package/skills/backend/apiEngineering/policies/compatibility.md +42 -0
  11. package/skills/backend/apiEngineering/policies/mandatory.md +48 -0
  12. package/skills/backend/apiEngineering/policies/performance.md +39 -0
  13. package/skills/backend/apiEngineering/policies/security.md +36 -0
  14. package/skills/backend/apiEngineering/references/apiObservability.md +39 -0
  15. package/skills/backend/apiEngineering/references/apiReference.md +3 -0
  16. package/skills/backend/apiEngineering/references/apiSecurityOwasp.md +47 -0
  17. package/skills/backend/apiEngineering/references/contractCompatibility.md +26 -0
  18. package/skills/backend/apiEngineering/references/databaseTransactions.md +40 -0
  19. package/skills/backend/apiEngineering/references/distributedReliability.md +26 -0
  20. package/skills/backend/apiEngineering/references/multiTenancy.md +27 -0
  21. package/skills/backend/apiEngineering/references/openApi32Standards.md +58 -0
  22. package/skills/backend/apiEngineering/references/paginationVersioning.md +57 -0
  23. package/skills/backend/apiEngineering/references/responseStandards.md +94 -0
  24. package/skills/backend/apiEngineering/scripts/auditApiContract.py +123 -0
  25. package/skills/backend/apiEngineering/scripts/checkBreakingChanges.py +77 -0
  26. package/skills/backend/apiEngineering/scripts/generateResponseEnvelope.py +88 -0
  27. package/skills/backend/apiEngineering/templates/apiChecklist.md +27 -0
  28. package/skills/backend/apiEngineering/templates/openapi.yaml +125 -0
  29. package/skills/backend/apiEngineering/templates/problemDetails.json +44 -0
  30. package/skills/backend/databaseArchitecture/SKILL.md +118 -0
  31. package/skills/backend/databaseArchitecture/evals/evalDatabaseArchitecture.py +85 -0
  32. package/skills/backend/databaseArchitecture/evals/fixtures/dangerousMigration.sql +4 -0
  33. package/skills/backend/databaseArchitecture/evals/fixtures/invalidSchema.sql +23 -0
  34. package/skills/backend/databaseArchitecture/evals/fixtures/safeMigration.sql +3 -0
  35. package/skills/backend/databaseArchitecture/evals/fixtures/validSchema.sql +37 -0
  36. package/skills/backend/databaseArchitecture/policies/integrity.md +25 -0
  37. package/skills/backend/databaseArchitecture/policies/mandatory.md +32 -0
  38. package/skills/backend/databaseArchitecture/policies/migration.md +22 -0
  39. package/skills/backend/databaseArchitecture/policies/normalization.md +25 -0
  40. package/skills/backend/databaseArchitecture/policies/performance.md +26 -0
  41. package/skills/backend/databaseArchitecture/policies/recovery.md +23 -0
  42. package/skills/backend/databaseArchitecture/policies/security.md +26 -0
  43. package/skills/backend/databaseArchitecture/policies/tableCreationChecklist.md +70 -0
  44. package/skills/backend/databaseArchitecture/references/analyticsWarehousing.md +32 -0
  45. package/skills/backend/databaseArchitecture/references/apiReference.md +3 -0
  46. package/skills/backend/databaseArchitecture/references/backupDisasterRecovery.md +27 -0
  47. package/skills/backend/databaseArchitecture/references/dataModelingLifecycle.md +30 -0
  48. package/skills/backend/databaseArchitecture/references/databaseTaxonomy.md +32 -0
  49. package/skills/backend/databaseArchitecture/references/indexingOptimization.md +32 -0
  50. package/skills/backend/databaseArchitecture/references/normalizationTheory.md +61 -0
  51. package/skills/backend/databaseArchitecture/references/scalabilitySharding.md +37 -0
  52. package/skills/backend/databaseArchitecture/references/transactionConcurrency.md +39 -0
  53. package/skills/backend/databaseArchitecture/scripts/analyzeMigration.py +99 -0
  54. package/skills/backend/databaseArchitecture/scripts/auditDatabaseSchema.py +177 -0
  55. package/skills/backend/databaseArchitecture/scripts/inspectDatabaseIndexes.py +149 -0
  56. package/skills/backend/databaseArchitecture/templates/adrTemplate.md +32 -0
  57. package/skills/backend/databaseArchitecture/templates/databaseChecklist.md +29 -0
  58. package/skills/backend/databaseArchitecture/templates/migrationPlan.md +40 -0
  59. package/skills/backend/durableBackgroundJobs/SKILL.md +112 -0
  60. package/skills/backend/durableBackgroundJobs/evals/durableJobVerification.json +14 -0
  61. package/skills/backend/durableBackgroundJobs/references/apiReference.md +3 -0
  62. package/skills/backend/durableBackgroundJobs/references/durableStepPatterns.md +6 -0
  63. package/skills/backend/durableBackgroundJobs/references/idempotencyKeys.md +5 -0
  64. package/skills/backend/durableBackgroundJobs/scripts/testWorkflowDispatch.py +24 -0
  65. package/skills/backend/golangStandard/SKILL.md +155 -0
  66. package/skills/backend/golangStandard/evals/goVerification.json +14 -0
  67. package/skills/backend/golangStandard/references/apiReference.md +3 -0
  68. package/skills/backend/golangStandard/references/layoutGuide.md +26 -0
  69. package/skills/backend/golangStandard/references/slogPatterns.md +26 -0
  70. package/skills/backend/golangStandard/scripts/scaffoldGoModule.py +105 -0
  71. package/skills/backend/pythonStandard/SKILL.md +138 -0
  72. package/skills/backend/pythonStandard/evals/pythonVerification.json +14 -0
  73. package/skills/backend/pythonStandard/references/apiReference.md +3 -0
  74. package/skills/backend/pythonStandard/references/pydanticPatterns.md +16 -0
  75. package/skills/backend/pythonStandard/references/pyprojectSpecs.md +37 -0
  76. package/skills/backend/pythonStandard/scripts/scaffoldUvProject.py +79 -0
  77. package/skills/backend/upstash/SKILL.md +98 -0
  78. package/skills/backend/upstash/evals/upstashVerification.json +14 -0
  79. package/skills/backend/upstash/references/apiReference.md +3 -0
  80. package/skills/backend/upstash/references/qstashFlowControl.md +34 -0
  81. package/skills/backend/upstash/references/ratelimitPatterns.md +53 -0
  82. package/skills/backend/upstash/references/workflowPatterns.md +35 -0
  83. package/skills/backend/upstash/scripts/testRedisConnection.py +36 -0
  84. package/skills/cicdDevops/cicdPipeline/SKILL.md +148 -0
  85. package/skills/cicdDevops/cicdPipeline/evals/evalCicd.py +37 -0
  86. package/skills/cicdDevops/cicdPipeline/references/apiReference.md +3 -0
  87. package/skills/cicdDevops/cicdPipeline/references/cicdDeploymentPatterns.md +27 -0
  88. package/skills/cicdDevops/cicdPipeline/scripts/auditDockerfileSecurity.py +56 -0
  89. package/skills/dataAi/mcpServerDevelopment/SKILL.md +123 -0
  90. package/skills/dataAi/mcpServerDevelopment/evals/mcpVerification.json +14 -0
  91. package/skills/dataAi/mcpServerDevelopment/references/apiReference.md +3 -0
  92. package/skills/dataAi/mcpServerDevelopment/references/mcpClientConfigs.md +38 -0
  93. package/skills/dataAi/mcpServerDevelopment/references/toolSchemaDesign.md +6 -0
  94. package/skills/dataAi/mcpServerDevelopment/scripts/runFastMcpBoilerplate.py +36 -0
  95. package/skills/dataAi/ragPipelineProduction/SKILL.md +113 -0
  96. package/skills/dataAi/ragPipelineProduction/evals/ragVerification.json +14 -0
  97. package/skills/dataAi/ragPipelineProduction/references/apiReference.md +3 -0
  98. package/skills/dataAi/ragPipelineProduction/references/chunkingStrategies.md +10 -0
  99. package/skills/dataAi/ragPipelineProduction/references/rrfAlgorithm.md +13 -0
  100. package/skills/dataAi/ragPipelineProduction/scripts/runHybridRrfSearch.py +33 -0
  101. package/skills/devopsCloud/cloudflare/SKILL.md +282 -0
  102. package/skills/devopsCloud/cloudflare/assets/README.md +48 -0
  103. package/skills/devopsCloud/cloudflare/assets/ai/agents-sdk.md +118 -0
  104. package/skills/devopsCloud/cloudflare/assets/ai/ai-gateway.md +105 -0
  105. package/skills/devopsCloud/cloudflare/assets/ai/ai-search.md +129 -0
  106. package/skills/devopsCloud/cloudflare/assets/ai/workers-ai.md +127 -0
  107. package/skills/devopsCloud/cloudflare/assets/cli/c3.md +292 -0
  108. package/skills/devopsCloud/cloudflare/assets/cli/cf-cli.md +90 -0
  109. package/skills/devopsCloud/cloudflare/assets/cli/wrangler.md +43 -0
  110. package/skills/devopsCloud/cloudflare/assets/compute/cron-triggers.md +486 -0
  111. package/skills/devopsCloud/cloudflare/assets/compute/service-bindings.md +251 -0
  112. package/skills/devopsCloud/cloudflare/assets/compute/smart-placement.md +435 -0
  113. package/skills/devopsCloud/cloudflare/assets/compute/static-assets.md +220 -0
  114. package/skills/devopsCloud/cloudflare/assets/compute/workers.md +129 -0
  115. package/skills/devopsCloud/cloudflare/assets/database-storage/d1.md +105 -0
  116. package/skills/devopsCloud/cloudflare/assets/database-storage/durable-objects.md +122 -0
  117. package/skills/devopsCloud/cloudflare/assets/database-storage/hyperdrive.md +210 -0
  118. package/skills/devopsCloud/cloudflare/assets/database-storage/kv.md +198 -0
  119. package/skills/devopsCloud/cloudflare/assets/database-storage/queues.md +105 -0
  120. package/skills/devopsCloud/cloudflare/assets/database-storage/r2.md +105 -0
  121. package/skills/devopsCloud/cloudflare/assets/database-storage/vectorize.md +97 -0
  122. package/skills/devopsCloud/cloudflare/assets/database-storage/workflows.md +141 -0
  123. package/skills/devopsCloud/cloudflare/assets/llms.txt +143 -0
  124. package/skills/devopsCloud/cloudflare/assets/networking-security/cache-cdn.md +109 -0
  125. package/skills/devopsCloud/cloudflare/assets/networking-security/dns.md +71 -0
  126. package/skills/devopsCloud/cloudflare/assets/networking-security/rate-limiting.md +130 -0
  127. package/skills/devopsCloud/cloudflare/assets/networking-security/tunnels.md +57 -0
  128. package/skills/devopsCloud/cloudflare/assets/networking-security/waf.md +143 -0
  129. package/skills/devopsCloud/cloudflare/assets/troubleshooting/1xxx-errors.md +209 -0
  130. package/skills/devopsCloud/cloudflare/assets/troubleshooting/5xx-errors.md +111 -0
  131. package/skills/devopsCloud/cloudflare/assets/troubleshooting/http-status-codes.md +38 -0
  132. package/skills/devopsCloud/cloudflare/evals/evals.json +75 -0
  133. package/skills/devopsCloud/cloudflare/references/ai-gateway/README.md +27 -0
  134. package/skills/devopsCloud/cloudflare/references/ai-gateway/configuration.md +18 -0
  135. package/skills/devopsCloud/cloudflare/references/ai-gateway/dynamic-routing.md +15 -0
  136. package/skills/devopsCloud/cloudflare/references/ai-gateway/features.md +22 -0
  137. package/skills/devopsCloud/cloudflare/references/ai-gateway/sdk-integration.md +19 -0
  138. package/skills/devopsCloud/cloudflare/references/ai-gateway/troubleshooting.md +16 -0
  139. package/skills/devopsCloud/cloudflare/references/ai-search/README.md +25 -0
  140. package/skills/devopsCloud/cloudflare/references/ai-search/api.md +13 -0
  141. package/skills/devopsCloud/cloudflare/references/ai-search/configuration.md +16 -0
  142. package/skills/devopsCloud/cloudflare/references/ai-search/gotchas.md +13 -0
  143. package/skills/devopsCloud/cloudflare/references/ai-search/patterns.md +15 -0
  144. package/skills/devopsCloud/cloudflare/references/bindings/README.md +16 -0
  145. package/skills/devopsCloud/cloudflare/references/bindings/api.md +19 -0
  146. package/skills/devopsCloud/cloudflare/references/bindings/configuration.md +20 -0
  147. package/skills/devopsCloud/cloudflare/references/bindings/gotchas.md +18 -0
  148. package/skills/devopsCloud/cloudflare/references/bindings/patterns.md +20 -0
  149. package/skills/devopsCloud/cloudflare/references/browser-rendering/README.md +18 -0
  150. package/skills/devopsCloud/cloudflare/references/browser-rendering/api.md +12 -0
  151. package/skills/devopsCloud/cloudflare/references/browser-rendering/configuration.md +12 -0
  152. package/skills/devopsCloud/cloudflare/references/browser-rendering/gotchas.md +15 -0
  153. package/skills/devopsCloud/cloudflare/references/browser-rendering/patterns.md +12 -0
  154. package/skills/devopsCloud/cloudflare/references/cliComparison.md +93 -0
  155. package/skills/devopsCloud/cloudflare/references/containers/README.md +23 -0
  156. package/skills/devopsCloud/cloudflare/references/containers/api.md +13 -0
  157. package/skills/devopsCloud/cloudflare/references/containers/configuration.md +15 -0
  158. package/skills/devopsCloud/cloudflare/references/containers/gotchas.md +16 -0
  159. package/skills/devopsCloud/cloudflare/references/containers/patterns.md +18 -0
  160. package/skills/devopsCloud/cloudflare/references/cron-triggers/README.md +20 -0
  161. package/skills/devopsCloud/cloudflare/references/cron-triggers/api.md +16 -0
  162. package/skills/devopsCloud/cloudflare/references/cron-triggers/configuration.md +16 -0
  163. package/skills/devopsCloud/cloudflare/references/cron-triggers/gotchas.md +17 -0
  164. package/skills/devopsCloud/cloudflare/references/cron-triggers/patterns.md +18 -0
  165. package/skills/devopsCloud/cloudflare/references/d1/README.md +15 -0
  166. package/skills/devopsCloud/cloudflare/references/d1/api.md +18 -0
  167. package/skills/devopsCloud/cloudflare/references/d1/configuration.md +18 -0
  168. package/skills/devopsCloud/cloudflare/references/d1/gotchas.md +18 -0
  169. package/skills/devopsCloud/cloudflare/references/d1/patterns.md +21 -0
  170. package/skills/devopsCloud/cloudflare/references/frameworkCompatibility.md +110 -0
  171. package/skills/devopsCloud/cloudflare/references/hyperdrive/README.md +28 -0
  172. package/skills/devopsCloud/cloudflare/references/hyperdrive/api.md +26 -0
  173. package/skills/devopsCloud/cloudflare/references/hyperdrive/configuration.md +34 -0
  174. package/skills/devopsCloud/cloudflare/references/hyperdrive/gotchas.md +20 -0
  175. package/skills/devopsCloud/cloudflare/references/hyperdrive/patterns.md +15 -0
  176. package/skills/devopsCloud/cloudflare/references/images/README.md +12 -0
  177. package/skills/devopsCloud/cloudflare/references/images/api.md +13 -0
  178. package/skills/devopsCloud/cloudflare/references/images/configuration.md +17 -0
  179. package/skills/devopsCloud/cloudflare/references/images/gotchas.md +16 -0
  180. package/skills/devopsCloud/cloudflare/references/images/patterns.md +16 -0
  181. package/skills/devopsCloud/cloudflare/references/kv/README.md +15 -0
  182. package/skills/devopsCloud/cloudflare/references/kv/api.md +18 -0
  183. package/skills/devopsCloud/cloudflare/references/kv/configuration.md +16 -0
  184. package/skills/devopsCloud/cloudflare/references/kv/gotchas.md +17 -0
  185. package/skills/devopsCloud/cloudflare/references/kv/patterns.md +21 -0
  186. package/skills/devopsCloud/cloudflare/references/miniflare/README.md +22 -0
  187. package/skills/devopsCloud/cloudflare/references/miniflare/api.md +16 -0
  188. package/skills/devopsCloud/cloudflare/references/miniflare/configuration.md +16 -0
  189. package/skills/devopsCloud/cloudflare/references/miniflare/gotchas.md +15 -0
  190. package/skills/devopsCloud/cloudflare/references/miniflare/patterns.md +19 -0
  191. package/skills/devopsCloud/cloudflare/references/observability/README.md +27 -0
  192. package/skills/devopsCloud/cloudflare/references/observability/api.md +20 -0
  193. package/skills/devopsCloud/cloudflare/references/observability/configuration.md +23 -0
  194. package/skills/devopsCloud/cloudflare/references/observability/gotchas.md +25 -0
  195. package/skills/devopsCloud/cloudflare/references/observability/patterns.md +14 -0
  196. package/skills/devopsCloud/cloudflare/references/pages/README.md +20 -0
  197. package/skills/devopsCloud/cloudflare/references/pages/api.md +13 -0
  198. package/skills/devopsCloud/cloudflare/references/pages/configuration.md +16 -0
  199. package/skills/devopsCloud/cloudflare/references/pages/gotchas.md +19 -0
  200. package/skills/devopsCloud/cloudflare/references/pages/patterns.md +15 -0
  201. package/skills/devopsCloud/cloudflare/references/pages-functions/README.md +20 -0
  202. package/skills/devopsCloud/cloudflare/references/pages-functions/api.md +13 -0
  203. package/skills/devopsCloud/cloudflare/references/pages-functions/configuration.md +14 -0
  204. package/skills/devopsCloud/cloudflare/references/pages-functions/gotchas.md +17 -0
  205. package/skills/devopsCloud/cloudflare/references/pages-functions/patterns.md +16 -0
  206. package/skills/devopsCloud/cloudflare/references/productSelectionMatrix.md +54 -0
  207. package/skills/devopsCloud/cloudflare/references/queues/README.md +24 -0
  208. package/skills/devopsCloud/cloudflare/references/queues/api.md +16 -0
  209. package/skills/devopsCloud/cloudflare/references/queues/configuration.md +20 -0
  210. package/skills/devopsCloud/cloudflare/references/queues/gotchas.md +18 -0
  211. package/skills/devopsCloud/cloudflare/references/queues/patterns.md +21 -0
  212. package/skills/devopsCloud/cloudflare/references/r2/README.md +26 -0
  213. package/skills/devopsCloud/cloudflare/references/r2/api.md +16 -0
  214. package/skills/devopsCloud/cloudflare/references/r2/configuration.md +19 -0
  215. package/skills/devopsCloud/cloudflare/references/r2/gotchas.md +17 -0
  216. package/skills/devopsCloud/cloudflare/references/r2/patterns.md +18 -0
  217. package/skills/devopsCloud/cloudflare/references/secrets-store/README.md +22 -0
  218. package/skills/devopsCloud/cloudflare/references/secrets-store/api.md +21 -0
  219. package/skills/devopsCloud/cloudflare/references/secrets-store/configuration.md +25 -0
  220. package/skills/devopsCloud/cloudflare/references/secrets-store/gotchas.md +19 -0
  221. package/skills/devopsCloud/cloudflare/references/secrets-store/patterns.md +27 -0
  222. package/skills/devopsCloud/cloudflare/references/skill-feedback.md +41 -0
  223. package/skills/devopsCloud/cloudflare/references/static-assets/README.md +21 -0
  224. package/skills/devopsCloud/cloudflare/references/static-assets/api.md +16 -0
  225. package/skills/devopsCloud/cloudflare/references/static-assets/configuration.md +16 -0
  226. package/skills/devopsCloud/cloudflare/references/static-assets/gotchas.md +18 -0
  227. package/skills/devopsCloud/cloudflare/references/static-assets/patterns.md +17 -0
  228. package/skills/devopsCloud/cloudflare/references/stream/README.md +22 -0
  229. package/skills/devopsCloud/cloudflare/references/stream/api-live.md +18 -0
  230. package/skills/devopsCloud/cloudflare/references/stream/api.md +21 -0
  231. package/skills/devopsCloud/cloudflare/references/stream/configuration.md +18 -0
  232. package/skills/devopsCloud/cloudflare/references/stream/gotchas.md +18 -0
  233. package/skills/devopsCloud/cloudflare/references/stream/patterns.md +22 -0
  234. package/skills/devopsCloud/cloudflare/references/tail-workers/README.md +21 -0
  235. package/skills/devopsCloud/cloudflare/references/tail-workers/api.md +13 -0
  236. package/skills/devopsCloud/cloudflare/references/tail-workers/configuration.md +15 -0
  237. package/skills/devopsCloud/cloudflare/references/tail-workers/gotchas.md +16 -0
  238. package/skills/devopsCloud/cloudflare/references/tail-workers/patterns.md +15 -0
  239. package/skills/devopsCloud/cloudflare/references/tunnel/README.md +20 -0
  240. package/skills/devopsCloud/cloudflare/references/tunnel/api.md +14 -0
  241. package/skills/devopsCloud/cloudflare/references/tunnel/configuration.md +14 -0
  242. package/skills/devopsCloud/cloudflare/references/tunnel/gotchas.md +15 -0
  243. package/skills/devopsCloud/cloudflare/references/tunnel/networking.md +14 -0
  244. package/skills/devopsCloud/cloudflare/references/tunnel/patterns.md +15 -0
  245. package/skills/devopsCloud/cloudflare/references/vectorize/README.md +22 -0
  246. package/skills/devopsCloud/cloudflare/references/vectorize/api.md +18 -0
  247. package/skills/devopsCloud/cloudflare/references/vectorize/configuration.md +19 -0
  248. package/skills/devopsCloud/cloudflare/references/vectorize/gotchas.md +15 -0
  249. package/skills/devopsCloud/cloudflare/references/vectorize/patterns.md +24 -0
  250. package/skills/devopsCloud/cloudflare/references/waf/README.md +21 -0
  251. package/skills/devopsCloud/cloudflare/references/waf/api.md +17 -0
  252. package/skills/devopsCloud/cloudflare/references/waf/configuration.md +18 -0
  253. package/skills/devopsCloud/cloudflare/references/waf/gotchas.md +19 -0
  254. package/skills/devopsCloud/cloudflare/references/waf/patterns.md +17 -0
  255. package/skills/devopsCloud/cloudflare/references/workers-ai/README.md +24 -0
  256. package/skills/devopsCloud/cloudflare/references/workers-ai/api.md +13 -0
  257. package/skills/devopsCloud/cloudflare/references/workers-ai/configuration.md +16 -0
  258. package/skills/devopsCloud/cloudflare/references/workers-ai/gotchas.md +15 -0
  259. package/skills/devopsCloud/cloudflare/references/workers-ai/patterns.md +14 -0
  260. package/skills/devopsCloud/cloudflare/references/workflows/README.md +23 -0
  261. package/skills/devopsCloud/cloudflare/references/workflows/api.md +17 -0
  262. package/skills/devopsCloud/cloudflare/references/workflows/configuration.md +18 -0
  263. package/skills/devopsCloud/cloudflare/references/workflows/gotchas.md +19 -0
  264. package/skills/devopsCloud/cloudflare/references/workflows/patterns.md +30 -0
  265. package/skills/devopsCloud/cloudflare/scripts/auditCloudflareProduction.py +95 -0
  266. package/skills/foundation/promptEvalTesting/SKILL.md +114 -0
  267. package/skills/foundation/promptEvalTesting/evals/promptEvalVerification.json +14 -0
  268. package/skills/foundation/promptEvalTesting/references/apiReference.md +3 -0
  269. package/skills/foundation/promptEvalTesting/references/evalMetricsCatalog.md +7 -0
  270. package/skills/foundation/promptEvalTesting/references/promptfooConfigSpecs.md +16 -0
  271. package/skills/foundation/promptEvalTesting/scripts/runPromptEvalSuite.py +29 -0
  272. package/skills/frontend/astro/SKILL.md +327 -0
  273. package/skills/frontend/astro/assets/README.md +71 -0
  274. package/skills/frontend/astro/assets/add-content-to-your-site/content-collections.md +1061 -0
  275. package/skills/frontend/astro/assets/add-content-to-your-site/data-fetching.md +109 -0
  276. package/skills/frontend/astro/assets/add-content-to-your-site/images.md +719 -0
  277. package/skills/frontend/astro/assets/add-content-to-your-site/markdown.md +725 -0
  278. package/skills/frontend/astro/assets/build-your-ui/components.md +402 -0
  279. package/skills/frontend/astro/assets/build-your-ui/fonts.md +437 -0
  280. package/skills/frontend/astro/assets/build-your-ui/front-end-frameworks.md +245 -0
  281. package/skills/frontend/astro/assets/build-your-ui/layouts.md +267 -0
  282. package/skills/frontend/astro/assets/build-your-ui/scripts-and-event-handling.md +229 -0
  283. package/skills/frontend/astro/assets/build-your-ui/styles-and-css.md +782 -0
  284. package/skills/frontend/astro/assets/build-your-ui/syntax-highlighting.md +269 -0
  285. package/skills/frontend/astro/assets/configuration/build-with-ai.md +389 -0
  286. package/skills/frontend/astro/assets/configuration/configuration-overview.md +122 -0
  287. package/skills/frontend/astro/assets/configuration/dev-toolbar.md +86 -0
  288. package/skills/frontend/astro/assets/configuration/editor-setup.md +166 -0
  289. package/skills/frontend/astro/assets/configuration/environment-variables.md +352 -0
  290. package/skills/frontend/astro/assets/configuration/typescript.md +379 -0
  291. package/skills/frontend/astro/assets/configuration/working-with-integrations.md +606 -0
  292. package/skills/frontend/astro/assets/reference/adapter-reference.md +1242 -0
  293. package/skills/frontend/astro/assets/reference/cli-reference.md +575 -0
  294. package/skills/frontend/astro/assets/reference/configuration-reference.md +3144 -0
  295. package/skills/frontend/astro/assets/reference/content-loader-reference.md +1682 -0
  296. package/skills/frontend/astro/assets/reference/directives-reference.md +324 -0
  297. package/skills/frontend/astro/assets/reference/image-service-reference.md +346 -0
  298. package/skills/frontend/astro/assets/reference/integrations-reference.md +2813 -0
  299. package/skills/frontend/astro/assets/reference/modules/astro-actions.md +604 -0
  300. package/skills/frontend/astro/assets/reference/modules/astro-app.md +460 -0
  301. package/skills/frontend/astro/assets/reference/modules/astro-assets.md +1657 -0
  302. package/skills/frontend/astro/assets/reference/modules/astro-config.md +395 -0
  303. package/skills/frontend/astro/assets/reference/modules/astro-content.md +720 -0
  304. package/skills/frontend/astro/assets/reference/modules/astro-env.md +46 -0
  305. package/skills/frontend/astro/assets/reference/modules/astro-fetch.md +346 -0
  306. package/skills/frontend/astro/assets/reference/modules/astro-hono.md +37 -0
  307. package/skills/frontend/astro/assets/reference/modules/astro-i18n.md +462 -0
  308. package/skills/frontend/astro/assets/reference/modules/astro-middleware.md +292 -0
  309. package/skills/frontend/astro/assets/reference/modules/astro-static-paths.md +74 -0
  310. package/skills/frontend/astro/assets/reference/modules/astro-transitions.md +595 -0
  311. package/skills/frontend/astro/assets/reference/modules/astro-zod.md +120 -0
  312. package/skills/frontend/astro/assets/reference/session-driver-reference.md +205 -0
  313. package/skills/frontend/astro/assets/routing-and-navigation/endpoints.md +251 -0
  314. package/skills/frontend/astro/assets/routing-and-navigation/internationalization.md +374 -0
  315. package/skills/frontend/astro/assets/routing-and-navigation/middleware.md +288 -0
  316. package/skills/frontend/astro/assets/routing-and-navigation/pages.md +205 -0
  317. package/skills/frontend/astro/assets/routing-and-navigation/prefetch.md +273 -0
  318. package/skills/frontend/astro/assets/routing-and-navigation/routing.md +760 -0
  319. package/skills/frontend/astro/assets/routing-and-navigation/view-transitions.md +792 -0
  320. package/skills/frontend/astro/assets/server-rendering/actions.md +770 -0
  321. package/skills/frontend/astro/assets/server-rendering/caching.md +255 -0
  322. package/skills/frontend/astro/assets/server-rendering/on-demand-rendering.md +289 -0
  323. package/skills/frontend/astro/assets/server-rendering/server-islands.md +126 -0
  324. package/skills/frontend/astro/assets/server-rendering/sessions.md +270 -0
  325. package/skills/frontend/astro/assets/start-a-new-project/develop-and-build.md +147 -0
  326. package/skills/frontend/astro/assets/start-a-new-project/installation.md +342 -0
  327. package/skills/frontend/astro/assets/start-a-new-project/project-structure.md +137 -0
  328. package/skills/frontend/astro/assets/upgrade-and-troubleshooting/testing.md +412 -0
  329. package/skills/frontend/astro/assets/upgrade-and-troubleshooting/troubleshooting.md +229 -0
  330. package/skills/frontend/astro/assets/upgrade-and-troubleshooting/upgrade-astro.md +205 -0
  331. package/skills/frontend/astro/assets/welcome/courses.md +46 -0
  332. package/skills/frontend/astro/assets/welcome/islands-architecture.md +135 -0
  333. package/skills/frontend/astro/assets/welcome/why-astro.md +90 -0
  334. package/skills/frontend/astro/evals/evals.json +66 -0
  335. package/skills/frontend/astro/references/contentCollections.md +164 -0
  336. package/skills/frontend/astro/references/islandsArchitecture.md +128 -0
  337. package/skills/frontend/astro/references/serverIslandsAndActions.md +187 -0
  338. package/skills/frontend/astro/scripts/auditAstroProduction.py +78 -0
  339. package/skills/frontend/generativeUi/SKILL.md +128 -0
  340. package/skills/frontend/generativeUi/evals/generativeUiVerification.json +14 -0
  341. package/skills/frontend/generativeUi/references/apiReference.md +3 -0
  342. package/skills/frontend/generativeUi/references/clientToolComponentMapping.md +8 -0
  343. package/skills/frontend/generativeUi/references/dataStreamProtocol.md +10 -0
  344. package/skills/frontend/generativeUi/scripts/generateUiComponentStub.py +46 -0
  345. package/skills/frontend/nextjs/SKILL.md +138 -0
  346. package/skills/frontend/nextjs/assets/README.md +67 -0
  347. package/skills/frontend/nextjs/assets/api-reference/cli/create-next-app.md +210 -0
  348. package/skills/frontend/nextjs/assets/api-reference/cli/next.md +484 -0
  349. package/skills/frontend/nextjs/assets/api-reference/components/font.md +952 -0
  350. package/skills/frontend/nextjs/assets/api-reference/components/form.md +387 -0
  351. package/skills/frontend/nextjs/assets/api-reference/components/image.md +1372 -0
  352. package/skills/frontend/nextjs/assets/api-reference/components/link.md +954 -0
  353. package/skills/frontend/nextjs/assets/api-reference/components/script.md +421 -0
  354. package/skills/frontend/nextjs/assets/api-reference/directives/use-cache-private.md +211 -0
  355. package/skills/frontend/nextjs/assets/api-reference/directives/use-cache-remote.md +652 -0
  356. package/skills/frontend/nextjs/assets/api-reference/directives/use-cache.md +848 -0
  357. package/skills/frontend/nextjs/assets/api-reference/directives/use-client.md +149 -0
  358. package/skills/frontend/nextjs/assets/api-reference/directives/use-server.md +234 -0
  359. package/skills/frontend/nextjs/assets/api-reference/edge-runtime.md +188 -0
  360. package/skills/frontend/nextjs/assets/api-reference/file-conventions/default.md +80 -0
  361. package/skills/frontend/nextjs/assets/api-reference/file-conventions/dynamic-routes.md +417 -0
  362. package/skills/frontend/nextjs/assets/api-reference/file-conventions/error.md +361 -0
  363. package/skills/frontend/nextjs/assets/api-reference/file-conventions/forbidden.md +75 -0
  364. package/skills/frontend/nextjs/assets/api-reference/file-conventions/instrumentation-client.md +308 -0
  365. package/skills/frontend/nextjs/assets/api-reference/file-conventions/instrumentation.md +177 -0
  366. package/skills/frontend/nextjs/assets/api-reference/file-conventions/intercepting-routes.md +78 -0
  367. package/skills/frontend/nextjs/assets/api-reference/file-conventions/layout.md +803 -0
  368. package/skills/frontend/nextjs/assets/api-reference/file-conventions/loading.md +209 -0
  369. package/skills/frontend/nextjs/assets/api-reference/file-conventions/mdx-components.md +84 -0
  370. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/app-icons.md +302 -0
  371. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/manifest.md +90 -0
  372. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/opengraph-image.md +580 -0
  373. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/robots.md +234 -0
  374. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/sitemap.md +459 -0
  375. package/skills/frontend/nextjs/assets/api-reference/file-conventions/not-found.md +278 -0
  376. package/skills/frontend/nextjs/assets/api-reference/file-conventions/page.md +283 -0
  377. package/skills/frontend/nextjs/assets/api-reference/file-conventions/parallel-routes.md +517 -0
  378. package/skills/frontend/nextjs/assets/api-reference/file-conventions/proxy.md +857 -0
  379. package/skills/frontend/nextjs/assets/api-reference/file-conventions/public-folder.md +47 -0
  380. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-groups.md +40 -0
  381. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/dynamicParams.md +40 -0
  382. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/ensureStatic.md +195 -0
  383. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/instant.md +204 -0
  384. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/maxDuration.md +42 -0
  385. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/preferredRegion.md +55 -0
  386. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/prefetch.md +113 -0
  387. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/runtime.md +43 -0
  388. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route.md +772 -0
  389. package/skills/frontend/nextjs/assets/api-reference/file-conventions/src-folder.md +42 -0
  390. package/skills/frontend/nextjs/assets/api-reference/file-conventions/template.md +174 -0
  391. package/skills/frontend/nextjs/assets/api-reference/file-conventions/unauthorized.md +143 -0
  392. package/skills/frontend/nextjs/assets/api-reference/functions/after.md +332 -0
  393. package/skills/frontend/nextjs/assets/api-reference/functions/cacheLife.md +642 -0
  394. package/skills/frontend/nextjs/assets/api-reference/functions/cacheTag.md +272 -0
  395. package/skills/frontend/nextjs/assets/api-reference/functions/catchError.md +267 -0
  396. package/skills/frontend/nextjs/assets/api-reference/functions/connection.md +114 -0
  397. package/skills/frontend/nextjs/assets/api-reference/functions/cookies.md +349 -0
  398. package/skills/frontend/nextjs/assets/api-reference/functions/draft-mode.md +173 -0
  399. package/skills/frontend/nextjs/assets/api-reference/functions/fetch.md +141 -0
  400. package/skills/frontend/nextjs/assets/api-reference/functions/forbidden.md +327 -0
  401. package/skills/frontend/nextjs/assets/api-reference/functions/generate-image-metadata.md +311 -0
  402. package/skills/frontend/nextjs/assets/api-reference/functions/generate-metadata.md +1510 -0
  403. package/skills/frontend/nextjs/assets/api-reference/functions/generate-sitemaps.md +102 -0
  404. package/skills/frontend/nextjs/assets/api-reference/functions/generate-static-params.md +606 -0
  405. package/skills/frontend/nextjs/assets/api-reference/functions/generate-viewport.md +347 -0
  406. package/skills/frontend/nextjs/assets/api-reference/functions/headers.md +92 -0
  407. package/skills/frontend/nextjs/assets/api-reference/functions/image-response.md +225 -0
  408. package/skills/frontend/nextjs/assets/api-reference/functions/io.md +131 -0
  409. package/skills/frontend/nextjs/assets/api-reference/functions/navigation.md +220 -0
  410. package/skills/frontend/nextjs/assets/api-reference/functions/next-request.md +116 -0
  411. package/skills/frontend/nextjs/assets/api-reference/functions/next-response.md +219 -0
  412. package/skills/frontend/nextjs/assets/api-reference/functions/next-root-params.md +479 -0
  413. package/skills/frontend/nextjs/assets/api-reference/functions/not-found.md +269 -0
  414. package/skills/frontend/nextjs/assets/api-reference/functions/permanentRedirect.md +92 -0
  415. package/skills/frontend/nextjs/assets/api-reference/functions/prefetch.md +202 -0
  416. package/skills/frontend/nextjs/assets/api-reference/functions/redirect.md +255 -0
  417. package/skills/frontend/nextjs/assets/api-reference/functions/refresh.md +91 -0
  418. package/skills/frontend/nextjs/assets/api-reference/functions/revalidatePath.md +248 -0
  419. package/skills/frontend/nextjs/assets/api-reference/functions/revalidateTag.md +175 -0
  420. package/skills/frontend/nextjs/assets/api-reference/functions/unauthorized.md +389 -0
  421. package/skills/frontend/nextjs/assets/api-reference/functions/unstable_cache.md +131 -0
  422. package/skills/frontend/nextjs/assets/api-reference/functions/unstable_noStore.md +61 -0
  423. package/skills/frontend/nextjs/assets/api-reference/functions/unstable_rethrow.md +79 -0
  424. package/skills/frontend/nextjs/assets/api-reference/functions/updateTag.md +173 -0
  425. package/skills/frontend/nextjs/assets/api-reference/functions/use-link-status.md +268 -0
  426. package/skills/frontend/nextjs/assets/api-reference/functions/use-offline.md +222 -0
  427. package/skills/frontend/nextjs/assets/api-reference/functions/use-params.md +102 -0
  428. package/skills/frontend/nextjs/assets/api-reference/functions/use-pathname.md +189 -0
  429. package/skills/frontend/nextjs/assets/api-reference/functions/use-report-web-vitals.md +175 -0
  430. package/skills/frontend/nextjs/assets/api-reference/functions/use-router.md +214 -0
  431. package/skills/frontend/nextjs/assets/api-reference/functions/use-search-params.md +416 -0
  432. package/skills/frontend/nextjs/assets/api-reference/functions/use-selected-layout-segment.md +214 -0
  433. package/skills/frontend/nextjs/assets/api-reference/functions/use-selected-layout-segments.md +116 -0
  434. package/skills/frontend/nextjs/assets/api-reference/functions/use-server-inserted-html.md +145 -0
  435. package/skills/frontend/nextjs/assets/api-reference/functions/userAgent.md +95 -0
  436. package/skills/frontend/nextjs/assets/api-reference/turbopack.md +552 -0
  437. package/skills/frontend/nextjs/assets/architecture/accessibility.md +47 -0
  438. package/skills/frontend/nextjs/assets/architecture/fast-refresh.md +122 -0
  439. package/skills/frontend/nextjs/assets/architecture/nextjs-compiler.md +376 -0
  440. package/skills/frontend/nextjs/assets/architecture/supported-browsers.md +146 -0
  441. package/skills/frontend/nextjs/assets/community/contribution-guide.md +459 -0
  442. package/skills/frontend/nextjs/assets/community/rspack.md +25 -0
  443. package/skills/frontend/nextjs/assets/getting-started/caching.md +626 -0
  444. package/skills/frontend/nextjs/assets/getting-started/css.md +336 -0
  445. package/skills/frontend/nextjs/assets/getting-started/deploying.md +115 -0
  446. package/skills/frontend/nextjs/assets/getting-started/error-handling.md +485 -0
  447. package/skills/frontend/nextjs/assets/getting-started/fetching-data.md +743 -0
  448. package/skills/frontend/nextjs/assets/getting-started/fonts.md +232 -0
  449. package/skills/frontend/nextjs/assets/getting-started/images.md +272 -0
  450. package/skills/frontend/nextjs/assets/getting-started/installation.md +446 -0
  451. package/skills/frontend/nextjs/assets/getting-started/layouts-and-pages.md +386 -0
  452. package/skills/frontend/nextjs/assets/getting-started/linking-and-navigating.md +475 -0
  453. package/skills/frontend/nextjs/assets/getting-started/metadata-and-og-images.md +370 -0
  454. package/skills/frontend/nextjs/assets/getting-started/mutating-data.md +679 -0
  455. package/skills/frontend/nextjs/assets/getting-started/project-structure.md +290 -0
  456. package/skills/frontend/nextjs/assets/getting-started/proxy.md +107 -0
  457. package/skills/frontend/nextjs/assets/getting-started/revalidating.md +241 -0
  458. package/skills/frontend/nextjs/assets/getting-started/route-handlers.md +233 -0
  459. package/skills/frontend/nextjs/assets/getting-started/server-and-client-components.md +683 -0
  460. package/skills/frontend/nextjs/assets/getting-started/upgrading.md +137 -0
  461. package/skills/frontend/nextjs/assets/glossary.md +315 -0
  462. package/skills/frontend/nextjs/evals/nextjsVerification.json +14 -0
  463. package/skills/frontend/nextjs/references/apiReference.md +3 -0
  464. package/skills/frontend/nextjs/references/dataAccessLayer.md +39 -0
  465. package/skills/frontend/nextjs/references/nextjsFeatureMap.md +276 -0
  466. package/skills/frontend/nextjs/references/productionChecklist.md +49 -0
  467. package/skills/frontend/nextjs/references/securityHeadersCsp.md +44 -0
  468. package/skills/frontend/nextjs/scripts/auditProductionReadiness.py +85 -0
  469. package/skills/frontend/shadcn-ui/SKILL.md +102 -0
  470. package/skills/frontend/shadcn-ui/assets/README.md +82 -0
  471. package/skills/frontend/shadcn-ui/assets/advanced/javascript.md +44 -0
  472. package/skills/frontend/shadcn-ui/assets/advanced/monorepo.md +254 -0
  473. package/skills/frontend/shadcn-ui/assets/advanced/react-19.md +166 -0
  474. package/skills/frontend/shadcn-ui/assets/advanced/tailwind-v4.md +333 -0
  475. package/skills/frontend/shadcn-ui/assets/ai-elements/chain-of-thought.md +519 -0
  476. package/skills/frontend/shadcn-ui/assets/ai-elements/chat.md +581 -0
  477. package/skills/frontend/shadcn-ui/assets/ai-elements/checkpoint.md +243 -0
  478. package/skills/frontend/shadcn-ui/assets/ai-elements/confirmation.md +382 -0
  479. package/skills/frontend/shadcn-ui/assets/ai-elements/context.md +188 -0
  480. package/skills/frontend/shadcn-ui/assets/ai-elements/file-tree.md +248 -0
  481. package/skills/frontend/shadcn-ui/assets/ai-elements/index.md +307 -0
  482. package/skills/frontend/shadcn-ui/assets/ai-elements/inline-citation.md +219 -0
  483. package/skills/frontend/shadcn-ui/assets/ai-elements/message.md +298 -0
  484. package/skills/frontend/shadcn-ui/assets/ai-elements/model-selector.md +368 -0
  485. package/skills/frontend/shadcn-ui/assets/ai-elements/plan.md +398 -0
  486. package/skills/frontend/shadcn-ui/assets/ai-elements/prompt-input.md +403 -0
  487. package/skills/frontend/shadcn-ui/assets/ai-elements/queue.md +517 -0
  488. package/skills/frontend/shadcn-ui/assets/ai-elements/reasoning.md +349 -0
  489. package/skills/frontend/shadcn-ui/assets/ai-elements/sources.md +303 -0
  490. package/skills/frontend/shadcn-ui/assets/ai-elements/stack-trace.md +514 -0
  491. package/skills/frontend/shadcn-ui/assets/ai-elements/subagent.md +551 -0
  492. package/skills/frontend/shadcn-ui/assets/ai-elements/suggestion.md +246 -0
  493. package/skills/frontend/shadcn-ui/assets/ai-elements/task.md +380 -0
  494. package/skills/frontend/shadcn-ui/assets/ai-elements/terminal.md +463 -0
  495. package/skills/frontend/shadcn-ui/assets/ai-elements/test-results.md +641 -0
  496. package/skills/frontend/shadcn-ui/assets/ai-elements/tool.md +915 -0
  497. package/skills/frontend/shadcn-ui/assets/components/accordion.md +490 -0
  498. package/skills/frontend/shadcn-ui/assets/components/alert-dialog.md +520 -0
  499. package/skills/frontend/shadcn-ui/assets/components/alert.md +351 -0
  500. package/skills/frontend/shadcn-ui/assets/components/aspect-ratio.md +206 -0
  501. package/skills/frontend/shadcn-ui/assets/components/attachment.md +715 -0
  502. package/skills/frontend/shadcn-ui/assets/components/avatar.md +581 -0
  503. package/skills/frontend/shadcn-ui/assets/components/badge.md +276 -0
  504. package/skills/frontend/shadcn-ui/assets/components/breadcrumb.md +556 -0
  505. package/skills/frontend/shadcn-ui/assets/components/bubble.md +706 -0
  506. package/skills/frontend/shadcn-ui/assets/components/button-group.md +969 -0
  507. package/skills/frontend/shadcn-ui/assets/components/button.md +523 -0
  508. package/skills/frontend/shadcn-ui/assets/components/calendar.md +959 -0
  509. package/skills/frontend/shadcn-ui/assets/components/card.md +684 -0
  510. package/skills/frontend/shadcn-ui/assets/components/carousel.md +643 -0
  511. package/skills/frontend/shadcn-ui/assets/components/chart.md +1295 -0
  512. package/skills/frontend/shadcn-ui/assets/components/checkbox.md +553 -0
  513. package/skills/frontend/shadcn-ui/assets/components/code-block.md +2041 -0
  514. package/skills/frontend/shadcn-ui/assets/components/collapsible.md +504 -0
  515. package/skills/frontend/shadcn-ui/assets/components/combobox.md +1102 -0
  516. package/skills/frontend/shadcn-ui/assets/components/command.md +682 -0
  517. package/skills/frontend/shadcn-ui/assets/components/context-menu.md +949 -0
  518. package/skills/frontend/shadcn-ui/assets/components/data-table.md +1667 -0
  519. package/skills/frontend/shadcn-ui/assets/components/date-picker.md +698 -0
  520. package/skills/frontend/shadcn-ui/assets/components/dialog.md +454 -0
  521. package/skills/frontend/shadcn-ui/assets/components/direction.md +205 -0
  522. package/skills/frontend/shadcn-ui/assets/components/drawer.md +806 -0
  523. package/skills/frontend/shadcn-ui/assets/components/dropdown-menu.md +1315 -0
  524. package/skills/frontend/shadcn-ui/assets/components/empty.md +562 -0
  525. package/skills/frontend/shadcn-ui/assets/components/field.md +1321 -0
  526. package/skills/frontend/shadcn-ui/assets/components/hover-card.md +342 -0
  527. package/skills/frontend/shadcn-ui/assets/components/index.md +82 -0
  528. package/skills/frontend/shadcn-ui/assets/components/input-group.md +980 -0
  529. package/skills/frontend/shadcn-ui/assets/components/input-otp.md +551 -0
  530. package/skills/frontend/shadcn-ui/assets/components/input.md +555 -0
  531. package/skills/frontend/shadcn-ui/assets/components/item.md +937 -0
  532. package/skills/frontend/shadcn-ui/assets/components/kbd.md +290 -0
  533. package/skills/frontend/shadcn-ui/assets/components/label.md +327 -0
  534. package/skills/frontend/shadcn-ui/assets/components/marker.md +445 -0
  535. package/skills/frontend/shadcn-ui/assets/components/menubar.md +804 -0
  536. package/skills/frontend/shadcn-ui/assets/components/message-scroller.md +2770 -0
  537. package/skills/frontend/shadcn-ui/assets/components/message.md +618 -0
  538. package/skills/frontend/shadcn-ui/assets/components/native-select.md +321 -0
  539. package/skills/frontend/shadcn-ui/assets/components/navigation-menu.md +568 -0
  540. package/skills/frontend/shadcn-ui/assets/components/pagination.md +425 -0
  541. package/skills/frontend/shadcn-ui/assets/components/popover.md +402 -0
  542. package/skills/frontend/shadcn-ui/assets/components/progress.md +240 -0
  543. package/skills/frontend/shadcn-ui/assets/components/questionnaire.md +2055 -0
  544. package/skills/frontend/shadcn-ui/assets/components/radio-group.md +440 -0
  545. package/skills/frontend/shadcn-ui/assets/components/resizable.md +302 -0
  546. package/skills/frontend/shadcn-ui/assets/components/scroll-area.md +226 -0
  547. package/skills/frontend/shadcn-ui/assets/components/select.md +647 -0
  548. package/skills/frontend/shadcn-ui/assets/components/separator.md +235 -0
  549. package/skills/frontend/shadcn-ui/assets/components/sheet.md +354 -0
  550. package/skills/frontend/shadcn-ui/assets/components/sidebar.md +1156 -0
  551. package/skills/frontend/shadcn-ui/assets/components/skeleton.md +217 -0
  552. package/skills/frontend/shadcn-ui/assets/components/slider.md +253 -0
  553. package/skills/frontend/shadcn-ui/assets/components/spinner.md +352 -0
  554. package/skills/frontend/shadcn-ui/assets/components/switch.md +296 -0
  555. package/skills/frontend/shadcn-ui/assets/components/table.md +572 -0
  556. package/skills/frontend/shadcn-ui/assets/components/tabs.md +425 -0
  557. package/skills/frontend/shadcn-ui/assets/components/textarea.md +218 -0
  558. package/skills/frontend/shadcn-ui/assets/components/toast.md +260 -0
  559. package/skills/frontend/shadcn-ui/assets/components/toggle-group.md +419 -0
  560. package/skills/frontend/shadcn-ui/assets/components/toggle.md +220 -0
  561. package/skills/frontend/shadcn-ui/assets/components/tooltip.md +332 -0
  562. package/skills/frontend/shadcn-ui/assets/components/trace.md +1890 -0
  563. package/skills/frontend/shadcn-ui/assets/components/typography.md +561 -0
  564. package/skills/frontend/shadcn-ui/assets/dark-mode/next.md +108 -0
  565. package/skills/frontend/shadcn-ui/assets/dark-mode/overview.md +75 -0
  566. package/skills/frontend/shadcn-ui/assets/dark-mode/vite.md +144 -0
  567. package/skills/frontend/shadcn-ui/assets/forms/next.md +716 -0
  568. package/skills/frontend/shadcn-ui/assets/forms/overview.md +60 -0
  569. package/skills/frontend/shadcn-ui/assets/forms/react-hook-form.md +2055 -0
  570. package/skills/frontend/shadcn-ui/assets/forms/tanstack-form.md +2236 -0
  571. package/skills/frontend/shadcn-ui/assets/installation/astro.md +252 -0
  572. package/skills/frontend/shadcn-ui/assets/installation/manual.md +255 -0
  573. package/skills/frontend/shadcn-ui/assets/installation/next.md +256 -0
  574. package/skills/frontend/shadcn-ui/assets/installation/react-router.md +226 -0
  575. package/skills/frontend/shadcn-ui/assets/installation/remix.md +52 -0
  576. package/skills/frontend/shadcn-ui/assets/installation/vite.md +314 -0
  577. package/skills/frontend/shadcn-ui/assets/mcp/mcp.md +338 -0
  578. package/skills/frontend/shadcn-ui/assets/overview/changelog.md +6 -0
  579. package/skills/frontend/shadcn-ui/assets/overview/cli.md +738 -0
  580. package/skills/frontend/shadcn-ui/assets/overview/components-json.md +379 -0
  581. package/skills/frontend/shadcn-ui/assets/overview/directory.md +74 -0
  582. package/skills/frontend/shadcn-ui/assets/overview/introduction.md +77 -0
  583. package/skills/frontend/shadcn-ui/assets/overview/skills.md +71 -0
  584. package/skills/frontend/shadcn-ui/assets/overview/theming.md +304 -0
  585. package/skills/frontend/shadcn-ui/assets/overview/typeset.md +242 -0
  586. package/skills/frontend/shadcn-ui/assets/registry/getting-started.md +648 -0
  587. package/skills/frontend/shadcn-ui/assets/registry/overview.md +90 -0
  588. package/skills/frontend/shadcn-ui/assets/registry/registry-item-json.md +483 -0
  589. package/skills/frontend/shadcn-ui/assets/registry/registry-json.md +178 -0
  590. package/skills/frontend/shadcn-ui/evals/componentVerification.json +19 -0
  591. package/skills/frontend/shadcn-ui/references/aiComponentsCatalog.md +51 -0
  592. package/skills/frontend/shadcn-ui/references/apiReference.md +3 -0
  593. package/skills/frontend/shadcn-ui/references/blocksCatalog.md +32 -0
  594. package/skills/frontend/shadcn-ui/references/cliCommands.md +47 -0
  595. package/skills/frontend/shadcn-ui/references/componentMarkdownSources.md +48 -0
  596. package/skills/frontend/shadcn-ui/scripts/fetchComponentDocs.py +43 -0
  597. package/skills/frontend/tsxReactStandard/SKILL.md +150 -0
  598. package/skills/frontend/tsxReactStandard/evals/tsxVerification.json +14 -0
  599. package/skills/frontend/tsxReactStandard/references/apiReference.md +3 -0
  600. package/skills/frontend/tsxReactStandard/references/discriminatedUnions.md +31 -0
  601. package/skills/frontend/tsxReactStandard/references/tsconfigStrict.md +36 -0
  602. package/skills/frontend/tsxReactStandard/scripts/validateTsxTypes.py +44 -0
  603. package/skills/gitVersionControl/gitWorkflow/SKILL.md +128 -0
  604. package/skills/gitVersionControl/gitWorkflow/assets/README.md +23 -0
  605. package/skills/gitVersionControl/gitWorkflow/assets/cli/gh-environment.md +87 -0
  606. package/skills/gitVersionControl/gitWorkflow/assets/cli/gh-formatting.md +156 -0
  607. package/skills/gitVersionControl/gitWorkflow/assets/cli/gh-reference.md +2363 -0
  608. package/skills/gitVersionControl/gitWorkflow/assets/using-git/about-git.md +156 -0
  609. package/skills/gitVersionControl/gitWorkflow/assets/using-git/about-remote-repositories.md +65 -0
  610. package/skills/gitVersionControl/gitWorkflow/assets/using-git/associating-text-editors-with-git.md +93 -0
  611. package/skills/gitVersionControl/gitWorkflow/assets/using-git/caching-your-github-credentials.md +115 -0
  612. package/skills/gitVersionControl/gitWorkflow/assets/using-git/getting-changes-from-a-remote-repository.md +76 -0
  613. package/skills/gitVersionControl/gitWorkflow/assets/using-git/ignoring-files.md +51 -0
  614. package/skills/gitVersionControl/gitWorkflow/assets/using-git/managing-remote-repositories.md +231 -0
  615. package/skills/gitVersionControl/gitWorkflow/assets/using-git/pushing-commits-to-a-remote-repository.md +119 -0
  616. package/skills/gitVersionControl/gitWorkflow/evals/evalGitWorkflow.py +43 -0
  617. package/skills/gitVersionControl/gitWorkflow/references/apiReference.md +3 -0
  618. package/skills/gitVersionControl/gitWorkflow/references/branchingModels.md +32 -0
  619. package/skills/gitVersionControl/gitWorkflow/scripts/diagnoseGitGraph.py +68 -0
  620. package/skills/github/assets/README.md +39 -0
  621. package/skills/github/assets/cli/gh-environment.md +87 -0
  622. package/skills/github/assets/cli/gh-formatting.md +156 -0
  623. package/skills/github/assets/cli/gh-reference.md +2363 -0
  624. package/skills/github/assets/docs-api/github-docs-api.md +60 -0
  625. package/skills/github/assets/rest-api/actions-secrets.md +1272 -0
  626. package/skills/github/assets/rest-api/actions-variables.md +1247 -0
  627. package/skills/github/assets/rest-api/actions-workflow-runs.md +1697 -0
  628. package/skills/github/assets/rest-api/actions-workflows.md +348 -0
  629. package/skills/github/assets/rest-api/authenticating.md +174 -0
  630. package/skills/github/assets/rest-api/branches.md +727 -0
  631. package/skills/github/assets/rest-api/checks-runs.md +1013 -0
  632. package/skills/github/assets/rest-api/checks-suites.md +1142 -0
  633. package/skills/github/assets/rest-api/code-scanning.md +2957 -0
  634. package/skills/github/assets/rest-api/collaborators.md +547 -0
  635. package/skills/github/assets/rest-api/commits.md +957 -0
  636. package/skills/github/assets/rest-api/dependabot-alerts.md +895 -0
  637. package/skills/github/assets/rest-api/orgs.md +1172 -0
  638. package/skills/github/assets/rest-api/overview.md +875 -0
  639. package/skills/github/assets/rest-api/pull-reviews.md +722 -0
  640. package/skills/github/assets/rest-api/pulls.md +1605 -0
  641. package/skills/github/assets/rest-api/quickstart.md +344 -0
  642. package/skills/github/assets/rest-api/releases.md +650 -0
  643. package/skills/github/assets/rest-api/repos.md +2957 -0
  644. package/skills/github/assets/rest-api/rules.md +1507 -0
  645. package/skills/github/assets/rest-api/secret-scanning.md +947 -0
  646. package/skills/github/assets/rest-api/teams.md +1690 -0
  647. package/skills/github/githubAction/SKILL.md +159 -0
  648. package/skills/github/githubAction/assets/README.md +38 -0
  649. package/skills/github/githubAction/assets/reference/contexts.md +918 -0
  650. package/skills/github/githubAction/assets/reference/dependency-caching.md +393 -0
  651. package/skills/github/githubAction/assets/reference/events-that-trigger-workflows.md +1348 -0
  652. package/skills/github/githubAction/assets/reference/expressions.md +441 -0
  653. package/skills/github/githubAction/assets/reference/metadata-syntax.md +803 -0
  654. package/skills/github/githubAction/assets/reference/variables.md +149 -0
  655. package/skills/github/githubAction/assets/reference/workflow-cancellation.md +22 -0
  656. package/skills/github/githubAction/assets/reference/workflow-commands.md +1056 -0
  657. package/skills/github/githubAction/assets/reference/workflow-syntax.md +1721 -0
  658. package/skills/github/githubAction/assets/rest-api/secrets.md +1272 -0
  659. package/skills/github/githubAction/assets/rest-api/workflow-runs.md +1697 -0
  660. package/skills/github/githubAction/assets/rest-api/workflows.md +348 -0
  661. package/skills/github/githubAction/assets/starter-workflows/automation/stale.yml +27 -0
  662. package/skills/github/githubAction/assets/starter-workflows/ci/blank.yml +36 -0
  663. package/skills/github/githubAction/assets/starter-workflows/ci/docker-image.yml +18 -0
  664. package/skills/github/githubAction/assets/starter-workflows/ci/go.yml +28 -0
  665. package/skills/github/githubAction/assets/starter-workflows/ci/maven.yml +35 -0
  666. package/skills/github/githubAction/assets/starter-workflows/ci/node.js.yml +31 -0
  667. package/skills/github/githubAction/assets/starter-workflows/ci/python-app.yml +39 -0
  668. package/skills/github/githubAction/assets/starter-workflows/ci/rust.yml +22 -0
  669. package/skills/github/githubAction/assets/starter-workflows/code-scanning/codeql.yml +97 -0
  670. package/skills/github/githubAction/evals/actionVerification.json +14 -0
  671. package/skills/github/githubAction/references/apiReference.md +3 -0
  672. package/skills/github/githubAction/references/workflowPatterns.md +81 -0
  673. package/skills/github/githubAction/scripts/validateWorkflowYaml.py +53 -0
  674. package/skills/github/githubQuality/SKILL.md +136 -0
  675. package/skills/github/githubQuality/assets/README.md +24 -0
  676. package/skills/github/githubQuality/assets/pull-requests/about-code-owners.md +178 -0
  677. package/skills/github/githubQuality/assets/pull-requests/about-merge-methods.md +48 -0
  678. package/skills/github/githubQuality/assets/pull-requests/creating-a-pull-request.md +170 -0
  679. package/skills/github/githubQuality/assets/pull-requests/giving-reviews.md +48 -0
  680. package/skills/github/githubQuality/assets/pull-requests/managing-a-merge-queue.md +134 -0
  681. package/skills/github/githubQuality/assets/pull-requests/merging-a-pull-request.md +101 -0
  682. package/skills/github/githubQuality/assets/pull-requests/resolving-reviews.md +59 -0
  683. package/skills/github/githubQuality/assets/pull-requests/status-checks.md +135 -0
  684. package/skills/github/githubQuality/assets/rest-api/checks-runs.md +1013 -0
  685. package/skills/github/githubQuality/assets/rest-api/checks-suites.md +1142 -0
  686. package/skills/github/githubQuality/assets/rest-api/commits.md +957 -0
  687. package/skills/github/githubQuality/assets/rest-api/pulls.md +1605 -0
  688. package/skills/github/githubQuality/assets/rest-api/reviews.md +722 -0
  689. package/skills/github/githubQuality/evals/qualityVerification.json +14 -0
  690. package/skills/github/githubQuality/references/apiReference.md +3 -0
  691. package/skills/github/githubQuality/references/codeownersExample.md +26 -0
  692. package/skills/github/githubQuality/references/prTemplate.md +20 -0
  693. package/skills/github/githubQuality/scripts/auditPrQuality.py +52 -0
  694. package/skills/github/githubSecurity/SKILL.md +170 -0
  695. package/skills/github/githubSecurity/assets/README.md +32 -0
  696. package/skills/github/githubSecurity/assets/code-scanning/code-scanning-alerts.md +133 -0
  697. package/skills/github/githubSecurity/assets/code-scanning/code-scanning.md +67 -0
  698. package/skills/github/githubSecurity/assets/code-scanning/codeql-code-scanning.md +79 -0
  699. package/skills/github/githubSecurity/assets/code-scanning/configure-code-scanning.md +121 -0
  700. package/skills/github/githubSecurity/assets/dependabot/about-the-dependabot-yml-file.md +74 -0
  701. package/skills/github/githubSecurity/assets/dependabot/dependabot-alerts.md +133 -0
  702. package/skills/github/githubSecurity/assets/dependabot/dependabot-security-updates.md +95 -0
  703. package/skills/github/githubSecurity/assets/dependabot/dependabot-version-updates.md +80 -0
  704. package/skills/github/githubSecurity/assets/rest-api/code-scanning.md +2957 -0
  705. package/skills/github/githubSecurity/assets/rest-api/dependabot-alerts.md +895 -0
  706. package/skills/github/githubSecurity/assets/rest-api/secret-scanning.md +947 -0
  707. package/skills/github/githubSecurity/assets/secret-scanning/enable-secret-scanning.md +59 -0
  708. package/skills/github/githubSecurity/assets/secret-scanning/secret-scanning.md +105 -0
  709. package/skills/github/githubSecurity/assets/security-advisories/github-advisory-database.md +148 -0
  710. package/skills/github/githubSecurity/evals/securityVerification.json +14 -0
  711. package/skills/github/githubSecurity/references/apiReference.md +3 -0
  712. package/skills/github/githubSecurity/references/codeqlAnalysis.yml +42 -0
  713. package/skills/github/githubSecurity/references/dependabotConfig.yml +27 -0
  714. package/skills/github/githubSecurity/scripts/auditRepoSecurity.py +47 -0
  715. package/skills/github/githubSetup/SKILL.md +137 -0
  716. package/skills/github/githubSetup/assets/README.md +40 -0
  717. package/skills/github/githubSetup/assets/branches/about-protected-branches.md +198 -0
  718. package/skills/github/githubSetup/assets/branches/changing-the-default-branch.md +49 -0
  719. package/skills/github/githubSetup/assets/branches/deleting-and-restoring-branches.md +44 -0
  720. package/skills/github/githubSetup/assets/branches/managing-a-branch-protection-rule.md +115 -0
  721. package/skills/github/githubSetup/assets/branches/renaming-a-branch.md +74 -0
  722. package/skills/github/githubSetup/assets/branches/viewing-branches-in-your-repository.md +30 -0
  723. package/skills/github/githubSetup/assets/repositories/about-repositories.md +127 -0
  724. package/skills/github/githubSetup/assets/repositories/cloning-a-repository.md +114 -0
  725. package/skills/github/githubSetup/assets/repositories/creating-a-new-repository.md +82 -0
  726. package/skills/github/githubSetup/assets/repositories/creating-a-repository-from-a-template.md +51 -0
  727. package/skills/github/githubSetup/assets/repositories/deleting-a-repository.md +34 -0
  728. package/skills/github/githubSetup/assets/repositories/managing-teams-and-people-with-access.md +69 -0
  729. package/skills/github/githubSetup/assets/repositories/renaming-a-repository.md +47 -0
  730. package/skills/github/githubSetup/assets/repositories/restoring-a-deleted-repository.md +61 -0
  731. package/skills/github/githubSetup/assets/repositories/setting-repository-visibility.md +137 -0
  732. package/skills/github/githubSetup/assets/rest-api/branches.md +727 -0
  733. package/skills/github/githubSetup/assets/rest-api/quickstart.md +344 -0
  734. package/skills/github/githubSetup/assets/rest-api/repos.md +2957 -0
  735. package/skills/github/githubSetup/assets/rulesets/about-rulesets.md +72 -0
  736. package/skills/github/githubSetup/assets/rulesets/available-rules-for-rulesets.md +383 -0
  737. package/skills/github/githubSetup/assets/rulesets/converting-branch-protections-to-rulesets.md +92 -0
  738. package/skills/github/githubSetup/assets/rulesets/creating-rulesets-for-a-repository.md +108 -0
  739. package/skills/github/githubSetup/assets/rulesets/managing-rulesets-for-a-repository.md +149 -0
  740. package/skills/github/githubSetup/assets/rulesets/troubleshooting-rules.md +122 -0
  741. package/skills/github/githubSetup/evals/setupVerification.json +14 -0
  742. package/skills/github/githubSetup/references/apiReference.md +3 -0
  743. package/skills/github/githubSetup/references/repoSettingsBlueprint.md +13 -0
  744. package/skills/github/githubSetup/references/rulesetTemplates.json +42 -0
  745. package/skills/github/githubSetup/scripts/configureRepoBaseline.py +46 -0
  746. package/skills/github/githubTeam/SKILL.md +115 -0
  747. package/skills/github/githubTeam/assets/README.md +21 -0
  748. package/skills/github/githubTeam/assets/organizations/about-organizations.md +69 -0
  749. package/skills/github/githubTeam/assets/organizations/repository-roles-for-an-organization.md +94 -0
  750. package/skills/github/githubTeam/assets/rest-api/collaborators.md +547 -0
  751. package/skills/github/githubTeam/assets/rest-api/orgs.md +1172 -0
  752. package/skills/github/githubTeam/assets/rest-api/teams.md +1690 -0
  753. package/skills/github/githubTeam/assets/teams/about-teams.md +82 -0
  754. package/skills/github/githubTeam/assets/teams/adding-members-to-a-team.md +55 -0
  755. package/skills/github/githubTeam/evals/teamVerification.json +14 -0
  756. package/skills/github/githubTeam/references/apiReference.md +3 -0
  757. package/skills/github/githubTeam/references/permissionMatrix.md +17 -0
  758. package/skills/github/githubTeam/references/reviewAssignment.md +17 -0
  759. package/skills/github/githubTeam/scripts/manageTeamSync.py +31 -0
  760. package/skills/securityQa/llmSecurityRedteaming/SKILL.md +86 -0
  761. package/skills/securityQa/llmSecurityRedteaming/evals/securityRedteamVerification.json +14 -0
  762. package/skills/securityQa/llmSecurityRedteaming/references/apiReference.md +3 -0
  763. package/skills/securityQa/llmSecurityRedteaming/references/jailbreakTaxonomy.md +6 -0
  764. package/skills/securityQa/llmSecurityRedteaming/references/owaspLlmTopTen.md +12 -0
  765. package/skills/securityQa/llmSecurityRedteaming/scripts/testPromptInjection.py +34 -0
  766. package/skills/softwareDevelopment/requirementsEngineering/SKILL.md +110 -0
  767. package/skills/softwareDevelopment/requirementsEngineering/evals/evalRequirements.py +33 -0
  768. package/skills/softwareDevelopment/requirementsEngineering/references/apiReference.md +3 -0
  769. package/skills/softwareDevelopment/requirementsEngineering/references/requirementsAnalysisModels.md +34 -0
  770. package/skills/softwareDevelopment/requirementsEngineering/scripts/validateUserStories.py +49 -0
  771. package/skills/testing/testDrivenDevelopment/SKILL.md +122 -0
  772. package/skills/testing/testDrivenDevelopment/evals/evalTdd.py +25 -0
  773. package/skills/testing/testDrivenDevelopment/references/apiReference.md +3 -0
  774. package/skills/testing/testDrivenDevelopment/references/testPyramidDoubles.md +35 -0
  775. package/skills/testing/testDrivenDevelopment/scripts/auditTestPyramid.py +58 -0
@@ -0,0 +1,1682 @@
1
+ ---
2
+ title: Astro Content Loader API
3
+ sidebar:
4
+ label: Content Loader API
5
+ i18nReady: true
6
+ tableOfContents:
7
+ minHeadingLevel: 2
8
+ maxHeadingLevel: 3
9
+ ---
10
+ import Since from '~/components/Since.astro';
11
+ import ReadMore from '~/components/ReadMore.astro';
12
+
13
+ Astro's Content Loader API allows you to load your data from any source, local or remote, and interact with Astro's content layer to manage your [content collections](/en/guides/content-collections/).
14
+
15
+ This API includes two ready-to-use loaders for content stored locally. It also provides tools for building your own custom objects that can load data from any source into content collections.
16
+
17
+ <ReadMore>Learn more about [querying data loaded from build-time loaders](/en/guides/content-collections/#querying-build-time-collections) or [accessing live data from live loaders](/en/guides/content-collections/#accessing-live-data) with guided explanations and example usage in the content collections guide.</ReadMore>
18
+
19
+ ## Build-time loaders
20
+
21
+ Build-time loaders are objects with a [`load()` method](#loaderload) that is called at build time to fetch data and update the data store. This object can also define a schema for the entries, which can be used to validate the data and generate static types.
22
+
23
+ Astro's [`glob()`](#glob-loader) and [`file()`](#file-loader) loaders are examples of object loaders that are provided out-of-the-box for use with local content. For remote content, no prebuilt loaders are provided. You will have to build an object loader or use a [community-published loader](https://astro.build/integrations/?search=&categories%5B%5D=loaders) to retrieve remote content and interact with the data store.
24
+
25
+ For simple data fetching, you can also [define a loader as an async function](#defining-a-loader-as-a-function) that returns an array or object containing entries.
26
+
27
+ ### `glob()` loader
28
+
29
+ <p>
30
+
31
+ **Type:** <code>(options: GlobOptions) => <a href="#the-loader-object">Loader</a></code><br />
32
+ <Since v="5.0.0" />
33
+ </p>
34
+
35
+ The `glob()` loader creates entries from directories of files from anywhere on the filesystem. The supported file types are Markdown, MDX, Markdoc, JSON, YAML, and TOML files.
36
+
37
+ This loader accepts an object with the following properties: `pattern`, `base` (optional), `generateId` (optional), `retainBody` (optional), and `deferRender` (optional).
38
+
39
+ ```ts title="src/content.config.ts"
40
+ import { defineCollection } from 'astro:content';
41
+ import { glob } from 'astro/loaders';
42
+
43
+ const pages = defineCollection({
44
+ /* Retrieve all Markdown files in your pages directory. */
45
+ loader: glob({ pattern: "**/*.md", base: "./src/data/pages" }),
46
+ });
47
+ const blog = defineCollection({
48
+ /* Retrieve all Markdown and MDX files in your blog directory. */
49
+ loader: glob({ pattern: "**/*.(md|mdx)", base: "./src/data/blog" }),
50
+ });
51
+ const notes = defineCollection({
52
+ /* Retrieve all Markdown files in your notes directory and prevent
53
+ * the raw body of content files from being stored in the data store. */
54
+ loader: glob({
55
+ pattern: '**/*.md',
56
+ base: './src/data/notes',
57
+ retainBody: false
58
+ }),
59
+ });
60
+ const authors = defineCollection({
61
+ /* Retrieve all JSON files in your authors directory while retaining
62
+ * uppercase letters in the ID. */
63
+ loader: glob({
64
+ pattern: '**/*.json',
65
+ base: "./src/data/authors",
66
+ generateId: ({ entry }) => entry.replace(/\.json$/, ''),
67
+ }),
68
+ });
69
+
70
+ export const collections = { pages, blog, authors };
71
+ ```
72
+
73
+ #### `pattern`
74
+
75
+ <p>
76
+
77
+ **Type:** `string | string[]`
78
+ </p>
79
+
80
+ The `pattern` property accepts a string or an array of strings using glob matching (e.g. wildcards, globstars). The patterns must be relative to the base directory of entry files to match.
81
+
82
+ You can learn more about the syntax to use in the [micromatch documentation](https://github.com/micromatch/micromatch#matching-features). You can also verify the validity of your pattern using an online tool like the [DigitalOcean Glob Tool](https://www.digitalocean.com/community/tools/glob).
83
+
84
+ #### `base`
85
+
86
+ <p>
87
+
88
+ **Type:** `string | URL`<br />
89
+ **Default:** `"."`
90
+ </p>
91
+
92
+ A relative path or [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) to the directory from which to resolve the `pattern`.
93
+
94
+ #### `generateId()`
95
+
96
+ <p>
97
+
98
+ **Type:** `(options: GenerateIdOptions) => string`
99
+ </p>
100
+
101
+ A callback function that returns a unique string per entry in a collection. It accepts an object as parameter with the following properties:
102
+ * `entry` - the path to the entry file, relative to the base directory
103
+ * `base` - the base directory [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL)
104
+ * `data` - the parsed, unvalidated data of the entry
105
+
106
+ By default it uses [`github-slugger`](https://github.com/Flet/github-slugger) to generate a slug with [kebab-cased](https://developer.mozilla.org/en-US/docs/Glossary/Kebab_case) words.
107
+
108
+ #### `retainBody`
109
+
110
+ <p>
111
+
112
+ **Type:** `boolean`<br />
113
+ **Default:** `true`
114
+ <Since v="5.17.0" />
115
+ </p>
116
+
117
+ Whether or not to store the raw body of content files in the data store.
118
+
119
+ When `retainBody` is `false`, [`entry.body`](/en/reference/modules/astro-content/#collectionentrybody) will be `undefined` instead of containing the raw file contents.
120
+
121
+ Setting this property to `false` significantly reduces the deployed size of the data store and helps avoid hitting size limits for sites with very large collections.
122
+
123
+ For Markdown files, the rendered body will still be available in the [`entry.rendered.html` property](#dataentryrenderedhtml), and the [`entry.filePath` property](#dataentryfilepath) will still point to the original file.
124
+
125
+ For MDX collections, this will dramatically reduce the size of the collection, as there will no longer be any body retained in the store.
126
+
127
+ #### `deferRender`
128
+
129
+ <p>
130
+
131
+ **Type:** `boolean`<br />
132
+ **Default:** `false`
133
+ <Since v="7.1.0" />
134
+ </p>
135
+
136
+ Whether to defer rendering Markdown entries until they are rendered in a page. When `false` (the default), their rendering occurs eagerly during content sync. This option does not apply to MDX, Markdoc, and data entries (e.g., JSON, YAML).
137
+
138
+ By default, the `glob()` loader renders each Markdown entry during sync and stores the resulting HTML in the data store. This allows the rendered content to be cached and reused across builds. However, for large collections whose rendered output is much larger than the source, storing all this rendered HTML in memory at once can cause your build to run out of memory.
139
+
140
+ When `deferRender` is `true`, rendering is instead deferred until each entry is actually rendered in a page, using the same on-demand rendering path that `.mdx` files already use. This keeps memory usage bounded during `astro build` at the cost of the rendered HTML no longer being cached in the data store.
141
+
142
+ ```ts title="src/content.config.ts"
143
+ import { defineCollection } from "astro:content";
144
+ import { glob } from "astro/loaders";
145
+
146
+ const docs = defineCollection({
147
+ /* Defer rendering of a large Markdown collection to avoid running out of memory during the build. */
148
+ loader: glob({
149
+ pattern: "**/*.md",
150
+ base: "./src/data/docs",
151
+ deferRender: true,
152
+ }),
153
+ });
154
+ ```
155
+
156
+ ### `file()` loader
157
+
158
+ <p>
159
+
160
+ **Type:** <code>(fileName: string, options?: FileOptions) => <a href="#the-loader-object">Loader</a></code><br />
161
+ <Since v="5.0.0" />
162
+ </p>
163
+
164
+ The `file()` loader creates entries from a single file that contains an array of objects with a unique `id` field, or an object with IDs as keys and entries as values.
165
+
166
+ It supports JSON, YAML, or TOML files and you can provide a custom `parser` for data files it cannot parse by default, or to parse data asynchronously.
167
+
168
+ This loader accepts a `fileName` property and an optional options object as second argument:
169
+
170
+ ```ts title="src/content.config.ts"
171
+ import { defineCollection } from 'astro:content';
172
+ import { file } from 'astro/loaders';
173
+
174
+ const authors = defineCollection({
175
+ /* Retrieve all entries from a JSON file. */
176
+ loader: file("src/data/authors.json"),
177
+ });
178
+ const products = defineCollection({
179
+ /* Retrieve all entries from a CSV file using a custom parser. */
180
+ loader: file("src/data/products.csv", {
181
+ parser: (fileContent) => { /* your parser logic */ },
182
+ }),
183
+ });
184
+
185
+ export const collections = { authors, products };
186
+ ```
187
+
188
+ #### `fileName`
189
+
190
+ <p>
191
+
192
+ **Type:** `string`
193
+ </p>
194
+
195
+ Sets the path to the file to load, relative to the root directory.
196
+
197
+ #### Options
198
+
199
+ <p>
200
+
201
+ **Type:** `FileOptions`
202
+ </p>
203
+
204
+ An optional object with the following properties:
205
+
206
+ ##### `parser()`
207
+
208
+ <p>
209
+
210
+ **Type:** `(text: string) => Record<string, Record<string, unknown>> | Array<Record<string, unknown>> | Promise<Record<string, Record<string, unknown>> | Array<Record<string, unknown>>>`
211
+ </p>
212
+
213
+ A callback function to create a collection from a file’s contents. Use it when you need to process files other than JSON, YAML, or TOML that not supported by default (e.g. `.csv`) or when using [nested `.json` documents](/en/guides/content-collections/#nested-json-documents).
214
+
215
+ ### Building a loader
216
+
217
+ The Content Loader API is flexible and full-featured, allowing for a variety of data fetching options. It is possible to build both simple and complex loaders. Your custom loader will depend on both the source and the shape of your data, as well as how you choose to manage the persistent data storage layer.
218
+
219
+ Most loaders will export a function that accepts configuration options and returns a [loader object](#the-loader-object) including a `name` for your loader, a `load()` method, and a `schema` defining your entries.
220
+
221
+ #### Loading collections into the data store
222
+
223
+ The [`load()`](#loaderload) function returned in the loader object defines how your content is fetched, parsed, validated and updated. It accepts a `context` object that allows you to customize your data handling in a variety of ways and interact with the data store. A typical `load()` function will:
224
+
225
+ - Fetch your data from a source.
226
+ - Clear the existing data store.
227
+ - Parse and validate your data entries according to a provided schema.
228
+ - Update the data store with new entries.
229
+
230
+ The `load()` method also provides helpers to log messages to the console, render content to HTML, watch for changes in dev mode and reload data, provide access to metadata
231
+ and even the full Astro config, and more.
232
+
233
+ <ReadMore>See the full [`LoaderContext`](#loadercontext) list of properties for all options available to the `load()` function.</ReadMore>
234
+
235
+ #### Providing a schema
236
+
237
+ Providing a Zod [`schema`](#loaderschema) in your loader allows you to validate your fetched content entries with [`parseData()`](#loadercontextparsedata) before adding them to the data [store](#loadercontextstore). This schema will also be used as the collection's default schema when one does not exist in `src/content.config.ts` to provide type safety and editor tooling. You do not also need a schema defined in the content collection if the loader provides this property.
238
+
239
+ However, if the content collection also [defines a schema](/en/guides/content-collections/#defining-the-collection-schema), that schema will be used instead of your loader's schema. This is to allow users of your loader to extend its schema, or transform data for use in their project. If you are [publishing and distributing a loader](#distributing-your-loader) for others to use, you may wish to document this behavior and encourage users not to define a collection schema themselves, or how to do so safely if they need data returned in a different format.
240
+
241
+ If you need to dynamically generate the schema based on the configuration options or by introspecting an API, you can use [`createSchema()`](#loadercreateschema) instead.
242
+
243
+ #### Loader example
244
+
245
+ The following example shows a loader that fetches data from a provided feed URL (using a custom `loadFeedData` utility) and updates the data store with new entries each time the site is built:
246
+
247
+ ```ts title="src/feed-loader.ts"
248
+ // 1. Import the `Loader` type and any other dependencies needed
249
+ import type { Loader } from 'astro/loaders';
250
+ import { z } from 'astro/zod';
251
+ import { loadFeedData } from "./feed.js";
252
+
253
+ // 2. Define any options that your loader needs
254
+ export function feedLoader(options: { url: string, apiKey: string }) {
255
+ const feedUrl = new URL(options.url);
256
+ // 3. Return a loader object
257
+ return {
258
+ name: "feed-loader",
259
+ load: async ({ store, parseData }) => {
260
+ const feed = await loadFeedData(feedUrl, options.apiKey);
261
+
262
+ store.clear();
263
+
264
+ for (const item of feed.items) {
265
+ const id = item.guid;
266
+ const data = await parseData({
267
+ id,
268
+ data: item,
269
+ });
270
+ store.set({
271
+ id,
272
+ data,
273
+ });
274
+ }
275
+ },
276
+ // 4. Define the schema of an entry.
277
+ schema: z.object({
278
+ // ...
279
+ })
280
+ } satisfies Loader;
281
+ }
282
+ ```
283
+
284
+ #### Defining your collection with your loader
285
+
286
+ Use your custom loader as the value of the `loader` property when you define your collection in `src/content.config.ts`. Configuration options can be passed to your loader as arguments:
287
+
288
+ ```ts title="src/content.config.ts"
289
+ import { defineCollection } from 'astro:content';
290
+ import { feedLoader } from './feed-loader.ts';
291
+
292
+ const blog = defineCollection({
293
+ loader: feedLoader({
294
+ url: "https://api.example.com/posts",
295
+ apiKey: "my-secret",
296
+ }),
297
+ });
298
+
299
+ export const collections = { blog };
300
+ ```
301
+
302
+ ### Defining a loader as a function
303
+
304
+ For simple data fetches that do not need custom data store handling, validation, logging, or any other helpers provided by the [build-time loader object](#the-loader-object), you can define your loader as a function.
305
+
306
+ The function can be async and must return either an array of entries that each contain a unique `id` field, or an object where each key is a unique ID and each value is the entry.
307
+
308
+ This pattern provides a convenient shorthand to accomplish the basic tasks normally performed by the `load()` function to [load collections into the data store](#loading-collections-into-the-data-store). At build-time, the loader will automatically clear the data store and reload all the entries. No further customization options or helpers for data handling are provided.
309
+
310
+ These loaders are often simple enough that you may choose to define them inline in the `src/content.config.ts` file:
311
+
312
+ ```ts title="src/content.config.ts"
313
+ import { defineCollection } from "astro:content";
314
+
315
+ const countries = defineCollection({
316
+ loader: async () => {
317
+ const response = await fetch("https://restcountries.com/v3.1/all");
318
+ const data = await response.json();
319
+ // Must return an array of entries with an id property
320
+ // or an object with IDs as keys and entries as values
321
+ return data.map((country: any) => ({
322
+ id: country.cca3,
323
+ ...country,
324
+ }));
325
+ },
326
+ });
327
+
328
+ export const collections = { countries };
329
+ ```
330
+
331
+ ## Live Loaders
332
+
333
+ The Live Loader API is built to handle querying any data in real time. Live loaders can filter incoming data and verify content with type safety. Since live loaders fetch data fresh upon every request, there is no data store to update. These loaders are designed to return either data or an `Error` object to allow you to handle errors gracefully.
334
+
335
+ ### Building a live loader
336
+
337
+ Most live loaders will export a function that accepts configuration options and returns a [live loader object](#the-liveloader-object) including a `name` for your loader and two methods to define how to load your collection of entries and how to load a single entry: `loadCollection()` and `loadEntry()`.
338
+
339
+ #### Loading live data
340
+
341
+ To return data about your collection, you must provide a [`loadCollection()`](#liveloaderloadcollection) function that fetches data, and returns an array of content [`entries`](#livedatacollectionentries) or an error.
342
+
343
+ To return a single live collection entry, you must provide a [`loadEntry()`](#liveloaderloadentry) function that fetches data filtered for a given `id`, and returns a single [`entry`](#livedataentry), `undefined`, or an error.
344
+
345
+ The data fetching for both of these functions is typically done using a [`try...catch` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch) to [handle errors when accessing live data](#error-handling-in-live-loaders).
346
+
347
+ <ReadMore>See the full [Live Loader API](#live-loader-api) for more about the functions and types available for building your live loader.</ReadMore>
348
+
349
+ #### Providing a schema for live loaders
350
+
351
+ Live loaders do not include a schema property. Instead, you can provide type safety by [defining a Zod schema for your collection](/en/guides/content-collections/#using-zod-schemas-with-live-collections) in `src/live.config.ts`, or by passing generic types to the `LiveLoader` interface for the data they return.
352
+
353
+ #### Example live loader
354
+
355
+ The following example shows a live loader that defines data fetching from a CMS (using a custom `fetchFromCMS` utility) for both a collection of entries and a single entry, including type safety and error handling:
356
+
357
+ ```ts title="src/article-loader.ts"
358
+ import type { LiveLoader } from 'astro/loaders';
359
+ import { fetchFromCMS } from './cms-client.js';
360
+
361
+ interface Article {
362
+ id: string;
363
+ title: string;
364
+ htmlContent: string;
365
+ author: string;
366
+ }
367
+
368
+ interface EntryFilter {
369
+ id: string;
370
+ }
371
+
372
+ interface CollectionFilter {
373
+ author?: string;
374
+ }
375
+
376
+ export function articleLoader(config: { apiKey: string }): LiveLoader<Article, EntryFilter, CollectionFilter> {
377
+ return {
378
+ name: 'article-loader',
379
+ loadCollection: async ({ filter }) => {
380
+ try {
381
+ const articles = await fetchFromCMS({
382
+ apiKey: config.apiKey,
383
+ type: 'article',
384
+ filter,
385
+ });
386
+
387
+ return {
388
+ entries: articles.map((article) => ({
389
+ id: article.id,
390
+ data: article,
391
+ })),
392
+ };
393
+ } catch (error) {
394
+ return {
395
+ error: new Error('Failed to load articles', { cause: error }),
396
+ };
397
+ }
398
+ },
399
+ loadEntry: async ({ filter }) => {
400
+ try {
401
+ // filter will be { id: "some-id" } when called with a string
402
+ const article = await fetchFromCMS({
403
+ apiKey: config.apiKey,
404
+ type: 'article',
405
+ id: filter.id,
406
+ });
407
+
408
+ if (!article) {
409
+ return {
410
+ error: new Error('Article not found'),
411
+ };
412
+ }
413
+
414
+ return {
415
+ id: article.id,
416
+ data: article,
417
+ rendered: {
418
+ html: article.htmlContent,
419
+ },
420
+ };
421
+ } catch (error) {
422
+ return {
423
+ error: new Error('Failed to load article', { cause: error }),
424
+ };
425
+ }
426
+ },
427
+ };
428
+ }
429
+ ```
430
+
431
+ #### Defining your live collection with your loader
432
+
433
+ Use your custom live loader as the value of the `loader` property when you define your collection in `src/live.config.ts`. Configuration options can be passed to your loader as arguments:
434
+
435
+ ```ts title="src/live.config.ts" {2,5-7}
436
+ import { defineLiveCollection } from 'astro:content';
437
+ import { articleLoader } from './article-loader.ts';
438
+
439
+ const blog = defineLiveCollection({
440
+ loader: articleLoader({
441
+ apiKey: "my-secret",
442
+ }),
443
+ });
444
+
445
+ export const collections = { blog };
446
+ ```
447
+
448
+ #### Error handling in live loaders
449
+
450
+ Live loaders return an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) subclass for errors. You can create [custom error types](#creating-live-loader-error-types) and use them for more specific error handling if needed. If an error is thrown in the live loader, it will be caught and returned, wrapped in a `LiveCollectionError`.
451
+
452
+ Astro will generate some errors itself, depending on the response from the live loader:
453
+
454
+ - If `loadEntry` returns `undefined`, Astro will return a `LiveEntryNotFoundError` to the user.
455
+ - If a schema is defined for the collection and the data does not match the schema, Astro will return a `LiveCollectionValidationError`.
456
+ - If the loader returns an invalid cache hint, Astro will return a `LiveCollectionCacheHintError`. The `cacheHint` field is optional, so if you do not have valid data to return, you can simply omit it.
457
+
458
+ ```ts title="my-loader.ts" {11-14}
459
+ import type { LiveLoader } from "astro/loaders";
460
+ import type { MyData } from "./types";
461
+ import { MyLoaderError } from "./errors";
462
+
463
+ export function myLoader(config: {
464
+ apiKey: string;
465
+ }): LiveLoader<MyData, never, never, MyLoaderError> {
466
+ return {
467
+ name: "my-loader",
468
+ loadCollection: async () => {
469
+ // Return your custom error type
470
+ return {
471
+ error: new MyLoaderError("Failed to load", "LOAD_ERROR"),
472
+ };
473
+ },
474
+ loadEntry: async () => {
475
+ // ...
476
+ },
477
+ };
478
+ }
479
+ ```
480
+
481
+ ##### Creating live loader error types
482
+
483
+ You can create custom error types for [errors returned by your loader](#error-handling-in-live-loaders) and pass them as a generic to get proper typing:
484
+
485
+ ```ts title="my-loader.ts"
486
+ import type { LiveLoader } from "astro/loaders";
487
+ import type { MyData } from "./types";
488
+
489
+ export class MyLoaderError extends Error {
490
+ constructor(
491
+ message: string,
492
+ public code?: string,
493
+ ) {
494
+ super(message);
495
+ this.name = "MyLoaderError";
496
+ }
497
+ }
498
+
499
+ export function myLoader(config: {
500
+ apiKey: string;
501
+ }): LiveLoader<MyData, never, never, MyLoaderError> {
502
+ return {
503
+ name: "my-loader",
504
+ loadCollection: async () => {
505
+ // Return your custom error type
506
+ return {
507
+ error: new MyLoaderError("Failed to load", "LOAD_ERROR"),
508
+ };
509
+ },
510
+ loadEntry: async () => {
511
+ // ...
512
+ },
513
+ };
514
+ }
515
+ ```
516
+
517
+ When you use `getLiveCollection()` or `getLiveEntry()`, TypeScript will infer the custom error type, allowing you to handle it appropriately:
518
+
519
+ ```astro title="src/pages/store.astro"
520
+ ---
521
+ export const prerender = false; // Not needed in 'server' mode
522
+
523
+ import { getLiveEntry } from 'astro:content';
524
+ import { MyLoaderError } from "../my-loader";
525
+
526
+ const { entry, error } = await getLiveEntry('products', '123');
527
+
528
+ if (error) {
529
+ if (error instanceof MyLoaderError) {
530
+ console.error(`Loader error: ${error.message} (code: ${error.code})`);
531
+ } else {
532
+ console.error(`Unexpected error: ${error.message}`);
533
+ }
534
+ return Astro.rewrite('/500');
535
+ }
536
+ ---
537
+ ```
538
+
539
+ #### Defining custom filter types
540
+
541
+ Live loaders can define custom filter types for both `getLiveCollection()` and `getLiveEntry()`. This enables type-safe querying that matches your API's capabilities, making it easier for users to discover available filters and ensure they are used correctly. If you include JSDoc comments in your filter types, the user will see these in their IDE as hints when using the loader.
542
+
543
+ ```ts title="store-loader.ts" "EntryFilter, CollectionFilter" {6,8}
544
+ import type { LiveLoader } from 'astro/loaders';
545
+ import { fetchProduct, fetchCategory, type Product } from './store-client';
546
+
547
+ interface CollectionFilter {
548
+ category?: string;
549
+ /** Minimum price to filter products */
550
+ minPrice?: number;
551
+ /** Maximum price to filter products */
552
+ maxPrice?: number;
553
+ }
554
+
555
+ interface EntryFilter {
556
+ /** Alias for `sku` */
557
+ id?: string;
558
+ slug?: string;
559
+ sku?: string;
560
+ }
561
+
562
+ export function productLoader(config: {
563
+ apiKey: string;
564
+ endpoint: string;
565
+ }): LiveLoader<Product, EntryFilter, CollectionFilter> {
566
+ return {
567
+ name: 'product-loader',
568
+ loadCollection: async ({ filter }) => {
569
+ // filter is typed as CollectionFilter
570
+ const data = await fetchCategory({
571
+ apiKey: config.apiKey,
572
+ category: filter?.category ?? 'all',
573
+ minPrice: filter?.minPrice,
574
+ maxPrice: filter?.maxPrice,
575
+ });
576
+
577
+ return {
578
+ entries: data.products.map((product) => ({
579
+ id: product.sku,
580
+ data: product,
581
+ })),
582
+ };
583
+ },
584
+ loadEntry: async ({ filter }) => {
585
+ // filter is typed as EntryFilter | { id: string }
586
+ const product = await fetchProduct({
587
+ apiKey: config.apiKey,
588
+ slug: filter.slug,
589
+ sku: filter.sku || filter.id,
590
+ });
591
+ if (!product) {
592
+ return {
593
+ error: new Error('Product not found'),
594
+ };
595
+ }
596
+ return {
597
+ id: product.sku,
598
+ data: product,
599
+ };
600
+ },
601
+ };
602
+ }
603
+ ```
604
+
605
+ #### Cache hints
606
+
607
+ Live loaders can provide cache hints to help with response caching. You can use this data to send HTTP cache headers or otherwise inform your caching strategy.
608
+
609
+ ```ts title="my-loader.ts"
610
+ import type { LiveLoader } from "astro/loaders";
611
+ import {
612
+ loadStoreProduct,
613
+ loadStoreProducts,
614
+ getLastModifiedDate,
615
+ } from "./store";
616
+ import type {
617
+ Product,
618
+ ProductEntryFilter,
619
+ ProductCollectionFilter,
620
+ } from "./types";
621
+
622
+ export function myLoader(config: {
623
+ apiKey: string;
624
+ }): LiveLoader<Product, ProductEntryFilter, ProductCollectionFilter> {
625
+ return {
626
+ name: "cached-loader",
627
+ loadCollection: async ({ filter }) => {
628
+ const products = await loadStoreProducts(filter);
629
+ return {
630
+ entries: products.map((item) => ({
631
+ id: item.id,
632
+ data: item,
633
+ // You can optionally provide cache hints for each entry
634
+ cacheHint: {
635
+ tags: [`product-${item.id}`, `category-${item.category}`],
636
+ },
637
+ })),
638
+ cacheHint: {
639
+ // All fields are optional, and are combined with each entry's cache hints
640
+ // tags are merged from all entries
641
+ // lastModified is the most recent lastModified of all entries and the collection
642
+ lastModified: getLastModifiedDate(products),
643
+ tags: ["products"],
644
+ },
645
+ };
646
+ },
647
+ loadEntry: async ({ filter }) => {
648
+ const item = await loadStoreProduct(filter);
649
+ return {
650
+ id: item.id,
651
+ data: item,
652
+ cacheHint: {
653
+ lastModified: new Date(item.lastModified),
654
+ tags: [`product-${item.id}`, `category-${item.category}`],
655
+ },
656
+ };
657
+ },
658
+ };
659
+ }
660
+ ```
661
+
662
+ You can then use these hints in your pages. If you have [configured a cache provider](/en/guides/caching/#configure-caching), pass cache hints directly to [`Astro.cache.set()`](/en/reference/api-reference/#cacheset):
663
+
664
+ ```astro title="src/pages/store/[id].astro"
665
+ ---
666
+ export const prerender = false; // Not needed in 'server' mode
667
+
668
+ import { getLiveEntry } from 'astro:content';
669
+
670
+ const { entry, error, cacheHint } = await getLiveEntry('products', Astro.params.id);
671
+
672
+ if (error) {
673
+ return Astro.redirect('/404');
674
+ }
675
+
676
+ // Pass cache hints to route caching
677
+ if (cacheHint) {
678
+ Astro.cache.set(cacheHint);
679
+ }
680
+ Astro.cache.set({ maxAge: 300 });
681
+ ---
682
+
683
+ <h1>{entry.data.name}</h1>
684
+ <p>{entry.data.description}</p>
685
+ ```
686
+
687
+ Without a cache provider, you can use cache hints to set response headers manually for your own caching strategy:
688
+
689
+ ```astro title="src/pages/store/[id].astro"
690
+ ---
691
+ export const prerender = false; // Not needed in 'server' mode
692
+
693
+ import { getLiveEntry } from 'astro:content';
694
+
695
+ const { entry, error, cacheHint } = await getLiveEntry('products', Astro.params.id);
696
+
697
+ if (error) {
698
+ return Astro.redirect('/404');
699
+ }
700
+
701
+ if (cacheHint?.tags) {
702
+ Astro.response.headers.set('Cache-Tag', cacheHint.tags.join(','));
703
+ }
704
+
705
+ if (cacheHint?.lastModified) {
706
+ Astro.response.headers.set('Last-Modified', cacheHint.lastModified.toUTCString());
707
+ }
708
+ ---
709
+
710
+ <h1>{entry.data.name}</h1>
711
+ <p>{entry.data.description}</p>
712
+ ```
713
+
714
+ :::note
715
+ Cache hints do not automatically cause the response to be cached by Astro. They provide values you can pass to [route caching](/en/guides/caching/) or use to implement your own caching strategy.
716
+ :::
717
+
718
+ ## Distributing your loader
719
+
720
+ Loaders can be defined in your site or as a separate npm package. If you want to share your loader with the community, you can [publish it to npm with the `withastro` and `astro-loader` keywords](/en/guides/integrations/#packagejson-data).
721
+
722
+ A loader should export a function that returns a `LiveLoader` object for live loaders or a `Loader` object for build-time loaders, allowing users to configure it with their own settings.
723
+
724
+ ## Object loader API
725
+
726
+ <p><Since v="5.0.0" /></p>
727
+
728
+ This section shows the API for defining a [build-time object loader](#building-a-loader).
729
+
730
+ ### The `Loader` object
731
+
732
+
733
+ <p>
734
+
735
+ **Type:** `Loader`
736
+ </p>
737
+
738
+ A loader function returns an object with two required properties. In addition to providing a name for the loader, this object describes how to fetch the collection data.
739
+
740
+ Optionally, you can return a third property defining a schema to validate your collection entries. Use the [TypeScript `satisfies` operator](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#the-satisfies-operator) instead of a return type annotation to provide type safety inside your loader object and to preserve type inference when your loader is used in a collection.
741
+
742
+ #### `Loader.name`
743
+
744
+ <p>
745
+
746
+ **Type:** `string`
747
+ <Since v="5.0.0" />
748
+ </p>
749
+
750
+ A unique name for the loader, used in logs and [for conditional loading](/en/reference/integrations-reference/#refreshcontent-option).
751
+
752
+ #### `Loader.load()`
753
+
754
+ <p>
755
+
756
+ **Type:** <code>(context: <a href="#loadercontext">LoaderContext</a>) => Promise&lt;void&gt;</code>
757
+ <Since v="5.0.0" />
758
+ </p>
759
+
760
+ An async function that is called at build time to load data and update the store. It is passed a [`LoaderContext`](#loadercontext) object that contains helper functions and properties for writing your loader's implementation logic, as well as the `store` database and methods for interacting with it.
761
+
762
+ #### `Loader.schema`
763
+
764
+ <p>
765
+
766
+ **Type:** `ZodSchema`
767
+ <Since v="5.0.0" />
768
+ </p>
769
+
770
+ An optional [Zod schema](/en/guides/content-collections/#defining-datatypes-with-zod) that defines the shape of the entries. It is used to both validate the data and also to generate TypeScript types for the collection.
771
+
772
+ When you need to dynamically generate the schema at build time based on configuration options or by introspecting an API, use [`createSchema()`](#loadercreateschema) instead.
773
+
774
+ If present, it will be overridden by any Zod `schema` defined for the collection in the `src/content.config.ts` file.
775
+
776
+ #### `Loader.createSchema()`
777
+
778
+ <p>
779
+
780
+ **Type:** `() => Promise<{ schema: ZodSchema; types: string }>`
781
+ <Since v="6.0.0" />
782
+ </p>
783
+
784
+ An optional async function that returns an object containing a [Zod schema](/en/guides/content-collections/#defining-datatypes-with-zod) and types. It is used to dynamically generate the schema at build time based on the configuration options or by introspecting an API.
785
+
786
+ When you only need to provide a static schema, provide a Zod validation object using [`schema`](#loaderschema) instead.
787
+
788
+ If present, it will be overridden by any Zod `schema` defined for the collection in the `src/content.config.ts` file.
789
+
790
+ The returned `types` contents will be written to a TypeScript file, and must export an `Entry` type or interface:
791
+
792
+ ```ts title="src/feed-loader.ts" ins={26-34}
793
+ import type { Loader } from "astro/loaders";
794
+ import { loadFeedData, getSchema, getTypes } from "./feed.js";
795
+
796
+ export function myLoader(options: { url: string; apiKey: string }) {
797
+ const feedUrl = new URL(options.url);
798
+
799
+ return {
800
+ name: "feed-loader",
801
+ load: async ({ store, parseData }) => {
802
+ const feed = await loadFeedData(feedUrl, options.apiKey);
803
+
804
+ store.clear();
805
+
806
+ for (const item of feed.items) {
807
+ const id = item.guid;
808
+ const data = await parseData({
809
+ id,
810
+ data: item,
811
+ });
812
+ store.set({
813
+ id,
814
+ data,
815
+ });
816
+ }
817
+ },
818
+ createSchema: async () => {
819
+ const schema = await getSchema();
820
+ const types = await getTypes();
821
+
822
+ return {
823
+ schema,
824
+ types: `export type Entry = ${types}`,
825
+ };
826
+ },
827
+ } satisfies Loader;
828
+ }
829
+ ```
830
+
831
+ ### `LoaderContext`
832
+
833
+ This object is passed to the [`load()`](#loaderload) method of the loader, and contains the following properties:
834
+
835
+ #### `LoaderContext.collection`
836
+
837
+ <p>
838
+
839
+ **Type:** `string`
840
+ <Since v="5.0.0" />
841
+ </p>
842
+
843
+ The unique name of the collection. This is the key in the `collections` object in the `src/content.config.ts` file.
844
+
845
+ #### `LoaderContext.store`
846
+
847
+ <p>
848
+
849
+ **Type:** [`DataStore`](#datastore)
850
+ <Since v="5.0.0" />
851
+ </p>
852
+
853
+ A database to store the actual data. Use this to update the store with new entries. See [`DataStore`](#datastore) for more information.
854
+
855
+ #### `LoaderContext.meta`
856
+
857
+ <p>
858
+
859
+ **Type:** `MetaStore`
860
+ <Since v="5.0.0" />
861
+ </p>
862
+
863
+ A key-value store scoped to the collection, designed for things like sync tokens and last-modified times. This metadata is persisted between builds alongside the collection data but is only available inside the loader.
864
+
865
+ ```ts
866
+ const lastModified = meta.get("lastModified");
867
+ // ...
868
+ meta.set("lastModified", new Date().toISOString());
869
+ ```
870
+
871
+ #### `LoaderContext.logger`
872
+
873
+ <p>
874
+
875
+ **Type:** [`AstroIntegrationLogger`](/en/reference/integrations-reference/#astrointegrationlogger)
876
+ <Since v="5.0.0" />
877
+ </p>
878
+
879
+ A logger that can be used to log messages to the console. Use this instead of `console.log` for more helpful logs that include loader-specific content such as the loader name or information about the loading process in the log message. See [`AstroIntegrationLogger`](/en/reference/integrations-reference/#astrointegrationlogger) for more information.
880
+
881
+ ```ts title="Extract from the file() loader" {15} "logger"
882
+ import type { Loader } from "astro/loaders";
883
+ import { fileURLToPath } from "node:url";
884
+ import { syncData } from "./helpers";
885
+
886
+ export function file(fileName: string) {
887
+ return {
888
+ name: "file-loader",
889
+ load: async ({ config, store, logger, watcher }) => {
890
+ const url = new URL(fileName, config.root);
891
+ const filePath = fileURLToPath(url);
892
+ await syncData(filePath, store);
893
+
894
+ watcher?.on("change", async (changedPath) => {
895
+ if (changedPath === filePath) {
896
+ logger.info(`Reloading data from ${fileName}`);
897
+ await syncData(filePath, store);
898
+ }
899
+ });
900
+ },
901
+ } satisfies Loader;
902
+ }
903
+ ```
904
+
905
+ #### `LoaderContext.config`
906
+
907
+ <p>
908
+
909
+ **Type:** `AstroConfig`
910
+ <Since v="5.0.0" />
911
+ </p>
912
+
913
+ The full, resolved Astro configuration object with all defaults applied. See [the configuration reference](/en/reference/configuration-reference/) for more information.
914
+
915
+ ```ts title="Extract from the file() loader" {9} "config"
916
+ import type { Loader } from "astro/loaders";
917
+ import { fileURLToPath } from "node:url";
918
+ import { syncData } from "./helpers";
919
+
920
+ export function file(fileName: string) {
921
+ return {
922
+ name: "file-loader",
923
+ load: async ({ config, store, logger, watcher }) => {
924
+ const url = new URL(fileName, config.root);
925
+ const filePath = fileURLToPath(url);
926
+ await syncData(filePath, store);
927
+
928
+ watcher?.on("change", async (changedPath) => {
929
+ if (changedPath === filePath) {
930
+ logger.info(`Reloading data from ${fileName}`);
931
+ await syncData(filePath, store);
932
+ }
933
+ });
934
+ },
935
+ } satisfies Loader;
936
+ }
937
+ ```
938
+
939
+ #### `LoaderContext.parseData()`
940
+
941
+ <p>
942
+
943
+ **Type:** `(props: ParseDataOptions<TData>) => Promise<TData>`
944
+ <Since v="5.0.0" />
945
+ </p>
946
+
947
+ Validates and parses the data according to the collection schema. Pass data to this function to validate and parse it before storing it in the data store.
948
+
949
+ ```ts title=loader.ts {15-18}
950
+ import type { Loader } from "astro/loaders";
951
+ import { loadFeed } from "./feed.js";
952
+
953
+ export function feedLoader({ url }: { url: string }) {
954
+ const feedUrl = new URL(url);
955
+ return {
956
+ name: "feed-loader",
957
+ load: async ({ store, logger, parseData }) => {
958
+ logger.info("Loading posts");
959
+ const feed = loadFeed(feedUrl);
960
+ store.clear();
961
+
962
+ for (const item of feed.items) {
963
+ const id = item.guid;
964
+ const data = await parseData({
965
+ id,
966
+ data: item,
967
+ });
968
+ store.set({
969
+ id,
970
+ data,
971
+ });
972
+ }
973
+ },
974
+ } satisfies Loader;
975
+ }
976
+ ```
977
+
978
+ #### `LoaderContext.renderMarkdown()`
979
+
980
+ <p>
981
+
982
+ **Type:** `(content: string, options?: { fileURL?: URL }) => Promise<RenderedContent>`
983
+ <Since v="5.9.0" />
984
+ </p>
985
+
986
+ Renders a Markdown string to HTML, returning a `RenderedContent` object.
987
+
988
+ This allows you to render Markdown content directly within your loaders using the same Markdown processing as Astro's built-in `glob()` loader and provides access to the `render()` function and `<Content />` component for [rendering body content](/en/guides/content-collections/#rendering-body-content).
989
+
990
+ Assign this object to the [rendered](#dataentryrendered) field of the [DataEntry](#dataentry) object to allow users to [render the content in a page](/en/guides/content-collections/#rendering-body-content). If the Markdown content includes frontmatter, it will be parsed and available in `metadata.frontmatter`. The frontmatter will be excluded from the HTML output.
991
+
992
+ ```ts title=loader.ts {16-17}
993
+ import type { Loader } from "astro/loaders";
994
+ import { loadFromCMS } from "./cms.js";
995
+
996
+ export function myLoader(settings: { apiKey: string }) {
997
+ return {
998
+ name: "cms-loader",
999
+ async load({ renderMarkdown, store }) {
1000
+ const entries = await loadFromCMS(settings.apiKey);
1001
+
1002
+ store.clear();
1003
+
1004
+ for (const entry of entries) {
1005
+ store.set({
1006
+ id: entry.id,
1007
+ data: entry,
1008
+ // Assume each entry has a 'content' field with markdown content
1009
+ rendered: await renderMarkdown(entry.content),
1010
+ });
1011
+ }
1012
+ },
1013
+ } satisfies Loader;
1014
+ }
1015
+ ```
1016
+
1017
+ ##### `fileURL`
1018
+
1019
+ <p>
1020
+
1021
+ **Type:** `URL`
1022
+ <Since v="6.0.0" />
1023
+ </p>
1024
+
1025
+ Specifies the file path to use for resolving relative image paths in Markdown content.
1026
+
1027
+ The following example uses the [configured root directory](/en/reference/configuration-reference/#root) to resolve image paths:
1028
+
1029
+ ```ts title=loader.ts {19}
1030
+ import type { Loader } from "astro/loaders";
1031
+ import { readFile } from "node:fs/promises";
1032
+ import { loadLocalMarkdown } from "./helpers";
1033
+
1034
+ export function myLoader() {
1035
+ return {
1036
+ name: "custom-loader",
1037
+ async load({ config, renderMarkdown, store }) {
1038
+ const files = await loadLocalMarkdown();
1039
+
1040
+ store.clear();
1041
+
1042
+ for (const file of files) {
1043
+ const content = await readFile(file.path, "utf8");
1044
+ store.set({
1045
+ id: file.id,
1046
+ data: file.data,
1047
+ rendered: await renderMarkdown(content, {
1048
+ fileURL: new URL(file.path, config.root),
1049
+ }),
1050
+ });
1051
+ }
1052
+ },
1053
+ } satisfies Loader;
1054
+ }
1055
+ ```
1056
+
1057
+ #### `LoaderContext.generateDigest()`
1058
+
1059
+ <p>
1060
+
1061
+ **Type:** `(data: Record<string, unknown> | string) => string`
1062
+ <Since v="5.0.0" />
1063
+ </p>
1064
+
1065
+ Generates a non-cryptographic content digest of an object or string. This can be used to track if the data has changed by setting [the `digest` field](#dataentrydigest) of an entry.
1066
+
1067
+ ```ts title=loader.ts {20,25}
1068
+ import type { Loader } from "astro/loaders";
1069
+ import { loadFeed } from "./feed.js";
1070
+
1071
+ export function feedLoader({ url }: { url: string }) {
1072
+ const feedUrl = new URL(url);
1073
+ return {
1074
+ name: "feed-loader",
1075
+ load: async ({ store, logger, parseData, generateDigest }) => {
1076
+ logger.info("Loading posts");
1077
+ const feed = loadFeed(feedUrl);
1078
+ store.clear();
1079
+
1080
+ for (const item of feed.items) {
1081
+ const id = item.guid;
1082
+ const data = await parseData({
1083
+ id,
1084
+ data: item,
1085
+ });
1086
+
1087
+ const digest = generateDigest(data);
1088
+
1089
+ store.set({
1090
+ id,
1091
+ data,
1092
+ digest,
1093
+ });
1094
+ }
1095
+ },
1096
+ } satisfies Loader;
1097
+ }
1098
+ ```
1099
+
1100
+ #### `LoaderContext.watcher`
1101
+
1102
+ <p>
1103
+
1104
+ **Type:** `FSWatcher`
1105
+ <Since v="5.0.0" />
1106
+ </p>
1107
+
1108
+ When running in dev mode, this is a filesystem watcher that can be used to trigger updates. See [`ViteDevServer`](https://vite.dev/guide/api-javascript.html#vitedevserver) for more information.
1109
+
1110
+ ```ts title="Extract from the file() loader" {13-18}
1111
+ import type { Loader } from "astro/loaders";
1112
+ import { fileURLToPath } from "node:url";
1113
+ import { syncData } from "./helpers";
1114
+
1115
+ export function file(fileName: string) {
1116
+ return {
1117
+ name: "file-loader",
1118
+ load: async ({ config, logger, store, watcher }) => {
1119
+ const url = new URL(fileName, config.root);
1120
+ const filePath = fileURLToPath(url);
1121
+ await syncData(filePath, store);
1122
+
1123
+ watcher?.on("change", async (changedPath) => {
1124
+ if (changedPath === filePath) {
1125
+ logger.info(`Reloading data from ${fileName}`);
1126
+ await syncData(filePath, store);
1127
+ }
1128
+ });
1129
+ },
1130
+ } satisfies Loader;
1131
+ }
1132
+ ```
1133
+
1134
+ #### `LoaderContext.refreshContextData`
1135
+
1136
+ <p>
1137
+
1138
+ **Type:** `Record<string, unknown>`
1139
+ <Since v="5.0.0" />
1140
+ </p>
1141
+
1142
+ If the loader has been triggered by an integration, this may optionally contain extra data set by that integration. It is only set when the loader is triggered by an integration. See the [`astro:server:setup`](/en/reference/integrations-reference/#refreshcontent-option) hook reference for more information.
1143
+
1144
+ ```ts title=loader.ts {8-11}
1145
+ import type { Loader } from "astro/loaders";
1146
+ import { processWebhook } from "./lib/webhooks";
1147
+
1148
+ export function myLoader(options: { url: string }) {
1149
+ return {
1150
+ name: "my-loader",
1151
+ load: async ({ refreshContextData, store, logger }) => {
1152
+ if(refreshContextData?.webhookBody) {
1153
+ logger.info("Webhook triggered with body");
1154
+ processWebhook(store, refreshContextData.webhookBody);
1155
+ }
1156
+ // ...
1157
+ },
1158
+ } satisfies Loader;
1159
+ }
1160
+ ```
1161
+
1162
+ ### `DataStore`
1163
+
1164
+ The data store is a loader's interface to the content collection data. It is a key-value (KV) store, scoped to the collection, and therefore a loader can only access the data for its own collection.
1165
+
1166
+ #### `DataStore.get()`
1167
+
1168
+ <p>
1169
+
1170
+ **Type:** <code>(key: string) => <a href="#dataentry">DataEntry</a> | undefined</code>
1171
+ <Since v="5.0.0" />
1172
+ </p>
1173
+
1174
+ Get an entry from the store by its ID. Returns `undefined` if the entry does not exist.
1175
+
1176
+ ```ts
1177
+ const existingEntry = store.get("my-entry");
1178
+ ```
1179
+
1180
+ The returned object is a [`DataEntry`](#dataentry) object.
1181
+
1182
+ #### `DataStore.set()`
1183
+
1184
+ <p>
1185
+
1186
+ **Type:** <code>(entry: <a href="#dataentry">DataEntry</a>) => boolean</code>
1187
+ <Since v="5.0.0" />
1188
+ </p>
1189
+
1190
+ Used after data has been [validated and parsed](#loadercontextparsedata) to add an entry to the store, returning `true` if the entry was set. This returns `false` when the [`digest`](#dataentrydigest) property determines that an entry has not changed and should not be updated.
1191
+
1192
+ ```ts title=loader.ts {20-27}
1193
+ import type { Loader } from "astro/loaders";
1194
+ import { loadFeed } from "./feed.js";
1195
+
1196
+ export function feedLoader({ url }: { url: string }) {
1197
+ const feedUrl = new URL(url);
1198
+ return {
1199
+ name: "feed-loader",
1200
+ load: async ({ store, logger, parseData, generateDigest }) => {
1201
+ logger.info("Loading posts");
1202
+ const feed = loadFeed(feedUrl);
1203
+ store.clear();
1204
+
1205
+ for (const item of feed.items) {
1206
+ const id = item.guid;
1207
+ const data = await parseData({
1208
+ id,
1209
+ data: item,
1210
+ });
1211
+ const digest = generateDigest(data);
1212
+ store.set({
1213
+ id,
1214
+ data,
1215
+ rendered: {
1216
+ html: data.description ?? "",
1217
+ },
1218
+ digest,
1219
+ });
1220
+ }
1221
+ },
1222
+ } satisfies Loader;
1223
+ }
1224
+ ```
1225
+
1226
+ #### `DataStore.entries()`
1227
+
1228
+ <p>
1229
+
1230
+ **Type:** <code>() => Array\<[id: string, <a href="#dataentry">DataEntry</a>]\></code>
1231
+ <Since v="5.0.0" />
1232
+ </p>
1233
+
1234
+ Get all entries in the collection as an array of key-value pairs.
1235
+
1236
+ #### `DataStore.keys()`
1237
+
1238
+ <p>
1239
+
1240
+ **Type:** `() => Array<string>`
1241
+ <Since v="5.0.0" />
1242
+ </p>
1243
+
1244
+ Get all the keys of the entries in the collection.
1245
+
1246
+ #### `DataStore.values()`
1247
+
1248
+ <p>
1249
+
1250
+ **Type:** <code>() => Array\<<a href="#dataentry">DataEntry</a>\></code>
1251
+ <Since v="5.0.0" />
1252
+ </p>
1253
+
1254
+ Get all entries in the collection as an array.
1255
+
1256
+ #### `DataStore.delete()`
1257
+
1258
+ <p>
1259
+
1260
+ **Type:** `(key: string) => void`
1261
+ <Since v="5.0.0" />
1262
+ </p>
1263
+
1264
+ Delete an entry from the store by its ID.
1265
+
1266
+ #### `DataStore.clear()`
1267
+
1268
+ <p>
1269
+
1270
+ **Type:** `() => void`
1271
+ <Since v="5.0.0" />
1272
+ </p>
1273
+
1274
+ Clear all entries from the collection.
1275
+
1276
+ #### `DataStore.has()`
1277
+
1278
+ <p>
1279
+
1280
+ **Type:** `(key: string) => boolean`
1281
+ <Since v="5.0.0" />
1282
+ </p>
1283
+
1284
+ Check if an entry exists in the store by its ID.
1285
+
1286
+ ### `DataEntry`
1287
+
1288
+ This is the type of the object that is stored in the data store. It has the following properties:
1289
+
1290
+ #### `DataEntry.id`
1291
+
1292
+ <p>
1293
+
1294
+ **Type:** `string`
1295
+ <Since v="5.0.0" />
1296
+ </p>
1297
+
1298
+ An identifier for the entry, which must be unique within the collection. This is used to look up the entry in the store and is the key used with [`getEntry()`](/en/reference/modules/astro-content/#getentry) for that collection.
1299
+
1300
+ #### `DataEntry.data`
1301
+
1302
+ <p>
1303
+
1304
+ **Type:** `Record<string, unknown>`
1305
+ <Since v="5.0.0" />
1306
+ </p>
1307
+
1308
+ The actual data for the entry. When a user accesses the collection, this will have TypeScript types generated according to the collection schema.
1309
+
1310
+ It is the loader's responsibility to use [`parseData()`](#loadercontextparsedata) to validate and parse the data before storing it in the data store: no validation is done when getting or setting the data.
1311
+
1312
+ #### `DataEntry.filePath`
1313
+
1314
+ <p>
1315
+
1316
+ **Type:** `string | undefined`
1317
+ <Since v="5.0.0" />
1318
+ </p>
1319
+
1320
+ A path to the file that is the source of this entry, relative to the root of the site. This only applies to file-based loaders and is used to resolve paths such as images or other assets.
1321
+
1322
+ If not set, then any fields in the schema that use [the `image()` helper](/en/guides/images/#images-in-content-collections) will be treated as [public paths](/en/guides/images/#where-to-store-images) and not transformed.
1323
+
1324
+ #### `DataEntry.body`
1325
+
1326
+ <p>
1327
+
1328
+ **Type:** `string | undefined`
1329
+ <Since v="5.0.0" />
1330
+ </p>
1331
+
1332
+ The raw body of the entry, if applicable. If the entry includes [rendered content](#dataentryrendered), then this field can be used to store the raw source. This is optional and is not used internally.
1333
+
1334
+ #### `DataEntry.digest`
1335
+
1336
+ <p>
1337
+
1338
+ **Type:** `string | undefined`
1339
+ <Since v="5.0.0" />
1340
+ </p>
1341
+
1342
+ An optional content digest for the entry. This can be used to check if the data has changed.
1343
+
1344
+ When [setting an entry](#datastoreset), the entry will only update if the digest does not match an existing entry with the same ID.
1345
+
1346
+ The format of the digest is up to the loader, but it must be a string that changes when the data changes. This can be done with the [`generateDigest`](#loadercontextgeneratedigest) function.
1347
+
1348
+ #### `DataEntry.rendered`
1349
+
1350
+ <p>
1351
+
1352
+ **Type:** `RenderedContent | undefined`
1353
+ <Since v="5.0.0" />
1354
+ </p>
1355
+
1356
+ Stores an object with an entry's rendered content and metadata if it has been rendered to HTML. For example, this can be used to store the rendered content of a Markdown entry, or HTML from a CMS.
1357
+
1358
+ If this field is provided, then [the `render()` function and `<Content />` component](/en/guides/content-collections/#rendering-body-content) are available to render the entry in a page.
1359
+
1360
+ If the entry has Markdown content then you can use the [`renderMarkdown()`](#loadercontextrendermarkdown) function to generate this object from the Markdown string.
1361
+
1362
+ ##### `DataEntry.rendered.html`
1363
+
1364
+ <p>
1365
+
1366
+ **Type:** `string`
1367
+ </p>
1368
+
1369
+ Contains the rendered HTML string. This is used by [`render()`](/en/reference/modules/astro-content/#render) to return a component that renders this HTML.
1370
+
1371
+ ##### `DataEntry.rendered.metadata`
1372
+
1373
+ <p>
1374
+
1375
+ **Type:** `object | undefined`
1376
+ </p>
1377
+
1378
+ Describes the metadata present in this file. This includes the `imagePaths`, the `headings`, the `frontmatter`, and any other metadata present in the file. When the file has not been rendered as HTML, this value will be `undefined`.
1379
+
1380
+ ###### `DataEntry.rendered.metadata.imagePaths`
1381
+
1382
+ <p>
1383
+
1384
+ **Type:** `string[]`
1385
+ </p>
1386
+
1387
+ Specifies the list of images paths present in this entry. Each path is relative to the [entry `filePath`](#dataentryfilepath).
1388
+
1389
+ ###### `DataEntry.rendered.metadata.headings`
1390
+
1391
+ <p>
1392
+
1393
+ **Type:** `MarkdownHeading[]`
1394
+ </p>
1395
+
1396
+ Specifies the list of headings present in this file. Each heading is described by a `depth` determined by the heading level (`h1 -> h6`), a `slug` generated with [`github-slugger`](https://github.com/Flet/github-slugger), and its `text` content.
1397
+
1398
+ ###### `DataEntry.rendered.metadata.frontmatter`
1399
+
1400
+ <p>
1401
+
1402
+ **Type:** `Record<string, any>`
1403
+ </p>
1404
+
1405
+ Describes the raw frontmatter, parsed from the file. This may include [programmatically injected data from Markdown processor plugins](/en/guides/markdown-content/#modifying-frontmatter-programmatically).
1406
+
1407
+ ## Live loader API
1408
+
1409
+ <p><Since v="6.0.0" /></p>
1410
+
1411
+ This section shows the API for defining a [live loader](#live-loaders).
1412
+
1413
+ ### The `LiveLoader` object
1414
+
1415
+ <p>
1416
+
1417
+ **Type:** `LiveLoader<TData, TEntryFilter, TCollectionFilter, TError>`
1418
+ <Since v="6.0.0" />
1419
+ </p>
1420
+
1421
+ A live loader function returns an object with three required live loader properties. In addition to providing a name for the loader, this object describes how to fetch both single entries and an entire collection from your live data source.
1422
+
1423
+ Use the `LiveLoader` generic type to provide type safety in your loader. This type accepts the following type parameters, in this order:
1424
+
1425
+ - **`TData`** (defaults to `Record<string, unknown>`): The data structure of each entry returned by the loader.
1426
+ - **`TEntryFilter`** (defaults to `never`): The filter object type accepted by [`getLiveEntry()`](/en/reference/modules/astro-content/#getliveentry) and accessible in [`loadEntry()`](#liveloaderloadentry). Use `never` when you don't support filtering single entries.
1427
+ - **`TCollectionFilter`** (defaults to `never`): The filter object type accepted by [`getLiveCollection()`](/en/reference/modules/astro-content/#getlivecollection) and accessible in [`loadCollection()`](#liveloaderloadcollection). Use `never` when you don't support filtering collections.
1428
+ - **`TError`** (defaults to `Error`): A [custom `Error` class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#custom_error_types) that can be returned by the loader for more granular error handling.
1429
+
1430
+ #### `LiveLoader.name`
1431
+
1432
+ <p>
1433
+
1434
+ **Type:** `string`
1435
+ <Since v="6.0.0" />
1436
+ </p>
1437
+
1438
+
1439
+ A unique name for the loader, used in logs.
1440
+
1441
+ #### `LiveLoader.loadCollection()`
1442
+
1443
+ <p>
1444
+
1445
+ **Type:** <code>(context: <a href="#loadcollectioncontext">LoadCollectionContext</a>\<TCollectionFilter\>) => Promise\<<a href="#livedatacollection">LiveDataCollection</a>\<TData\> | \{ error: TError; \}\></code>
1446
+ <Since v="6.0.0" />
1447
+ </p>
1448
+
1449
+ Defines a method to load a collection of entries. This function receives a [context object](#loadcollectioncontext) containing an optional `filter` property and must return the data associated with this collection or the errors.
1450
+
1451
+ #### `LiveLoader.loadEntry()`
1452
+
1453
+ <p>
1454
+
1455
+ **Type:** <code>(context: <a href="#loadentrycontext">LoadEntryContext</a>\<TEntryFilter\>) => Promise\<<a href="#livedataentry">LiveDataEntry</a>\<TData\> | undefined | \{ error: TError; \}\></code>
1456
+ <Since v="6.0.0" />
1457
+ </p>
1458
+
1459
+ Defines a method to load a single entry. This function receives a [context object](#loadentrycontext) containing a `filter` property and returns either the data associated with the requested entry, `undefined` when the entry cannot be found, or the errors.
1460
+
1461
+ ### `LoadCollectionContext`
1462
+
1463
+ <p>
1464
+
1465
+ **Type:** `{ filter?: TCollectionFilter; }`
1466
+ <Since v="6.0.0" />
1467
+ </p>
1468
+
1469
+ This object is passed to the [`loadCollection()` method](#liveloaderloadcollection) of the loader and contains the following properties:
1470
+
1471
+ #### `LoadCollectionContext.filter`
1472
+
1473
+ <p>
1474
+
1475
+ **Type:** `Record<string, any> | never`<br />
1476
+ **Default:** `never`
1477
+ <Since v="6.0.0" />
1478
+ </p>
1479
+
1480
+ An object describing the [filters supported by your loader](#defining-custom-filter-types).
1481
+
1482
+ ### `LoadEntryContext`
1483
+
1484
+ <p>
1485
+
1486
+ **Type:** `{ filter: TEntryFilter; }`
1487
+ <Since v="6.0.0" />
1488
+ </p>
1489
+
1490
+ This object is passed to the [`loadEntry()` method](#liveloaderloadentry) of the loader and contains the following properties:
1491
+
1492
+ #### `LoadEntryContext.filter`
1493
+
1494
+ <p>
1495
+
1496
+ **Type:** `Record<string, any> | never`<br />
1497
+ **Default:** `never`
1498
+ <Since v="6.0.0" />
1499
+ </p>
1500
+
1501
+ An object describing the [filters supported by your loader](#defining-custom-filter-types).
1502
+
1503
+
1504
+ ### `LiveDataEntry`
1505
+
1506
+ <p>
1507
+
1508
+ **Type:** <code>\{ id: string; data: TData; rendered?: \{ html: string \}; cacheHint?: <a href="#cachehint">CacheHint</a>; \}</code>
1509
+ <Since v="6.0.0" />
1510
+ </p>
1511
+
1512
+ This is the type object that is returned by the [`loadEntry()`](#liveloaderloadentry) method. It contains the following properties:
1513
+
1514
+ #### `LiveDataEntry.id`
1515
+
1516
+ <p>
1517
+
1518
+ **Type:** `string`
1519
+ <Since v="6.0.0" />
1520
+ </p>
1521
+
1522
+ An identifier for the entry, which must be unique within the collection. This is the key used with [`getLiveEntry()`](/en/reference/modules/astro-content/#getliveentry) for that collection.
1523
+
1524
+ #### `LiveDataEntry.data`
1525
+
1526
+ <p>
1527
+
1528
+ **Type:** `Record<string, unknown>`
1529
+ <Since v="6.0.0" />
1530
+ </p>
1531
+
1532
+ The actual data for the entry. When a user accesses the collection, this will have TypeScript types generated according to the collection schema.
1533
+
1534
+ It is the loader's responsibility to validate and parse the data before returning it.
1535
+
1536
+ #### `LiveDataEntry.rendered`
1537
+
1538
+ <p>
1539
+
1540
+ **Type:** `{ html: string }`
1541
+ <Since v="6.0.0" />
1542
+ </p>
1543
+
1544
+ An object with an entry's rendered content if it has been rendered to HTML. For example, this can be the rendered content of a Markdown entry, or HTML from a CMS.
1545
+
1546
+ If this field is provided, then [the `render()` function and `<Content />` component](/en/guides/content-collections/#rendering-body-content) are available to render the entry in a page.
1547
+
1548
+ If the loader does not return a `rendered` property for an entry, the `<Content />` component will render nothing.
1549
+
1550
+ #### `LiveDataEntry.cacheHint`
1551
+
1552
+ <p>
1553
+
1554
+ **Type:** [`CacheHint`](#cachehint)
1555
+ <Since v="6.0.0" />
1556
+ </p>
1557
+
1558
+ An optional object to provide a hint for how to cache this specific entry.
1559
+
1560
+ <ReadMore>See the content collection guide to learn how to [use cache hints at entry-level](/en/guides/content-collections/#entry-level-cache-hints).</ReadMore>
1561
+
1562
+ ### `LiveDataCollection`
1563
+
1564
+ <p>
1565
+
1566
+ **Type:** <code>\{ entries: Array\<<a href="#livedataentry">LiveDataEntry</a>\<TData\>\>; cacheHint?: <a href="#cachehint">CacheHint</a>; \}</code>
1567
+ <Since v="6.0.0" />
1568
+ </p>
1569
+
1570
+ This is the type object that is returned by the [`loadCollection()`](#liveloaderloadcollection) method. It contains the following properties:
1571
+
1572
+ #### `LiveDataCollection.entries`
1573
+
1574
+ <p>
1575
+
1576
+ **Type:** <code>Array\<<a href="#livedataentry">LiveDataEntry</a>\<TData\>\></code>
1577
+ <Since v="6.0.0" />
1578
+ </p>
1579
+
1580
+ An array of [`LiveDataEntry`](#livedataentry) objects.
1581
+
1582
+ #### `LiveDataCollection.cacheHint`
1583
+
1584
+ <p>
1585
+
1586
+ **Type:** [`CacheHint`](#cachehint)
1587
+ <Since v="6.0.0" />
1588
+ </p>
1589
+
1590
+ An optional object providing guidance on how to cache this collection. This object will be merged with the cache hints defined for each individual entry, if provided.
1591
+
1592
+ <ReadMore>See the content collection guide to learn how to [use cache hints at collection-level](/en/guides/content-collections/#collection-level-cache-hints).</ReadMore>
1593
+
1594
+ ### `CacheHint`
1595
+
1596
+ An object that loaders can return through the `cacheHint` property in [`LiveDataCollection`](#livedatacollection) or [`LiveDataEntry`](#livedataentry) to provide hints to assist in [caching the response](/en/guides/caching/). This contains the following properties:
1597
+
1598
+ #### `CacheHint.tags`
1599
+
1600
+ <p>
1601
+
1602
+ **Type:** `Array<string>`
1603
+ <Since v="6.0.0" />
1604
+ </p>
1605
+
1606
+ An array of string identifiers allowing fine-grained cache control. This allows you to group related content and selectively invalidate cached responses when specific content changes.
1607
+
1608
+ The following example defines cache hint tags for a collection of posts filtered by author:
1609
+
1610
+ ```ts title="src/cms-loader.ts" collapse={1-4, 19-21} {14-16}
1611
+ import type { LiveLoader } from "astro/loaders";
1612
+ import { loadRemotePosts } from "./cms";
1613
+ import type { Post, PostEntryFilter, PostCollectionFilter } from "./types";
1614
+
1615
+ export function myLoader(config: {
1616
+ apiKey: string;
1617
+ }): LiveLoader<Post, PostEntryFilter, PostCollectionFilter> {
1618
+ return {
1619
+ name: "cms-loader",
1620
+ loadCollection: async ({ filter }) => {
1621
+ const posts = await loadRemotePosts(config.apiKey, filter);
1622
+ return {
1623
+ entries: posts,
1624
+ cacheHint: {
1625
+ tags: ["posts", `posts-${filter.author}`],
1626
+ },
1627
+ };
1628
+ },
1629
+ loadEntry: async () => {
1630
+ /* ... */
1631
+ },
1632
+ };
1633
+ }
1634
+ ```
1635
+
1636
+ #### `CacheHint.lastModified`
1637
+
1638
+ <p>
1639
+
1640
+ **Type:** `Date`
1641
+ <Since v="6.0.0" />
1642
+ </p>
1643
+
1644
+ The date of the last modification of the content (e.g., the last update of an entry in a collection). This can be used to set HTTP cache headers like [`Last-Modified`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Last-Modified) and [`If-Modified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Modified-Since).
1645
+
1646
+ The following example defines a cache hint for a single product using its last update date:
1647
+
1648
+ ```ts title="src/store-loader.ts" collapse={1-8, 15-21} {27-29}
1649
+ import type { LiveLoader } from "astro/loaders";
1650
+ import { loadStoreProduct, loadStoreProducts } from "./store";
1651
+ import type {
1652
+ Product,
1653
+ ProductEntryFilter,
1654
+ ProductCollectionFilter,
1655
+ } from "./types";
1656
+
1657
+ export function myLoader(): LiveLoader<
1658
+ Product,
1659
+ ProductEntryFilter,
1660
+ ProductCollectionFilter
1661
+ > {
1662
+ return {
1663
+ name: "store-loader",
1664
+ loadCollection: async ({ filter }) => {
1665
+ const products = await loadStoreProducts(filter);
1666
+ return {
1667
+ entries: products,
1668
+ };
1669
+ },
1670
+ loadEntry: async ({ filter }) => {
1671
+ const product = await loadStoreProduct(filter);
1672
+ return {
1673
+ id: product.id,
1674
+ data: product,
1675
+ cacheHint: {
1676
+ lastModified: new Date(product.updatedAt),
1677
+ },
1678
+ };
1679
+ },
1680
+ };
1681
+ }
1682
+ ```