agentleFS
Ampli-GroupAmpli-Group/agentic-mobile-blueprint/.agents/skills/sentry-integration/SKILL.md

sentry-integration

Skill4 starsChanged 6 months agoMITView on GitHub

Add Sentry error tracking to Supabase Edge Functions. Use when creating functions that need error monitoring.

  • Reads credentials

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check Sentry dashboard for the error with full context.

    line 101

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sentry Integration for Supabase Edge Functions

Helpers Available

Module _shared/sentry.ts provides:

  • initSentry() - Initialize (call once)
  • handleError() - Capture errors automatically
  • setSentryUser() - Track user (optional)
  • addBreadcrumb() - Track flow (optional)

Usage

Basic Pattern

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

initSentry();

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

  try {
    const result = await processData();
    return new Response(JSON.stringify({ success: true }));
  } catch (error) {
    return handleError(error, { functionName: 'my-function', corsHeaders });
  }
});

With User Context

import { initSentry, setSentryUser, handleError } from '../_shared/sentry.ts';
import { authenticate } from '../_shared/auth.ts';

initSentry();

Deno.serve(async (req: Request) => {
  try {
    const { user } = await authenticate(req);
    setSentryUser(user.id, user.email);
    
    // Your logic
    
    return new Response(JSON.stringify({ success: true }));
  } catch (error) {
    return handleError(error, { functionName: 'auth-function', corsHeaders });
  }
});

With Breadcrumbs

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

initSentry();

try {
  addBreadcrumb('Started processing');
  const result = await process();
  addBreadcrumb('Completed', { count: result.length });
} catch (error) {
  return handleError(error, { functionName: 'processor', corsHeaders });
}

Setup

  1. Set SENTRY_DSN in .env.local:
    SENTRY_DSN=https://your-sentry-dsn@sentry.io/123456
  2. Module exists at supabase/functions/_shared/sentry.ts (already created)

What Gets Captured

✅ Error message and stack trace
✅ Function name (tagged)
✅ Request details
✅ User context (if set)
✅ Breadcrumbs (if added)
❌ Authorization headers (auto-removed)

Testing

throw new Error('Test error for Sentry');

Check Sentry dashboard for the error with full context.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.