PluginWorks in Claude CodeCurrent
Netlify skills
Netlify platform skills for Claude Code — functions, edge functions, blobs, database, image CDN, forms, config, CLI, frameworks, caching, AI gateway, and deployment.
0
Try it
See what this would do for you. No sign-up needed.
Install in Claude Code
Run these in Claude Code, in order. The first adds the marketplace, the second installs the plugin.
Step 1
/plugin marketplace add anthropics/claude-plugins-official
Step 2
/plugin install netlify-skills@claude-plugins-official
Review commands before running them. Promptu never runs code on your machine or pushes changes to your repo.
What's inside
15 skills
- netlify-access-control
- netlify-agent-runner
- netlify-ai-gateway
- netlify-blobs
- netlify-caching
- netlify-config
- netlify-database
- netlify-deploy
- netlify-edge-functions
- netlify-forms
- netlify-frameworks
- netlify-functions
- netlify-identity
- netlify-image-cdn
- netlify-mcp-servers
1 MCP server
Security scan
Flagged
Promptu's text scan flagged something in this plugin. Read its files before you install it.
rm-rf in README.md:80; env-exfiltration in skills/netlify-frameworks/SKILL.md:86
Details
# Netlify Context and Tools
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.
## Skills
| Skill | What it covers |
|---|---|
| [netlify-functions](skills/netlify-functions/SKILL.md) | Serverless functions — modern syntax, routing, background/scheduled/streaming |
| [netlify-edge-functions](skills/netlify-edge-functions/SKILL.md) | Edge compute — Deno runtime, middleware, geolocation |
| [netlify-blobs](skills/netlify-blobs/SKILL.md) | Object storage — key-value and binary data |
| [netlify-database](skills/netlify-database/SKILL.md) | Managed Postgres (Neon) with Drizzle ORM and migrations |
| [netlify-image-cdn](skills/netlify-image-cdn/SKILL.md) | Image transformation and optimization via CDN |
| [netlify-forms](skills/netlify-forms/SKILL.md) | HTML form handling, AJAX submissions, spam filtering |
| [netlify-config](skills/netlify-config/SKILL.md) | `netlify.toml` — redirects, headers, build settings, deploy contexts, environment variables |
| [netlify-frameworks](skills/netlify-frameworks/SKILL.md) | Framework adapters for Vite, Astro, TanStack, and Next.js |
| [netlify-caching](skills/netlify-caching/SKILL.md) | CDN cache control, cache tags, purge, stale-while-revalidate |
| [netlify-ai-gateway](skills/netlify-ai-gateway/SKILL.md) | AI Gateway proxy for OpenAI, Anthropic, and Google SDKs |
| [netlify-identity](skills/netlify-identity/SKILL.md) | User authentication — signups, logins, OAuth, role-based access control |
| [netlify-deploy](skills/netlify-deploy/SKILL.md) | CLI install/auth, site linking, Git-based and manual deploys, CI deploys, deploy troubleshooting |
| [netlify-access-control](skills/netlify-access-control/SKILL.md) | Protecting sites and previews — password protection, team-only access, visibility defaults, SSO |
| [netlify-agent-runner](skills/netlify-agent-runner/SKILL.md) | Running Claude, Codex, or Gemini agent tasks remotely against a site's repo |
| [netlify-mcp-servers](skills/netlify-mcp-servers/SKILL.md) | MCP servers on Netlify Functions — transport, authentication, connecting clients |
### References
Some skills include `references/` subdirectories with deeper content:
- [User-uploaded images pipeline](skills/netlify-image-cdn/references/user-uploads.md) — composing Functions + Blobs + Image CDN
- [Vite on Netlify](skills/netlify-frameworks/references/vite.md)
- [Astro on Netlify](skills/netlify-frameworks/references/astro.md)
- [TanStack Start on Netlify](skills/netlify-frameworks/references/tanstack.md)
- [Next.js on Netlify](skills/netlify-frameworks/references/nextjs.md)
- [Advanced identity patterns](skills/netlify-identity/references/advanced-patterns.md) — external providers, role-based access, server-side validation
- [CLI commands reference](skills/netlify-deploy/references/cli-commands.md)
- [Deployment patterns](skills/netlify-deploy/references/deployment-patterns.md)
- [netlify.toml guide](skills/netlify-deploy/references/netlify-toml.md)
## Installation
One command installs the skills into any project, from the released [`@netlify/skills`](https://www.npmjs.com/package/@netlify/skills) package:
```bash
npx @netlify/skills@latest add --all
```
It writes the skills into the agent directory already in the project (`.claude/`, `.agents/`, or `.grok/`) and never guesses: with none, or more than one, it asks for `--agent`.
| Agent | `--agent` | Skills directory |
|---|---|---|
| Claude Code | `claude-code` | `.claude/skills/` |
| Cursor | `cursor` | `.agents/skills/` |
| Codex | `codex` | `.agents/skills/` |
| Gemini CLI | `gemini-cli` | `.agents/skills/` |
| GitHub Copilot, VS Code | `github-copilot` | `.agents/skills/` |
| Grok Build | `grok` | `.grok/skills/` |
| Anything else | | `--dest <dir>` |
Each directory is the project-level skills location in that agent's own docs: [Claude Code](https://code.claude.com/docs/en/skills), [Cursor](https://cursor.com/docs/context/skills), [Codex](https://developers.openai.com/codex/skills), [Gemini CLI](https://geminicli.com/docs/cli/skills/), [GitHub Copilot](https://docs.github.com/en/copilot/concepts/agents/about-agent-skills), and [Grok](https://docs.x.ai/build/features/skills-plugins-marketplaces). Cursor, Codex, Gemini CLI, and Copilot all read the shared `.agents/skills/`. The generated `.cursor/rules/` files and the `codex/AGENTS.md` router under [Other ways to install](#other-ways-to-install) are the older formats for those two agents; they still work, but they are not what `add` writes.
`add netlify-functions` installs one skill, `check` reports what is installed and whether it is current, and `update` brings it up to date. See [Install skills and keep them current](#install-skills-and-keep-them-current).
### Other ways to install
Each agent's plugin marketplace carries the same skills, packaged the way that agent manages plugins (with the Netlify MCP server bundled where the format allows). Use one of these when you want the agent, not the repo, to own the install.
#### Codex Desktop App
Install the Netlify plugin from the [Codex plugin directory](https://developers.openai.com/codex/plugins/) in the Codex desktop app.
The plugin lets Codex deploy to Netlify without leaving your coding workflow. You can create projects, generate preview URLs, deploy to production, validate build configuration, and inspect deploy status and logs. For full details, refer to [Deploy from Codex with the Netlify Plugin](https://www.netlify.com/changelog/2026-03-27-deploy-from-codex-netlify-plugin/).
#### Codex CLI
Copy the pre-built `codex/` directory into your project root:
```bash
git clone --depth 1 https://github.com/netlify/context-and-tools.git /tmp/netlify-skills && \
cp -r /tmp/netlify-skills/codex . && \
rm -rf /tmp/netlify-skills
```
This gives you `codex/AGENTS.md` (the skill router) and `codex/skills/` with all Netlify skills. Codex discovers `AGENTS.md` automatically and activates skills by name using `$skill-name` syntax.
#### GitHub Copilot CLI
Copy the pre-built `codex/` directory into your project root, then point Copilot CLI at it:
```bash
git clone --depth 1 https://github.com/netlify/context-and-tools.git /tmp/netlify-skills && \
cp -r /tmp/netlify-skills/codex . && \
rm -rf /tmp/netlify-skills
```
```bash
export COPILOT_CUSTOM_INSTRUCTIONS_DIRS="$PWD/codex"
```
Copilot CLI reads `AGENTS.md` from any directory listed in `COPILOT_CUSTOM_INSTRUCTIONS_DIRS` and uses it as a router into the skill files under `codex/skills/`. Add the export to your shell profile to persist across sessions.
#### Claude Code
Add the marketplace and install the plugin:
```
/plugin marketplace add netlify/context-and-tools
/plugin install netlify-skills@netlify-context-and-tools
```
This installs all Netlify skills into Claude Code. The included `skills/CLAUDE.md` acts as a router — it tells the agent which skill to read based on what you're building.
#### VS Code
VS Code's [agent plugins](https://code.visualstudio.com/docs/agent-customization/agent-plugins) use the same plugin format as Claude Code, so VS Code installs the skills directly from this repository — no separate build step or generated output. VS Code auto-detects the plugin from `.claude-plugin/plugin.json` and loads the `skills/` directory and the bundled Netlify MCP server (`.mcp.json`).
Add this repository as a plugin marketplace, then install:
1. Add the marketplace source `netlify/context-and-tools` to the `chat.plugins.marketplaces` setting.
2. Open the Extensions view, search `@agentPlugins`, find **netlify-skills**, and click **Install**.
Or install directly from source via the command palette: `Cmd+Shift+P` / `Ctrl+Shift+P` → **Chat: Install Plugin From Source** → enter `https://github.com/netlify/context-and-tools.git`.
#### Cursor
Install from the [Cursor plugin marketplace](https://cursor.com/marketplace):
1. Open Cursor Settings (`Cmd+,` / `Ctrl+,`)
2. Go to **Plugins**
3. Search for **netlify-skills**
4. Click **Install**
Or install via the command palette: `Cmd+Shift+P` → **Plugins: Install Plugin** → search **netlify-skills**.
This installs 21 `.mdc` rule files covering all Netlify platform primitives. A router rule (`netlify-skills-router.mdc`) is always active and directs the agent to the right skill for the task.
<details>
<summary>Manual installation (without the plugin marketplace)</summary>
Copy pre-built rule files directly into your project:
```bash
git clone --depth 1 https://github.com/netlify/context-and-tools.git /tmp/netlify-skills && \
mkdir -p .cursor/rules && \
cp /tmp/netlify-skills/cursor/rules/*.mdc .cursor/rules/ && \
rm -rf /tmp/netlify-skills
```
This copies `.mdc` rule files into `.cursor/rules/`, where Cursor automatically discovers them.
</details>
#### Grok Build
Netlify is listed in the [official xAI plugin marketplace](https://github.com/xai-org/plugin-marketplace). In Grok Build, open the extensions modal (`/plugins`) and use the **Marketplace** tab to find and install **netlify**.
Grok Build uses the same plugin format as Claude Code, so it installs all Netlify skills directly from this repository — no separate build step or generated output. Marketplace sources live in `~/.grok/config.toml` under `[[marketplace.sources]]`; if the xAI marketplace isn't already configured, add it there. See the [xAI Skills, Plugins & Marketplaces docs](https://docs.x.ai/build/features/skills-plugins-marketplaces) for details.
#### Netlify MCP server
The Claude Code, VS Code, and Grok Build plugins (and the Gemini CLI extension) also register the [official Netlify MCP server](https://docs.netlify.com/build/build-with-ai/netlify-mcp-server/), giving the agent tools to create and manage Netlify projects, deploys, and environment variables — not just the reference skills.
It connects to Netlify's hosted server over HTTP (`https://netlify-mcp.netlify.app/mcp`) and authorizes via OAuth on first use — no token or local install required. The rules-based integrations (Cursor, Codex, Copilot) don't bundle the MCP server — add it to those clients manually using the [Netlify MCP docs](https://docs.netlify.com/build/build-with-ai/netlify-mcp-server/).
#### Other AI agents
Each `SKILL.md` file is a self-contained reference with YAML frontmatter (`name` and `description`) and markdown body. Feed them into any agent's context as needed.
## Hosted skills, manifest, and npm
Every release publishes the skills to two places you can consume without cloning this repo:
- **Hosted:** `https://netlify-agent-skills.netlify.app` — `manifest.json` and `skills/<name>/<file>` for the latest release, `versions.json` listing every published version, and immutable copies at `v/<version>/…`.
- **npm:** [`@netlify/skills`](https://www.npmjs.com/package/@netlify/skills) — every skill plus `manifest.json` and the `netlify-skills` command, which installs single skills out of the package.
Skill files under `v/<version>/` are exact `git archive` bytes of the tag and never change. Each `v/<version>/manifest.json` is regenerated on publish, but its `tree_hash` formula is frozen for `schema_version: 1`, so a pinned hash stays valid.
The manifest is the contract every client syncs against. It lists each skill's name, status (`active` or `deprecated`), its own `version`, prior names, description, a per-file SHA-256, and a `tree_hash` over path, executable bit, and content that changes whenever any file in the skill changes, so "am I stale?" is one hash comparison.
Skills change independently, so each carries its own version: the release in which its files last changed. The set might be at 1.6.0 while `netlify-functions` is still at 1.4.2 because nothing in it has moved since. Pin a skill by its own version: `v/1.4.2/skills/netlify-functions/…`. Nobody maintains these by hand; they are derived from git tags at publish time.
```bash
# Latest manifest
curl -s https://netlify-agent-skills.netlify.app/manifest.json | head -c 600
# One skill, pinned to a version
curl -s https://netlify-agent-skills.netlify.app/v/1.3.2/skills/netlify-functions/SKILL.md
```
### Install skills and keep them current
The `netlify-skills` command ships inside `@netlify/skills`. By default it installs skills out of the package it came with, so `npx @netlify/skills@latest` is a complete, offline-after-fetch install of the newest release, and pinning is picking the package version (`npx @netlify/skills@1.3.2 add …`). Every file is checked against the manifest's SHA-256 before it is written. No clone needed:
```bash
# One or more skills into the agent directory found in the project (see the table above);
# `functions` works for `netlify-functions`
npx @netlify/skills@latest add netlify-functions blobs
# Name the agent, or any directory
npx @netlify/skills@latest add netlify-functions --agent cursor
npx @netlify/skills@latest add netlify-functions --dest tools/skills
# Every skill
npx @netlify/skills@latest add --all
# Pin a skill to its own version
npx @netlify/skills@latest add netlify-functions --version 1.3.0
# What state are my installed skills in? (`status` works too.) Exits 1 if update would change anything.
npx @netlify/skills@latest check
# Bring them up to date from this package's release
npx @netlify/skills@latest update
# Or reconcile against the hosted manifest (the newest release, whatever package version is running)
npx @netlify/skills@latest update --remote
```
Use `@latest` with `npx`: it otherwise reuses whatever version it cached last time, and the release you install from should be the newest one. `--remote` reads the hosted manifest instead of the bundled one, which is what the Netlify CLI and MCP do; `--host <url>` names a different hosted location, and `--version` applies to the hosted path.
What the hashes do and do not cover: the manifest and the files come from the same place (the package, or the hosted site), so a hash mismatch means a truncated or corrupted transfer, or a file that no longer matches its release, not a compromised source. Trust in the source is npm's provenance attestation for the package and TLS for the site (`--host` accepts `https://` only, except for localhost).
`check` (or `status`) classifies each installed skill: `current`, `stale (have 1.2.0, latest is 1.3.0)`, `modified` (edited locally), `renamed`, `deprecated`, `duplicate` (one of our skills copied under another name), or `unknown` (yours, never touched), and lists what is `missing`. With `--json` this is what an orchestrator such as Agent Runners reads before injecting skills into a repo, so it adds only what is absent and never overwrites or duplicates. `update` replaces stale copies, migrates renamed ones, deletes deprecated ones, and leaves edited copies alone (stale, renamed, or deprecated) unless you pass `--reset`. It adds missing skills only with `--all`, so a single-skill install stays single. The manifest's per-skill `history` (every release a skill changed at, with its hash) is what lets it tell "outdated" from "edited".
A service that reads skills programmatically (Agent Runners) can depend on the package and read one skill by path: `node_modules/@netlify/skills/skills/netlify-functions/SKILL.md`. The bundled `manifest.json` carries each skill's own version, so a service can tell which skills changed between two package versions without diffing files.
The same client is in this repo as `scripts/fetch-skill.mjs` (`--source <dir>` or `--host <url>`; `--skill`/`--all` with `--dest`, `--check`, `--update`), which is what the Netlify CLI's init and sync will build on. The whole-set package also ships the `skills/CLAUDE.md` router; the hosted site serves exactly the files the manifest lists, so the router is not there. Both targets are published from the release tag by `.github/workflows/release-please.yml`.
## Design Principles
- **Factual, not opinionated** — platform behavior and API reference, not workflow preferences
- **Composable** — skills cover individual primitives; agents combine them as needed
- **Concise** — each SKILL.md stays under 500 lines; detailed content goes in `references/`
- **Current** — covers modern Netlify patterns (v2 functions, Vite plugin, AI Gateway)
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for commit/PR title conventions and how releases are cut.
Keep skills focused on Netlify platform primitives. Each skill should answer "how does this Netlify feature work?" rather than "how should I structure my project?"
Follow the existing format: YAML frontmatter with `name` and `description`, markdown body, code examples with TypeScript where applicable. Use `references/` subdirectories for content that would push a SKILL.md past 500 lines.
### Generated outputs — do not edit them directly
The `cursor/rules/`, `codex/`, and `agent-plugin/skills/` directories, and the `skills` array in `gemini-extension.json`, are auto-generated from `skills/` by a GitHub Actions workflow. Always edit the source files in `skills/`. On same-repo PRs and on every push to `main` that changes `skills/`, the workflow rebuilds all of them and commits them alongside your change — you don't need to run the build yourself. (Fork PRs can't be committed to automatically; include the regenerated output in your PR, or a maintainer will regenerate it.) To preview locally:
```bash
bash scripts/build-cursor-rules.sh
bash scripts/build-codex-skills.sh
bash scripts/build-agent-plugin.sh
bash scripts/build-gemini-extension.sh
```
## skills/netlify-access-control/SKILL.md
---
name: netlify-access-control
description: 'Picks 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 app SSO, or invite users to a private project. 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 access control — pick the protection layer
This skill routes you to the correct protection layer. It does not teach each one. **These settings have no public API, CLI command, or MCP tool.** Never curl `api.netlify.com` or read local auth tokens to inspect or change them — give the user the dashboard path and checklist. On failure, report what you tried and stop.
## First: disambiguate "auth" — three unrelated layers
Users constantly conflate these. Identify which one is meant before recommending anything.
1. **Netlify Identity** — "who is this user *inside my app*." Issues `nf_jwt`. → route to the **netlify-identity** skill; not covered here.
2. **Password Protection / project visibility** — "can this request load the site at all." Covered here.
3. **Team/Org SAML SSO** — "can you log in to the Netlify *dashboard*." Gates dashboard access; also underlies team-login site protection.
Sessions are separate. The same provider (e.g. Google) can appear twice unrelated — Identity OAuth for app users vs. SAML IdP for team members.
**Double-login footgun:** a Password-Protection/team-login perimeter session and an Identity app session have **no bridge** — no shared cookie, no header forwarding, no JWT exchange. Don't try to wire them together. For the combined layered pattern and its tradeoffs, see `references/two-layer-pattern.md`.
**Want company-wide app SSO with a single sign-in (no double login)?** Recommend the **Auth0 extension** federating to the corporate IdP *before* the two-layer stack.
## Decision guide (this skill's job)
- Restrict entire site to your team, invite by email → **Private project** (Credit-based) or **Team login protection** (Password Protection).
- Share with anyone holding one shared password → **Basic password protection** (Pro) or **Password** visibility (Pro, Credit-based).
- Keep production public, protect previews only → scope **Previews only** / **Non-production deploys only**.
- Require SSO to *view a site* → Organization/Team SSO with **Only SSO allowed (strict)**, then Password Protection with **Team login protection**.
- Protect specific pages/sections with multiple passwords → **Basic authentication with custom HTTP headers** (formerly Selective password protection): https://docs.netlify.com/manage/security/secure-access-to-sites/basic-authentication-with-custom-http-headers/
- Authenticate your own end users → **Netlify Identity** / **OAuth provider tokens** / **Role-based access control with JWT** → route to netlify-identity.
- Block malicious/automated traffic or AI crawlers → **Advanced Web Security** (WAF / Firewall Traffic Rules / rate limiting) or **User Agent Blocker** extension: https://docs.netlify.com/build/build-with-ai/block-ai-crawlers/
## Key distinction: Private vs Password
- **Private** already requires Netlify credentials — no shared password. Invite by email; recommended for team-only access.
- **Password** = one universal shared password anyone can use (including managing team members, who must also enter it). No SSO.
- **Team login protection** = same mechanism as Private: a visitor must log in as a member of your Netlify team, and **Reviewers** you invite can get in too (unlimited and not counted toward the member count on legacy plans; Pro or higher on Credit-based plans). **Git Contributors cannot log in** — invite them as Reviewers rather than upgrading them to Developer.
## SSO-session symptom: 401s after ~1 hour
If a user reports being "logged out mid-session" or 401s on an SSO-protected site: **SSO auth tokens expire after 1 hour**, after which requests return `401`. Sites with SSO protection return the header **`Netlify-Site-Protection-Expires-In`** — seconds until the request's token expires. Refresh proactively:
```js
// Client-side. Checks the Netlify SSO protection header and reloads before expiry.
const res = await fetch(window.location.href, { method: "HEAD" });
const secondsLeft = Number(res.headers.get("Netlify-Site-Protection-Expires-In"));
// Tokens last 1 hour (3600s). Reload a bit early to avoid a 401.
if (!Number.isNaN(secondsLeft) && secondsLeft < 60) {
window.location.reload();
}
```
## UI paths (the only path — no API)
**Credit-based plans (Free, Personal, Pro)** — project-level "Password Protection" is replaced by **Project visibility**:
- Per project: Project configuration > General > Visitor access > **Project visibility** — `https://app.netlify.com/projects/{site_name}/configuration/general/#project-visibility`. Edit visibility → (Customize if a team default exists) → **Public** / **Password** (Pro only) / **Private** → set **Preview access** (Production and previews / Previews only) → Save.
- Team default: Team settings > General > Visitor access > **Default project visibility** — `https://app.netlify.com/teams/{team_name}/settings/general#default-project-visibility`. Options: Private for new projects / Private for all projects / Public for new projects.
- No per-team default *password* here; set a password per project.
**Enterprise / Open Source / legacy (non-Credit-based)** — use **Password Protection** UI:
- Per site: Project configuration > General > Visitor access > **Password Protection** — `https://app.netlify.com/projects/{site_name}/configuration/general#visitor-access`. Configure → Basic or Team login → scope (All deploys / Non-production deploys only) → Save.
- Team default: Team settings > Access & security > Visitor access > **Default Password Protection settings** — `https://app.netlify.com/teams/{team_name}/settings/access#default-site-protection-settings`. Applies to all sites without their own settings.
**Legacy → Credit-based mapping:** No protection→Public · Basic protection→Password · Team protection→Private · All deploys→Production and previews · Non-production deploys only→Previews only.
## Constraints & footguns
- **Site-specific Password Protection overrides team defaults.**
- **Who can change these settings:** project visibility — Organization Owners (on certain Enterprise plans), Team Owners, and Developers with access to that project; **Internal Builders cannot publish to production, so they cannot make a project public**. Password Protection — a Developer changes it per site, a Team Owner sets the team default.
- **Advanced Web Security runs before password/login prompts** — a blocked IP hits an error page before ever seeing the prompt. Internal order: Firewall Traffic Rules → WAF → Rate limiting.
- **Third-party webhooks (Slack, Stripe, etc.) cannot reach a private project** — receiving webhooks requires the project to be **public**.
- **Make public** requires at least one successful **production deploy**.
- **Protecting only non-production deploys** with Password Protection is **Enterprise only**.
- **Plan gating:** Basic password protection for the whole site → all Pro plans; all Password Protection options → Enterprise. Project visibility (public/private, private-by-default) → Credit-based Free/Personal/Pro only; password-protected visibility → Pro only. On Free/Personal a private project is visible only to the Team Owner (single-seat); Pro allows unlimited members.
- **Team default changes by creation date:** teams created on/after **July 28, 2026** default to **Private for new projects**; earlier teams default to **Public**.
- **Renamed:** "site-wide password protection" (old name of a Password Protection option); "Selective password protection" → Basic authentication with custom HTTP headers.
Reference: https://docs.netlify.com/manage/security/secure-access-to-sites/overview/ · https://docs.netlify.com/manage/security/secure-access-to-sites/password-protection/ · https://docs.netlify.com/manage/security/secure-access-to-sites/project-visibility/
<!-- Advanced Web Security (WAF, Firewall Traffic Rules, rate limiting) specifics — limits, config keys, plan gating — not in source; referenced by URL only. -->
<!-- Exact per-tier matrix of basic vs team-login options across plans is only partially stated in sources. -->
<!-- system: agent-context/access-control/system.md — human-owned, merged by ctx-gen; edit system.md, not this section -->
# Netlify house rules (access-control)
These are org conventions, not docs facts — merged into the rendered skill by
ctx-gen and never generated. Owned by the skills maintainer.
1. This is a routing/disambiguation skill: keep it narrow — its job is
picking the right protection layer, not teaching each one.
2. The combined Password-Protection + Identity pattern lives in this skill's
`references/two-layer-pattern.md`.
3. "Auth" on Netlify is three unrelated layers users constantly conflate:
Netlify Identity ("who is this user inside my app" — issues `nf_jwt`),
Password Protection / project visibility ("can this request load the site
at all"), and Team/Org SAML SSO ("can you log in to the Netlify
dashboard"). Sessions are separate; the same provider (Google) can appear
in two unrelated places — Identity OAuth for app users, SAML IdP for team
members. Disambiguate before recommending anything.
4. The double login is real: a Password-Protection/team-login perimeter
session and an Identity app session have no bridge — no shared cookie, no
header forwarding, no JWT exchange. Don't burn iterations wiring them
together; tradeoffs live in `references/two-layer-pattern.md`.
5. These settings have no public API, CLI command, or MCP tool. Never curl
`api.netlify.com` or read local auth tokens to inspect or change them —
hand the user the dashboard path and checklist; on failure, report what
you tried and stop.
6. Identity setup, auth code, and OAuth providers for app users belong to the
netlify-identity skill — route there; this skill only picks the layer.
7. For company-wide app-level SSO with a single sign-in (no double login),
the Auth0 extension — federating to the corporate IdP — is the
recommendation before the two-layer stack.
8. The description's triggers must include the SSO-session symptoms users
actually report — "logged out mid-session", 401s on an SSO-protected
site, token expiry/refresh — not only setup phrasing. The
`Netlify-Site-Protection-Expires-In` guidance is unreachable if the
skill never triggers on the symptom.
9. Team login protection excludes Git Contributors, and the answer to that is
**Reviewers**, never a Developer seat. Reviewers can open team-login-
protected deploys: unlimited and not counted toward the member count on
legacy plans, Pro or higher on Credit-based plans. Every answer about Git
Contributor access must name the Reviewer path — recommending an upgrade to
Developer sells a paid seat per person to solve something the product
already solves for free. Stating the exclusion without the remedy is the
failure mode this rule exists to prevent; it has happened. Never frame the
permitted roles as a closed list ("only X, Y and Z get in") — even with the
Reviewer path added after it, a closed list reads as Reviewers being shut
out, and agents repeat it. Naming roles is optional; the question is
usually only about Git Contributors.
10. Say who can change these settings, not only how to change them. Project
visibility: Organization Owners (on certain Enterprise plans), Team Owners,
and Developers with access to that project — and Internal Builders cannot
make a project public, because they cannot publish to production. Password
Protection: a Developer per site, a Team Owner for the team default. A
checklist handed to someone without the role is a dead end.
## skills/netlify-agent-runner/SKILL.md
---
name: netlify-agent-runner
description: 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, get a second opinion from another model, or delegate development tasks to run remotely against their repo.
---
# Netlify Agent Runner
Run AI coding agents (Claude, Codex, Gemini) remotely on Netlify infrastructure to automate development tasks on your site.
## Prerequisites
- The site must be **linked to a Netlify project** (via `netlify link` or `netlify init`).
- **Or skip linking entirely:** pass `--project <name>` (a project ID or name) directly to `netlify agents:create` to target any Netlify site without linking first.
- The Netlify CLI must be installed and authenticated
- Agent runs **consume plan credits**. If the account has no available credits — or the agent/AI usage limit has been reached — `netlify agents:create` is **blocked** and the run won't start. That's an account/plan-state issue to surface to the user, not something to work around.
## Use only documented CLI surfaces
Interact with agent tasks only through the documented `netlify agents:*` commands (plus `netlify --help` and the public CLI reference). Do **not** go around the CLI:
- **Do not curl `https://api.netlify.com/...`** to fetch, create, or stop a task — the endpoint shapes are not part of the public contract.
- **Do not run `netlify api <method>`** as a recovery hatch when a documented command fails.
- **Do not read auth tokens** out of `~/Library/Preferences/netlify/config.json` (or anywhere on disk) to authenticate side-channel calls.
If a documented command fails, report the exact error and context to the user and stop — don't invent an undocumented way to reach the task.
## How Agent Tasks Run
Read this before creating a task — agent tasks behave differently from running an agent locally, and the differences are easy to miss.
- **Remote, not local.** Tasks run on Netlify infrastructure, not on your machine. They operate on the site's **connected repository**, not your local working tree. The remote agent only sees what has been pushed to the remote — it cannot see uncommitted or unpushed changes.
- **Branch-based.** By default a task runs against the production branch (`main` or `master`). To choose a different *base* branch for the agent to start from, use `-b <branch>` and make sure that branch has been **pushed to the remote first**, or the agent will be working from code that doesn't exist remotely. `-b` sets the base (starting) branch — not where the results are written (see the next bullet).
- **Output lands on a new branch — not in place.** The agent does **not** commit its changes onto the base branch you selected. It pushes its work to a **new branch** with its own **Deploy Preview**, so your existing branch (or `main`) is never overwritten. Review the task's results on that new branch / Deploy Preview — don't expect the base branch to change directly.
- **Asynchronous.** `netlify agents:create` returns as soon as the task is queued — it does **not** block until the work is finished. When the command returns, the task is still running remotely.
- **No webhooks or callbacks.** Nothing notifies you when a task changes state or completes. To find out what's happening, you have to **poll** with `netlify agents:show <task-id>` or `netlify agents:list`.
- **Statuses are terminal or not.** A task moves through `new` → `running` → one of `done`, `error`, or `cancelled`. Keep polling until the status is one of those last three before you act on the results.
### Typical workflow
1. **Create** a task: `netlify agents:create "<prompt>" -a <agent>`. Note the task ID it returns (use `--json` to capture it reliably).
2. **Poll** for status: `netlify agents:show <task-id>`. Repeat periodically — there is no completion notification — until the status is `done`, `error`, or `cancelled`.
3. **Review** the results once the task reaches `done` (or inspect the failure on `error`).
## Creating Agent Tasks
```bash
# Run a prompt with the default agent
netlify agents:create "Add a contact form"
# Choose a specific agent: claude, codex, or gemini
netlify agents:create --prompt "Add dark mode" --agent claude
netlify agents:create -p "Update the README" -a codex
netlify agents:create -p "Write unit tests" -a gemini
# Target a specific branch
netlify agents:create -p "Fix the login bug" -a claude -b feature-branch
# Specify a project by name (if not in a linked directory)
netlify agents:create "Add tests" --project my-site-name
# Output result as JSON
netlify agents:create "Add a footer" --json
```
### Options
| Flag | Description |
|------|-------------|
| `-a, --agent <agent>` | Agent type: `claude`, `codex`, or `gemini` |
| `-p, --prompt <prompt>` | The prompt for the agent to execute |
| `-b, --branch <branch>` | Git branch to work on |
| `-m, --model <model>` | Model to use for the agent |
| `--project <project>` | Project ID or name |
| `--json` | Output result as JSON |
## Managing Agent Tasks
All `netlify agents:*` commands are **project-scoped** — they operate on a single project (the one your directory is linked to, or the one named with `--project <name>`), not on your whole team. `netlify agents:list` shows the tasks for that one project only; there is no team-wide command that lists tasks across all your sites. To see a different site's tasks, run from its linked directory or pass `--project <name>` for it.
### List tasks
```bash
# List all tasks for the current site
netlify agents:list
# Filter by status
netlify agents:list --status running
netlify agents:list --status done
netlify agents:list --status error
# Output as JSON
netlify agents:list --json
```
Status values: `new`, `running`, `done`, `error`, `cancelled`.
### Show task details
```bash
netlify agents:show <task-id>
netlify agents:show <task-id> --json
```
### Stop a running task
```bash
netlify agents:stop <task-id>
```
## Use Cases
Some of the many things you can do with Agent Runners:
| Category | Example prompt |
|----------|---------------|
| Prototyping / internal tools | "Build an internal dashboard for our HR team" |
| Code reviews | "Audit the code with fresh eyes and identify areas for improvement" |
| Security audits | "Do a deep security audit of our codebase to identify any potential issues" |
| Feature suggestions | "Based on our current codebase & docs, what should we build next?" |
| Performance improvements | "Scan our codebase for performance bottlenecks and suggest improvements" |
| Telemetry & analytics | "What analytics things are we not tracking but probably should" |
| SEO audit | "Audit our site for SEO issues — missing meta tags, broken links, slow pages, missing alt text" |
| Copy improvements | "Rewrite our landing page copy to be more compelling and conversion-focused" |
| Accessibility | "Run an accessibility audit and fix all WCAG 2.1 AA violations" |
| Mobile responsiveness | "Improve the mobile responsiveness — audit every page on small viewports" |
| End-to-end tests | "Add end-to-end tests for our critical user flows using Playwright" |
| Unit tests | "Generate unit tests for our untested utility functions" |
| Documentation | "Generate a README and contributing guide based on our codebase" |
| Error handling | "Add proper error boundaries, logging, and user-friendly error states throughout the app" |
| UX polish | "Add loading states, skeleton screens, & transitions to improve perceived performance" |
| Form hardening | "Add form validation, rate limiting, and spam protection to our contact form" |
| Edge Functions | "Add an edge function for A/B testing on our landing page" |
## Using as an Agent
If you are an AI agent, you can use `netlify agents:create` to delegate work to an agent running remotely on Netlify — for example, to get a second opinion from a different model.
**IMPORTANT — ask for permission first, as a distinct confirmation step.** Agent tasks run on Netlify infrastructure and cost the user credits, so a real approval gate matters. Get explicit permission before running any `netlify agents:create` command — and treat that as its own turn, separate from the user's original request. A directive-sounding prompt ("start a task…", "use the claude agent and pin it to Opus") is **not** itself the approval: it tells you what they want, but the billable command still waits for a yes.
Make the permission request a concrete proposal, not a menu:
- **The exact command**, filled in — e.g. `netlify agents:create -p "<the real prompt>" -a codex` — not a `<placeholder>` and not a pick-one list of agents.
- **One agent, already chosen** — commit to a single `-a` value and say why you picked it ("codex for a second opinion on the auth logic"), rather than offering claude/codex/gemini as interchangeable options.
- **Why**, plus **what happens after "yes"**: the run is asynchronous — `agents:create` returns as soon as the task is queued, there's no callback, and you'll poll `netlify agents:show <task-id>` for the outcome.
- **Even if a prerequisite is missing** (not authenticated, not linked to a site, not a git repo yet), still show the exact command and chosen agent you'll run *once it's resolved* — surface the blocker **and** the concrete proposal, rather than collapsing to only describing the blocker.
Never run these commands without the user's approval.
Before delegating, understand what you're handing off (see [How Agent Tasks Run](#how-agent-tasks-run) above):
- **It runs remotely against the pushed branch — not your local work.** The remote agent only sees code that has been committed and pushed. Do **not** delegate work that depends on your local, in-progress changes; the remote agent can't see them and will work from stale code. If a task needs your current changes, commit and push them first (or finish the work yourself).
- **It's asynchronous — delegating does not block you.** The task runs remotely while you keep wor

