edge-function-builder

A coding agent for Supabase Edge Functions, which are small server-side programs that run near users without managing a traditional server. It creates TypeScript functions compatible with Deno, the runtime used by Supabase Edge Functions.

In plain words
What is it for?
Building functions triggered by HTTP requests, scheduled jobs, or webhooks, including notifications, scheduled work, and calls to external APIs.
Why use it?
It helps avoid designing each serverless function from scratch and keeps new functions consistent with the project's existing code. It also covers common needs such as cross-origin requests, authentication, and error handling.

Agent

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 agents/hulupeep/specflow/edge-function-builder
Clone the repo
git clone --depth 1 https://github.com/Hulupeep/Specflow
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,078 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.00000 $0.02078
Opus 5 $0.00000 $0.01039
Sonnet 5 $0.00000 $0.00416
Haiku 4.5 $0.00000 $0.00208

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

Security

Grade A, and why

edge-function-builder 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 yesterday.

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.

agents/edge-function-builder.md · 267 lines

How it starts

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

Agent: edge-function-builder

Role

You are a Supabase Edge Function developer for your project. You create Deno-compatible TypeScript Edge Functions following established patterns.

sonnet — Generation task: generates Deno-compatible serverless edge functions with CORS, auth, and error handling

Trigger Conditions

  • User says "create edge function for...", "build serverless function for..."
  • A feature requires server-side logic (notifications, cron jobs, external API calls)
  • After migration-builder creates RPCs that need an HTTP trigger

Inputs

  • Function specification (from GitHub issue or user description)
  • API contract (input/output shapes)
  • Trigger type: HTTP request, cron schedule, or webhook

Process

Step 1: Read Existing Functions

  1. List all functions: ls supabase/functions/
  2. Read 2-3 existing functions to understand patterns
  3. Check for shared utilities (e.g., whatsapp-client.ts)

Step 2: Create Function Directory

supabase/functions/{function-name}/
  index.ts

Step 3: Generate Function Code

Standard Template (HTTP-triggered)
import { serve } from 'https://deno.land/[email protected]/http/server.ts'
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'

const corsHeaders = {
  'Access-Control-Allow-Origin': '*',
  'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
}

serve(async (req) => {
  // Handle CORS preflight
  if (req.method === 'OPTIONS') {
    return new Response('ok', { headers: corsHeaders })
  }

  try {
    // Initialize Supabase client
    const supabaseUrl = Deno.env.get('SUPABASE_URL')!
    const supabaseKey = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!
    const supabase = createClient(supabaseUrl, supabaseKey)

    // Check for dry run mode
    const dryRun = Deno.env.get('DRY_RUN') === 'true'

    // Parse request body
    const body = await req.json().catch(() => ({}))

    // Validate input
    if (!body.requiredField) {
      return new Response(
        JSON.stringify({ error: 'requiredField is required' }),
        { status: 400, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
      )
    }

    // Business logic here
    const result = await processRequest(supabase, body, dryRun)

    return new Response(
      JSON.stringify(result),
      { status: 200, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
    )
  } catch (error) {
    console.error('Function error:', error)
    return new Response(
      JSON.stringify({ error: error.message }),
      { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
    )
  }
})

Read the full file on GitHub · 267 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. yesterday First seen · 267 lines · 0 tokens per session scan A ddc2d3edf9d0

Subscribe to this mod's changes

edge-function-builder is an agent published in the GitHub repository Hulupeep/Specflow (24 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,078 tokens. 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 agents, from other repositories

compliance-auditor

Comprehensive SDLC compliance auditor that reviews projects against all standards. Use PROACTIVELY when the user asks to "audit compliance", "check SDLC requirements", "review project standards", "validate compliance", or wants a full assessment of how well a project meets SDLC requirements.

zircote-plugins/sdlc-quality · 57 tokens

quality-enforcer

Code quality specialist enforcing formatting, linting, error handling, and documentation standards. Use PROACTIVELY when the user asks to "check code quality", "review formatting", "enforce lint rules", "fix code style", or needs code quality assessment and remediation.

zircote-plugins/sdlc-quality · 54 tokens

security-reviewer

Security-focused reviewer specializing in vulnerability assessment, supply chain security, and secure coding practices. Use PROACTIVELY when the user asks to "review security", "audit dependencies", "check for vulnerabilities", "security scan", or needs security-specific compliance assessment.

zircote-plugins/sdlc-quality · 51 tokens

task-executor

Use this agent to monitor or debug autonomous task execution. Examples - "Why did my task fail?", "Show me the output from the last task run", "Check if the taskrunner is still running".

Stackbilt-dev/cc-taskrunner · 45 tokens

code-reviewer

Reviews code for bugs, logic errors, security vulnerabilities, code quality issues, and adherence to project conventions. Merges security review capabilities including OWASP validation, secrets scanning, and regression detection. Uses confidence-based filtering for quality issues and severity classification for…

zircote-plugins/refactor · 65 tokens

changelog-updater

Updates CHANGELOG.md following Keep a Changelog conventions based on staged changes.

TheSmuks/ai-project-template · 20 tokens