cds-code

bởi coinbase

Chỉ thực hiện các thao tác sau một lần mỗi phiên, sau khi kỹ năng được kích hoạt.

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

Thêm skills từ coinbase

authenticate-wallet
coinbase
Xác thực ví dựa trên OTP qua email với kiểm tra trạng thái và xác thực. Quy trình đăng nhập hai bước: khởi tạo bằng email để nhận mã OTP 6 chữ số, sau đó xác minh với flowId và mã để hoàn tất xác thực. Bao gồm các quy tắc kiểm tra đầu vào cho email, flowId và OTP nhằm ngăn chặn tấn công shell trước khi thực thi lệnh. Cung cấp kiểm tra trạng thái, truy vấn số dư, lấy địa chỉ và truy cập cửa sổ ví thông qua các lệnh CLI đi kèm. Tất cả lệnh đều hỗ trợ đầu ra --json để máy có thể đọc được...
official
fund
coinbase
Nạp USDC vào ví qua Coinbase Onramp hoặc chuyển khoản trực tiếp. Mở giao diện đồng hành cho phép người dùng chọn số tiền định sẵn ($10, $20, $50) hoặc giá trị tùy chỉnh và chọn thanh toán qua Apple Pay, thẻ ghi nợ, chuyển khoản ngân hàng hoặc tài khoản Coinbase. Hỗ trợ nhiều phương thức thanh toán với thời gian xử lý khác nhau: thanh toán ngay lập tức qua thẻ và Apple Pay, 1–3 ngày đối với chuyển khoản ngân hàng ACH. Nạp tiền dưới dạng USDC trên mạng Base; ngoài ra, người dùng có thể gửi USDC trực tiếp đến địa chỉ ví qua npx [email protected]...
official
monetize-service
coinbase
Triển khai một điểm cuối API trả phí mà các tác nhân khác có thể khám phá và thanh toán qua giao thức x402. Tính phí USDC mỗi yêu cầu trên Base bằng giao thức thanh toán HTTP 402; khách hàng thanh toán bằng giao dịch đã ký, không cần khóa API hoặc tài khoản. Tự động đăng ký điểm cuối với x402 Bazaar để các tác nhân khám phá khi bạn khai báo phần mở rộng khám phá. Hỗ trợ nhiều mức giá, tuyến đường ký tự đại diện và nhiều tùy chọn thanh toán cho mỗi điểm cuối bằng phần mềm trung gian Express. Được xây dựng trên @x402/express và @x402/core...
official
pay-for-service
coinbase
Gọi các API trả phí trên Base với thanh toán USDC tự động qua giao thức x402. Thực thi các yêu cầu HTTP (GET, POST, v.v.) đến các điểm cuối hỗ trợ x402 với thanh toán USDC nguyên tử được xử lý tự động. Hỗ trợ tùy chỉnh yêu cầu thông qua phương thức, nội dung JSON, tham số truy vấn và tiêu đề tùy chỉnh. Bao gồm các kiểm soát thanh toán: đặt số tiền USDC tối đa cho mỗi yêu cầu và nhóm các thao tác liên quan với ID tương quan. Yêu cầu xác thực ví và số dư USDC đủ; xác thực tất cả đầu vào của người dùng để ngăn chặn shell...
official
query-blockchain-data
coinbase
Truy vấn dữ liệu onchain blockchain trên Base bằng CDP SQL API qua x402. Sử dụng khi bạn hoặc người dùng muốn xem thông tin onchain về các block đã được giải mã,…
official
query-onchain-data
coinbase
Truy vấn dữ liệu onchain trên Base bằng SQL với thanh toán x402 theo từng truy vấn. Truy cập các sự kiện, giao dịch và khối đã được giải mã qua CoinbaseQL, một phương ngữ SQL dựa trên ClickHouse hỗ trợ joins, CTEs, truy vấn con và các hàm tiêu chuẩn. Ba bảng chính có sẵn: base.events (log hợp đồng thông minh đã giải mã), base.transactions (dữ liệu giao dịch đầy đủ) và base.blocks (siêu dữ liệu khối). Yêu cầu lọc trên các trường được đánh chỉ mục (event_signature, address, block_timestamp) trong truy vấn sự kiện để tránh quét toàn bộ bảng...
official
search-for-service
coinbase
Tìm kiếm và khám phá các dịch vụ API trả phí có sẵn trên thị trường x402 bazaar. Truy vấn thị trường bằng tìm kiếm mức độ liên quan BM25, liệt kê tất cả tài nguyên có sẵn hoặc kiểm tra các endpoint cụ thể để xem giá cả và yêu cầu thanh toán mà không cần thanh toán. Hỗ trợ lọc theo mạng (base, base-sepolia) và định dạng đầu ra (có thể đọc được bằng con người hoặc JSON). Kết quả được lưu vào bộ nhớ đệm cục bộ và tự động làm mới sau mỗi 12 giờ; không yêu cầu xác thực cho bất kỳ thao tác tìm kiếm hoặc khám phá nào. Sử dụng làm phương án dự ph
official
send-usdc
coinbase
Chuyển USDC đến địa chỉ Ethereum hoặc tên ENS trên Base. Chấp nhận cả địa chỉ hex (0x...) và tên ENS (.eth) làm người nhận, với tính năng tự động phân giải ENS. Hỗ trợ các định dạng số lượng linh hoạt: ký hiệu đô la ($5.00), số thập phân (1.50) hoặc đơn vị nguyên tử (1000000). Yêu cầu xác thực ví thông qua skill authenticate-wallet và số dư USDC đủ trước khi gửi. Bao gồm kiểm tra đầu vào để ngăn chặn shell injection và đầu ra JSON tùy chọn cho mục đích lập trình.
official