Agent Skills › simstudioai/sim › validate-selector

validate-selector

GitHub

用于审计 Sim 动态选择器的完整性,涵盖声明、清单、服务器边界及安全策略。检查密钥处理、作用域授权及死路由,确保数据不泄露至客户端或日志。

.agents/skills/validate-selector/SKILL.md simstudioai/sim

触发场景

审查选择器正确性 检查秘密处理逻辑 验证作用域授权机制 排查无效的选择器路由

安装

npx skills add simstudioai/sim --skill validate-selector -g -y
更多选项

非标准路径

npx skills add https://github.com/simstudioai/sim/tree/main/.agents/skills/validate-selector -g -y

不安装直接使用

npx skills use simstudioai/sim@validate-selector

指定 Agent (Claude Code)

npx skills add simstudioai/sim --skill validate-selector -a claude-code -g -y

安装 repo 全部 skill

npx skills add simstudioai/sim --all -g -y

预览 repo 内 skill

npx skills add simstudioai/sim --list

SKILL.md

Frontmatter
{
    "name": "validate-selector",
    "description": "Audit a Sim dynamic selector across its declaration, browser-safe manifest, server attachment, provider primitive, and selectors.execute security boundary. Use when reviewing selector correctness, secret handling, scope authorization, or dead selector-only routes.",
    "argument-hint": "<selector-key-or-service>"
}

Validate Selector

Validate the complete path, not only the provider adapter.

Gather the path

Read:

  • Every block, trigger, and connector field using the selector key.
  • apps/sim/lib/selectors/manifest.ts and types.ts.
  • apps/sim/lib/selectors/context.ts.
  • The matching server attachment and any shared provider listing primitive.
  • apps/sim/lib/selectors/server/registry.ts.
  • The shared application executor, route contract, client transport, and focused tests when the finding concerns shared behavior.

Search literal API paths as well as TypeScript imports before deciding whether an old provider route or contract is unused.

Validate the declaration and manifest

  • The key has exactly one classification and one attachment (local keys use the local registry).
  • Allowed context is minimal and readiness matches the provider request.
  • List, pagination, search, detail, unknown-detail, scope, and stale-time metadata match actual UX.
  • dependsOn names the required source fields; canonical pairs contribute only their active member.
  • Action/trigger and connector surfaces build the same canonical context.
  • Exact {{KEY}} references remain unresolved in the browser; runtime references are omitted, while embedded interpolation is forwarded unresolved and rejected by the server executor.
  • Query keys contain no context value, reference, credential ID, secret, or hash of one.

Validate the server boundary

For provider and internal selectors, confirm the shared executor owns this order:

  1. Session authentication before request parsing.
  2. Canonical workflow/workspace loading and read authorization.
  3. Manifest capability and exact-context allowlisting.
  4. Exact environment-reference resolution on the server.
  5. Credential use, workspace, and trusted provider/service binding.
  6. Destination-policy enforcement before provider network access.
  7. Provider/internal execution followed by explicit option projection and sanitization.

The attachment must not duplicate these shared checks. It must not accept a browser-provided module, provider, service, operation kind, origin, or scope list.

Review its destination classification:

  • fixed origins are code-defined.
  • credential-bound origins are derived from or checked against the authorized credential.
  • user-controlled destinations have an explicit policy for hidden use-only authentication and network safety.

Missing and inaccessible references, and missing, unauthorized, or provider-mismatched credentials, must not become existence oracles. Hidden/server-only resolved plaintext, credentials, authentication material, and raw upstream errors must not enter responses, query/cache/rate keys, selector result caches, logs, audit metadata, redirects, or error messages. Browser-known literals and viewable personal/shared values are not automatically protected plaintext, but the executor must still never deliberately or wholesale echo selector context. Only intentionally projected, normalized { id, label, meta? } options and bounded cursors may cross the boundary.

Selector code adds no context, token, or result cache beyond the single accepted exception described in the add-selector skill ("Wire the UI declaration").

Validate provider reuse and browser boundaries

  • The attachment calls a server-only provider primitive, not a route handler or internal HTTP URL.
  • A surviving provider route has a proven non-selector caller and delegates to the same primitive.
  • There is no client provider selector module, selector-specific token request, or browser request to a provider-specific selector route.
  • Internal selectors delegate to existing authorized use cases rather than querying protected data in the route or adapter.

Tests and report

Use existing Vitest/route/React Query patterns. Preserve valuable provider tests, but do not demand a per-selector authorization matrix. Shared executor tests should cover ordering, references, credential binding, sanitization, and safe errors; adapter tests should cover only special provider behavior.

Report critical, warning, and suggestion findings. Treat browser secret resolution, missing scope or credential authorization, unsafe destination binding, provider payload passthrough, and plaintext egress as critical.

Run the smallest relevant focused suites plus:

bun run --cwd apps/sim type-check
bun run check:api-validation:strict
bun run check:fork-dependent-coverage
bun run check:client-boundary
git diff --check

State which live-provider checks remain pending when disposable credentials are unavailable.

版本历史

  • c6cef5f 当前 2026-10-20 02:39

    修复了从 lib/copilot 到 lib/mothership 的过时引用;新增 check:guidance-refs 审计以清除无效文档路径;更新了多个技能中的过时事实。

  • 6dfb467 2026-09-23 06:36

同 Skill 集合

.agents/skills/add-block-preview/SKILL.md
.agents/skills/add-block/SKILL.md
.agents/skills/add-column-type/SKILL.md
.agents/skills/add-connector/SKILL.md
.agents/skills/add-enrichment/SKILL.md
.agents/skills/add-feature-flag/SKILL.md
.agents/skills/add-hosted-key/SKILL.md
.agents/skills/add-integration/SKILL.md
.agents/skills/add-managed-cli/SKILL.md
.agents/skills/add-model/SKILL.md
.agents/skills/add-permission-group-item/SKILL.md
.agents/skills/add-selector/SKILL.md
.agents/skills/add-settings-page/SKILL.md
.agents/skills/add-tools/SKILL.md
.agents/skills/add-trigger/SKILL.md
.agents/skills/babysit/SKILL.md
.agents/skills/cleanup/SKILL.md
.agents/skills/council/SKILL.md
.agents/skills/db-migrate/SKILL.md
.agents/skills/design-taste-frontend/SKILL.md
.agents/skills/emcn-design-review/SKILL.md
.agents/skills/emil-design-eng/SKILL.md
.agents/skills/make-interfaces-feel-better/SKILL.md
.agents/skills/memory-load-check/SKILL.md
.agents/skills/react-query-best-practices/SKILL.md
.agents/skills/ship/SKILL.md
.agents/skills/test-audit/SKILL.md
.agents/skills/tool-registry-boundary/SKILL.md
.agents/skills/v2-api-conventions/SKILL.md
.agents/skills/validate-connector/SKILL.md
.agents/skills/validate-integration/SKILL.md
.agents/skills/validate-model/SKILL.md
.agents/skills/validate-permission-group-item/SKILL.md
.agents/skills/validate-trigger/SKILL.md
.agents/skills/you-might-not-need-a-callback/SKILL.md
.agents/skills/you-might-not-need-a-comment/SKILL.md
.agents/skills/you-might-not-need-a-memo/SKILL.md
.agents/skills/you-might-not-need-an-effect/SKILL.md
.agents/skills/you-might-not-need-state/SKILL.md
.agents/skills/you-might-not-need-url-state/SKILL.md
.claude/skills/add-settings-page/SKILL.md
helm/sim/.claude/skills/sim-helm/SKILL.md
.agents/skills/migrate-application-operation/SKILL.md

元信息

文件数
0
版本
c6cef5f
Hash
d4ead4fd
收录时间
2026-09-23 06:36

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-21 16:19
浙ICP备14020137号-1