Agent skill

Card Endpoint Shape

by LedgerHQ in LedgerHQ/ledger-live

Read this before adding or editing an endpoint in domain/api/card-management/src/api.ts, a credential-bearing one included.

MITAuto-check passedFrontend & Design

Install Card Endpoint Shape

skills CLI
$ npx skills add LedgerHQ/ledger-live --skill card-endpoint-shape -a claude-code

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

GitHub CLI
$ gh skill install LedgerHQ/ledger-live card-endpoint-shape --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/LedgerHQ/ledger-live.git skills-src && mkdir -p .claude/skills && cp -r skills-src/domain/api/card-management/.agents/skills/card-endpoint-shape .claude/skills/card-endpoint-shape && 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
card-endpoint-shape
GitHub stars
622
Token cost
~1.3k tokens
SKILL.md length
669 words
Files
1
Skills in repo
50
Repo updated
First seen
Licence
MIT

At a glance

Read this before adding or editing an endpoint in domain/api/card-management/src/api.ts, a credential-bearing one included.

  • Frontend & Design work in your project
  • SKILL.md covers Never use queryFn, An endpoint that handles a…, Where configuration comes from and Rules, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Card Endpoint Shape is an agent skill from LedgerHQ/ledger-live. Read this before adding or editing an endpoint in domain/api/card-management/src/api.ts, a credential-bearing one included.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design. It works with Redux. The repository describes itself as: Mono-repository for Ledger Wallet apps and related packages. The licence is MIT.

When your agent uses it

  • Frontend & Design work in your project

Example prompts

  • “/card-endpoint-shape”

What it can do on your machine

Read from SKILL.md and the folder at commit 9c51f17. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    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

Card Endpoint Shape loads about 1.3k tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 669 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from LedgerHQ/ledger-live at commit 9c51f17, republished under its MIT licence (© LedgerHQ). 669 words, ~1,268 tokens.

Download SKILL.mdSave it as .claude/skills/card-endpoint-shape/SKILL.md (or your agent's skills folder).
name
card-endpoint-shape
description
Read this before adding or editing an endpoint in `domain/api/card-management/src/api.ts`, a credential-bearing one included.

Card endpoint shape

Every endpoint is a declaration. Four keys, always in this order:

typescript
someEndpoint: build.query<Canonical, Request>({
  query: (request) => ({
    url: "/v1/some/path",
    method: "GET",
  }),
  rawResponseSchema: SomeWireSchema, // the wire shape
  transformResponse: transformSome, // wire -> canonical
  responseSchema: SomeSchema, // what callers receive
});
KeyAnswersLives in
queryWhat we sendapi.ts
rawResponseSchemaWhat the backend promisedschema.ts
transformResponseHow it becomes ourstransforms.ts
responseSchemaWhat the caller getsschema.ts

Drop the keys you do not need. An endpoint whose wire shape is already canonical declares responseSchema alone — logout and getUser both do.

Return the wire contract, nothing more. A field the backend never sent does not belong on the answer. If a caller needs one of its own request values afterwards, it already has it.

Never use queryFn

queryFn is the escape hatch for endpoints that are not one HTTP call. None here is, and it costs more than it looks:

  • RTK Query skips transformResponse for a queryFn endpoint. getTransformCallbackForEndpoint in buildThunks is guarded by endpointDefinition.query &&. The mapper is silently ignored, so the mapping moves inside the function, by hand.
  • The baseQuery result is unknown, so the body needs a cast or a manual safeParse.
  • Every one brings its own if (response.error) return { error: response.error }.

Three lines of declaration become twenty of plumbing, and the endpoint stops reading like its neighbours.

An endpoint that handles a credential

The two OAuth2 grants are endpoints like any other, plus three rules. RTK Query puts the argument of a call on its pending action and the answer on its settled one, so a grant's credential travels through redux, and three controls keep it out of every reader:

  • extraOptions: { authenticated: false }, so the base query sends no Bearer and never renews. A grant presents its own credential, and a grant that renewed would loop on its own 401.
  • No hook. Export a hook for every other endpoint, and none for a grant.
  • track: false at every call site, so the answer never becomes a cache entry in redux state.

The apps add the last control: redactCardApiAction strips every Card action before the desktop logger, the desktop DevTools or the mobile DevTools relay reads one, and redactCardApiState strips a grant out of the state. A new grant must be added to CARD_GRANT_ENDPOINTS in @shared/api-services, which a test in api.test.ts checks.

Show full SKILL.md (312 more words)Show less

Where configuration comes from

query receives the request argument and nothing else. It cannot reach the store, so:

  • The base query's business — base URL, x-client-key, Authorization, the 401 refresh — comes from cardApiExtra in @shared/api-services. Never restate it in an endpoint.
  • Everything else is a request argument. The OAuth client id and redirect URI are the app's to know, so they arrive on the oauthConfig prop and travel down as arguments. Reaching for queryFn to read them out of cardApiExtra is the trap this rule exists to close.

transformResponse does receive the request as its third argument, after the base query's meta. Use it to map, never to staple a request value back onto the answer.

When a credential must be captured before local state is cleared, keep it outside the Redux action and hide the opaque request behind a domain-owned initiation helper. The logout endpoint uses this pattern so callers and Redux readers never receive the access token.

Rules

  • Schemas are the only validation. No as on response.data, no hand-built PARSING_ERROR. A schema failure rejects the thunk and keeps the body out of the rejected action.
  • Keep the wire schema narrow. Zod drops undeclared keys, which is what keeps PII out of the cache. PayCardUserResponseSchema declares two fields on purpose. Do not widen it.
  • Transforms are named functions in transforms.ts, transformXxx, one test each. Never inline.
  • Types are z.infer in types.ts. Request-argument types are hand-written there too.
  • build.mutation for anything not idempotent, even a GET. A call that changes something on the backend, or that cannot be repeated safely, is a mutation.

Checklist

  • query, not queryFn
  • A credential-bearing endpoint: authenticated: false, no hook, track: false, and its name in CARD_GRANT_ENDPOINTS
  • No as and no try/catch in api.ts
  • Wire shape validated by a schema in schema.ts
  • Mapping in transforms.ts, with a test
  • Nothing the base query already sends is repeated in the endpoint

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

Files

Just SKILL.md in domain/api/card-management/.agents/skills/card-endpoint-shape of LedgerHQ/ledger-live.

Open the folder on GitHubat commit 9c51f17

Compare with similar skills

Card Endpoint Shape 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.

Card Endpoint Shape compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Card Endpoint Shape this skillLedgerHQ/ledger-live622—~1.3kAutomated safety check: PassMIT
React State Managementinvolvex/youtube-music-cli45613 repos~3kAutomated safety check: PassMIT
Frontendredis/RedisInsight8.9k—~3.2kAutomated safety check: PassCustom licence
Reactvalkey-io/valkey-admin148—~766Automated safety check: PassApache-2.0
Nekocap Redux Featurenopol10/nekocap105—~939Automated safety check: PassGPL-3.0
React ExpertJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT

Similar skills

  • React State Management

    involvex/youtube-music-cli

    Master modern React state management with Redux Toolkit, Zustand, Jotai, and React Query.

    456 GitHub starsUsed in 13 repos~3k tokens
    Frontend & DesignAuto-check passed
  • Frontend

    redis/RedisInsight

    Official

    React/Redux frontend development patterns for RedisInsight UI: component folder structure, styled-components, hooks, named exports, barrel files, layout components, and theme usage.

    8.9k GitHub stars~3.2k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • React

    valkey-io/valkey-admin

    Guidance for React frontend work. An agent skill from valkey-io/valkey-admin.

    148 GitHub stars~766 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Nekocap Redux Feature

    nopol10/nekocap

    A skill your agent uses when adding or modifying a Redux feature folder in the nekocap frontend — creating slices, writing sagas, defining selectors, changing persisted state shape, or touching…

    105 GitHub stars~939 tokensUpdated 6 days ago
    Frontend & DesignAuto-check passed
  • React Expert

    Jeffallan/claude-skills

    Builds React 19 components in TypeScript with Server Components, useActionState forms, custom hooks and state libraries, checked with tsc and React Testing Library.

    12k GitHub stars~1.4k tokensUpdated 6 days ago
    Frontend & DesignAuto-check passed
  • Sentry React SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for React. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~4.8k tokensUpdated today
    Frontend & DesignAuto-check passed

More from LedgerHQ/ledger-live

All 50 skills in this repo
  • Impacting PRs

    LedgerHQ/ledger-live

    Find which open PRs are impacted by a migration/sunset/refactor and notify their authors — blocking review when the old path is already gone from develop, heads-up comment when it is only deprecated…

    622 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Cloud Sync Module

    LedgerHQ/ledger-live

    Write, review or debug a cloudSyncModule.ts — a CloudSyncDataManager that syncs one slice of user data through Ledger Sync (Cloud Sync).

    622 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Codeownership

    LedgerHQ/ledger-live

    Maintain CODEOWNERS file and team directories. An agent skill from LedgerHQ/ledger-live.

    622 GitHub stars~687 tokensUpdated today
    Auto-check passed
  • Coin Families Contract

    LedgerHQ/ledger-live

    Coin-specific families logic must live in families/. An agent skill from LedgerHQ/ledger-live.

    622 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Data Layer Advanced

    LedgerHQ/ledger-live

    Structure a Ledger Wallet data layer where one API response serves several entities.

    622 GitHub stars~509 tokensUpdated today
    Auto-check passed
  • Debug Rn Native Crash

    LedgerHQ/ledger-live

    Investigate native React Native crashes (Fabric/Hermes/iOS) in ledger-live-mobile when JS error logs are missing or unhelpful.

    622 GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Works with

Questions about Card Endpoint Shape

What does Card Endpoint Shape do?

Read this before adding or editing an endpoint in domain/api/card-management/src/api.ts, a credential-bearing one included. Card Endpoint Shape is an agent skill from LedgerHQ/ledger-live.ts, a credential-bearing one included.

When should I use Card Endpoint Shape?

Card Endpoint Shape fits situations like: frontend & Design work in your project.

How do I install Card Endpoint Shape in Claude Code?

Run `npx skills add LedgerHQ/ledger-live --skill card-endpoint-shape -a claude-code`. Or copy the skill folder (domain/api/card-management/.agents/skills/card-endpoint-shape in LedgerHQ/ledger-live) into .claude/skills/card-endpoint-shape in your project. Claude Code loads it when a task matches its description.

How do I install Card Endpoint Shape in Codex?

Run `npx skills add LedgerHQ/ledger-live --skill card-endpoint-shape -a codex`. Or copy the skill folder (domain/api/card-management/.agents/skills/card-endpoint-shape in LedgerHQ/ledger-live) into .agents/skills/card-endpoint-shape in your project. Codex loads it when a task matches its description.

Can I use Card Endpoint Shape 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 LedgerHQ/ledger-live --skill card-endpoint-shape -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/card-endpoint-shape, .gemini/skills/card-endpoint-shape, .github/skills/card-endpoint-shape and .opencode/skills/card-endpoint-shape in your project.

What does Card Endpoint Shape need to run?

SKILL.md names no scripts, command-line tools or credentials: Card Endpoint Shape is instructions for the agent only.

Does Card Endpoint Shape 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 Card Endpoint Shape 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. Review the folder before installing.

What licence does Card Endpoint Shape use?

Card Endpoint Shape is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Card Endpoint Shape use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Card Endpoint Shape?

Skills that share tags, products or a category with Card Endpoint Shape: React State Management (involvex/youtube-music-cli, 456 stars), Frontend (redis/RedisInsight, 8.9k stars), React (valkey-io/valkey-admin, 148 stars) and Nekocap Redux Feature (nopol10/nekocap, 105 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Card Endpoint Shape?

LedgerHQ (a GitHub organization) maintains it in LedgerHQ/ledger-live, which has 622 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on October 9, 2026.

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