netlify-config

Configure Netlify builds, redirects, headers, and environment variables via netlify.toml.

Updated May 19, 2026
One-click install
npx skills add https://github.com/costrict-plugins-repo/anthropic-netlify-skills --skill netlify-config-costrict-plugins-repo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-config
Source: https://github.com/costrict-plugins-repo/anthropic-netlify-skills/tree/main/codex/skills/netlify-config
Command: npx skills add https://github.com/costrict-plugins-repo/anthropic-netlify-skills --skill netlify-config-costrict-plugins-repo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Netlify projects are configured through netlify.toml and the _headers/_redirects files, but the rules are full of footguns — env vars set in netlify.toml never reach functions at runtime, redirects and headers cannot be scoped per branch, and secrets in client-prefixed vars leak into bundles. This Skill gives an agent the exact syntax, precedence rules, and constraints needed to write correct configuration the first time. ## Core Features & Use Cases - Build and context configuration: Set build commands, publish directories, Node/tool versions, and per-context overrides for production, deploy previews, branch deploys, and local dev. - Redirects, rewrites, and headers: Write redirect/rewrite/proxy rules with splats, query params, country/language conditions, signed proxy redirects, custom headers, and SPA fallbacks. - Environment variables and secrets: Scope variables correctly across Builds, Functions, Runtime, and Post processing, mark secrets with the Secrets Controller, and avoid committing .env snapshots. - Use Case: A user asks why their env var is undefined inside a Netlify Function — the Skill explains that netlify.toml vars only get Builds and Post processing scopes and shows the fix using netlify env:set. ## Quick Start Ask the agent to add an SPA fallback redirect and a production-scoped environment variable to your Netlify site configuration.

Frequently Asked Questions about netlify-config

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up redirects in netlify.toml?

Add [[redirects]] blocks with from, to, and status fields, or use a _redirects file in the publish directory with one rule per line. Rules process top-down with first match winning, and _redirects rules run before netlify.toml rules.

Why is my environment variable undefined in a Netlify Function?

Variables declared in netlify.toml only receive the Builds and Post processing scopes, so functions read them as undefined at runtime. Set runtime variables in the Netlify UI or with netlify env:set so they carry the Functions scope.

How do I configure an SPA fallback on Netlify?

Add a redirect rule from /* to /index.html with status 200, either in _redirects or as a [[redirects]] entry in netlify.toml. The 200 status rewrites rather than redirects, which is required for pushState routing to avoid 404s.

Can netlify.toml redirects be scoped to specific branches?

No, [[redirects]] and [[headers]] are global and cannot be scoped to branches or deploy contexts. The workaround is a per-context build command that copies a context-specific _redirects file into the publish directory.

Does Netlify read .env files during builds?

No, the Netlify build system does not read .env files. Import variables into Netlify first with netlify env:import; the CLI reads .env only for local builds, and any local .env snapshot should stay gitignored.

What are the limits of Netlify proxy rewrites?

Proxy rewrites time out after 26 seconds, HTTP 307 is unsupported so use 302, and cross-team rewrites between Netlify sites are not allowed. For longer-running work, use asynchronous patterns instead of proxying.