netlify-deploy-deployment-patterns

Examples of common ways to deploy projects on Netlify, a web hosting platform. The main pattern connects a Git repository so Netlify builds after pushes and creates preview URLs for pull requests.

In plain words
What is it for?
Use it to set up continuous deployment, deploy previews, branch deployments, or manual CLI and artifact uploads with netlify.toml.
Why use it?
It helps choose between automatic Git deployments and manual uploads and explains when each deployment is created.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/netlify/context-and-tools/netlify-deploy-deployment-patterns
Clone the repo
git clone --depth 1 https://github.com/netlify/context-and-tools
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,220 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.01220
Opus 5 $0.00007 $0.00610
Sonnet 5 $0.00003 $0.00244
Haiku 4.5 $0.00001 $0.00122

Measured 2d ago against content hash a0e3b583fe1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

netlify-deploy-deployment-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cursor/rules/netlify-deploy-deployment-patterns.mdc · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Netlify Deployment Patterns

Common deployment scenarios for Netlify. The primary path is Git-based continuous deployment (Netlify builds and deploys on every push); manual CLI uploads are the exception for prototypes, Git-less projects, and CI artifact uploads.

Don't gate deploys behind a netlify status pre-check. Run the real command; if it fails with an auth or link error, that failure tells you what to fix.

Pattern 1: Git-Based Continuous Deployment (primary)

Context: A project in a Git repository that should deploy automatically.

Setup once:

netlify init   # Creates/links a site and connects Git CI/CD

After that, Netlify builds on its own servers on every push:

  • Push to the production branch → production deploy.
  • Open a pull request → deploy preview with a unique URL.
  • Push to another branch → branch deploy, only if branch deploys are enabled (off by default; enable in the site's build & deploy settings).

Configure the build command, publish directory, and base directory in netlify.toml (see the netlify-config skill). No local build or upload step is needed — the build happens on Netlify.

Pattern 2: Linking an Existing Repo to an Existing Site

Context: A site already exists on Netlify and you want the local repo linked to it.

# Link by Git remote
netlify link --git-remote-url https://github.com/user/my-app.git

# Or link interactively (pick from a list)
netlify link

If the site can't be found, create one with netlify init.

Pattern 3: Manual / Local Deploy (secondary)

Context: A prototype, a project with no Git remote, or a CI pipeline that builds elsewhere and uploads the artifact.

# Draft deploy (preview URL) to test the upload
netlify deploy --dir=dist

# Production deploy
netlify deploy --dir=dist --prod

--dir names the already-built output directory to upload. Omit it to let the CLI resolve the publish directory from netlify.toml. If the site also has Git CD connected, remember a manual --prod deploy is replaced by the next push to the production branch unless you lock the deploy in the UI.

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 114 lines · 14 tokens per session scan A a0e3b583fe1d

Subscribe to this mod's changes

netlify-deploy-deployment-patterns is a cursor rule published in the GitHub repository netlify/context-and-tools (36 stars, last pushed 6d ago), licensed MIT. It adds 14 tokens to every session and 1,220 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other cursor rules, from other repositories

aws-ecs

Definitive guidelines for building, deploying, and operating applications on AWS ECS, emphasizing immutable containers, secure secrets management, and robust operational patterns.

sanjeed5/awesome-cursor-rules-mdc · 2,640 tokens

redteam-compute

Compute security sub-agent for an Azure red team engagement. Covers VMs, VMSS, App Service, and Functions. Finds disk encryption gaps, exposed managed identities, plaintext secrets, runCommand exposure, FTP/remote-debug, and missing auth. Containers and Kubernetes (AKS, ACR, Container Apps/Instances) are owned by the…

Contoso-State/red-team-agent-orchestration · 85 tokens

cloud-workload-cost-estimator

Pre-deployment cost modeling for new workloads, architecture alternatives, and migration plans. Produces estimates the FinOps and Engineering teams both trust, with explicit assumptions and sensitivity ranges.

Cletrics/finops-agents · 35 tokens

powertools-parameters

Powertools Parameters - getParameter (SSM), getSecret (Secrets Manager), getAppConfig, built-in caching with maxAge, transform JSON/binary, environment-aware parameter paths.

GoranErhartic/cursor-development-rules · 36 tokens

union-mcp-v2

Rules for using the Union MCP v2 server to run compute- or io-intensive workloads on Flyte.

unionai-oss/union-mcp · 1,872 tokens

aws-rds-best-practices

AWS RDS PostgreSQL best practices - database configuration, connection management, authentication, backup, and performance optimization standards.

beettlle/CursorRules · 0 tokens