agentsclimarketplace

Edge functions

Skill Ampli-Group/agentic-mobile-blueprint/.agents/skills/edge-functions

Supabase Edge Function development patterns with Deno runtime. Use when creating, modifying, or debugging edge functions. For Langfuse tracing see the langfuse-tracing skill. For Sentry error handling see the sentry-integration skill.From its SKILL.md

Install
npx -y skills add Ampli-Group/agentic-mobile-blueprint --skill edge-functions

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

3 things to look at

  • reads credentialsReads from 1 credential source: `supabase/functions/.env.local`.
  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 2 commands, including `mise run supabase:function` and 1 more.

SKILL.md

2.1 KB, 477 tokens by cl100k_base, as published. Nobody here has run it

Supabase Edge Functions

Runtime

Deno. Entry point: Deno.serve(). Files live in supabase/functions/<name>/index.ts.

New Function Scaffold

import { initSentry, handleError } from "../_shared/sentry.ts";

initSentry();

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

Deno.serve(async (req: Request) => {
  if (req.method === "OPTIONS") return new Response("ok", { headers: corsHeaders });

  try {
    const body = await req.json();
    const result = { message: "Hello" };
    return new Response(JSON.stringify(result), {
      headers: { ...corsHeaders, "Content-Type": "application/json" },
    });
  } catch (error) {
    return handleError(error, { functionName: "my-function", corsHeaders });
  }
});

For AI calls, wrap with withTrace() — see the langfuse-tracing skill.

Imports

  • Shared code: ../_shared/sentry.ts, ../_shared/langfuse/gemini.ts
  • External: via import map in supabase/functions/deno.json
  • Convention: npm: prefix for npm packages, URLs for Deno packages

Calling from Frontend/Mobile

const { data, error } = await supabase.functions.invoke('my-function', {
  body: { prompt: 'Hello' },
});

Database Migrations

Path: supabase/migrations/. Naming: 00000000000000_slug.sql.

Rules:

  • Enable RLS on every table
  • Policies use auth.uid() for row-level access
  • Add updated_at trigger for mutable tables
  • Index foreign keys and common filter columns
  • Storage bucket policies: auth.uid()::text = (storage.foldername(name))[1]

Local Development

mise run supabase:function   # Starts functions with hot reload

Env vars for functions go in supabase/functions/.env.local.

Deploy

supabase functions deploy <function-name>

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.