netlify-config

Configures netlify.toml build settings, redirects, headers, and deploy contexts.

1|Updated May 13, 2026
One-click install
npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-config-syedarmanali2003
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-config
Source: https://github.com/SyedArmanAli2003/AgroNaV/tree/main/.agents/skills/netlify-config
Command: npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-config-syedarmanali2003

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing a correct netlify.toml file from memory is error-prone, with subtle syntax rules for redirects, headers, deploy contexts, and function configuration that are easy to get wrong. ## Core Features & Use Cases - Build & Dev Configuration: Set base directory, build command, publish directory, and Netlify Dev server options. - Redirects & Rewrites: Define SPA catch-alls, splats, path parameters, forced redirects, proxy rules, and country/language conditions with correct rule ordering. - Headers & Deploy Contexts: Apply per-path HTTP headers and override settings for production, deploy-preview, branch-deploy, and dev contexts. - Functions & Plugins: Configure serverless function directories, scheduled functions, edge functions, Deno import maps, plugins, and the Image CDN. - Use Case: You are deploying a React SPA to Netlify and need a catch-all rewrite to index.html, long-lived cache headers for static assets, and a separate build command for deploy previews. ## Quick Start Write a netlify.toml for my React app with an SPA catch-all redirect, immutable cache headers for /assets, and a staging branch context.

Frequently Asked Questions about netlify-config

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

FAQPage Schema
How do I configure redirects in netlify.toml?

Add [[redirects]] blocks with from, to, and status fields. Use status 200 for rewrites, 301 or 302 for redirects, and support splats like /blog/* to /news/:splat. Netlify applies the first matching rule, so place specific rules before general ones.

How do I set up an SPA catch-all rewrite on Netlify?

Add a redirect rule with from = "/*", to = "/index.html", and status = 200. This serves index.html for all unmatched paths so client-side routing works. Place it after any more specific redirect rules.

Can I set different build commands per branch in Netlify?

Yes, use deploy contexts in netlify.toml. Define [context.production], [context.deploy-preview], [context.branch-deploy], or a named branch like [context."staging"], each with its own command and environment variables.

Should I put secrets in netlify.toml environment variables?

No. netlify.toml is committed to source control, so secrets placed there are exposed. Use the Netlify UI or CLI for sensitive values, and keep only non-sensitive variables like NODE_VERSION in the file.

Why are my netlify.toml headers not applied to function responses?

Headers defined in netlify.toml only apply to files served from Netlify's CDN. Function and edge function responses bypass these rules, so you must set headers directly in your function code.