Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/tanstack/ai/build-cloudflare-artifact-storenpx skills add TanStack/ai --skill build-cloudflare-artifact-storegit clone --depth 1 https://github.com/TanStack/aiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tanstack/ai/build-cloudflare-artifact-store)<a href="https://agentmods.dev/skills/tanstack/ai/build-cloudflare-artifact-store"><img src="https://agentmods.dev/badge/skills/tanstack/ai/build-cloudflare-artifact-store.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00104 | $0.07594 |
| Opus 5 | $0.00052 | $0.03797 |
| Sonnet 5 | $0.00021 | $0.01519 |
| Haiku 4.5 | $0.00010 | $0.00759 |
Grade A, and why
ai-persistence/build-cloudflare-artifact-store scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
async fetch(request: Request, env: Env) { How it starts
The opening of the file, as written. The whole thing — 716 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cloudflare Artifact + Blob Store
withGenerationPersistence(persistence) needs only stores.generationRuns to track a
generation's lifecycle. Add stores.artifacts (metadata) and stores.blobs
(the bytes) — both, or neither — and the middleware also persists the generated
media: image/audio/TTS/video/transcription bytes land at blob key
artifacts/<runId>/<artifactId>, with an ArtifactRecord row describing each.
The deliverable is one file in the Worker — e.g.
src/lib/generation-persistence.ts — exporting a factory that builds an
AIPersistence from the request's R2 + D1 bindings, plus a GET route that serves
artifact bytes with retrieveArtifact / retrieveBlob.
Read the sibling ai-persistence/build-cloudflare-adapter skill for the
per-request-binding rule, wrangler config shape, D1 migration workflow, and the
chat (generation-run/message) side. This skill covers only the two byte-storage stores and
how to compose them.
The two contracts
Both come from @tanstack/ai-persistence. defineBlobStore / defineArtifactStore
type an object literal inline (autocomplete + contract checking, no separate
annotation).
// BlobStore — the byte layer. R2 backs it.
interface BlobStore {
put: (
key: string,
body: BlobBody,
options?: BlobPutOptions,
) => Promise<BlobRecord>
// metadata + byte accessors; `options.range` reads one slice (for `206`s)
get: (key: string, options?: BlobGetOptions) => Promise<BlobObject | null>
head: (key: string) => Promise<BlobRecord | null> // metadata only
delete: (key: string) => Promise<void> // no-op if absent
list: (options?: BlobListOptions) => Promise<BlobListPage>
}
// ArtifactStore — the metadata layer. D1 backs it.
interface ArtifactStore {
save: (record: ArtifactRecord) => Promise<void> // insert or overwrite
get: (artifactId: string) => Promise<ArtifactRecord | null>
list: (runId: string) => Promise<Array<ArtifactRecord>> // [] when none
listForThread: (threadId: string) => Promise<Array<ArtifactRecord>>
delete: (artifactId: string) => Promise<void>
deleteForRun: (runId: string) => Promise<void>
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 716 lines · 104 tokens per session scan A 61f02020ee85
ai-persistence/build-cloudflare-artifact-store is a skill published in the GitHub repository TanStack/ai (3,060 stars, last pushed today), licensed MIT. It adds 104 tokens to every session and 7,594 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
export-as-pptx-editable
Native text & shapes — editable in PowerPoint.
image-generation
Generate images and iteratively edit saved image artifacts.
flier
Design a print-ready, single-page flier as one self-contained HTML file: exactly one fixed-size page.
nano-banana-pro
Generate or edit images via Gemini 3 Pro Image (Nano Banana Pro). Use when the user asks to create an image, generate a picture, produce AI-generated artwork, edit a photo, compose multiple images, or upscale an image to higher resolution. Supports text-to-image generation, single-image editing, and multi-image…
animated-video
Timeline-based motion design.
make-a-deck
Slide presentation in HTML.