dev.cds-web

tarafından coinbase

dev.cds-web — coinbase/cds tarafından yayınlanan, yapay zeka ajanları için yüklenebilir bir beceri.

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

CDS Web Package Guidelines

Component Config Adoption (Web)

Use this guidance when adding ComponentConfigProvider defaults for the specific component you are editing.

Required implementation pattern

  1. Register the component in packages/web/src/core/componentConfig.ts using its *BaseProps:
import type { MyComponentBaseProps } from '../category/MyComponent';

export type ComponentConfig = {
  MyComponent?: ConfigResolver<MyComponentBaseProps>;
};
  1. Adopt useComponentConfig in the component and destructure from merged props:
import { useComponentConfig } from '../hooks/useComponentConfig';

export const MyComponent = memo((_props: MyComponentProps) => {
  const mergedProps = useComponentConfig('MyComponent', _props);
  const { className, style, ...props } = mergedProps;

  return <Box className={className} style={style} {...props} />;
});

Rules to preserve behavior

  • Provider config supplies defaults only; local props must continue to win.
  • Use _props as the input variable and mergedProps as the configured output.
  • Type resolver entries with *BaseProps (not polymorphic/full *Props).
  • Keep scope to prop-level theming defaults; do not alter component behavior or control flow.
  • When practical during the same change, prefer arrow-function component declarations.

CSS with Linaria

Use Linaria for zero-runtime CSS. Always use CDS theme CSS variables for colors, spacing, typography, and other design tokens. Reference packages/web/src/core/theme.ts:53-119 for the CSS variable naming pattern.

import { css, cx } from '@linaria/core';

const containerCss = css`
  /* Spacing tokens */
  padding: var(--space-2);
  gap: var(--space-1);

  /* Color tokens */
  background: var(--color-bgPrimary);
  color: var(--color-fgPrimary);
  border: 1px solid var(--color-line);

  /* Border radius tokens */
  border-radius: var(--borderRadius-400);

  /* Typography tokens */
  font-size: var(--fontSize-body);

  &:hover {
    background: var(--color-bgPrimaryHover);
  }
`;

// Merge classNames with cx utility **in CORRECT ORDER**
<div
  className={cx(
    containerCss, // Base styles first
    isCompact && conditionClassToApply, // Conditional computed styles
    className, // User-provided className prop
    classNames.root, // granular overrides last
  )}
/>;

IMPORTANT: Using CSS variables ensures components respond correctly to theme changes (light/dark mode, brand themes).

CSS Variable Naming

Design tokens from packages/common/src/core/theme.ts map to CSS variables:

  • Colors: --color-{tokenName} (e.g., --color-bgPrimary, --color-fgMuted)
  • Spacing: --space-{scale} (e.g., --space-2 = 16px, --space-3 = 24px)
  • Typography: --fontSize-{font}, --fontWeight-{font}, --lineHeight-{font}, --fontFamily-{font}
  • Border: --borderRadius-{size}, --borderWidth-{size}
  • Sizing: --iconSize-{size}, --avatarSize-{size}, --controlSize-{name}
  • Shadows: --shadow-{level}

Responsive Breakpoints

Reference packages/web/src/styles/media.ts for breakpoint values:

  • phone: 0-767px
  • tablet: 768-1279px
  • desktop: 1280px+

Use the Box component's responsive prop API for responsive values:

<Box padding={{ base: 2, phone: 1, desktop: 3 }} />

Granular classNames

  • Components can expose a classNames object prop for granular overrides on child elements within the component.
  • Since the keys of the classNames object are specific to the component they should never be on the *BaseProps type

data-attributes

  • Use data attributes for state-based styling: data-active, data-disabled, data-variant, data-filled

Inline styles

  • Web components should all expose a style and styles object props for overriding inline styles.
  • As styling is a concern of that specific component, the style and styles props should never be on the *BaseProps type.
  • Styles should be merged into a single object with a useMemo hook and applied in the correct order (default styles => style prop => styles[ELEMENT_NAME] prop).

Example:

type ComponentProps = ComponentBaseProps & {
  style?: React.CSSProperties;
  styles?: { root?: React.CSSProperties; label?: React.CSSProperties };
};

Animation

Use Framer Motion for complex animations:

import { m as motion, AnimatePresence } from 'framer-motion';

<AnimatePresence>
  {visible && (
    <motion.div
      initial={{ opacity: 0, y: -8 }}
      animate={{ opacity: 1, y: 0 }}
      exit={{ opacity: 0, y: -8 }}
    />
  )}
</AnimatePresence>;

For simple transitions, prefer CSS transitions in Linaria.

Accessibility

Use ARIA attributes:

<div role="group" aria-roledescription="carousel" aria-live="polite">
  <button aria-pressed={isActive} tabIndex={isVisible ? 0 : -1} />
</div>
  • Implement keyboard navigation (Arrow keys, Home, End) for interactive components.
  • Provide descriptive labels for all interactive elements
  • Associate form inputs with helper text using aria-describedby
  • Use semantic HTML elements whenever possible
  • Follow WCAG 2.1 AA standards for color contrast
  • Support screen readers by providing descriptive labels and instructions

Web-Specific Props

  • className?: string - CSS class always applied to root element
  • style?: React.CSSProperties - inline styles always applied to root element
  • Polymorphic as prop for element type (where applicable e.g. see Box)

Reference Components

  • Carousel: compound components, imperative handle, context pattern
  • Select (alpha/): generics, controlled/uncontrolled
  • RollingNumber: animation config, measurement patterns

coinbase tarafından daha fazla skill

git.repo-manager
coinbase
git.repo-manager — coinbase/cds tarafından yayınlanan, yapay zeka ajanları için kurulabilir bir beceri.
official
agentic-wallet
coinbase
Awal CLI üzerinden kripto cüzdan işlemleri — giriş yapma, bakiyeleri kontrol etme, USDC/ETH/POL/SOL gönderme, token takası yapma, cüzdanı fonlama ve x402 ödeme protokolünü kullanarak…
official
authenticate-wallet
coinbase
E-posta OTP tabanlı cüzdan kimlik doğrulaması, doğrulama ve durum kontrolü ile birlikte. İki adımlı giriş akışı: e-posta ile başlatılarak 6 haneli OTP alınır, ardından flowId ve kod ile doğrulanarak kimlik doğrulama tamamlanır. Komutları çalıştırmadan önce shell enjeksiyonunu önlemek için e-posta, flowId ve OTP için giriş doğrulama kuralları içerir. Yardımcı CLI komutları aracılığıyla durum kontrolü, bakiye sorgulama, adres alma ve cüzdan penceresi erişimi sağlar. Tüm komutlar makine tarafından okunabilir çıktı için --json çıktısını destekler...
official
fund
coinbase
Coinbase Onramp veya doğrudan transfer yoluyla cüzdana USDC yatırır. Kullanıcıların önceden belirlenmiş miktarları (10$, 20$, 50$) veya özel değerleri seçip Apple Pay, banka kartı, banka havalesi veya Coinbase hesabı finansmanı arasından tercih yapabileceği bir yardımcı arayüz açar. Farklı mutabakat sürelerine sahip birden fazla ödeme yöntemini destekler: kart ve Apple Pay için anlık, ACH banka havaleleri için 1–3 gün. Fonları Base ağında USDC olarak yatırır; alternatif olarak, kullanıcılar npx awal@2.0.3... aracılığıyla doğrudan cüzdan adresine USDC göndere
official
monetize-service
coinbase
Ücretli bir API uç noktası dağıtır; diğer ajanlar bunu x402 protokolü üzerinden keşfedip ödeme yapabilir. Base üzerinde HTTP 402 ödeme protokolü kullanarak istek başına USDC tahsil eder; istemciler imzalı işlemlerle ödeme yapar, API anahtarı veya hesap gerekmez. Keşif uzantılarını bildirdiğinizde uç noktaları otomatik olarak x402 Bazaar'a kaydeder. Express middleware kullanarak uç nokta başına birden fazla fiyatlandırma katmanı, joker karakter rotaları ve birden fazla ödeme seçeneğini destekler. @x402/express ve @x402/core üzerine inşa edilmiştir...
official
pay-for-service
coinbase
Base üzerinde x402 protokolü aracılığıyla otomatik USDC ödemesiyle ücretli API'leri çağırır. Atomik USDC ödemeleriyle x402 destekli uç noktalara HTTP istekleri (GET, POST vb.) yürütür. Yöntem, JSON gövdesi, sorgu parametreleri ve özel başlıklar aracılığıyla istek özelleştirmesini destekler. Ödeme kontrolleri içerir: istek başına maksimum USDC miktarını ayarlayın ve ilgili işlemleri korelasyon kimlikleriyle gruplandırın. Cüzdan kimlik doğrulaması ve yeterli USDC bakiyesi gerektirir; shell'i önlemek için tüm kullanıcı girdilerini doğrular...
official
query-blockchain-data
coinbase
Base üzerinde CDP SQL API aracılığıyla x402 kullanarak zincir üstü blok zinciri verilerini sorgulayın. Siz veya kullanıcınız, çözülmüş bloklar hakkında zincir üstü bilgileri görüntülemek istediğinizde kullanın.
official
query-onchain-data
coinbase
Base üzerinde SQL kullanarak sorgu başına x402 ödemeleriyle zincir üstü verileri sorgulayın. CoinbaseQL aracılığıyla çözülmüş olaylara, işlemlere ve bloklara erişin; bu, birleştirmeleri, CTE'leri, alt sorguları ve standart işlevleri destekleyen ClickHouse tabanlı bir SQL lehçesidir. Üç ana tablo mevcuttur: base.events (çözülmüş akıllı sözleşme günlükleri), base.transactions (tam işlem verileri) ve base.blocks (blok meta verileri). Olay sorgularında tam tablo taramasını önlemek için indekslenmiş alanlarda (event_signature, address, block_timestamp) filtreleme gerektirir.
official