---
name: netlify
description: Operating guidance for AI agents building, deploying, and managing production-ready sites and web apps on Netlify
version: 1.0.0
---

# Netlify Agent Skill

Netlify is the platform for building and deploying production-ready sites and web apps without managing infrastructure. Connect a Git repo and Netlify handles CI/CD, global CDN delivery, serverless functions, edge computing, managed Postgres, and more.

## Key platform primitives

| Primitive | Purpose | Docs |
|---|---|---|
| **Functions** | On-demand or scheduled serverless TypeScript/JS | https://docs.netlify.com/build/functions/overview.md |
| **Edge Functions** | Deno-based functions that run at the CDN edge | https://docs.netlify.com/build/edge-functions/overview.md |
| **Async Workloads** | Event-driven, durable background processing | https://docs.netlify.com/build/async-workloads/overview.md |
| **Netlify Database** | Managed Postgres with branch isolation | https://docs.netlify.com/build/data-and-storage/netlify-database.md |
| **Blobs** | Key-value and binary object store, zero config | https://docs.netlify.com/build/data-and-storage/netlify-blobs.md |
| **Image CDN** | On-the-fly image transforms via URL params | https://docs.netlify.com/build/image-cdn/overview.md |
| **Forms** | HTML form handling, no server code needed | https://docs.netlify.com/manage/forms/setup.md |

## Configuration

All Netlify config lives in `netlify.toml` at the project root. Key sections:

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

[[redirects]]
  from = "/old-path"
  to = "/new-path"
  status = 301

[[headers]]
  for = "/*"
  [headers.values]
  X-Frame-Options = "DENY"
```

Reference: https://docs.netlify.com/build/configure-builds/file-based-configuration.md

## Functions

Place function files in `netlify/functions/`. Use TypeScript (`.mts`) by default.

```typescript
// netlify/functions/hello.mts
import type { Context } from "@netlify/functions";

export default async (req: Request, context: Context) => {
  return new Response("Hello, world!");
};
```

- Use `Netlify.env.*` for environment variables, not `process.env`
- First argument is a standard `Request` object
- Second argument is a Netlify `Context` object with geo, account, and deploy info

## Edge Functions

Place edge function files in `netlify/edge-functions/`. Runtime is Deno.

```typescript
// netlify/edge-functions/hello.ts
import type { Context } from "@netlify/edge-functions";

export default async (request: Request, context: Context) => {
  return new Response("Hello from the edge!");
};
```

Declare routes in `netlify.toml`:

```toml
[[edge_functions]]
  path = "/hello"
  function = "hello"
```

## Deploy flow

1. Connect a Git repo in the Netlify dashboard or `netlify link`
2. Set build command and publish directory in `netlify.toml` or the dashboard
3. Push to trigger a deploy; every pull request gets an automatic Deploy Preview
4. Promote to production with `netlify deploy --prod` or by merging to the production branch

## MCP server (agent-driven deploys)

```json
{
  "mcpServers": {
    "netlify": {
      "command": "npx",
      "args": ["-y", "@netlify/mcp"]
    }
  }
}
```

For Claude Code: `claude mcp add --transport http netlify https://mcp.netlify.com/mcp`

## Skills (fine-grained context per feature)

Install all Netlify Skills into your agent:

```bash
npx skills add netlify/context-and-tools --skill '*' --yes
```

Full skills repository: https://github.com/netlify/context-and-tools

## Documentation index

Full index: https://docs.netlify.com/llms.txt
