Validate integration

From simstudioai/sim · View interactive version

Validate integration is an AI agent skill from the GitHub repository simstudioai/sim. Validate an existing Sim integration (tools, block, registry, and resolved-secret/model-input boundaries) against the service's API docs and Sim execution conventions

How to use this skill

Skill file

Validate Integration Skill

You are an expert auditor for Sim integrations. Your job is to thoroughly validate that an existing integration is correct, complete, and follows all conventions.

Your Task

When the user asks you to validate an integration:

  1. Read the service's API documentation (via WebFetch or Context7)
  2. Read every tool, the block, and registry entries
  3. Cross-reference everything against the API docs and Sim conventions
  4. Report all issues found, grouped by severity (critical, warning, suggestion)
  5. Fix all issues after reporting them

Step 1: Gather All Files

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

apps/sim/tools/{service}/          # All tool files, types.ts, index.ts
apps/sim/blocks/blocks/{service}.ts # Block definition
apps/sim/tools/registry.ts          # Tool registry entries for this service
apps/sim/blocks/registry-maps.ts    # Block + meta registry entry (BLOCK_REGISTRY / BLOCK_META_REGISTRY)
apps/sim/components/icons.tsx        # Icon definition
apps/sim/lib/auth/connectors/providers.ts # Better Auth connector providers (buildConnectorProviders) — should use getCanonicalScopesForProvider()
apps/sim/lib/oauth/oauth.ts         # OAuth provider config — single source of truth for scopes
apps/sim/lib/oauth/utils.ts         # Scope utilities, SCOPE_DESCRIPTIONS for modal UI
packages/deployment-config/src/env-capabilities.ts # OAuth client runtime capability source of truth
apps/sim/lib/core/config/env.ts     # Runtime env schema for capability fields
packages/sim-setup/src/capability-config.ts # Exhaustive CLI input-mode mapping for OAuth fields
packages/deployment-config/src/integrations.json # Generated client-safe integration catalog
packages/deployment-config/src/service-account-providers.generated.ts # Generated provider-ID facts
packages/deployment-config/src/service-account-metadata.ts # Handwritten deployment policy

If the block, its triggers, or connector fields use a selectorKey, also apply the validate-selector skill and read

the key's entry in apps/sim/lib/selectors/manifest.ts, its server attachment and provider listing

primitive, and the shared context builder. Selector provider logic runs only server-side through

selectors.execute.

Step 2: Pull API Documentation

Fetch the official API docs for the service. This is the source of truth for:

Hard Rule: No Guessed Response Schemas

If the official docs do not clearly show the response JSON shape for an endpoint, you MUST tell the user instead of guessing.

If a response schema is unknown, the validation must explicitly call that out and require:

  1. sample responses from the user,
  2. live test credentials for verification, or
  3. trimming the tool/block down to only documented fields.

Step 3: Validate Tools

For every tool file, check:

Tool ID and Naming

Params

Request

Response / transformResponse

Outputs

Types (types.ts)

Barrel Export (index.ts)

Tool Registry (tools/registry.ts)

Resolved-Secret Provenance and Model Input

For every request field, determine whether it is ordinary API input, model-visible text/structured

content, opaque model input, or a value persisted into Sim-owned durable storage.

Treat model-input provenance as opt-in. Require official documentation or an unambiguous local

execution path proving that the exact field reaches an AI model. If the evidence is ambiguous,

leave the integration unchanged; do not infer a model boundary merely from natural-language,

search, extraction, or "AI-powered" marketing terminology.

minimal exact selector; nested/JSON-string adapters preserve shape through applyProjected

semantics unless the exact field is proven model-visible; an AI-backed provider or later model

processing of the referenced resource is not sufficient evidence

request.modelInput, projected before the existing formatter parses it, and has deterministic

formatter behavior when a whole-value placeholder is invalid for the serialized grammar

operation.modelInput with privateInputPaths (or mode: 'private-provenance'), and the

operation calls validateOpaqueModelInputProvenance before model egress; storage keys, paths, signed URLs,

and ordinary remote URLs are not treated as byte provenance, while tracked stored bytes are

authorized independently at the owning model-egress boundary

their bytes or decoded content cross into a model/tool-result boundary; ordinary file APIs

remain unchanged. Unsupported secret-bearing file paths are rejected at file_write

field-scoped operation.secretProvenance; the owning operation validates the exact selection

and scope, strip private metadata, and persist, import, or propagate it at the owning boundary

preserve it through operation.modelInput / operation.secretProvenance, while proven

model-visible external fields use request projection and other external inputs remain unchanged

only execution-scoped, activated Sim provenance is projected at shared model/log boundaries

hand-rolled or returned as functional output

persistence/model/log crossing; there is no generic handling for arbitrary filenames,

metadata, provider results, or API payloads

ordinary provider responses, filenames, URLs, and errors are unchanged

shape handling, unchanged ordinary external inputs, malformed/incomplete metadata, headerless

legacy requests, metadata stripping, and durable legacy/stale/scope cases when applicable

Treat a missing or bypassed model, durable, or internal-execution provenance boundary as

critical. Do not fix it with a tool-specific string replacer or by sanitizing every provider

result; repair the shared request, in-process operation, persistence, or re-entry boundary

that owns the data.

Step 4: Validate Block

Block ↔ Tool Alignment

This is the most important validation — the block must be perfectly aligned with every tool it references.

For each tool in tools.access:

SubBlocks

saved token credential (add-integration → Token credentials), not an inline password field

(legacy blocks keep theirs); a successor changes its legacy block only by hideFromToolbar

and sunset, and its picker sits under the operation

tokenCredentialOAuth policy, every

param that decides the request host is mapped, and the stored domain is in the form the tools

build URLs from (check-block-registry.ts origin/staging passes)

credentialKind: 'service-account' }` and pin every host or account param in

authoritativeParams (check-block-registry enforces this for every block with a

saved-credential picker)

and in MIXED_MODE_PROVIDERS (prepare-workload-identity.ts), and the provider catalog

shows keyless only when the deployment can sign tokens

anything that could steer the host or path, and a fake key is rejected without a valid

scoped key being refused

password fields (Enter your API key). Formatted values show the shape

(2023-01-01T00:00:00Z); optional fields with a server default name it. See add-integration → Step 3

Advanced Mode

WandConfig

Tools Config

Block Outputs

Block Metadata

BlockMeta

Block Inputs

Dynamic Selectors

server attachment

pagination, scope, and stale-time behavior

{{KEY}} references remain unresolved in the browser

user-controlled destination policy

IDs, context values, and raw upstream errors do not enter responses, logs, or query keys

selector-only provider route remains

Step 5: Validate OAuth Scopes (if OAuth service)

Scopes are centralized — the single source of truth is OAUTH_PROVIDERS in lib/oauth/oauth.ts.

Step 6: Validate Deployment Availability (if OAuth service)

The deployment UI and setup CLI do not infer OAuth client fields from scopes. They resolve the

block's generated oauthServiceId through the shared deployment capability catalog.

the generated SERVICE_ACCOUNT_PROVIDER_BY_OAUTH_SERVICE_ID[serviceId] has the same provider ID

omitted for an independent path, 'oauth-client' when it needs the OAuth client fields, or

'preview-gated' when controlled by a preview block

Treat a missing capability as critical: runtime availability intentionally throws instead of

silently exposing an unusable integration.

Step 7: Validate Pagination Consistency

If any tools support pagination:

Step 8: Validate Memory Load Safety

If any tool lists, searches, exports, imports, downloads, uploads, paginates, batches, transforms arrays, or reads file/HTTP bodies, read .agents/skills/memory-load-check/SKILL.md and apply it to the integration.

before JSON serialization; external raw downloads explicitly use request.responseType: 'binary'

and return a buffered output.file. Provider base64 JSON needs separate handling

crossing executor admission without another upload. New file outputs contain references only,

without inline content aliases; preserve legacy versions when removing existing inline fields

descriptors, export operations, and old/new block versions; checking download-named tools alone

misses late reads that occur after the first response admission

of provider size metadata, and forward ToolResponseContext.signal through every fetch/read

aliases reference the same stored files, with no duplicate upload or raw bytes left behind

retained provider metadata has a distinct purpose, and types match the stored-file runtime shape

Step 9: Validate Error Handling

Step 10: Report and Fix

Report Format

Group findings by severity:

Critical (will cause runtime errors or incorrect behavior):

legacy headerless/NULL data

unrelated third-party results

destination enforcement, or returns provider payloads or protected values across the selector

boundary

Warning (follows conventions incorrectly or has 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.

Regenerate Derived Artifacts

Several files are generated from tool and block definitions. Editing a tool or block WITHOUT regenerating them fails CI, so run this before pushing:

bun run generate                     # every generator below (and any other generate:<x>/check:<x> pair)
bun run check:integration-catalog    # registry ↔ committed deployment metadata drift
bun run check:docs                   # committed docs ↔ what the generator renders today
bun run check:deployment-config     # OAuth registry/catalog ↔ provider-ID fact drift
bun run check:audits                 # every audit CI enforces, including check:docs
bun run apps/sim/scripts/check-block-registry.ts origin/staging  # block ↔ tool param coverage (CI, not in check:audits)

deployment fields, and compares them with the committed catalog. It catches missing/unexpected

entries and stale auth/service IDs without loading the executable registry in client code.

memory and fails listing any committed file that differs. Runs in CI via check:audits.

Always diff the regen output before committing — but commit all of it. These generators rewrite

every file they own, so they also true up drift that accumulated on the base branch (pages whose

source changed without a regen). That catch-up is correct output, not a regression: check:docs

fails CI on any page left stale, so reverting swept-in hunks with git checkout -- reintroduces the

failure. Review the diff to confirm each hunk is explained by a real source change (yours or an

upstream PR that skipped regeneration), and investigate anything that looks like content loss — a

page losing a section usually means its source block moved or a generator input broke, not that the

hunk should be reverted.

The integration's page must carry a {/* MANUAL-CONTENT-START:intro */} section directly under

<BlockInfoCard />. If it is missing, write one using the template in add-integration → Step 8, and

check an existing intro against what the block actually ships (no removed or unshipped operations).

If an icon changed, apps/sim/components/icons.tsx is the source of truth and apps/docs/components/icons.tsx is its generated mirror — they must end up byte-identical for that component.

Validation Output

After fixing, confirm:

  1. bun run lint passes with no fixes needed
  2. TypeScript compiles clean (no type errors) — check the error list is empty for the files you touched; pre-existing unrelated errors in a worktree usually mean workspace packages resolve to the main checkout
  3. The integration's tests pass, and any test you added actually fails without its fix (revert it once and watch it go red)
  4. Derived artifacts regenerated and their diffs reviewed (see above)
  5. bun run check:integration-catalog passes
  6. bun run check:docs passes
  7. bun run apps/sim/scripts/check-block-registry.ts origin/staging passes
  8. For OAuth or service-account changes, bun run check:deployment-config passes
  9. For OAuth or service-account changes, bun run --cwd apps/sim test lib/integrations/availability.server.test.ts passes
  10. Re-read all modified files to verify fixes are correct
  11. Any remaining unknown response schemas were explicitly reported to the user instead of guessed

Checklist Summary

owning boundaries

selectors.execute boundary

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.