netlify-functions

netlify-functions is a skill for Codex from PracticalSwan/agent-skills. It costs 127 tokens per session (5,004 once invoked), scanned D, a copy of netlify-functions, MIT.

A serverless function tool for Netlify websites. Serverless functions are small backend programs that run when called, without the developer managing a separate server.

In plain words
What is it for?
It helps create API endpoints, contact-form handlers, login hooks, streaming or AI proxy responses, scheduled jobs, and background tasks in TypeScript, JavaScript, or Go.
Why use it?
It provides a way to add backend behaviour to a site without building and operating a traditional application server.

Skill for Codex

Written for Codex: reads ~/.codex or $CODEX_HOME. Also seen: mentions Claude Code; mentions Codex.

Good fit It helps create API endpoints, contact-form handlers, login hooks, streaming or AI…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/practicalswan/agent-skills/netlify-functions
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.

Any agent
npx skills add PracticalSwan/agent-skills --skill netlify-functions
Clone the repo
git clone --depth 1 https://github.com/PracticalSwan/agent-skills

Made for: Codex.

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-functions

README.md
[![agentmods](https://agentmods.dev/badge/skills/practicalswan/agent-skills/netlify-functions.svg)](https://agentmods.dev/skills/practicalswan/agent-skills/netlify-functions)
Your own site
<a href="https://agentmods.dev/skills/practicalswan/agent-skills/netlify-functions"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/netlify-functions.svg" alt="Measured on agentmods" height="20"></a>
Per session 127 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,004 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod 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.1 $0.00127 $0.05004
Opus 5 $0.00063 $0.02502
Sonnet 5 $0.00025 $0.01001
Haiku 4.5 $0.00013 $0.00500

Measured today against content hash aed6a088f375, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade D, and why

netlify-functions scanned grade D with 2 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 today.

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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- system: agent-context/functions/system.md — human-owned, merged by ctx-gen; edit system.md, not this section -->

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

const res = await fetch("https://api.openai.com/v1/chat/completions", { method: "POST",
Origin

This is a copy

89% identical to netlify-functions — 55 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

netlify-functions/SKILL.md · 400 lines

How it starts

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

Netlify Functions

Reach for the modern default-handler API (.mts TypeScript). Export a default async handler taking a web Request and a Netlify Context, returning a web Response. Avoid the legacy AWS Lambda handler shape unless writing Go or migrating old code (see Legacy at the end).

File locations

  • Default directory: netlify/functions/ (relative to base directory). Keep it outside your publish directory or source files ship as static assets.
  • A function is one file or a subdirectory whose entry file is named index or matches the subdirectory name. All of these create a function hello:
    • netlify/functions/hello.mts
    • netlify/functions/hello/hello.mts
    • netlify/functions/hello/index.mts
  • Use .mts (TS) / .mjs (JS) for ES modules. .cts/.cjs force CommonJS; .ts/.js follow the nearest package.json "type".

Minimal function

No config export. Serves at /.netlify/functions/hello.

import type { Context } from "@netlify/functions"

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

Install types: npm install @netlify/functions (required for TS types; optional for JS).

Read env vars and secrets with Netlify.env.get():

const apiKey = Netlify.env.get("STRIPE_SECRET_KEY")

Never hardcode secrets. For the variable to exist at runtime its scope must include Functions. Variables set in netlify.toml are NOT available to functions. Values are frozen per deploy — change them and redeploy to apply.

Response headers are set in code on the returned Response. [[headers]] in netlify.toml, _headers, and redirect header rules apply ONLY to static CDN responses, not function responses. Do not add CORS headers unless explicitly requested.

Custom path routing

Set config.path to route to custom URLs. When set, the function serves ONLY at that path — not at /.netlify/functions/<name>.

import type { Config, Context } from "@netlify/functions"

export default async (req: Request, context: Context) => {
  const { city, country } = context.params
  return new Response(`You're visiting ${city} in ${country}!`)
}

export const config: Config = {
  path: "/travel-guide/:city/:country",
}

Read the full file on GitHub · 400 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today Changed aed6a088f375
  2. 3d ago First seen · 400 lines · 127 tokens per session scan D 464ce8bd0c32

Subscribe to this mod's changes

netlify-functions is a skill published in the GitHub repository PracticalSwan/agent-skills (13 stars, last pushed yesterday), licensed MIT. It adds 127 tokens to every session and 5,004 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it D with 2 findings (hidden instructions, sends data to an external url). It is 89% identical to netlify-functions, differing in 55 lines, and is treated as a copy.

Related

Other skills, from other repositories

stripe-projects

Provision SaaS services + sync creds via Stripe Projects.

NousResearch/hermes-agent · 15 tokens

azure-eventhub-dotnet

Azure Event Hubs SDK for .NET. Use for high-throughput event streaming: sending events (EventHubProducerClient, EventHubBufferedProducerClient), receiving events (EventProcessorClient with checkpointing), partition management, and real-time data ingestion. Triggers: "Event Hubs", "event streaming"…

microsoft/skills · 94 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

workers-best-practices

Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from…

cloudflare/skills · 72 tokens

django-storages-s3

Use when configuring Django to store static and media files on AWS S3 with django-storages. Invoke when working with the STORAGES setting, S3 buckets, presigned URLs, CloudFront, or boto3-backed file storage in settings.py. Configures the Django 4.2+ STORAGES dict, public/private custom backends, presigned GET/POST…

Jeffallan/claude-skills · 138 tokens

wikipedia

Search and read Wikipedia via x wkp — MediaWiki API, no API key, zero install; query, extract, suggest, and DDG route in one module. Load for wiki, wikipedia, encyclopedia lookup, article summary.

x-cmd/x-cmd · 49 tokens