/netlify-skills:netlify-formsfrom netlify-skills
Adds HTML forms to Netlify sites without a backend. Covers data-netlify markup, AJAX/fetch submission, JS-rendered forms needing static skeletons, spam protection, notifications, and the Netlify Forms API.
Ships in netlify-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
<!-- ✅ Reach for this -->
<form name="contact" method="POST" data-netlify="true"> … </form>
// ✅ URL-encoded body built from FormData
fetch(target, {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams(new FormData(form)).toString(),
});
// ❌ JSON is NOT supported. Submissions are lost.
fetch(target, { method: "POST", body: JSON.stringify(data) });
netlify (bare attribute) works the same as data-netlify="true".data-remove-prefix only applies to legacy forms created before May 5, 2023. Don't add it to new forms.⚠️ Prerequisite: enable Forms > Enable form detection in the UI (https://app.netlify.com/projects/{site_name}/forms), then redeploy. Without detection, new or changed forms accept no submissions. Enabling has no effect until the next deploy.
<form> tags with data-netlify="true" or netlify.netlify-honeypot) and injects <input type="hidden" name="form-name" value="<name>">.name is the form's identity in the UI. It must be unique per site.name attributes. Multi-selects can use name="role[]".<form name="contact" method="POST" data-netlify="true" action="/thank-you">
<input type="hidden" name="subject" value="New lead from %{formName} (%{submissionId})" />
<label>Name <input type="text" name="name" /></label>
<label>Email <input type="email" name="email" /></label>
<label>Role
<select name="role[]" multiple>
<option value="leader">Leader</option>
<option value="follower">Follower</option>
</select>
</label>
<label>Message <textarea name="message"></textarea></label>
<button type="submit">Send</button>
</form>
action: optional custom success page. It must start with / (site-root relative). Without it, visitors see a generic Netlify success page.email field: sets Reply-to on notification emails. Otherwise replies go to [email protected].subject hidden input: sets the notification subject (details below).document.querySelector("form").addEventListener("submit", (event) => {
event.preventDefault();
fetch("/", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams(new FormData(event.target)).toString(),
})
.then(() => alert("Thank you for your submission"))
.catch((error) => alert(error));
});
form-name must be in the body. FormData picks up the injected hidden input automatically.
Two parts are required: a detectable static skeleton, plus a component that sends form-name.
1. public/__forms.html — a hidden static copy of every form. Each input name must exactly match what the component submits.
<!DOCTYPE html>
<html>
<body>
<form name="pizzaOrder" data-netlify="true" netlify-honeypot="bot-field" hidden>
<input type="hidden" name="form-name" value="pizzaOrder" />
<input name="bot-field" />
<input name="order" type="text" />
<input name="email" type="email" />
</form>
</body>
</html>
If the form uses Netlify-provided reCAPTCHA, also include <div data-netlify-recaptcha="true"></div> in the skeleton.
2. Component — includes the hidden form-name input (or put form-name in the POST body) and submits via AJAX.
export default function PizzaForm() {
const [status, setStatus] = useState(null);
const handleSubmit = async (event) => {
event.preventDefault();
const body = new URLSearchParams(new FormData(event.target)).toString();
try {
const res = await fetch("/__forms.html", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body,
});
setStatus(res.ok ? "ok" : "error");
} catch {
setStatus("error");
}
};
return (
<form name="pizzaOrder" method="POST" onSubmit={handleSubmit}>
<input type="hidden" name="form-name" value="pizzaOrder" />
<p hidden><input name="bot-field" /></p>
<input name="order" type="text" />
<input name="email" type="email" />
<button type="submit">Order</button>
{status === "ok" && <p>Thanks!</p>}
</form>
);
}
navigate("/thank-you/") in Gatsby, or set state as above.<form name="fileForm" method="POST" enctype="multipart/form-data" data-netlify="true">
<input name="name" type="text" />
<input name="file" type="file" />
<button>Submit</button>
</form>
document.forms.fileForm.addEventListener("submit", (event) => {
event.preventDefault();
fetch("/", { method: "POST", body: new FormData(event.target) }); // NO Content-Type header
});
⚠️ Do not set
Content-Typewhen uploading files. PassFormDatadirectly and let the browser set the multipart boundary.
<input type="file">. Use multiple fields for multiple files.Akismet filters every submission automatically. Flagged submissions go to Spam submissions, not the default list.
⚠️ Honeypot and reCAPTCHA failures are rejected outright. They never appear in the spam list, so there is nothing to recover.
Honeypot:
<form name="contact" method="POST" netlify-honeypot="bot-field" data-netlify="true">
<p class="hidden"><label>Don't fill this out: <input name="bot-field" /></label></p>
…
</form>
FormData does this.Netlify-provided reCAPTCHA 2:
data-netlify-recaptcha="true" on <form>.<div data-netlify-recaptcha="true"></div> where the widget should render.Custom reCAPTCHA 2:
data-netlify-recaptcha="true" on <form>.| Var | Value | Scopes |
|---|---|---|
SITE_RECAPTCHA_KEY | site key | Builds + Runtime |
SITE_RECAPTCHA_SECRET | secret key | Runtime |
The body must include a valid g-recaptcha-response (FormData includes it).
Test submissions "missing": they are probably in Akismet spam. Avoid this with a real email (not [email protected]), real sentences in textareas, and spaced-out submissions from the same IP.
Configure in Forms > Submission notifications (https://app.netlify.com/projects/{site_name}/forms?tab=notifications).
Email recipients must be active team members or confirmed outside addresses:
Subject line:
<input type="hidden" name="subject" value="…">.%{formName}, %{siteName}, %{submissionId}.[Netlify] prefix. Drop it either with data-remove-prefix on the subject input or by setting the subject in the UI.API (https://docs.netlify.com/api-and-cli-guides/api-guides/get-started-with-api#forms):
listFormSubmissions (https://open-api.netlify.com/#tag/submission/operation/listFormSubmissions).Function on submission: a function can run when a submission is verified. See https://docs.netlify.com/build/functions/trigger-on-events
UI (Forms tab, under Active forms):
Submission summary (shown for each item in the UI list):
<input>. If none exists, a field named title or subject is used.<textarea>.Sanitization: content is sanitized automatically. <script> is stored as <script>. For PII, export and delete submissions regularly.
⚠️ Deleting a form is irreversible. It deletes all submissions, and future POSTs return
404. Export CSV first. Uploaded files stay reachable by direct URL for 24 h after deletion.
⚠️ Renaming or retyping a field hides old data in the UI. Mark the old field
hiddeninstead of removing it. Old data remains in the API.
action path on the form page and verify it resolves.These are org conventions and field-learned guardrails, not docs facts — they are merged into the rendered skill by ctx-gen and are never generated. Extracted from the previous hand-written netlify-forms skill; owned by the skills maintainer.
fetch("/") is intercepted
by the SSR catch-all function and never reaches Netlify's form processing.
POST the AJAX submission to the static skeleton file itself (e.g.
/__forms.html), not to an arbitrary path.https://api.netlify.com/...
with an invented endpoint shape, and do not read tokens out of local CLI
config files (~/Library/Preferences/netlify/config.json).Link
header); code that reads only the first response silently drops the rest.public/__forms.html: a hidden copy of each form with
data-netlify="true", a hidden form-name input, and every field the
component submits — names matching exactly (Netlify validates field names
against the registered form). Without this file, submissions silently fail.export const prerender = false, or
output: "server" routes) are never scanned at build time, so their forms
are never registered. Put the form on a prerendered page or rely on the
static skeleton file.?state=spam) and mark it verified.
Do not build a custom recovery function or disable spam filtering as a
first resort.action paths (/thank-you,
not /thank-you.html) — Netlify serves thank-you.html at /thank-you
and the .html path returns 404.What SKILL.md sets; muted values are Claude Code's defaults
16 skills in this plugin
/netlify-access-controlPicks the right Netlify site-protection layer and disambiguates the three unrelated "auth" concepts users conflate — app-user login (Netlify Identity), site-load gating (Password Protection / project visibility), and dashboard SAML SSO. Use it when asked to password-protect a site or Deploy Preview, make a project private/public, restrict a site to your team, require SSO to view a site, set up company-wide or internal-app SSO, invite users to a private project, or know which team member made a request to a private site. Also use it for SSO-session symptoms on protected sites: "logged out mid-session", 401s after about an hour, or token expiry/refresh questions. Not for wiring auth code — route app-login setup to netlify-identity./netlify-agent-runnerRun AI agent tasks remotely on Netlify using Claude, Codex, or Gemini. Use when the user wants to run an AI agent on their site, get a second opinion from another model, or delegate development tasks to run remotely against their repo./netlify-ai-gatewayUse Netlify AI Gateway to call OpenAI, Anthropic Claude, Google Gemini, Meta, TypeSafe (Jev), or OpenRouter-hosted models (xAI/DeepSeek/Mistral/Qwen) from Netlify Functions or Edge Functions without managing provider accounts or API keys. Reach for this when adding an AI feature to a Netlify app — a chatbot, text summarizer, image generator, joke/content generator, form-submission routing or analysis, or any LLM call — or when wiring the OpenAI/Anthropic/Gemini/TypeSafe/OpenRouter SDK into a Netlify Function, choosing which env vars to use, streaming long generations, or debugging why gateway calls fail at build time or return 401./netlify-blobsStore and retrieve unstructured objects, files, and cache-like state on Netlify with the @netlify/blobs module. Use when persisting user file uploads (images/documents), caching computed output from functions or Background Functions, serving downloadable assets, storing JSON blobs keyed by ID, or seeding deploy-specific data. Reach for this for key/value or object storage from Functions, Edge Functions, or Build Plugins — not for per-user, transactional, or relational data (use Netlify DB for that). Triggers include "save an uploaded file", "cache API results", "store generated site map", "key/value store for a function", or "file uploads without a database"./netlify-cachingCache dynamic and static responses on Netlify's CDN from Functions, Edge Functions, Netlify Server, and proxies. Use when you add caching or cache-control headers to a function or server response, tune cache TTL or stale-while-revalidate, set up the durable cache, vary a cache key by query/header/cookie/country/language, purge or invalidate the cache by site or cache tag, use the programmatic Cache API (caches.open/match/put) or @netlify/cache helpers (fetchWithCache/cacheHeaders/getCacheStatus/purgeCache), speed up an expensive API call, add ISR or on-demand revalidation, or debug why a response is or isn't cached via the Cache-Status header./netlify-configConfigure Netlify builds and routing via netlify.toml, _redirects, and _headers. Use when setting a build command or publish directory, validating netlify.toml against its JSON schema, adding redirects/rewrites/proxies or an SPA fallback rewrite, or setting custom response headers or basic auth. Also use when managing environment variables and secrets, scoping vars per deploy context, marking a var as secret or disabling secret scanning, handling sensitive vars in fork Deploy Previews, configuring functions bundling or the Netlify Server region/size, ignoring builds, or wiring up a monorepo or JavaScript SPA on Netlify.Other plugins' skills for the same job
npx claudepluginhub netlify/context-and-tools --plugin netlify-skills