Token导航 LogoToken导航

Agent Skill · 研究检索

using-ui-bundle-salesforce-data(using UI bundle Salesforce 数据)

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

using-ui-bundle-salesforce-data 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 15,045。

总安装 8,127周安装 332GitHub Stars 212下载 2,629核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:using-ui-bundle-salesforce-data(using UI bundle Salesforce 数据)
来源仓库:https://github.com/forcedotcom/afv-library
仓库路径:skills/using-ui-bundle-salesforce-data
安装命令:
npx skills add https://github.com/forcedotcom/afv-library --skill using-ui-bundle-salesforce-data
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/forcedotcom/afv-library --skill using-ui-bundle-salesforce-data

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助数据整理、表格处理和指标计算。适合清洗字段、汇总数据、发现异常或生成统计口径。使用时需确认数据来源和时间范围,避免将样本当作全量事实。涉及敏感数据时应先确认权限和脱敏边界。using-ui-bundle-salesforce-data 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/using-ui-bundle-salesforce-data

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/forcedotcom/afv-library --skill using-ui-bundl…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

using-ui-bundle-salesforce-data 怎么安装?

在终端执行 npx skills add https://github.com/forcedotcom/afv-library --skill using-ui-bundle-salesfor…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

using-ui-bundle-salesforce-data 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

using-ui-bundle-salesforce-data 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

using-ui-bundle-salesforce-data 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

using-ui-bundle-salesforce-data 用的人多吗?

公开数据是累计安装 8,127 次,近一周安装 332 次,下载 2,629 次,GitHub 212 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

using-ui-bundle-salesforce-data 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
using-ui-bundle-salesforce-data

using UI bundle Salesforce 数据 · 本页

8,127212需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Salesforce Data Access

Data SDK Requirement

All Salesforce data access MUST use the Data SDK (@salesforce/sdk-data). The SDK handles authentication, CSRF, and base URL resolution.
import { createDataSDK, gql } from "@salesforce/sdk-data";
import type { ResponseTypeQuery } from "../graphql-operations-types";

const sdk = await createDataSDK();

// GraphQL for record queries/mutations (PREFERRED)
const response = await sdk.graphql?.<ResponseTypeQuery>(query, variables);

// REST for Connect REST, Apex REST, UI API (when GraphQL insufficient)
const res = await sdk.fetch?.("/services/apexrest/my-resource");

Always use optional chaining (sdk.graphql?.(), sdk.fetch?.()) — these methods may be undefined in some surfaces.

Preconditions — verify before starting

#RequirementHow to verifyIf missing
1@salesforce/sdk-data installedCheck package.json in the UI bundle dirCannot proceed — tell user to install it
2schema.graphql at project rootCheck if file existsRun npm run graphql:schema from UI bundle dir
3Custom objects/fields deployedRun graphql-search.sh <Entity> — no output means not deployedAsk user to deploy metadata and assign permission sets

If preconditions are not met, you may scaffold components, routes, layout, and UI logic, but use empty arrays / null for data and mark query locations with // TODO: add query after schema verification and include in the plan to go back, resolve requirements and write the GraphQL. Do not write GraphQL query strings until the schema workflow is complete.

Supported APIs

Only the following APIs are permitted. Any endpoint not listed here must not be used.

APIMethodEndpoints / Use Case
GraphQLsdk.graphqlAll record queries and mutations via uiapi {} namespace
UI API RESTsdk.fetch/services/data/v{ver}/ui-api/records/{id} — record metadata when GraphQL is insufficient
Apex RESTsdk.fetch/services/apexrest/{resource} — custom server-side logic, aggregates, multi-step transactions
Connect RESTsdk.fetch/services/data/v{ver}/connect/file/upload/config — file upload config
Einstein LLMsdk.fetch/services/data/v{ver}/einstein/llm/prompt/generations — AI text generation

Not supported:

  • Enterprise REST query endpoint (/services/data/v*/query with SOQL) — blocked at the proxy level. Use GraphQL for record reads; use Apex REST if server-side SOQL aggregates are required.
  • Aura-enabled Apex (@AuraEnabled) — an LWC/Aura pattern with no invocation path from React UI bundles.
  • Chatter API (/chatter/users/me) — use uiapi {currentUser {...}} in a GraphQL query instead.
  • Any other Salesforce REST endpoint not listed in the supported table above.

Decision: GraphQL vs REST

NeedMethodExample
Query/mutate recordssdk.graphqlAccount, Contact, custom objects
Current user infosdk.graphqluiapi {currentUser {Id Name {value}}}
UI API record metadatasdk.fetch/ui-api/records/{id}
Connect RESTsdk.fetch/connect/file/upload/config
Apex RESTsdk.fetch/services/apexrest/auth/login
Einstein LLMsdk.fetch/einstein/llm/prompt/generations

GraphQL is preferred for record operations. Use REST only when GraphQL doesn't cover the use case.


GraphQL Non-Negotiable Rules

These rules exist because Salesforce GraphQL has platform-specific behaviors that differ from standard GraphQL. Violations cause silent runtime failures.

  1. HTTP 200 does not mean success — Salesforce returns HTTP 200 even when operations fail. Always parse the errors array in the response body.
  2. Schema is the single source of truth — Every entity name, field name, and type must be confirmed via the schema search script before use in a query. Never guess — Salesforce field names are case-sensitive, relationships may be polymorphic, and custom objects use suffixes (__c, __e). Objects added to UI API in v60+ may use a _Record suffix (e.g., FeedItem_Record instead of FeedItem).
  3. @optional on all record fields (read queries) — Salesforce field-level security (FLS) causes queries to fail entirely if the user lacks access to even one field. The @optional directive (v65+) tells the server to omit inaccessible fields instead of failing. Apply it to every scalar field, parent relationship, and child relationship. Consuming code must use optional chaining (?.) and nullish coalescing (??).
  4. Correct mutation syntax — Mutations wrap under uiapi(input: {allOrNone: true/false}), not bare uiapi {...}. Always set allOrNone explicitly. Output fields cannot include child relationships or navigated reference fields.
  5. Explicit pagination — Always include first: in every query. If omitted, the server silently defaults to 10 records. Include pageInfo {hasNextPage endCursor} for any query that may need pagination. Forward-only (first/after) — last/before are unsupported.
  6. SOQL-derived execution limits — Max 10 subqueries per request, max 5 levels of child-to-parent traversal, max 1 level of parent-to-child (no grandchildren), max 2,000 records per subquery. If a query would exceed these, split into multiple requests.
  7. Only requested fields — Only generate fields the user explicitly asked for. Do NOT add extra fields.
  8. Compound fields — When filtering or ordering, use constituent fields (e.g., BillingCity, BillingCountry), not the compound wrapper (BillingAddress). The compound wrapper is only for selection.

GraphQL Workflow

StepActionKey output
1Acquire schemaschema.graphql exists
2Look up entitiesField names, types, relationships confirmed
3Generate query.graphql file or inline gql tag
4Generate typesgraphql-operations-types.ts
5ValidateLint + codegen pass

Step 1: Acquire Schema

The schema.graphql file (265K+ lines) is the source of truth. Never open or parse it directly — no cat, less, head, tail, editors, or programmatic parsers.

Verify preconditions 1–3 (see Preconditions), then proceed to Step 2.

Step 2: Look Up Entity Schema

Map user intent to PascalCase names ("accounts" → Account), then run the search script from the sfdx-project folder (project root):

bash scripts/graphql-search.sh Account
# Multiple entities:
bash scripts/graphql-search.sh Account Contact Opportunity

The script outputs seven sections per entity:

  1. Type definition — all queryable fields and relationships
  2. Filter options — available fields for where: conditions
  3. Sort options — available fields for orderBy:
  4. Create mutation wrapper — <Entity>CreateInput
  5. Create mutation fields — <Entity>CreateRepresentation (fields accepted by create mutations)
  6. Update mutation wrapper — <Entity>UpdateInput
  7. Update mutation fields — <Entity>UpdateRepresentation (fields accepted by update mutations)

Maximum 2 script runs. If the entity still can't be found, ask the user — the object may not be deployed.

Entity Identification

If a candidate does not match:

  • Try __c suffix for custom objects, __e for platform events
  • Try _Record suffix — objects added in v60+ may use <EntityName>_Record
  • If still unresolved, ask the user — do not guess
Iterative Introspection (max 3 cycles)
  1. Introspect — Run the script for each unresolved entity
  2. Fields — Extract requested field names and types from the type definition
  3. References — Identify reference fields. If polymorphic (multiple types), use inline fragments. Add newly discovered entity types to the working list.
  4. Child relationships — Identify Connection types. Add child entity types to the working list.
  5. Repeat if unresolved entities remain (max 3 cycles)

Hard stops: If no data returned for an entity, stop — it may not be deployed. If unknown entities remain after 3 cycles, ask the user. Do not generate queries with unconfirmed entities or fields.

Step 3: Generate Query

Every field name must be verified from the script output in Step 2.

Read Query Template
query QueryName($after: String) {
  uiapi {
    query {
      EntityName(
        first: 10
        after: $after
        where: { ... }
        orderBy: { ... }
      ) {
        edges {
          node {
            Id
            FieldName @optional { value }
            # Parent relationship (non-polymorphic)
            Owner @optional { Name { value } }
            # Parent relationship (polymorphic — use fragments)
            What @optional {
              ...WhatAccount
              ...WhatOpportunity
            }
            # Child relationship — max 1 level, no grandchildren
            Contacts @optional(first: 10) {
              edges { node { Name @optional { value } } }
            }
          }
        }
        pageInfo { hasNextPage endCursor }
      }
    }
  }
}

fragment WhatAccount on Account {
  Id
  Name @optional { value }
}
fragment WhatOpportunity on Opportunity {
  Id
  Name @optional { value }
}

Consuming code must defend against missing fields:

const name = node.Name?.value ?? "";
const relatedName = node.Owner?.Name?.value ?? "N/A";
Filtering
# Implicit AND
Account(where: { Industry: { eq: "Technology" }, AnnualRevenue: { gt: 1000000 } })

# Explicit OR
Account(where: { OR: [{ Industry: { eq: "Technology" } }, { Industry: { eq: "Finance" } }] })

# NOT
Account(where: { NOT: { Industry: { eq: "Technology" } } })

# Date literal
Opportunity(where: { CloseDate: { eq: { value: "2024-12-31" } } })

# Relative date
Opportunity(where: { CloseDate: { gte: { literal: TODAY } } })

# Relationship filter (nested objects, NOT dot notation)
Contact(where: { Account: { Name: { like: "Acme%" } } })

# Polymorphic relationship filter
Account(where: { Owner: { User: { Username: { like: "admin%" } } } })

String equality (eq) is case-insensitive. Both 15-char and 18-char record IDs are accepted.

Ordering
Account(
  first: 10,
  orderBy: { Name: { order: ASC }, CreatedDate: { order: DESC } }
) { ... }

Unsupported for ordering: multi-select picklist, rich text, long text area, encrypted fields. Add Id as tie-breaker for deterministic ordering.

UpperBound Pagination (v59+)

For >200 records per page or >4,000 total records, use upperBound. first must be 200–2000 when set.

Account(first: 2000, after: $cursor, upperBound: 10000) {
  edges { node { Id Name @optional { value } } }
  pageInfo { hasNextPage endCursor }
}
Semi-Join and Anti-Join

Filter a parent entity by conditions on child entities using inq (semi-join) or ninq (anti-join) on the parent's Id. If the only condition is child existence, use Id: {ne: null}.

query SemiJoinExample {
  uiapi {
    query {
      Account(where: {
        Id: {
          inq: {
            Contact: { LastName: { like: "Smith%" } }
            ApiName: "AccountId"
          }
        }
      }, first: 10) {
        edges { node { Id Name @optional { value } } }
      }
    }
  }
}

Replace inq with ninq for anti-join. Restrictions: no OR in subquery, no orderBy in subquery, no nesting joins within each other.

Current User

Use uiapi.currentUser (no arguments) instead of the standard query pattern:

query CurrentUser {
  uiapi { currentUser { Id Name { value } } }
}
Field Value Wrappers

Schema fields use typed wrappers — access via .value:

Wrapper TypeUnderlyingWrapper TypeUnderlying
StringValueStringBooleanValueBoolean
IntValueIntDoubleValueDouble
CurrencyValueCurrencyPercentValuePercent
DateTimeValueDateTimeDateValueDate
PicklistValuePicklistLongValueLong
IDValueIDTextAreaValueTextArea
EmailValueEmailPhoneNumberValuePhoneNumber
UrlValueUrl

All wrappers also expose displayValue: String (server-rendered via toLabel()/format()) — use for UI display instead of formatting client-side.

Mutation Template

Mutations are GA in API v66+. Three operations: Create, Update, Delete.

# Create
mutation CreateAccount($input: AccountCreateInput!) {
  uiapi(input: { allOrNone: true }) {
    AccountCreate(input: $input) {
      Record { Id Name { value } }
    }
  }
}

# Update — must include Id
mutation UpdateAccount {
  uiapi(input: { allOrNone: true }) {
    AccountUpdate(input: { Id: "001xx000003GYkZAAW", Account: { Name: "New Name" } }) {
      Record { Id Name { value } }
    }
  }
}

Input constraints:

  • Create: Required fields (unless defaultedOnCreate), only createable fields, no child relationships. Reference fields set by ApiName (e.g., AccountId).
  • Update: Must include Id, only updateable fields, no child relationships.
  • Delete: Id only.
  • IdOrRef type: The Id field in Update and Delete inputs uses the IdOrRef type, which accepts either a literal record ID (e.g., "001xx...") or a mutation chaining reference ("@{Alias}"). Reference fields in Create inputs (e.g., AccountId) also accept @{Alias} for chaining.
  • Raw values: No commas, currency symbols, or locale formatting (e.g., 80000 not "$80,000").

Output constraints:

  • Create/Update: Exclude child relationships, exclude navigated reference fields (only ApiName member allowed). Output field is always named Record.
  • Delete: Id only.

allOrNone semantics:

  • true (default) — All operations succeed or all roll back.
  • false — Independent operations succeed individually, but dependent operations (using @{alias}) still roll back together.
Mutation Chaining

Chain related mutations using @{alias} references to Id from earlier mutations. Required for parent-child creation (nested child creates are not supported).

mutation CreateAccountAndContact {
  uiapi(input: { allOrNone: true }) {
    AccountCreate(input: { Account: { Name: "Acme" } }) {
      Record { Id }
    }
    ContactCreate(input: { Contact: { LastName: "Smith", AccountId: "@{AccountCreate}" } }) {
      Record { Id }
    }
  }
}

Rules: A must come before B in the query. @{A} is always the Id from mutation A. Only Create or Delete can be chained from (not Update).

Delete Mutation

Delete uses generic RecordDeleteInput (not entity-specific). Output is Id only — no Record field.

mutation DeleteAccount($id: ID!) {
  uiapi(input: { allOrNone: true }) {
    AccountDelete(input: { Id: $id }) {
      Id
    }
  }
}
Object Metadata & Picklist Values

Use uiapi {objectInfos(...)} to fetch field metadata or picklist values. Pass either apiNames or objectInfoInputs — never both.

// Object metadata
const GET_OBJECT_INFO = gql`
  query GetObjectInfo($apiNames: [String!]!) {
    uiapi {
      objectInfos(apiNames: $apiNames) {
        ApiName
        label
        labelPlural
        fields { ApiName label dataType updateable createable }
      }
    }
  }
`;

// Picklist values (use objectInfoInputs + inline fragment)
const GET_PICKLIST_VALUES = gql`
  query GetPicklistValues($objectInfoInputs: [ObjectInfoInput!]!) {
    uiapi {
      objectInfos(objectInfoInputs: $objectInfoInputs) {
        ApiName
        fields {
          ApiName
          ... on PicklistField {
            picklistValuesByRecordTypeIDs {
              recordTypeID
              picklistValues { label value }
            }
          }
        }
      }
    }
  }
`;

Step 4: Generate Types (codegen)

After writing the query (whether in a .graphql file or inline with gql), generate TypeScript types:

# Run from UI bundle dir
npm run graphql:codegen

Output: src/api/graphql-operations-types.ts

Generated type naming conventions:

  • <OperationName>Query / <OperationName>Mutation — response types
  • <OperationName>QueryVariables / <OperationName>MutationVariables — variable types

Always import and use the generated types when calling sdk.graphql:

import type { GetAccountsQuery, GetAccountsQueryVariables } from "../graphql-operations-types";

const response = await sdk.graphql?.<GetAccountsQuery, GetAccountsQueryVariables>(GET_ACCOUNTS, variables);

Use NodeOfConnection<T> to extract the node type from a Connection for cleaner typing:

import { type NodeOfConnection } from "@salesforce/sdk-data";

type AccountNode = NodeOfConnection<GetAccountsQuery["uiapi"]["query"]["Account"]>;

Step 5: Validate & Test

  1. Lint: npx eslint <file> from UI bundle dir
  2. codegen: npm run graphql:codegen from UI bundle dir
Common Error patterns
Error ContainsResolution
Cannot query field / ValidationErrorField name wrong — re-run graphql-search.sh <Entity>
Unknown typeType name wrong — verify PascalCase entity name via script
Unknown argumentArgument wrong — check Filter/OrderBy sections in script output
invalid syntax / InvalidSyntaxFix syntax per error message
VariableTypeMismatch / UnknownTypeCorrect argument type from schema
invalid cross reference idEntity deleted — ask for valid Id
OperationNotSupportedCheck object availability and API version
is not currently available in mutation resultsRemove field from mutation output
Cannot invoke JsonElement.isJsonObject()Use API version 64+ for update mutation Record selection

On PARTIAL If a mutation returns both data and errors (partial success): Report inaccessible fields, explain they cannot be in mutation output, offer to remove them. Wait for user consent before changing.


UI Bundle Integration (React)

Two integration patterns:

Pattern 1 — External .graphql file (complex queries)

One operation per .graphql file. Each file contains exactly one query or mutation (plus its fragments). Do not combine multiple operations in a single file.

import { createDataSDK, type NodeOfConnection } from "@salesforce/sdk-data";
import MY_QUERY from "./query/myQuery.graphql?raw"; // ?raw suffix required
import type { GetMyDataQuery, GetMyDataQueryVariables } from "../graphql-operations-types";

const sdk = await createDataSDK();
const response = await sdk.graphql?.<GetMyDataQuery, GetMyDataQueryVariables>(MY_QUERY, variables);

After creating/changing .graphql files, run npm run graphql:codegen to generate types into src/api/graphql-operations-types.ts.

Pattern 2 — Inline gql tag (simple queries)

Must use gql — plain template strings bypass ESLint schema validation.

import { createDataSDK, gql } from "@salesforce/sdk-data";
import type { GetAccountsQuery } from "../graphql-operations-types";

const GET_ACCOUNTS = gql`
  query GetAccounts {
    uiapi {
      query {
        Account(first: 10) {
          edges { node { Id Name @optional { value } } }
        }
      }
    }
  }
`;

const sdk = await createDataSDK();
const response = await sdk.graphql?.<GetAccountsQuery>(GET_ACCOUNTS);

Error Handling

// Strict (default) — any errors = failure
if (response?.errors?.length) {
  throw new Error(response.errors.map(e => e.message).join("; "));
}

// Tolerant — log errors, use available data
if (response?.errors?.length) {
  console.warn("GraphQL partial errors:", response.errors);
}

// Discriminated — fail only when no data returned
if (!response?.data && response?.errors?.length) {
  throw new Error(response.errors.map(e => e.message).join("; "));
}

const accounts = response?.data?.uiapi?.query?.Account?.edges?.map(e => e.node) ?? [];

REST API Patterns

Use sdk.fetch when GraphQL is insufficient. See the Supported APIs table for the full allowlist.

declare const __SF_API_VERSION__: string;
const API_VERSION = typeof __SF_API_VERSION__ !== "undefined" ? __SF_API_VERSION__ : "65.0";

// Connect — file upload config
const res = await sdk.fetch?.(`/services/data/v${API_VERSION}/connect/file/upload/config`);

// Apex REST (no version in path)
const res = await sdk.fetch?.("/services/apexrest/auth/login", {
  method: "POST",
  body: JSON.stringify({ email, password }),
  headers: { "Content-Type": "application/json" },
});

// UI API — record with metadata (prefer GraphQL for simple reads)
const res = await sdk.fetch?.(`/services/data/v${API_VERSION}/ui-api/records/${recordId}`);

// Einstein LLM
const res = await sdk.fetch?.(`/services/data/v${API_VERSION}/einstein/llm/prompt/generations`, {
  method: "POST",
  body: JSON.stringify({ promptTextorId: prompt }),
});

Current user: Do not use Chatter (/chatter/users/me). Use GraphQL instead:

const GET_CURRENT_USER = gql`
  query CurrentUser {
    uiapi { currentUser { Id Name { value } } }
  }
`;
const response = await sdk.graphql?.(GET_CURRENT_USER);

Directory Structure

<project-root>/                              ← SFDX project root
├── schema.graphql                           ← grep target (lives here)
├── sfdx-project.json
├── scripts/graphql-search.sh                ← schema lookup script
└── force-app/main/default/uiBundles/<app-name>/  ← UI bundle dir
    ├── package.json                         ← npm scripts
    └── src/
CommandRun FromWhy
npm run graphql:schemaUI bundle dirScript in UI bundle's package.json
npm run graphql:codegenUI bundle dirGenerate GraphQL types
npx eslint <file>UI bundle dirReads eslint.config.js
bash scripts/graphql-search.sh <Entity>project rootSchema lookup

Quick Reference

Schema Lookup (from project root)

Run the search script to get all relevant schema info in one step:

bash scripts/graphql-search.sh <EntityName>
Script Output SectionUsed For
Type definitionField names, parent/child relationships
Filter optionswhere: conditions
Sort optionsorderBy:
CreateRepresentationCreate mutation field list
UpdateRepresentationUpdate mutation field list

Error Categories

Error ContainsResolution
Cannot query fieldField name is wrong — run graphql-search.sh <Entity> and use the exact name from the Type definition section
Unknown typeType name is wrong — run graphql-search.sh <Entity> to confirm the correct PascalCase entity name
Unknown argumentArgument name is wrong — run graphql-search.sh <Entity> and check Filter or OrderBy sections
invalid syntaxFix syntax per error message
validation errorField name is wrong — run graphql-search.sh <Entity> to verify
VariableTypeMismatchCorrect argument type from schema
invalid cross reference idEntity deleted — ask for valid Id

Checklist

  • All field names verified via search script (Step 2)
  • @optional applied to all record fields (reads)
  • Mutations use uiapi(input: {allOrNone:...}) wrapper
  • first: specified in every query
  • Optional chaining in consuming code
  • errors array checked in response handling
  • Lint passes: npx eslint <file>

平台分布

Codex

37.46%
按下载量换算985

Claude

33.43%
按下载量换算879

Cursor

18.22%
按下载量换算479

Gemini CLI

8.85%
按下载量换算233

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills