Skip to content

Commit 44810fc

Browse files
Merge branch 'master' into perf/mobile-chart-rendering
2 parents 1bc9f42 + fb3cf07 commit 44810fc

12 files changed

Lines changed: 793 additions & 255 deletions

File tree

Binary file not shown.
Binary file not shown.

AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ Runtime: NodeJS (see .nvmrc for version)
5959
- **`apps/storybook/`** - Component development and testing environment for cds-web
6060
- **`apps/expo-app/`** - Expo app for testing and visual regression of CDS mobile components
6161

62+
## Skills
63+
64+
Skills for this project live in `skills/`. Each skill has a `README.md` and optionally an `evals/` directory with benchmark test cases.
65+
66+
### After running skill evals
67+
68+
If a skill has evals and you run them, update the skill's `README.md` with a `## Performance` section containing the latest benchmark results:
69+
70+
- Overall summary table: pass rate, avg time, avg tokens — with/without skill and the delta
71+
- Per-eval breakdown table showing each task name and pass rates for each configuration
72+
- A callout of the biggest gains (where the skill adds the most value)
73+
- The iteration number and date for traceability
74+
75+
See `skills/cds-code/README.md` for a reference example.
76+
6277
## Standards & Best Practices
6378

6479
### General

skills-lock.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"skill-creator": {
55
"source": "anthropics/skills",
66
"sourceType": "github",
7+
"skillPath": "skills/skill-creator/SKILL.md",
78
"computedHash": "5ea13a6d9f0d4bb694405d79acd00cadec0d21bb138c4dd10fcf3c500cb835c2"
89
}
910
}

skills/cds-code/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,38 @@
11
# cds-code
22

3-
Helps your agent write idiomatic Coinbase Design System (CDS) code for React or React Native projects.
3+
Helps your agent write idiomatic Coinbase Design System (CDS) code for React or React Native projects. Also supports CDS code review — ask your agent to audit a feature or set of files for CDS adherence.
44

55
We recommend also installing the `cds-docs` Skill or the CDS MCP server for even better performance!
66

77
```bash
88
npx skills add https://github.com/coinbase/cds --skill cds-docs
99
```
1010

11+
## Performance
12+
13+
Evaluated against 8 real-world coding and review tasks (iteration 3, 2026-06-26):
14+
15+
| Metric | With skill | Without skill | Delta |
16+
| ---------- | ---------- | ------------- | ------ |
17+
| Pass rate | **100%** | 73.7% | +26.3% |
18+
| Avg time | 112.5s | 72.4s | +40.1s |
19+
| Avg tokens | 39,907 | 38,176 | +1,731 |
20+
21+
### Per-eval breakdown
22+
23+
| Task | With skill | Without skill |
24+
| ------------------------------------------------- | ---------- | ------------- |
25+
| Profile card (Avatar, ListCell, tokens) | 100% | 78% |
26+
| Create team modal (Modal, Select alpha) | 100% | 100% |
27+
| Banner + progress visualizations | 100% | 100% |
28+
| Sidebar nav (icon names, active state) | 100% | 80% |
29+
| Empty state + illustration sizing | 100% | 60% |
30+
| React Native wallet screen (CDS mobile) | 100% | 83% |
31+
| Deprecated component trap (TextHeadline/TextBody) | 100% | 17% |
32+
| CDS code review (structured lint output) | 100% | 71% |
33+
34+
The biggest gains come from domain-specific knowledge the base model lacks: CDS mobile primitives, deprecated API awareness, illustration component selection, and structured audit-format output.
35+
1136
## Running evaluations
1237

1338
Use the `skill-creator` skill to run the evals.

skills/cds-code/SKILL.md

Lines changed: 71 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,64 @@
11
---
22
name: cds-code
33
description: |
4-
Produces high quality Coinbase Design System (CDS) code for React and React Native projects.
5-
Always use this skill every time you are asked to create or update UI or write React or React Native code.
4+
Provides a structured workflow for writing high quality Coinbase Design System (CDS) code.
5+
Use this skill every time you are asked to create or update a user interface using React or React Native.
6+
Additinoally, this skill may be used to conduct a code review on existing code for CDS adherence.
7+
Trigger examples: "build this screen", "update this component", "perform a CDS audit on our changes",
8+
"check our codebase for CDS adherence", "does this feature use CDS well?"
69
license: Apache-2.0
710
metadata:
8-
version: '2.0.0'
11+
version: '2.1.0'
912
---
1013

11-
# CDS Code Writing Skill
14+
# CDS Code Skill
1215

13-
## Contents
16+
## On every request
1417

15-
1. Part 1: Initialization | Follow these steps once per session, before you write any code
16-
2. Part 2: Workflow | Follow these steps for all frontend coding tasks
18+
Before responding, determine what the user needs:
1719

18-
## Part 1: Initialization
20+
**Coding** — the user wants to create or update UI → follow the Coding Workflow.
1921

20-
Perform the following operations only once per session, after the skill is activated.
22+
**Review**the user explicitly asks to audit, review, or check existing code for CDS adherence → read `guidelines/code-review.md` and follow it instead.
2123

22-
### Prepare CDS documentation
24+
**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.
2325

24-
For any CDS documentation needs, you will need to use either of the following tools.
25-
If neither are available you may let the user know but still continue on with the task as documentation is helpful but not required.
26+
## Initialization
2627

27-
- Activate the `cds-docs` skill OR...
28-
- If the `cds-docs` skill is not configured, try calling the CDS MCP server `list-cds-routes` tool.
28+
Run this once per session, before doing anything else.
2929

30-
### Environment Detection
30+
Run the discovery script: `scripts/discover-cds-packages.sh`
3131

32-
You must determine if you are operating in a React or React Native project before you write any code.
32+
Its output tells you:
3333

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

36-
Run the `bash` discovery script: `scripts/discover-cds-packages.sh`
37+
If the script cannot be run, much of the information it provides can be determined via manual inspection:
3738

38-
This will gve you:
39+
- Infer the platform by inspecting existing CDS imports in the project's source code
40+
- Find valid import paths by reading the `exports` field of the `package.json` of installed CDS packages in `node_modules`
3941

40-
- The `CDS Runtime` (`web` or `mobile`) - use this value as the `platform` argument for the CDS MCP server
41-
- Every installed CDS package: its name, version, and valid export subpaths - these import paths are the ONLY ALLOWED PATHS for importing from CDS packages.
42+
## Coding Workflow
4243

43-
If you are unable to run the bash script, you can likely infer the `platform` by inspecting the project's source code.
44+
For all frontend coding tasks, follow these steps in order.
4445

45-
2. Read the platform-specific styling and themeing documentation:
46+
**YOU MUST** perform steps 1 and 2 before writing any code!
4647

47-
- `getting-started/styling`
48-
- `getting-started/theming`
48+
### Step 1: Prepare CDS documentation
49+
50+
For any CDS documentation needs, use either of the following tools.
51+
If neither are available, let the user know but continue — documentation is helpful but not required.
4952

50-
## Part 2: Workflow
53+
- Activate the `cds-docs` skill OR...
54+
- If the `cds-docs` skill is not configured, try calling the CDS MCP server `list-cds-routes` tool.
5155

52-
For all frontend coding tasks, you must follow these steps.
56+
Then read the platform-specific docs (using the runtime detected in Initialization):
5357

54-
**YOU MUST** perform steps 1 and 2 before writing any code!
58+
- `getting-started/styling`
59+
- `getting-started/theming`
5560

56-
### Step 1: Identify the appropriate components
61+
### Step 2: Identify the appropriate components
5762

5863
Use `guidelines/components.md` to help identify the appropriate CDS components for the task.
5964
The guidelines file will cover most use cases, but you may optionally browse the CDS docs for the full list of supported CDS components.
@@ -64,31 +69,48 @@ If you decide your task will require icons (`Icon` or `IconButton`) or illustrat
6469
| --------------------- | ----------------------------- |
6570
| `guidelines/icons.md` | `guidelines/illustrations.md` |
6671

67-
If the task involves icons, also follow `guidelines/icons.md` and use `scripts/discover-cds-icons.mjs` to search icon names. If the task involves illustrations, also follow `guidelines/illustrations.md` and use `scripts/discover-cds-illustrations.mjs` to search illustration names.
68-
6972
If no CDS component fits your use case, you may fall back to the following options in this order of priority:
7073

71-
1. use a custom React component from the project's codebase
72-
2. build your own custom React component
73-
3. use the native platform's JSX elements for bespoke UI
74+
1. search for a relevant and reusable React component from the project's codebase to use
75+
2. build your own custom React component using CDS primitives as building blocks
76+
3. use the native platform's JSX elements (div, View, etc.) for bespoke UI as a last resort
77+
78+
**IMPORTANT:** Always inform the user which CDS components you are planning to use before moving on to Step 3.
7479

75-
**IMPORTANT:** Always inform the user which CDS components you are planning to use before moving on to `Step 2`.
80+
### Step 3: Optionally read component docs
7681

77-
### Step 2: Optionally read component docs
82+
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).
7883

79-
For any CDS component you plan to use, retrieve and read their documentation (see `Part 1` for more details on docs setup).
84+
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.
8085

81-
### Step 3: Execute the task (writing frontend code)
86+
### Step 4: Execute the task (writing code)
8287

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

85-
Most CDS component implement an API that allows you to apply the CDS design tokens, we call these 'style props'. Prefer setting these style props for styling components over setting custom style via inline styles or CSS.
90+
#### Package scope
91+
92+
The package name may vary between projects. Different repos may install CDS under different scopes.
93+
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.
94+
95+
#### Using the Design System
96+
97+
In most cases, you should avoid using inline style objects or CSS classNames (web only).
98+
Through these methods it is very easy to make common mistakes like using hardcoded property values instead of the CDS design tokens.
99+
Doing so would break the component's connection to the CDS theme.
100+
101+
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).
102+
103+
Most CDS components implement an API that conveniently allows you to apply CDS design tokens, internally we call these 'style props'.
104+
105+
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.
106+
107+
You should prefer setting these style props for styling components over setting custom style via inline styles or CSS.
86108

87109
**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.
88110

89-
You should check a component's props table in their CDS docs page to verify what props are available.
111+
You should check a component's documentation which includes a props table to verify the available API.
90112

91-
Example misuse of custom styles and their style props alternatives:
113+
Examples of opportunities to use style props over inline styles:
92114

93115
| Instead of `style` | Use the prop |
94116
| --------------------------------------------------------------- | -------------------------------------------------- |
@@ -101,34 +123,14 @@ Example misuse of custom styles and their style props alternatives:
101123
| `style={{ padding: 16 }}` | `padding={2}` |
102124
| `style={{ backgroundColor: "..." }}` | `background="bgAlternate"` (or semantic token) |
103125

104-
If you need to further customize the style of a rendered CDS component or a specific style is not support via style props, you may reference: `guidelines/customizing-styles.md`.
105-
106-
### Step 4: Validate changes
126+
### Step 5: Validate changes
107127

108128
Your task will be complete if:
109129

110-
1. You performed initialization steps in `Part 1`
111-
2. You examined the user's request and identified specific CDS components to use
112-
3. Your changes DO NOT include any raw rgb/hex/etc color values
113-
4. Your changes DO NOT use any raw pixel values for spacing, border radius, etc.
114-
5. You changes use style props (e.g. `font`, `color`, `textAlign`, `textTransform`, `padding`, `gap`) instead of customization via `style` or with CSS.
115-
6. All import paths are valid CDS package exports (see section below)
116-
7. Any project linting/typechecking tasks are passing
117-
118-
#### Validating import paths
119-
120-
**This is critical.** Do not guess or memorize CDS import paths. The discovery script output is the source of truth (see `Part 1` for details).
121-
122-
Before writing or returning any CDS import, verify it against the export list from setup:
123-
124-
1. Find the CDS package for the target platform in the discovery script output.
125-
2. Confirm the subpath you want to import is listed as a valid export.
126-
3. If the subpath is not listed, it does not exist -- pick the closest valid export instead.
127-
128-
**The package name may vary between projects.** Different repos may install CDS under different scopes. Always use the package name reported by the discovery script, not a hardcoded scope. If the project already has CDS imports in existing code, match whatever scope those files use.
129-
130-
Common mistakes to avoid:
131-
132-
- Inventing deep subpaths like `<pkg>/layout/Box` or `<pkg>/buttons/Button` when the actual export is `<pkg>/layout` or `<pkg>/buttons`.
133-
- Guessing a package scope when the project uses a different one.
134-
- Assuming that the CDS docs examples use the same package name as the target project -- they may differ.
130+
1. You performed skill initialization and explicitly identified the specific CDS components you would use
131+
2. Your changes DO NOT include any raw rgb/hex/etc color values
132+
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.
133+
4. Your changes DO NOT import any depreacted CDS components or hooks.
134+
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.
135+
6. All import paths are valid CDS package exports, determined in initialization
136+
7. The project's linting/typechecking/formatting tasks are passing

0 commit comments

Comments
 (0)