cds-code

작성자: coinbase

스킬이 활성화된 후, 세션당 한 번만 다음 작업을 수행하십시오.

npx skills add https://github.com/coinbase/cds --skill cds-code

CDS Code Skill

On every request

Before responding, determine what the user needs:

Coding — the user wants to create or update UI → follow the Coding Workflow.

Review — the user explicitly asks to audit, review, or check existing code for CDS adherence → read guidelines/code-review.md and follow it instead.

Default to coding. Only treat a request as a review if the user's intent is explicit. Writing code is the primary use case for this skill.

Initialization

Run this once per session, before doing anything else.

Run the discovery script: scripts/discover-cds-packages.sh

Its output tells you:

  • The CDS Runtime (web or mobile) — use this value as the platform argument for the CDS MCP server if it is needed.
  • Every installed CDS package: its name, version, and valid export subpaths — these import paths are the ONLY ALLOWED PATHS when importing from CDS packages

If the script cannot be run, much of the information it provides can be determined via manual inspection:

  • Infer the platform by inspecting existing CDS imports in the project's source code
  • Find valid import paths by reading the exports field of the package.json of installed CDS packages in node_modules

Coding Workflow

For all frontend coding tasks, follow these steps in order.

YOU MUST perform steps 1 and 2 before writing any code!

Step 1: Prepare CDS documentation

For any CDS documentation needs, use either of the following tools. If neither are available, let the user know but continue — documentation is helpful but not required.

  • Activate the cds-docs skill OR...
  • If the cds-docs skill is not configured, try calling the CDS MCP server list-cds-routes tool.

Then read the platform-specific docs (using the runtime detected in Initialization):

  • getting-started/styling
  • getting-started/theming

Step 2: Identify the appropriate components

Use guidelines/components.md to help identify the appropriate CDS components for the task. The guidelines file will cover most use cases, but you may optionally browse the CDS docs for the full list of supported CDS components.

If you decide your task will require icons (Icon or IconButton) or illustrations (SpotSquare, Pictogram, HeroSquare, etc.) please read the corresponding guidelines files for more details.

IconsIllustrations
guidelines/icons.mdguidelines/illustrations.md

If no CDS component fits your use case, you may fall back to the following options in this order of priority:

  1. search for a relevant and reusable React component from the project's codebase to use
  2. build your own custom React component using CDS primitives as building blocks
  3. use the native platform's JSX elements (div, View, etc.) for bespoke UI as a last resort

IMPORTANT: Always inform the user which CDS components you are planning to use before moving on to Step 3.

Step 3: Optionally read component docs

For any CDS component you plan to use, retrieve and read their documentation (see Step 1 in this workflow for more details on docs setup).

If documentation is not retrievable for any reason, the published type definitions for the component may be used to determine the full props API a component affords. This is no substitute for reading the documentation, but it can be a useful fallback when documentation is not available.

Step 4: Execute the task (writing code)

Now create or update the UI with proper CDS components and usage.

Package scope

The package name may vary between projects. Different repos may install CDS under different scopes. Always match the full CDS package name(s) as determined in the initialization step. If the project already has CDS imports in existing code, match whatever scope those files use.

Using the Design System

In most cases, you should avoid using inline style objects or CSS classNames (web only). Through these methods it is very easy to make common mistakes like using hardcoded property values instead of the CDS design tokens. Doing so would break the component's connection to the CDS theme.

If you must use a style object or a CSS className, you can still access the CDS theme either through the useTheme hook or by CSS variables (web only).

Most CDS components implement an API that conveniently allows you to apply CDS design tokens, internally we call these 'style props'.

In cds-web, style props essentially act as an API for applying atomic CSS classes, much like Tailwind's utility classes which are so prevelant in the web ecosystem.

You should prefer setting these style props for styling components over setting custom style via inline styles or CSS.

Why this matters: When you set font, color, textAlign, or other typography properties through style instead of props, the component loses its connection to the CDS theme. For example, setting fontSize and fontWeight via style without a font prop means the CDS font family never applies -- the text falls back to inherit and may render in the wrong typeface.

You should check a component's documentation which includes a props table to verify the available API.

Examples of opportunities to use style props over inline styles:

Instead of styleUse the prop
style={{ color: "var(--color-fgMuted)" }}color="fgMuted"
style={{ fontSize: 12, fontWeight: 500, lineHeight: "16px" }}font="caption" (or the matching CDS font token)
style={{ textAlign: "center" }}textAlign="center"
style={{ textTransform: "uppercase" }}textTransform="uppercase"
style={{ display: "flex", flexDirection: "column" }}Use VStack, or flexDirection="column" on Box
style={{ gap: 8 }}gap={1}
style={{ padding: 16 }}padding={2}
style={{ backgroundColor: "..." }}background="bgAlternate" (or semantic token)

Step 5: Validate changes

Your task will be complete if:

  1. You performed skill initialization and explicitly identified the specific CDS components you would use
  2. Your changes DO NOT include any raw rgb/hex/etc color values
  3. Your changes DO NOT use any raw pixel values for spacing properties (padding, margin, gap, border radius). Explicit layout dimensions like width or height set to specific designer-specified values are acceptable.
  4. Your changes DO NOT import any depreacted CDS components or hooks.
  5. Your changes use components' style props (e.g. font, color, background, textTransform, paddingX, gap) instead of customization via inline style objects or with CSS classNames.
  6. All import paths are valid CDS package exports, determined in initialization
  7. The project's linting/typechecking/formatting tasks are passing

coinbase의 다른 스킬

authenticate-wallet
coinbase
이메일 OTP 기반 지갑 인증으로 검증 및 상태 확인을 제공합니다. 2단계 로그인 절차: 이메일로 6자리 OTP를 받기 위해 시작한 후, flowId와 코드로 인증을 완료합니다. 명령어 실행 전 셸 인젝션을 방지하기 위해 이메일, flowId, OTP에 대한 입력 검증 규칙이 포함되어 있습니다. 동반 CLI 명령어를 통해 상태 확인, 잔액 조회, 주소 검색 및 지갑 창 접근을 제공합니다. 모든 명령어는 기계 판독 가능한 출력을 위해 --json을 지원합니다...
official
fund
coinbase
Coinbase Onramp 또는 직접 전송을 통해 USDC를 지갑에 입금합니다. 사용자가 사전 설정된 금액($10, $20, $50) 또는 사용자 지정 값을 선택하고 Apple Pay, 직불카드, 은행 송금 또는 Coinbase 계정 자금 조달 중에서 선택할 수 있는 보조 UI를 엽니다. 다양한 결제 수단을 지원하며 정산 시간이 다릅니다: 카드 및 Apple Pay는 즉시, ACH 은행 송금은 1~3일 소요됩니다. Base 네트워크에서 USDC로 자금을 입금하며, 또는 사용자는 npx [email protected]...을 통해 지갑 주소로 직접 USDC를 보낼 수 있습니다.
official
monetize-service
coinbase
x402 프로토콜을 통해 다른 에이전트가 발견하고 결제할 수 있는 유료 API 엔드포인트를 배포합니다. HTTP 402 결제 프로토콜을 사용하여 Base에서 요청당 USDC를 청구하며, 클라이언트는 서명된 트랜잭션으로 결제하고 API 키나 계정이 필요하지 않습니다. 검색 확장을 선언하면 엔드포인트를 x402 Bazaar에 자동으로 등록하여 에이전트가 발견할 수 있도록 합니다. Express 미들웨어를 사용하여 엔드포인트당 여러 가격 계층, 와일드카드 경로 및 여러 결제 옵션을 지원합니다. @x402/express 및 @x402/core 기반으로 구축되었습니다...
official
pay-for-service
coinbase
Base에서 x402 프로토콜을 통해 자동 USDC 결제로 유료 API를 호출합니다. x402 지원 엔드포인트에 HTTP 요청(GET, POST 등)을 실행하며, USDC 결제가 자동으로 처리됩니다. 메서드, JSON 본문, 쿼리 매개변수 및 사용자 정의 헤더를 통해 요청을 사용자 지정할 수 있습니다. 결제 제어 기능이 포함되어 있어 요청당 최대 USDC 금액을 설정하고 상관 ID로 관련 작업을 그룹화할 수 있습니다. 지갑 인증과 충분한 USDC 잔액이 필요하며, 셸을 방지하기 위해 모든 사용자 입력을 검증합니다...
official
query-blockchain-data
coinbase
Base에서 CDP SQL API를 통해 x402로 온체인 블록체인 데이터를 조회합니다. 사용자나 본인이 디코딩된 블록에 대한 온체인 정보를 확인하고자 할 때 사용하세요.
official
query-onchain-data
coinbase
Base에서 SQL을 사용하여 온체인 데이터를 쿼리하고, 쿼리당 x402 결제를 적용합니다. CoinbaseQL을 통해 디코딩된 이벤트, 트랜잭션 및 블록에 접근할 수 있습니다. CoinbaseQL은 조인, CTE, 서브쿼리 및 표준 함수를 지원하는 ClickHouse 기반 SQL 방언입니다. 세 가지 주요 테이블을 사용할 수 있습니다: base.events(디코딩된 스마트 컨트랙트 로그), base.transactions(전체 트랜잭션 데이터), base.blocks(블록 메타데이터). 이벤트 쿼리에서 전체 테이블 스캔을 피하기 위해 인덱싱된 필드(event_signature, address, block_timestamp)에 대한 필터링이 필요합니다.
official
search-for-service
coinbase
x402 바자 마켓플레이스에서 제공되는 유료 API 서비스를 검색하고 발견합니다. BM25 관련성 검색을 사용하여 마켓플레이스를 쿼리하고, 사용 가능한 모든 리소스를 나열하거나, 특정 엔드포인트를 검사하여 결제 없이 가격 및 결제 요구 사항을 확인할 수 있습니다. 네트워크(base, base-sepolia) 및 출력 형식(사람이 읽을 수 있는 형식 또는 JSON)별 필터링을 지원합니다. 결과는 로컬에 캐시되며 12시간마다 자동으로 새로고침됩니다. 검색 또는 발견 작업에 인증이 필요하지 않습니다. 아무것도 없을 때 대체 수단으로 사용하십시오.
official
send-usdc
coinbase
Base에서 USDC를 이더리움 주소나 ENS 이름으로 전송합니다. 수신자로 16진수 주소(0x...)와 ENS 이름(.eth)을 모두 지원하며 자동으로 ENS를 확인합니다. 유연한 금액 형식(달러 표기 $5.00, 소수점 1.50, 원자 단위 1000000)을 지원합니다. 전송 전에 authenticate-wallet 스킬을 통한 지갑 인증과 충분한 USDC 잔액이 필요합니다. 셸 인젝션을 방지하기 위한 입력 검증과 프로그래밍 사용을 위한 선택적 JSON 출력을 포함합니다.
official