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

Skills เพิ่มเติมจาก coinbase

authenticate-wallet
coinbase
การยืนยันตัวตนกระเป๋าเงินผ่าน OTP ทางอีเมล พร้อมการตรวจสอบความถูกต้องและสถานะ ขั้นตอนการเข้าสู่ระบบสองขั้นตอน: เริ่มต้นด้วยอีเมลเพื่อรับ OTP 6 หลัก จากนั้นยืนยันด้วย flowId และรหัสเพื่อดำเนินการยืนยันตัวตนให้สมบูรณ์ รวมถึงกฎการตรวจสอบข้อมูลนำเข้าสำหรับอีเมล flowId และ OTP เพื่อป้องกันการแทรกคำสั่งเชลล์ก่อนดำเนินการคำสั่ง ให้การตรวจสอบสถานะ การสอบถามยอดคงเหลือ การดึงที่อยู่ และการเข้าถึงหน้าต่างกระเป๋าเงินผ่านคำสั่ง CLI ที่เกี่ยวข้อง คำสั่งทั้งหมดรองรับเอาต์พุต --json สำหรับการอ่านโดยเครื่อง...
official
fund
coinbase
ฝาก USDC เข้ากระเป๋าเงินผ่าน Coinbase Onramp หรือโอนโดยตรง เปิด UI คู่หูที่ให้ผู้ใช้เลือกจำนวนเงินที่กำหนดไว้ ($10, $20, $50) หรือกำหนดเอง และเลือกจาก Apple Pay, บัตรเดบิต, โอนผ่านธนาคาร หรือการเติมเงินจากบัญชี Coinbase รองรับวิธีการชำระเงินหลายวิธีโดยมีระยะเวลาการชำระที่แตกต่างกัน: ทันทีสำหรับบัตรและ Apple Pay, 1–3 วันสำหรับการโอนผ่านธนาคารแบบ ACH ฝากเงินเป็น USDC บนเครือข่าย Base; หรือผู้ใช้สามารถส่ง USDC ไปยังที่อยู่กระเป๋าเงินโดยตรงผ่าน npx [email protected]...
official
monetize-service
coinbase
ปรับใช้ปลายทาง API แบบชำระเงินที่เอเจนต์อื่นสามารถค้นพบและชำระเงินผ่านโปรโตคอล x402 คิดค่าบริการเป็น USDC ต่อคำขอบน Base โดยใช้โปรโตคอลการชำระเงิน HTTP 402; ลูกค้าชำระเงินด้วยธุรกรรมที่ลงนามแล้ว ไม่ต้องใช้คีย์ API หรือบัญชีใดๆ ลงทะเบียนปลายทางกับ x402 Bazaar โดยอัตโนมัติเพื่อให้เอเจนต์ค้นพบเมื่อคุณประกาศส่วนขยายการค้นพบ รองรับระดับราคาหลายระดับ เส้นทางแบบ Wildcard และตัวเลือกการชำระเงินหลายแบบต่อปลายทางโดยใช้ Express Middleware สร้างบน @x402/express และ @x402/core...
official
pay-for-service
coinbase
เรียกใช้ API แบบชำระเงินบน Base ด้วยการชำระเงิน USDC อัตโนมัติผ่านโปรโตคอล x402 ดำเนินการร้องขอ HTTP (GET, POST ฯลฯ) ไปยังเอนด์พอยต์ที่รองรับ x402 โดยจัดการชำระเงิน USDC แบบอะตอมิกโดยอัตโนมัติ รองรับการปรับแต่งคำขอผ่านเมธอด, เนื้อหา JSON, พารามิเตอร์คิวรี, และส่วนหัวที่กำหนดเอง รวมถึงการควบคุมการชำระเงิน: กำหนดจำนวน USDC สูงสุดต่อคำขอ และจัดกลุ่มการดำเนินการที่เกี่ยวข้องด้วยรหัส correlation ต้องมีการยืนยันตัวตนของกระเป๋าเงินและยอดคงเหลือ USDC ที่เพียงพอ ตรวจสอบอินพุตของผู้ใช้ทั้งหมดเพื่อป้องกันเชลล์...
official
query-blockchain-data
coinbase
สอบถามข้อมูลบล็อกเชนออนเชนบน Base โดยใช้ CDP SQL API ผ่าน x402 ใช้เมื่อคุณหรือผู้ใช้ของคุณต้องการดูข้อมูลออนเชนเกี่ยวกับบล็อกที่ถอดรหัสแล้ว…
official
query-onchain-data
coinbase
สอบถามข้อมูลออนเชนบน Base โดยใช้ SQL พร้อมการชำระเงินแบบ x402 ต่อคำสั่งค้นหา เข้าถึงอีเวนต์ ธุรกรรม และบล็อกที่ถอดรหัสแล้วผ่าน CoinbaseQL ซึ่งเป็นภาษา SQL ที่ใช้ ClickHouse รองรับการ join, CTE, subquery และฟังก์ชันมาตรฐาน มีตารางหลักสามตาราง: base.events (บันทึกสัญญาอัจฉริยะที่ถอดรหัสแล้ว), base.transactions (ข้อมูลธุรกรรมทั้งหมด), และ base.blocks (ข้อมูลเมตาของบล็อก) จำเป็นต้องกรองฟิลด์ที่จัดทำดัชนี (event_signature, address, block_timestamp) ในการค้นหาอีเวนต์เพื่อหลีกเลี่ยงการสแกนทั้งตาราง...
official
search-for-service
coinbase
ค้นหาและค้นพบบริการ API แบบชำระเงินที่มีอยู่ในตลาด x402 bazaar ค้นหาตลาดโดยใช้การค้นหาความเกี่ยวข้องแบบ BM25 แสดงรายการทรัพยากรที่มีทั้งหมด หรือตรวจสอบเอนด์พอยต์เฉพาะเพื่อดูราคาและข้อกำหนดการชำระเงินโดยไม่ต้องจ่ายเงิน รองรับการกรองตามเครือข่าย (base, base-sepolia) และรูปแบบผลลัพธ์ (อ่านได้โดยมนุษย์หรือ JSON) ผลลัพธ์จะถูกแคชในเครื่องและรีเฟรชอัตโนมัติทุก 12 ชั่วโมง ไม่ต้องมีการยืนยันตัวตนสำหรับการค้นหาหรือการค้นพบใดๆ ใช้เป็นทางเลือกสำรองเมื่อไม่มี...
official
send-usdc
coinbase
โอน USDC ไปยังที่อยู่ Ethereum หรือชื่อ ENS บน Base รองรับทั้งที่อยู่แบบ hex (0x...) และชื่อ ENS (.eth) เป็นผู้รับ พร้อมการแก้ไขชื่อ ENS อัตโนมัติ รองรับรูปแบบจำนวนเงินที่ยืดหยุ่น: สัญลักษณ์ดอลลาร์ ($5.00), ทศนิยม (1.50) หรือหน่วยอะตอม (1000000) ต้องมีการยืนยันตัวตนกระเป๋าเงินผ่านสกิล authenticate-wallet และมียอดคงเหลือ USDC เพียงพอก่อนส่ง รวมถึงการตรวจสอบอินพุตเพื่อป้องกัน shell injection และเอาต์พุต JSON สำหรับการใช้งานแบบโปรแกรม
official