Agent skill

Experience Lds Graphql Generate

by forcedotcom in forcedotcom/sf-skills

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".

Apache-2.0Auto-check passedBackend & APIs

Install Experience Lds Graphql Generate

skills CLI
$ npx skills add forcedotcom/sf-skills --skill experience-lds-graphql-generate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install forcedotcom/sf-skills experience-lds-graphql-generate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/forcedotcom/sf-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/experience-lds-graphql-generate .claude/skills/experience-lds-graphql-generate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
experience-lds-graphql-generate
GitHub stars
1.1k
Token cost
~2.8k tokens
SKILL.md length
1,034 words
Files
6 (incl. scripts, references)
Skills in repo
251
Repo updated
First seen
Licence
Apache-2.0

At a glance

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".

  • Works in 7 steps: General query information → Acquire the schema → Entity identification → …
  • Ly if the prompt forbids GraphQL
  • SKILL.md covers When to Use, Prerequisites, Core Rules and Workflow, plus 3 more sections
  • Runs Shell scripts from its folder

What it does

Experience Lds Graphql Generate is an agent skill from forcedotcom/sf-skills. 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…

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `references/generation-guide.md`, `references/generation-mutation.md` and `references/generation-query.md`).

It sits in Backend & APIs, covering GraphQL. It works with GraphQL and Salesforce. The repository describes itself as: Salesforce's curated collection of agent skills for building applications. Optimized for Agentforce Vibes, compatible with all AI tools. The licence is Apache-2.0.

When your agent uses it

  • Ly if the prompt forbids GraphQL
  • Chooses UIAPI/Apex (use experience-lds-best-practices-apply)
  • Asks for data requirements (use experience-lds-data-requirements-generate)

Example prompts

  • “build an LWC”
  • “/experience-lds-graphql-generate”

Requirements

  • A Bash shell

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. General query information
  2. Acquire the schema
  3. Entity identification
  4. Iterative entity introspection
  5. Read query generation (only if query type is read)
  6. Mutation query generation (only if query type is mutation)
  7. Test the query

What it can do on your machine

Read from SKILL.md and the folder at commit e5164d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Experience Lds Graphql Generate loads about 2.8k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 258 tokens; SKILL.md has 1,034 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~258
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~12k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from forcedotcom/sf-skills at commit e5164d9, republished under its Apache-2.0 licence (© forcedotcom). 1,034 words, ~2,840 tokens.

Download SKILL.mdSave it as .claude/skills/experience-lds-graphql-generate/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
experience-lds-graphql-generate
description
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).
metadata.relatedSkills
experience-lds-best-practices-apply, experience-lds-data-requirements-generate, experience-lwc-generate
metadata.version
1.0
metadata.domains
Experience, Platform
<!-- adk-managed-skill -->

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 / sf available in the shell for the schema fetch.
  • Decision on:
    • Namespace — uiapi (default: standard + custom objects) or setup (setup objects like permission sets, profiles).
    • Query type — read (default) or mutation.
    • Output format — standalone (raw GraphQL + variables) or LWC integration (full component wiring).

Core Rules

These apply to every step — they are the rules this skill enforces:

  1. Sequential execution — Steps 1→6 run in order. Every step is mandatory unless its triggering conditions are not met.
  2. Hard stop on failure — A failed step blocks subsequent steps until remediation is complete.
  3. Schema is the single source of truth — Every entity name, field name, field type, and relationship must come from schema.graphql introspection. Never use common Salesforce knowledge (e.g., do not assume Owner is a User — it may be polymorphic).
  4. Report each step — Use the provided templates before advancing.
  5. 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:

text
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
  1. Ask for the usernameOrAlias. If a default is inferred from context, present it and wait for explicit confirmation.
  2. Run scripts/fetch-lds-graphql-schema.sh USERNAME_OR_ALIAS [OUTPUT_PATH] [API_VERSION] with the confirmed alias. The script writes the SDL to schema.graphql (or the path you pass) so the schema never enters the chat context. If a non-empty schema.graphql already exists at OUTPUT_PATH, the script exits early (set LDS_FETCH_FORCE=1 to re-fetch).
  3. 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 Record with -A 100.
  • Filter: ^input <ObjectName>_Filter with -A 50.
  • OrderBy: ^input <ObjectName>_OrderBy with -A 30.
  • Mutation input: ^input <ObjectName>(Create|Update)Input with -A 50.

Search budget: max 4–5 grep calls per entity. Plan before executing.

Step 3 — Entity identification
  1. Entity names are PascalCase.
  2. If names aren't given, extract candidates from ^type <Name> implements Record matches.
  3. If any entity is still unresolved, ask the user and wait.
  4. Report:
    text
    Identified entities:
    - EntityName (Field1, Field2, ...)
    Unknown entities:
    - <textual name>
    Step 3 status: SUCCESS | FAILED
  5. If Unknown entities is non-empty → status FAILED → 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:

  1. Remove already-introspected entities from the list.
  2. Grep for the remaining entities' fields using the schema patterns above.
  3. Extract standard field types.
  4. 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 inline fragments (... on TypeA, ... on TypeB).
  5. Identify child relationships (Connection types, e.g., Contacts: ContactConnection). Add new entities to the unknown list.
  6. If unknown list not empty and iterations < 3, loop.
  7. Report:
    text
    [PASS|FAIL] EntityName
      - Standard fields: FieldName (type), ...
      - Reference fields: FieldName → TargetType, ...
      - Polymorphic fields: FieldName → [TypeA, TypeB], ...
      - Child relationships: RelationshipName → ChildType, ...
      - Unknown fields: FieldName, ...
    Introspection cycles used: N/3
    Step 4 status: SUCCESS | FAILED
  8. If any entity is [FAIL] → global FAILED → remediation → resume from cycle start.
Show full SKILL.md (374 more words)Show less
Step 5 — Read query generation (only if query type is read)

Author the read query per references/generation-query.md, feeding in the introspection data, entity list, field types, output format, and usernameOrAlias.

Apply the rules in references/generation-query.md — covers:

  • Query root / namespace selection (uiapi.query vs setup.query).
  • Field selection discipline (ask only for fields actually needed — every field is a billable scan).
  • Filter operators (eq, ne, in, nin, gt, gte, lt, lte, like, contains).
  • OrderBy (per-field direction).
  • Pagination (first, after, last, before; edges.node, pageInfo).
  • Polymorphic inline fragments.
  • Aliasing and variable placeholders.
  • Standalone vs LWC output (wire adapter from lightning/graphql, gql tagged template, refreshGraphQL for imperative refresh).

If the tool returns an error, categorize it and ask the user how to proceed.

Step 6 — Mutation query generation (only if query type is mutation)

Author the mutation per references/generation-mutation.md — covers:

  • create, update, delete operation shape.
  • Input types (<Entity>CreateInput, <Entity>UpdateInput) discovered via the input grep pattern.
  • Required vs optional fields (from schema's ! annotation).
  • Reference-field updates using Id only.
  • Return selection — what to read back after the mutation to drive cache consistency.
  • Error handling (record.errors[]).
  • LWC integration: imperative mutation via graphqlMutate from lightning/graphql.
Step 7 — Test the query

Run scripts/test-lds-graphql-query.sh USERNAME_OR_ALIAS 'QUERY' '<VARIABLES_JSON>' against the confirmed usernameOrAlias and present the response shape/sample to the user. Errors are categorized, not echoed verbatim.

Cross-References

  • Bundled scripts:
    • scripts/fetch-lds-graphql-schema.sh — schema acquisition via a GraphQL introspection query against the org's /services/data/vX/graphql endpoint (LDS exposes no /graphql/sdl route); call once per org/session before query authoring.
    • scripts/test-lds-graphql-query.sh — org-backed validation of the generated query against /services/data/vX/graphql.
  • Related skills:
    • experience-lds-best-practices-apply — general LDS principles, cache semantics, and wire-vs-imperative choice.
    • experience-lds-data-requirements-generate — pre-work that decides what to query before this skill decides how.
    • experience-lwc-generate — host the generated wire adapter cleanly.

Examples

Standalone read — minimal

graphql
query Accounts($limit: Int = 10) {
  uiapi {
    query {
      Account(first: $limit) {
        edges {
          node {
            Id
            Name { value }
          }
        }
      }
    }
  }
}

LWC integration — read with wire

javascript
import { LightningElement, wire } from 'lwc';
import { gql, graphql } from 'lightning/graphql';

export default class AccountList extends LightningElement {
    @wire(graphql, {
        query: gql`
            query Accounts($limit: Int = 10) {
                uiapi {
                    query {
                        Account(first: $limit) {
                            edges { node { Id Name { value } } }
                        }
                    }
                }
            }
        `,
        variables: '$variables'
    })
    accounts;

    variables = { limit: 10 };

    get records() {
        return this.accounts?.data?.uiapi?.query?.Account?.edges ?? [];
    }
}

Verification

  • Step 3 status: SUCCESS before Step 4; Step 4 status: SUCCESS before Steps 5/6.
  • Every field in the generated query appears in the introspection report (no hallucinated fields).
  • Polymorphic fields use inline fragments; non-polymorphic fields do not.
  • For mutations, every required input field (! in schema) is present.
  • scripts/test-lds-graphql-query.sh returns without errors; or, on error, a categorized remediation is presented.
  • If output format is LWC integration, the component imports from lightning/graphql, uses gql tagged template, and exposes data via a getter (not directly in HTML).

© forcedotcom, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in skills/experience-lds-graphql-generate of forcedotcom/sf-skills.

  • SKILL.md
  • references/generation-guide.md
  • references/generation-mutation.md
  • references/generation-query.md
  • scripts/fetch-lds-graphql-schema.sh
  • scripts/test-lds-graphql-query.sh

Open the folder on GitHubat commit e5164d9

Compare with similar skills

Experience Lds Graphql Generate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Experience Lds Graphql Generate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Experience Lds Graphql Generate this skillforcedotcom/sf-skills1.1k—~2.8kAutomated safety check: PassApache-2.0
Hunt Sqlielementalsouls/Claude-BugHunter4.8k—~5.5kAutomated safety check: PassMIT
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15818 repos~4kAutomated safety check: PassAGPL-3.0
GraphQL Operations with CodegenChrisWiles/claude-code-showcase6.1k3 repos~1.5kAutomated safety check: PassNone
API Design Principlesjh941213/my-cc-harness12620 repos~3.4kAutomated safety check: PassNone

Similar skills

  • Hunt Sqli

    elementalsouls/Claude-BugHunter

    Hunting skill for sqli vulnerabilities. An agent skill from elementalsouls/Claude-BugHunter.

    4.8k GitHub stars~5.5k tokensUpdated yesterday
    DatabasesAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed
  • GraphQL Operations with Codegen

    ChrisWiles/claude-code-showcase

    Sets the rules for writing GraphQL queries and mutations in .gql files, running codegen, and using generated Apollo hooks with proper error and loading handling.

    6.1k GitHub starsUsed in 3 repos~1.5k tokens
    Backend & APIsAuto-check passed
  • API Design Principles

    jh941213/my-cc-harness

    REST 및 GraphQL API 설계 원칙 가이드. An agent skill from jh941213/my-cc-harness.

    126 GitHub starsUsed in 20 repos~3.4k tokens
    Backend & APIsAuto-check passed
  • API And Interface Design

    dzhalaevd/Donatello

    Guides stable API and interface design. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 9 repos~2.6k tokens
    Backend & APIsAuto-check passed

More from forcedotcom/sf-skills

All 251 skills in this repo
  • Agentforce Architecture Analyze

    forcedotcom/sf-skills

    Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins.

    1.1k GitHub stars~4.5k tokensUpdated yesterday
    Auto-check passed
  • Agentforce D360 Analyze

    forcedotcom/sf-skills

    Data Cloud 360° view of a single Agentforce session. An agent skill from forcedotcom/sf-skills.

    1.1k GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.3k tokensUpdated yesterday
    Auto-check: notes
  • Apply a Salesforce sandbox post-copy automation JSON config against a target org.

    1.1k GitHub stars~5.4k tokensUpdated yesterday
    Auto-check: notes
  • Design Systems Slds Apply

    forcedotcom/sf-skills

    Apply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons.

    1.1k GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Experience Lwc Generate

    forcedotcom/sf-skills

    Lightning Web Components with PICKLES methodology and 165-point scoring.

    1.1k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Experience Lds Graphql Generate

What does Experience Lds Graphql Generate do?

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". Experience Lds Graphql Generate is an agent skill from forcedotcom/sf-skills.), or gql template tags in an LWC context — even if the surface ask is "build an LWC".

When should I use Experience Lds Graphql Generate?

Experience Lds Graphql Generate fits situations like: ly if the prompt forbids GraphQL; chooses UIAPI/Apex (use experience-lds-best-practices-apply); asks for data requirements (use experience-lds-data-requirements-generate).

How do I install Experience Lds Graphql Generate in Claude Code?

Run `npx skills add forcedotcom/sf-skills --skill experience-lds-graphql-generate -a claude-code`. Or copy the skill folder (skills/experience-lds-graphql-generate in forcedotcom/sf-skills) into .claude/skills/experience-lds-graphql-generate in your project. Claude Code loads it when a task matches its description.

How do I install Experience Lds Graphql Generate in Codex?

Run `npx skills add forcedotcom/sf-skills --skill experience-lds-graphql-generate -a codex`. Or copy the skill folder (skills/experience-lds-graphql-generate in forcedotcom/sf-skills) into .agents/skills/experience-lds-graphql-generate in your project. Codex loads it when a task matches its description.

Can I use Experience Lds Graphql Generate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add forcedotcom/sf-skills --skill experience-lds-graphql-generate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/experience-lds-graphql-generate, .gemini/skills/experience-lds-graphql-generate, .github/skills/experience-lds-graphql-generate and .opencode/skills/experience-lds-graphql-generate in your project.

What does Experience Lds Graphql Generate need to run?

Going by SKILL.md and its folder, Experience Lds Graphql Generate needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does Experience Lds Graphql Generate access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Experience Lds Graphql Generate safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Experience Lds Graphql Generate use?

Experience Lds Graphql Generate is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Experience Lds Graphql Generate use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.7k tokens, read only when the agent opens those files.

What are the alternatives to Experience Lds Graphql Generate?

Skills that share tags, products or a category with Experience Lds Graphql Generate: Hunt Sqli (elementalsouls/Claude-BugHunter, 4.8k stars), API Designer (Jeffallan/claude-skills, 12k stars), Nodejs Backend Patterns (ever-works/ever-works, 158 stars) and GraphQL Operations with Codegen (ChrisWiles/claude-code-showcase, 6.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Experience Lds Graphql Generate?

forcedotcom (a GitHub organization) maintains it in forcedotcom/sf-skills, which has 1,060 GitHub stars. The repository holds 251 skills in this directory. The repository was last updated on October 7, 2026.

Source: forcedotcom/sf-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.