davila7/claude-code-templates / cli-tool/components/skills/development/netlify-deploy
netlify-deploy
VerifiedDeploy web projects to Netlify using the Netlify CLI (`npx netlify`). Use when the user asks to deploy, host, publish, or link a site/repo on Netlify, including preview and production deploys.
| File | Kind | Size |
|---|---|---|
| LICENSE.txt | markdown | 10.5 KB |
| SKILL.md | skill md | 6.9 KB |
| agents/openai.yaml | config | 318 B |
| assets/netlify-small.svg | other | 1.3 KB |
| assets/netlify.png | binary | 933 B |
| references/cli-commands.md | markdown | 2.6 KB |
| references/deployment-patterns.md | markdown | 6.5 KB |
| references/netlify-toml.md | markdown | 3.9 KB |
references/netlify-toml.md
View on GitHub# netlify.toml Configuration Reference
Configuration file for Netlify builds and deployments.
## Basic Structure
```toml
[build]
command = "npm run build"
publish = "dist"
```
## Build Settings
### Common Configuration
```toml
[build]
# Command to build your site
command = "npm run build"
# Directory to publish (relative to repo root)
publish = "dist"
# Functions directory
functions = "netlify/functions"
# Base directory (if not repo root)
base = "packages/frontend"
# Ignore builds for specific conditions
ignore = "git diff --quiet HEAD^ HEAD package.json"
```
## Environment Variables
```toml
[build.environment]
NODE_VERSION = "18"
NPM_FLAGS = "--prefix=/dev/null"
[context.production.environment]
NODE_ENV = "production"
```
## Framework Detection
Netlify auto-detects frameworks, but you can override:
### Next.js
```toml
[build]
command = "npm run build"
publish = ".next"
```
### React (Vite)
```toml
[build]
command = "npm run build"
publish = "dist"
```
### Vue
```toml
[build]
command = "npm run build"
publish = "dist"
```
### Astro
```toml
[build]
command = "npm run build"
publish = "dist"
```
### SvelteKit
```toml
[build]
command = "npm run build"
publish = "build"
```
## Redirects and Rewrites
```toml
[[redirects]]
from = "/old-path"
to = "/new-path"
status = 301
[[redirects]]
from = "/api/*"
to = "https://api.example.com/:splat"
status = 200
# SPA fallback (for client-side routing)
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
```
## Headers
```toml
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
Content-Security-Policy = "default-src 'self'"
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
```
## Context-Specific Configuration
Deploy different settings per context:
```toml
# Production
[context.production]
command = "npm run build:prod"
[context.production.environment]
NODE_ENV = "production"
# Deploy previews
[context.deploy-preview]
command = "npm run build:preview"
# Branch deploys
[context.branch-deploy]
command = "npm run build:staging"
# Specific branch
[context.staging]
command = "npm run build:staging"
```
## Functions Configuration
```toml
[functions]
directory = "netlify/functions"
node_bundler = "esbuild"
[[functions]]
path = "/api/*"
function = "api"
```
## Build Plugins
```toml
[[plugins]]
package = "@netlify/plugin-lighthouse"
[plugins.inputs]
output_path = "reports/lighthouse.html"
[[plugins]]
package = "netlify-plugin-submit-sitemap"
[plugins.inputs]
baseUrl = "https://example.com"
sitemapPath = "/sitemap.xml"
```
## Edge Functions
```toml
[[edge_functions]]
function = "geolocation"
path = "/api/location"
```
## Processing
```toml
[build.processing]
skip_processing = false
[build.processing.css]
bundle = true
minify = true
[build.processing.js]
bundle = true
minify = true
[build.processing.html]
pretty_urls = true
[build.processing.images]
compress = true
```
## Common Patterns
### Single Page Application (SPA)
```toml
[build]
command = "npm run build"
publish = "dist"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
```
### Monorepo with Base Directory
```toml
[build]
base = "packages/web"
command = "npm run build"
publish = "dist"
```
### Multiple Redirects with Country-Based Routing
```toml
[[redirects]]
from = "/"
to = "/uk"
status = 302
conditions = {Country = ["GB"]}
[[redirects]]
from = "/"
to = "/us"
status = 302
conditions = {Country = ["US"]}
```
## Validation
Validate your netlify.toml:
```bash
npx netlify build --dry
```
## Resources
- Full configuration reference: https://docs.netlify.com/configure-builds/file-based-configuration/
- Framework-specific guides: https://docs.netlify.com/frameworks/
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |