edge-functions

Orchestrate LLM calls and embedding generation in Deno edge functions.

Updated Oct 26, 2025
One-click install
npx skills add https://github.com/discountedcookie/10x-mapmaster --skill edge-functions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: edge-functions
Source: https://github.com/discountedcookie/10x-mapmaster/tree/main/.opencode/skills/edge-functions
Command: npx skills add https://github.com/discountedcookie/10x-mapmaster --skill edge-functions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides Deno edge function patterns for external integrations, including CORS handling, request validation, OpenRouter/LLM calls, and embedding generation. Also covers error handling and database callbacks.

Core Features & Use Cases

  • Standard edge function pattern with CORS preflight and robust error handling
  • Request validation using Zod schemas
  • LLM calling pattern for chat completions
  • Embedding generation pattern and DB callback example

Quick Start

Create a new edge function at supabase/functions/my-function/index.ts using the standard pattern and wire up call-llm and generate-embedding paths as needed.

Frequently Asked Questions about edge-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call LLMs securely from edge functions in Deno?

Edge functions for LLM calls require request validation, CORS handling, and secure credential management. This Skill provides standardized Deno patterns using Zod for validation, OpenRouter integration, and environment-driven configuration to safely orchestrate LLM requests from edge environments.

Can I generate embeddings in Deno edge functions?

Yes. This Skill includes embedding generation patterns for Deno edge functions, with request validation via Zod schemas, error handling, and optional database callbacks to Supabase for storing results.

How do I handle CORS and validation in Deno edge functions?

Deno edge functions need CORS preflight handling and strict request validation. This Skill provides a standard pattern combining CORS middleware, Zod schema validation, and method checks to secure external integrations.

What's the best way to structure edge functions for external API integrations?

A standardized edge function pattern reduces bugs and security gaps. This Skill offers templates with CORS preflight, robust error handling, request validation, function whitelisting, and consistent JSON responses for integrations like LLM calls and embeddings.

Do I need a database callback when generating embeddings?

Database callbacks are optional. This Skill includes patterns for both standalone embedding generation and Supabase database integration, letting you choose whether to persist results based on your workflow needs.

Why use environment-driven configuration in edge functions?

Environment-driven configuration keeps secrets and deployment logic separate from code. This Skill enforces environment-based settings for LLM providers, API keys, and function routing, improving security and portability across deployments.