experience-lds-graphql-generate
БесплатноЗапускает вложенные скриптыНе проверенUse ALWAYS when a prompt mentions GraphQL, lightning/uiGraphQLApi, @wire(graphql, ...), or gql template tags in an LWC context — even if the surface ask is…
от forcedotcom★ 1 200 звёзд на GitHubОб этом скилле
Building LDS GraphQL
Generate schema-validated Salesforce LDS GraphQL queries (read or mutation), either as standalone queries or wired into a Lightning Web Component via the lightning/graphql adapters. The skill encodes the schema-as-source-of-truth workflow end-to-end. Two bundled bash scripts handle the org-aware steps — scripts/fetch-lds-graphql-schema.sh for schema introspection and scripts/test-lds-graphql-query.sh for live-org validation.
When to Use
- User wants to create, modify, or integrate a Salesforce GraphQL query (standard objects, custom objects, or setup objects).
- Building or updating an LWC that consumes/mutates LDS data through GraphQL.
- Introspecting an org's schema before writing a query.
- Validating a generated query end-to-end against a connected org.
Do NOT use this skill for:
- REST-based UI API (use LDS wire adapters; see
experience-lds-best-practices-apply). - Apex callouts or custom GraphQL endpoints — this skill is LDS-scoped.
- Data-requirements discovery — that's
experience-lds-data-requirements-generate.
Prerequisites
- A connected Salesforce org (username or alias). User must confirm it before schema fetch — never assume.
- Salesforce CLI /
sfavailable in the shell for the schema fetch. - Decision on:
- Namespace —
uiapi(default: standard + custom objects) orsetup(setup objects like permission sets, profiles). - Query type —
read(default) ormutation. - Output format —
standalone(raw GraphQL + variables) orLWC integration(full component wiring).
- Namespace —
Core Rules
These apply to every step — they are the rules this skill enforces:
- Sequential execution — Steps 1→6 run in order. Every step is mandatory unless its triggering conditions are not met.
- Hard stop on failure — A failed step blocks subsequent steps until remediation is complete.
- Schema is the single source of truth — Every entity name, field name, field type, and relationship must come from
schema.graphqlintrospection. Never use common Salesforce knowledge (e.g., do not assumeOwneris aUser— it may be polymorphic). - Report each step — Use the provided templates before advancing.
- Error reporting — Categorize errors; never echo raw tool output into the chat.
Workflow
The full normative workflow lives in references/generation-guide.md. Read it before starting. Read-query specifics are in references/generation-query.md; mutation specifics are in references/generation-mutation.md.
Step 1 — General query information
Collect and echo back:
Query type: [read | mutation]
Namespace: [uiapi | setup]
Output format: [standalone | LWC integration]
If any is unclear, ask once and wait.
Step 2 — Acquire the schema
- Ask for the
usernameOrAlias. If a default is inferred from context, present it and wait for explicit confirmation. - Run
scripts/fetch-lds-graphql-schema.sh USERNAME_OR_ALIAS [OUTPUT_PATH] [API_VERSION]with the confirmed alias. The script writes the SDL toschema.graphql(or the path you pass) so the schema never enters the chat context. If a non-emptyschema.graphqlalready exists atOUTPUT_PATH, the script exits early (setLDS_FETCH_FORCE=1to re-fetch). - On failure: hard stop, report category, ask user to resolve org access, then retry.
Using the schema file
The schema is 265,000+ lines. NEVER read the whole file — use targeted grep calls only.
- Object type:
^type <ObjectName> implements Recordwith-A 100. - Filter:
^input <ObjectName>_Filterwith-A 50. - OrderBy:
^input <ObjectName>_OrderBywith-A 30. - Mutation input:
^input <ObjectName>(Create|Update)Inputwith-A 50.
Search budget: max 4–5 grep calls per entity. Plan before executing.
Step 3 — Entity identification
- Entity names are PascalCase.
- If names aren't given, extract candidates from
^type <Name> implements Recordmatches. - If any entity is still unresolved, ask the user and wait.
- Report:
Identified entities: - EntityName (Field1, Field2, ...) Unknown entities: - <textual name> Step 3 status: SUCCESS | FAILED - If
Unknown entitiesis non-empty → statusFAILED→ ask for clarification → restart Step 3.
Step 4 — Iterative entity introspection
Iteration limit: 3 cycles (primary entity → references → child relationships). Hard-stop after 3.
Per cycle:
- Remove already-introspected entities from the list.
- Grep for the remaining entities' fields using the schema patterns above.
- Extract standard field types.
- Identify reference fields (
Owner: User). Fields with the same name on different entities may have different types — check each entity independently. If a field resolves to multiple entity types, mark it polymorphic and plan to use i
Установить experience-lds-graphql-generate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл experience-lds-graphql-generate?
Use ALWAYS when a prompt mentions GraphQL, lightning/uiGraphQLApi, @wire(graphql, ...), or gql template tags in an LWC context — even if the surface ask is "build an LWC". Owns the ENTIRE flow: introspect the org's LDS GraphQL schema, identify entities/fields, construct the schema-validated gql query or mutation, wire it into the LWC via lightning/uiGraphQLApi, verify against a connected org. REQUIRED whenever a prompt asks to render, list, or edit Salesforce records (Account, Contact, Case, custom objects) via GraphQL — the .html and .js scaffolding IS in scope. DO NOT delegate to experience-lwc-generate: that skill has NO GraphQL schema introspection, NO create_lds_graphql_read_query binding, and defaults to getRecord/getRelatedListRecords wire adapters which will not satisfy a GraphQL prompt. DO NOT TRIGGER only if the prompt forbids GraphQL, chooses UIAPI/Apex (use experience-lds-best-practices-apply), or asks for data requirements (use experience-lds-data-requirements-generate).
Как установить скилл experience-lds-graphql-generate?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл experience-lds-graphql-generate запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic