Validate connector

From simstudioai/sim · View interactive version

Validate connector is an AI agent skill from the GitHub repository simstudioai/sim. Validate an existing knowledge base connector against its service's API docs

How to use this skill

Skill file

Validate Connector Skill

Identify the runtime under review

For Sim Search, validate the live provider registration and access pipeline: catalog and metadata parity, both search/read handlers, current member grants, service-source restrictions, safe scoped references, pagination, provenance, and provider failure behavior. Test real localhost setup/search/read with authorized fixtures when available, and distinguish those results from mocked provider tests. Live Search must not enqueue content indexing or background ACL/directory builds; GitLab still computes request-time permissions or uses current CSV grants.

The ingestion-specific checks below apply to ordinary workspace KB connectors only. Do not require a live-only provider to implement content hashes, ingestion cursors, embeddings, or stored ACL snapshots.

You are an expert auditor for Sim knowledge base connectors. Your job is to thoroughly validate that an existing connector is correct, complete, and follows all conventions.

Your Task

When the user asks you to validate a connector:

  1. Read the service's API documentation (via Context7 or WebFetch)
  2. Read the connector implementation, OAuth config, 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 connector — do not skip any:

apps/sim/connectors/{service}/meta.ts        # ConnectorMeta — client-safe metadata (icon, name, auth, configFields, tagDefinitions)
apps/sim/connectors/{service}/{service}.ts   # Connector implementation — spreads the meta + runtime functions
apps/sim/connectors/{service}/index.ts       # Barrel export
apps/sim/connectors/registry.server.ts       # Server-only full registry entry (CONNECTOR_REGISTRY; full connector)
apps/sim/connectors/registry.ts              # Client-safe meta registry entry (CONNECTOR_META_REGISTRY)
apps/sim/connectors/types.ts                 # ConnectorMeta / ConnectorConfig interfaces, ExternalDocument, etc.
apps/sim/connectors/utils.ts                 # Shared utilities (computeContentHash, htmlToPlainText, etc.)
apps/sim/lib/oauth/oauth.ts                  # OAUTH_PROVIDERS — single source of truth for scopes
apps/sim/lib/oauth/utils.ts                  # getCanonicalScopesForProvider, getScopesForService, SCOPE_DESCRIPTIONS
apps/sim/lib/oauth/types.ts                  # OAuthService union type
apps/sim/components/icons.tsx                 # Icon definition for the service

If the connector uses selectors, also read:

apps/sim/lib/selectors/manifest.ts            # Browser-safe exhaustive metadata
apps/sim/lib/selectors/types.ts               # Selector context and option types
apps/sim/lib/selectors/context.ts             # Active canonical context projection
apps/sim/lib/selectors/server/registry.ts     # Exhaustive server attachments
apps/sim/lib/selectors/server/providers/*     # Matching provider attachment

Apply the validate-selector skill to the matching key and provider primitive. There is no client

provider selector registry.

Step 2: Pull API Documentation

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

Use Context7 (resolve-library-id → query-docs) or WebFetch to retrieve documentation. If both fail, note which claims are based on training knowledge vs verified docs.

Hard Rule: No Guessed Source Schemas

If the service docs do not clearly show document list responses, document fetch responses, metadata fields, or pagination shapes, you MUST tell the user instead of guessing.

If a schema is unknown, validation must explicitly recommend:

  1. sample API responses,
  2. live test credentials, or
  3. trimming the connector to only documented fields.

Step 3: Validate API Endpoints

For every API call in the connector (listDocuments, getDocument, validateConfig, and any helper functions), verify against the API docs:

URLs and Methods

Headers

Request Bodies

Input Sanitization

Response Parsing

Step 4: Validate OAuth Scopes (if OAuth connector)

Scopes must be correctly declared and sufficient for all API calls the connector makes.

Connector requiredScopes

Scope Subset Validation

Scope Sufficiency

For each API endpoint the connector calls:

Token Refresh Config

Step 5: Validate Pagination

listDocuments Pagination

Deletion-Reconciliation Safety (`listingCapped`)

The sync engine tombstones, then hard-deletes, any stored document absent from a full listing. Audit every path where listDocuments can return less than the full source set:

Verify it against the checkpoint.unsafe computation in lib/knowledge/connectors/listing-checkpoint.ts.

Pagination State Across Pages

Step 6: Validate Data Transformation

Content Deferral

Connectors that require per-document API calls to fetch content (file download, export, blocks fetch) MUST use contentDeferred: true. This is the standard pattern for reliability — without it, content downloads during listing can exhaust the sync task's time budget before any documents are saved.

Connectors where the list API already returns content inline (e.g., Slack messages, Reddit posts) do NOT need contentDeferred.

ExternalDocument Construction

Content Extraction

Step 7: Validate Tag Definitions and mapTags

tagDefinitions

mapTags

Step 8: Validate Config Fields and Validation

configFields

validateConfig

Step 9: Validate getDocument

Step 10: Validate General Quality

fetchWithRetry Usage

API Efficiency

Error Handling

Concurrency

Logging

Meta / Runtime Split

Registry

Step 11: Report and Fix

Report Format

Group findings by severity:

Critical (will cause runtime errors, data loss, or auth failures):

binding, combines hidden authentication with an unsafe user-controlled destination, or forwards

protected/provider payload data to the client

Warning (incorrect behavior, data quality issues, or convention violations):

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 lint passes
  2. TypeScript compiles clean
  3. Re-read all modified files to verify fixes are correct
  4. Any remaining unknown source schemas were explicitly reported to the user instead of guessed

Checklist Summary

Before reporting, confirm every step above was checked, issues are grouped by severity, critical and warning fixes are applied, and bun run lint plus type-check pass.

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.