agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/devops/netlify/SKILL.md

netlify

Skill15 starsChanged 2 months agoMITView on GitHub

Expert Netlify assistance covering continuous deployments, Netlify Functions, edge redirects (_redirects), and form handling. Use when deploying frontend Jamstack applications and edge web services.

  • Reads credentials
  • Installs packages

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use netlify-honeypot on HTML forms to prevent automated spam bot submissions.

    line 150
  2. Distinctive:

    Use Netlify Edge Functions for auth checks, localized redirects, and A/B testing at the CDN layer.

    line 151
  3. Very specific:

    Test builds and serverless functions locally using the Netlify CLI (netlify dev).

    line 152
  4. Very specific:

    Commit .env files containing production secrets.

    line 156
  5. Very specific:

    Use client-side redirects when Netlify edge redirects ([[redirects]]) execute significantly faster.

    line 157

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Netlify

Netlify is an essential platform for modern web architectures, providing automated git-based deployments, edge compute, serverless functions, and unified frontend caching primitives.

When to Use

  • Modern Frontend & Jamstack Deployment: Automated git-triggered builds, preview URLs, and global edge CDN hosting.
  • Netlify Edge Functions: Running low-latency serverless TypeScript code at the edge using Deno runtime.
  • Serverless Form Handling & Identity: Zero-backend form submissions and user authentication.
  • Branch Previews & Collaborative Feedback: Generating unique preview environments for every pull request with visual commenting.

Quick Start

npm i -g netlify-cli

# Run local dev environment (simulates Lambda/Edge)
netlify dev

# Deploy
netlify deploy --prod

Core Concepts

Declarative Configuration with netlify.toml

Defining build commands, headers, and SPA redirects:

# netlify.toml
[build]
  command = "npm run build"
  publish = "dist"

[build.environment]
  NODE_VERSION = "22"

# Security headers across all pages
[[headers]]
  for = "/*"
  [headers.values]
    X-Frame-Options = "DENY"
    X-Content-Type-Options = "nosniff"
    Strict-Transport-Security = "max-age=63072000; includeSubDomains; preload"
    Referrer-Policy = "strict-origin-when-cross-origin"

# Single Page App redirect: forward all unhandled paths to index.html
[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

# Proxy internal API to external microservice backend
[[redirects]]
  from = "/api/*"
  to = "https://api.backend-internal.com/:splat"
  status = 200
  force = true

Netlify Edge Functions (Deno Runtime)

Running geolocation-based transforms directly at the edge:

// netlify/edge-functions/geo-routing.ts
import type { Context } from "@netlify/edge-functions";

export default async (request: Request, context: Context) => {
  const country = context.geo?.country?.code || "US";

  // Redirect visitors from specific regions
  if (country === "FR") {
    return new Response(null, {
      status: 302,
      headers: { Location: "/fr" },
    });
  }

  // Pass request through to original destination with custom headers
  const response = await context.next();
  response.headers.set("x-visitor-country", country);
  return response;
};

export const config = {
  path: "/*",
};

Automated Netlify Forms

Collecting form submissions without writing backend endpoints:

<!-- Native Netlify form capture -->
<form
  name="contact-us"
  method="POST"
  data-netlify="true"
  netlify-honeypot="bot-field"
>
  <input type="hidden" name="form-name" value="contact-us" />
  <p class="hidden"><input name="bot-field" /></p>

  <label>Email: <input type="email" name="email" required /></label>
  <label>Message: <textarea name="message" required></textarea></label>
  <button type="submit">Send Message</button>
</form>

Common Patterns

Declarative netlify.toml with SPA Fallback and Security Headers

Problem: SPA routes returning 404 on browser refresh, combined with missing security response headers.

Solution: Define routing and headers in netlify.toml:

[build]
  command = "npm run build"
  publish = "dist"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

[[headers]]
  for = "/*"
  [headers.values]
    X-Frame-Options = "DENY"
    X-Content-Type-Options = "nosniff"
    Referrer-Policy = "strict-origin-when-cross-origin"

Best Practices

Do:

  • Store all routing, redirects, headers, and build commands in netlify.toml for version-controlled reproducibility.
  • Use netlify-honeypot on HTML forms to prevent automated spam bot submissions.
  • Use Netlify Edge Functions for auth checks, localized redirects, and A/B testing at the CDN layer.
  • Test builds and serverless functions locally using the Netlify CLI (netlify dev).

Don't:

  • Commit .env files containing production secrets; configure environment variables in Netlify UI.
  • Use client-side redirects when Netlify edge redirects ([[redirects]]) execute significantly faster.
  • Store large persistent media assets in Git; link to external storage like Cloudinary or S3.

Troubleshooting

ErrorCauseSolution
Page Not Found (404) on route refreshMissing SPA catch-all redirect rule to /index.html.Add /* /index.html 200 to _redirects or netlify.toml.
Build failed: command not found: ...Tool or framework dependency not declared in package.json.Ensure dependencies are in dependencies or devDependencies.
Function invocation timed out (default 10s)Netlify serverless function taking longer than execution limit.Optimize database calls or request timeout extension in site settings.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.