netlify-deploy-netlify-toml

netlify-deploy-netlify-toml is a cursor rule for coding agents from netlify/context-and-tools. It costs 20 tokens per session (676 once invoked), scanned A, original, MIT.

A rule for configuring how Netlify builds and publishes a website through netlify.toml. Netlify is a service that builds and deploys websites, while a monorepo stores multiple projects in one repository.

In plain words
What is it for?
Setting build commands, publish folders, base directories, serverless-function folders, and rules for skipping unnecessary builds.
Why use it?
It clarifies which folder Netlify builds and publishes, especially when the site lives inside a monorepo, reducing deployment configuration mistakes.

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-netlify-toml
Clone the repo
git clone --depth 1 https://github.com/netlify/context-and-tools

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for netlify-deploy-netlify-toml

README.md
[![agentmods](https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-deploy-netlify-toml.svg)](https://agentmods.dev/rules/netlify/context-and-tools/netlify-deploy-netlify-toml)
Your own site
<a href="https://agentmods.dev/rules/netlify/context-and-tools/netlify-deploy-netlify-toml"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-deploy-netlify-toml.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 676 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.00020 $0.00676
Opus 5 $0.00010 $0.00338
Sonnet 5 $0.00004 $0.00135
Haiku 4.5 $0.00002 $0.00068

Measured 5d ago against content hash e8440d6b3725, 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-netlify-toml 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 5d 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-netlify-toml.mdc · 71 lines

How it starts

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

netlify.toml — Build Configuration for Deploys

netlify.toml at the repository root controls how Netlify builds and deploys the site (in monorepos, the first config found wins — see the discovery order under "Monorepo with a Base Directory" below). This reference covers the deploy-relevant build settings. For the complete netlify.toml syntax — redirects, headers, deploy contexts, functions and edge-functions config, plugins, and the Image CDN block — see the netlify-config skill, which is the source of truth for configuration.

Build Settings

[build]
  # Command to build the site
  command = "npm run build"

  # Directory to publish, relative to `base` when set, otherwise the repo root
  publish = "dist"

  # Base directory the build runs from (default: repo root)
  base = "packages/frontend"

  # Functions directory (default: netlify/functions)
  functions = "netlify/functions"

  # Skip a build when nothing relevant changed
  ignore = "git diff --quiet HEAD^ HEAD package.json"

publish is resolved relative to base. With base = "packages/frontend" and publish = "dist", Netlify publishes packages/frontend/dist — not dist at the repo root. Set publish relative to the base directory or the deploy will fail with "publish directory not found."

netlify.toml overrides the Netlify UI. When a build setting is in both, the committed file wins; the UI field becomes inert until you change the file and redeploy.

Monorepo with a Base Directory

[build]
  base = "packages/web"
  command = "npm run build"
  publish = "dist"    # publishes packages/web/dist

In a monorepo, Netlify uses the first netlify.toml it finds: the package directory, then the base directory, then the repo root.

Build-Time Environment and Context Overrides

Build-scoped environment variables and per-context build overrides can live in netlify.toml:

[build.environment]
  NODE_VERSION = "20"

[context.production]
  command = "npm run build:prod"

[context.deploy-preview]
  command = "npm run build:preview"

Read the full file on GitHub · 71 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. 5d ago First seen · 71 lines · 20 tokens per session scan A e8440d6b3725

Subscribe to this mod's changes

netlify-deploy-netlify-toml is a cursor rule published in the GitHub repository netlify/context-and-tools (36 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 676 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.