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/atman-33/workhub/cloudflare-static-assetsnpx skills add atman-33/workhub --skill cloudflare-static-assetsgit clone --depth 1 https://github.com/atman-33/workhubWrote 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/atman-33/workhub/cloudflare-static-assets)<a href="https://agentmods.dev/skills/atman-33/workhub/cloudflare-static-assets"><img src="https://agentmods.dev/badge/skills/atman-33/workhub/cloudflare-static-assets.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.1 | $0.00048 | $0.01583 |
| Opus 5 | $0.00024 | $0.00792 |
| Sonnet 5 | $0.00010 | $0.00317 |
| Haiku 4.5 | $0.00005 | $0.00158 |
Grade A, and why
cloudflare-static-assets 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 2d 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.
const response = await context.cloudflare.env.ASSETS.fetch(assetRequest); How it starts
The opening of the file, as written. The whole thing — 249 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cloudflare Static Assets
Overview
This skill provides a robust solution for handling static assets in React Router applications deployed to Cloudflare Workers. It addresses the common issue where files in the public directory work in development (Vite) but fail with 404 errors in production due to differences in how assets are served.
Problem Context
Development vs Production Mismatch:
- Development (Vite): Files in
public/are automatically served at the root path - Production (Cloudflare Workers): Static files need to be configured separately as Static Assets
This causes code like fetch('/data/config.json') to work locally but fail with 404 in production.
Solution: Configuration + Utility Functions
Step 1: Configure wrangler.jsonc
Enable Static Assets by adding the assets configuration:
{
"compatibility_date": "2024-11-18",
"assets": {
"directory": "./public",
"binding": "ASSETS"
}
}
Step 2: Create Utility Functions
Create app/lib/utils/static-assets.ts (or similar path) with the following implementation:
/**
* Static Assets Utility
*
* Provides unified access to static files across different environments:
* - Development (Vite): Uses standard fetch()
* - Production (Cloudflare Workers): Uses ASSETS binding
* - Build time (Node.js): Falls back to file system access
*/
interface CloudflareContext {
cloudflare?: {
env: Env;
};
}
/**
* Determines if we have access to Cloudflare Workers ASSETS binding
*/
function hasAssetsBinding(context?: CloudflareContext): boolean {
return !!context?.cloudflare?.env?.ASSETS;
}
/**
* Fetches a static asset with automatic fallback between ASSETS and standard fetch
*/
export async function fetchStaticAsset(
path: string,
context?: CloudflareContext,
request?: Request,
): Promise<Response> {
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
// Try Static Assets first if available
if (hasAssetsBinding(context) && context?.cloudflare?.env?.ASSETS) {
try {
const assetUrl = new URL(normalizedPath, "https://example.com");
const assetRequest = new Request(assetUrl.toString());
const response = await context.cloudflare.env.ASSETS.fetch(assetRequest);
if (response.ok) return response;
// Log fallback only in development
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
console.warn(
`[Static Assets] Failed for ${normalizedPath} (${response.status}), using fallback`
);
}
} catch (error) {
// Log errors only in development
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
console.warn(`[Static Assets] Error for ${normalizedPath}:`, error);
}
}
}
// Fallback: Use standard fetch
let url = normalizedPath;
if (request) {
const requestUrl = new URL(request.url);
url = `${requestUrl.origin}${normalizedPath}`;
}
const response = await fetch(url);
if (!response.ok) {
throw new Error(
`Static asset not found: ${normalizedPath} (${response.status})`
);
}
return response;
}
/**
* Fetches and parses a JSON static asset
*/
export async function fetchStaticJSON<T>(
path: string,
context?: CloudflareContext,
request?: Request,
): Promise<T> {
try {
const response = await fetchStaticAsset(path, context, request);
const json = await response.json();
return json as T;
} catch (error) {
// Log detailed errors only in development
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
console.error(`Failed to fetch static JSON ${path}:`, error);
}
throw new Error(`Failed to load JSON asset: ${path}`);
}
}
/**
* Fetches a text static asset
*/
export async function fetchStaticText(
path: string,
context?: CloudflareContext,
request?: Request,
): Promise<string> {
try {
const response = await fetchStaticAsset(path, context, request);
const text = await response.text();
return text;
} catch (error) {
// Log detailed errors only in development
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
console.error(`Failed to fetch static text ${path}:`, error);
}
throw new Error(`Failed to load text asset: ${path}`);
}
}
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.
- 2d ago First seen · 249 lines · 48 tokens per session scan A c3b50471cc22
cloudflare-static-assets is a skill published in the GitHub repository atman-33/workhub (2 stars, last pushed yesterday), licensed MIT. It adds 48 tokens to every session and 1,583 once invoked, about $0.0002 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-09-03.
Other skills, from other repositories
cloudflare-nextjs
Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare). Use for SSR/ISR/SSG/App or Pages Router, getCloudflareContext, bindings (D1/R2/KV/AI/Hyperdrive), caching tiers, skew protection, multi-worker, custom worker, env vars, or worker…
frontend
Use when building React components, optimizing performance, analyzing bundle sizes, scaffolding projects, implementing accessibility, reviewing frontend code quality, performing visual overhauls, or designing UI/UX systems.
react-patterns
React + TypeScript component and hook standards. TRIGGER when: creating components, custom hooks, or reviewing React code. SKIP: visual styling and theme tokens (use mui-styling); global store design (use state-management).
nextjs-patterns
Next.js App Router — Server Components, Actions, streaming, caching. Use when building or migrating Next.js apps.
Cursor rules for Next
Cursor rules for Next.js development with Vercel and TypeScript integration.
fe-build
Implements frontend components and pages for React / Next.js / Vite SPA + TypeScript projects. Use when: starting implementation after feature.md or a spec is approved, writing components, building pages. Do NOT load for: writing specs, code review, bug analysis.