agentleFS
AayushMSAayushMS/deploy-skills/skills/deploy-netlify/SKILL.md

deploy-netlify

Skill0 starsChanged 9 months agoMITView on GitHub

Use this skill when the user asks to "deploy to Netlify", "host my frontend on Netlify", "deploy my React app to Netlify", "deploy my static site to Netlify", or when invoked by deploy-project for frontend deployment as an alternative to Vercel. Deploys using netlify CLI, auto-detects build command and publish directory, sets environment variables, and deploys to production. Exports NETLIFY_SITE_ID and NETLIFY_URL. Free tier: 100GB bandwidth/month, 125k function invocations.

  • Reads credentials
  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Before deploying, detect from package.json:

    line 17
  2. Very specific:

    If netlify.toml exists at project root, it already has these settings — don't override.

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Deploy to Netlify

Netlify is used for frontend deployment (React, Vite, Next.js static, SvelteKit, Astro). Alternative to Vercel — both are free. Use Netlify if the project has a netlify.toml or if Vercel is already in use for another service.

Prerequisites

  • Netlify CLI installed: netlify --version (install: npm install -g netlify-cli)
  • Logged in: netlify status (run setup-auth if not)

Auto-detect Build Settings

Before deploying, detect from package.json:

  • Build command: check scripts.build, else npm run build
  • Publish directory: check in order: dist/, build/, .next/, out/, public/ — use first that exists after build

If netlify.toml exists at project root, it already has these settings — don't override.

Deployment Workflow

1. Create site (first time only)

cd <frontend-dir>
# Check if already linked
netlify status 2>/dev/null | grep "Site ID" && ALREADY_LINKED=true

if [ -z "$ALREADY_LINKED" ]; then
  netlify sites:create --name "$(basename $(pwd) | tr '[:upper:]' '[:lower:]' | tr '_' '-')"
fi

2. Set environment variables

# Set the backend URL (replace with actual value from deploy-render output)
netlify env:set VITE_API_URL "$BACKEND_URL" --context production 2>/dev/null || true
netlify env:set NEXT_PUBLIC_API_URL "$BACKEND_URL" --context production 2>/dev/null || true
netlify env:set REACT_APP_API_URL "$BACKEND_URL" --context production 2>/dev/null || true
# Set all from .env.example that don't contain secrets

3. Deploy to production

netlify deploy --prod --build

This builds and deploys in one step. The --build flag runs the build command from netlify.toml or package.json.

4. Get deployed URL

NETLIFY_URL=$(netlify status --json 2>/dev/null | python3 -c "
import sys,json
try:
  data = json.load(sys.stdin)
  print(data.get('siteData',{}).get('url',''))
except: pass
" 2>/dev/null)

NETLIFY_SITE_ID=$(netlify status --json 2>/dev/null | python3 -c "
import sys,json
try:
  data = json.load(sys.stdin)
  print(data.get('siteData',{}).get('id',''))
except: pass
")

echo "✓ Deployed: $NETLIFY_URL"
echo "Site ID: $NETLIFY_SITE_ID"

5. Verify deployment

HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 30 "$NETLIFY_URL")
if [ "$HTTP_STATUS" -ge 200 ] && [ "$HTTP_STATUS" -lt 400 ]; then
  echo "✓ Frontend is live: $NETLIFY_URL"
else
  echo "⚠ HTTP $HTTP_STATUS — deployment may still be propagating, check in 1-2 minutes"
fi

6. Save and export

cat >> DEPLOYMENT_DOCS/DEPLOYED_ENV.md << EOF

## Netlify
NETLIFY_URL=$NETLIFY_URL
NETLIFY_SITE_ID=$NETLIFY_SITE_ID
EOF
chmod 600 DEPLOYMENT_DOCS/DEPLOYED_ENV.md 2>/dev/null || true

Export: NETLIFY_URL, NETLIFY_SITE_ID for CI/CD setup.

Free Tier Notes

  • Bandwidth: 100GB/month
  • Function invocations: 125,000/month
  • Build minutes: 300/month
  • Suitable for most personal and small team projects

On Failure

  • Build fails: check build command, run npm run build locally first
  • netlify deploy authentication error: run netlify login again
  • Publish directory not found: specify with netlify deploy --prod --dir=dist

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.