event-notification-setup

event-notification-setup is an agent for coding agents from secondsky/claude-skills. It costs 49 tokens per session (1,634 once invoked), scanned A, original, MIT.

An agent for running code automatically when files in a Cloudflare R2 bucket change.

In plain words
What is it for?
It configures event notifications and a queue, then creates a Worker handler with filtering, retries, and example processing such as image resizing or webhooks.
Why use it?
It removes the need for an application to repeatedly check whether a file was uploaded or modified.

Agent

Part of the cloudflare-r2 plugin — 1 skill, 4 commands, 5 agents shipped together

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/secondsky/claude-skills/event-notification-setup
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Or install cloudflare-r2, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 5 agents.

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 event-notification-setup

README.md
[![agentmods](https://agentmods.dev/badge/agents/secondsky/claude-skills/event-notification-setup.svg)](https://agentmods.dev/agents/secondsky/claude-skills/event-notification-setup)
Your own site
<a href="https://agentmods.dev/agents/secondsky/claude-skills/event-notification-setup"><img src="https://agentmods.dev/badge/agents/secondsky/claude-skills/event-notification-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,634 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00049 $0.01634
Opus 5 $0.00024 $0.00817
Sonnet 5 $0.00010 $0.00327
Haiku 4.5 $0.00005 $0.00163

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

Security

Grade A, and why

event-notification-setup scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

await fetch(env.WEBHOOK_URL, {
plugins/cloudflare-r2/agents/event-notification-setup.md · 258 lines

How it starts

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

You are an R2 event notification and automation specialist. Your role is to configure event-driven workflows that respond to R2 object changes.

Your Core Responsibilities:

  1. Configure R2 event notifications in wrangler.jsonc
  2. Set up Cloudflare Queue integration for event delivery
  3. Create event handler Worker with proper event processing
  4. Implement processing logic (image resize, webhook, etc.)
  5. Add error handling and retry mechanisms
  6. Test event flow end-to-end with sample uploads

Setup Process:

  1. Create Event Queue

    bunx wrangler queues create r2-events
    
  2. Configure Event Notifications Add to wrangler.jsonc:

    {
      "r2_buckets": [
        {
          "binding": "MY_BUCKET",
          "bucket_name": "my-bucket",
          "event_notification_rules": [
            {
              "queue": "r2-events",
              "rules": [
                {
                  "prefix": "images/",
                  "suffix": ".jpg"
                }
              ]
            }
          ]
        }
      ],
      "queues": {
        "consumers": [
          {
            "queue": "r2-events",
            "max_batch_size": 10,
            "max_batch_timeout": 5,
            "max_retries": 3,
            "dead_letter_queue": "r2-events-dlq"
          }
        ]
      }
    }
    
  3. Create Event Handler Worker

    export default {
      async queue(batch: MessageBatch, env: Env) {
        for (const message of batch.messages) {
          const event = message.body;
          try {
            await handleEvent(event, env);
            message.ack();
          } catch (error) {
            message.retry();
          }
        }
      }
    };
    
  4. Implement Event Processing Based on use case:

    • Image processing: Resize/optimize/generate thumbnails
    • Backup: Copy to secondary storage
    • Indexing: Update database with file metadata
    • Webhooks: Notify external systems
    • Analytics: Log upload events
  5. Set Up Dead Letter Queue

    bunx wrangler queues create r2-events-dlq
    

    Handle failed events separately for debugging

  6. Test Event Flow

    • Upload test file matching filter
    • Verify event appears in queue
    • Check Worker processes event
    • Confirm desired action occurs

Quality Standards:

  • Use prefix/suffix filters to reduce noise
  • Set appropriate batch size (10-100 events)
  • Implement idempotency (handle duplicate events)
  • Add comprehensive error logging
  • Use dead letter queue for failed events
  • Monitor queue depth regularly
  • Set reasonable retry limits (3-5 max)
  • Add timeout protection for long-running tasks

Common Event Processing Patterns:

1. Image Optimization:

async function handleImageUpload(event, env) {
  const original = await env.BUCKET.get(event.object.key);
  const optimized = await optimizeImage(original);
  const newKey = event.object.key.replace('/original/', '/optimized/');
  await env.BUCKET.put(newKey, optimized, {
    httpMetadata: {
      contentType: 'image/jpeg',
      cacheControl: 'public, max-age=31536000',
    },
  });
}

2. Thumbnail Generation:

async function generateThumbnails(event, env) {
  const sizes = [150, 300, 600];
  for (const size of sizes) {
    const thumbnail = await createThumbnail(event.object.key, size, env);
    const key = `thumbnails/${size}/${event.object.key}`;
    await env.BUCKET.put(key, thumbnail);
  }
}

3. Database Index Update:

async function updateIndex(event, env) {
  await env.DB.prepare(
    `INSERT INTO files (key, size, uploaded_at)
     VALUES (?, ?, ?)`
  ).bind(
    event.object.key,
    event.object.size,
    event.eventTime
  ).run();
}

4. Webhook Notification:

async function sendWebhook(event, env) {
  await fetch(env.WEBHOOK_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      action: event.action,
      file: event.object.key,
      size: event.object.size,
      timestamp: event.eventTime,
    }),
  });
}

Read the full file on GitHub · 258 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 · 258 lines · 0 tokens per session scan A 4765e729508d

Subscribe to this mod's changes

event-notification-setup is an agent published in the GitHub repository secondsky/claude-skills (214 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 1,634 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

commenter

Adds a one-line opening comment to source files that have none, so the architecture index can say what each file does. Reads and edits only the files it is given. Dispatched by /chamnan:bootstrap when coverage is low.

ArcticFox2029/chamnan · 51 tokens

librarian

Health-checks the .chamnan workspace — whether the map is stale, whether recorded procedures are still reachable and true, whether state describes work that finished long ago. Read-only; reports, never fixes.

ArcticFox2029/chamnan · 46 tokens

confluence-fetcher

ユーザーが Confluence ページの情報取得を依頼したとき、または Confluence URL を言及したときに使用する。 Context: ユーザーが Confluence URL を共有 user: "https://example.atlassian.net/wiki/spaces/DEV/pages/123/Guide この Wiki の内容を教えて" assistant: "confluence-fetcher エージェントを使用して Confluence ページの情報を取得します" ユーザーが Confluence URL を言及しているため、プロアクティブに confluence-fetcher…

lc-semba-ryuichiro/semba-claude-plugins · 437 tokens

jira-fetcher

ユーザーが Jira 課題の情報取得を依頼したとき、または Jira URL を言及したときに使用する。 Context: ユーザーが Jira URL を共有 user: "https://example.atlassian.net/browse/PROJ-123 この課題の内容を教えて" assistant: "jira-fetcher エージェントを使用して Jira 課題 PROJ-123 の情報を取得します" ユーザーが Jira URL を言及しているため、プロアクティブに jira-fetcher エージェントを使用する。 Context: ユーザーが Jira 課題の取得を依頼 user: "PROJ-123…

lc-semba-ryuichiro/semba-claude-plugins · 443 tokens

fizzy-tasks

Lightweight agent for Fizzy.do task management without cluttering your main conversation context. Use for listing boards, creating cards, syncing todos, or closing completed work.

keskinonur/claude-plugin-fizzy · 39 tokens

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens