Validate trigger

From simstudioai/sim · View interactive version

Validate trigger is an AI agent skill from the GitHub repository simstudioai/sim. Validate an existing Sim webhook trigger against provider API docs and repository conventions

How to use this skill

Skill file

Validate Trigger

You are an expert auditor for Sim webhook triggers. Your job is to validate that an existing trigger implementation is correct, complete, secure, and aligned across all layers.

Your Task

  1. Read the service's webhook/API documentation (via WebFetch)
  2. Read every trigger file, provider handler, and registry entry
  3. Cross-reference against the API docs and Sim conventions
  4. Report all issues grouped by severity (critical, warning, suggestion)
  5. Fix all issues after reporting them

Step 1: Gather All Files

Read every file for the trigger — do not skip any:

apps/sim/triggers/{service}/           # All trigger files, utils.ts, index.ts
apps/sim/lib/webhooks/providers/{service}.ts  # Provider handler (if exists)
apps/sim/lib/webhooks/providers/registry.ts   # Handler registry
apps/sim/triggers/registry.ts                 # Trigger registry
apps/sim/blocks/blocks/{service}.ts           # Block definition (trigger wiring)

Also read for reference:

apps/sim/lib/webhooks/providers/types.ts            # WebhookProviderHandler interface
apps/sim/lib/webhooks/providers/utils.ts            # Shared helpers (createHmacVerifier, etc.)
apps/sim/lib/webhooks/provider-subscription-utils.ts    # Subscription helpers
apps/sim/lib/webhooks/processor.ts                  # Central webhook processor

If trigger sub-blocks use a selectorKey, also apply the validate-selector skill and read the

key's browser-safe manifest entry, shared active-value context builder, server attachment, and

provider listing primitive.

Step 2: Pull API Documentation

Fetch the service's official webhook documentation. This is the source of truth for:

Hard Rule: No Guessed Webhook Payload Schemas

If the official docs do not clearly show the webhook payload JSON for an event, you MUST tell the user instead of guessing.

If a payload schema is unknown, validation must explicitly recommend:

  1. sample webhook payloads,
  2. a live test webhook source, or
  3. trimming the trigger to only documented outputs.

Step 3: Validate Trigger Definitions

utils.ts

Trigger Files

one server attachment

references stay unresolved in the browser

module, browser token request, or selector-only provider route

Trigger ↔ Provider Alignment

Step 4: Validate Provider Handler

Auth Verification

Event Matching

formatInput

Idempotency

Challenge Handling (if applicable)

Step 5: Validate Automatic Subscription Lifecycle

If the service supports programmatic webhook creation:

createSubscription

deleteSubscription

Orchestration Isolation

Step 6: Validate Registration and Block Wiring

Trigger Registry (`triggers/registry.ts`)

Provider Handler Registry (`providers/registry.ts`)

Block Wiring (`blocks/blocks/{service}.ts`)

Step 7: Validate Security

Step 8: Report and Fix

Report Format

Group findings by severity:

Critical (runtime errors, security issues, or data loss):

scope authorization, credential provider binding, destination enforcement, or safe projection

Warning (convention violations or usability issues):

Suggestion (minor improvements):

Fix All Issues

After reporting, fix every critical and warning issue. Apply suggestions where they don't add unnecessary complexity.

Validation Output

After fixing, confirm:

  1. bun run type-check passes
  2. Re-read all modified files to verify fixes are correct
  3. Provider handler tests pass (if they exist): bun run --cwd apps/sim test lib/webhooks/providers/<handler-basename> — handler files are kebab-case (azure-devops.ts) while trigger directories are snake_case (azure_devops), so use the handler's actual basename
  4. Any remaining unknown webhook payload schemas were explicitly reported to the user instead of guessed

Checklist Summary

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.