netlify-access-control
Picks the right Netlify site-protection layer and disambiguates the three unrelated "auth" concepts users conflate — app-user…
Write, route, cache, and debug Netlify Edge Functions, the Deno-based TypeScript or JavaScript handlers in netlify/edge-functions that run at the network edge in front of static files and serverless functions. Activate this skill whenever someone wants to add auth middleware or
Claude Code
$ npx -y skills add netlify/context-and-tools --skill netlify-edge-functions --agent claude-code
Codex
$ npx skills add netlify/context-and-tools --skill netlify-edge-functions -a codex -y
Cursor
$ npx skills add netlify/context-and-tools --skill netlify-edge-functions -a cursor -y
Gemini CLI
$ npx skills add netlify/context-and-tools --skill netlify-edge-functions -a gemini-cli -y
GitHub Copilot
$ npx skills add netlify/context-and-tools --skill netlify-edge-functions -a github-copilot -y
OpenCode
$ npx skills add netlify/context-and-tools --skill netlify-edge-functions -a opencode -y
Windsurf
$ npx skills add netlify/context-and-tools --skill netlify-edge-functions -a windsurf -y
name: netlify-edge-functions description: Write, route, cache, and debug Netlify Edge Functions, the Deno-based TypeScript or JavaScript handlers in netlify/edge-functions that run at the network edge in front of static files and serverless functions. Activate this skill whenever someone wants to add auth middleware or a login gate, redirect or rewrite visitors by country or cookie, localize or personalize a page with geolocation, run A/B testing, transform or inject HTML into a response, stream server-side rendering at the edge, or cache an edge response. Also use it when an edge function silently does nothing, runs in the wrong order, ignores its Cache-Control headers, or cannot read an environment variable.
// netlify/edge-functions/hello.ts
import type { Config, Context } from "@netlify/edge-functions";
export default async (request: Request, context: Context) => {
return new Response(`Hello from ${context.geo.country?.name ?? "somewhere"}`);
};
export const config: Config = { path: "/hello" }; export default {
async fetch(request: Request, context: Context) {
return new Response("Hello");
},
};
export const config: Config = { path: "/hello" }; // still a named export**Avoid these:**
| What | Where | |---|---| | Functions | `<base>/netlify/edge-functions/*.{js,ts,jsx,tsx}` | | Custom dir | `[build] edge_functions = "my-dir"` (relative to base dir; keep it outside the publish dir) | | Name in toml | file name without extension (`auth.ts` → `function = "auth"`) | | Import map | any JSON file, referenced by `[functions] deno_import_map = "./import_map.json"` |
| Return | Effect | |---|---| | `Response` | sent to client; chain ends | | `URL` | same-site rewrite, 200, address bar unchanged | | `undefined` / `return;` | skip this function; chain continues |
export default async () =>
new Response("Hello, World!", { headers: { "content-type": "text/html" } });
export const config = { path: "/api/hello" };import type { Context } from "@netlify/edge-functions";
export default async (req: Request, { cookies, geo }: Context) => {
if (geo.city === "Paris" && cookies.get("promo-code") === "15-for-followers") {
return Response.redirect(new URL("/subscriber-sale", req.url)); // redirect
// or: return new URL("/subscriber-sale", req.url); // rewrite (same-site only)
}
};
export const config = { path: "/sale" };Rewrites must target the same site. To reach other sites, use `fetch`.
import type { Context } from "@netlify/edge-functions";
export default async (request: Request, context: Context) => {
if (new URL(request.url).searchParams.get("method") !== "transform") return;
const response = await context.next();
return new Response((await response.text()).toUpperCase(), response);
};
export const config = { path: "/blog/*" };Call `context.next()` only when you need the response body. If you just return `undefined`, the chain continues on its own.
export default async (req: Request, { next }: Context) => {
const res = await next({ sendConditionalRequest: true });
if (res.status === 304) return res;
return new Response((await res.text()).toUpperCase(), res);
};By default, `next()` strips conditional headers, so it always returns a full response.
export default async (req: Reque
Public Netlify skills for AI coding agents. Each skill is a focused, factual reference for a Netlify platform primitive — designed to help agents build correctly on Netlify without needing to search docs.
Picks the right Netlify site-protection layer and disambiguates the three unrelated "auth" concepts users conflate — app-user…
Run AI agent tasks remotely on Netlify using Claude, Codex, or Gemini. Use when the user wants to run an AI agent on their site,…
Use Netlify AI Gateway to call OpenAI, Anthropic Claude, Google Gemini, TypeSafe (Jev), or OpenRouter-hosted models…
Store and retrieve unstructured objects, files, and cache-like state on Netlify with the @netlify/blobs module. Use when…
Cache dynamic and static responses on Netlify's CDN from Functions, Edge Functions, and proxies. Use when you add caching or…
Configure Netlify builds and routing via netlify.toml, _redirects, and _headers. Use when setting a build command or publish…
Use this skill whenever the user mentions Horizon by name in a Laravel context. Covers the full Horizon lifecycle: installing…
Use when launching cloud VMs, Kubernetes pods, or Slurm jobs for GPU/TPU/CPU workloads, training or fine-tuning models on cloud…
Use this skill when the user mentions "pinme", or needs to upload files, store to IPFS, create/publish/deploy websites or…