@viasat/beam-react-claude-plugin 2.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +19 -0
- package/.claude-plugin/plugin.json +22 -0
- package/README.md +78 -0
- package/package.json +32 -0
- package/references/data-sources.md +120 -0
- package/references/rules-preamble.md +38 -0
- package/references/tokens.md +100 -0
- package/skills/beam-ui/SKILL.md +53 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-marketplace.json",
|
|
3
|
+
"name": "beam",
|
|
4
|
+
"description": "Beam Design System plugins for Claude Code.",
|
|
5
|
+
"owner": {
|
|
6
|
+
"name": "Viasat",
|
|
7
|
+
"url": "https://git.viasat.com/vega/beam"
|
|
8
|
+
},
|
|
9
|
+
"plugins": [
|
|
10
|
+
{
|
|
11
|
+
"name": "beam-react-claude-plugin",
|
|
12
|
+
"description": "Reduce AI hallucinations on Beam Design System usage. Ships skills for build/audit/Q&A workflows plus reference docs, and launches the Beam MCP server via npx.",
|
|
13
|
+
"source": {
|
|
14
|
+
"source": "npm",
|
|
15
|
+
"package": "@viasat/beam-react-claude-plugin"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
|
|
3
|
+
"name": "beam-react-claude-plugin",
|
|
4
|
+
"displayName": "Beam React Claude Plugin",
|
|
5
|
+
"description": "Equips AI tools with Beam Design System context for building, auditing, and answering implementation questions across tokens, components and data sources in React.",
|
|
6
|
+
"version": "2.39.0",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Viasat",
|
|
9
|
+
"url": "https://git.viasat.com/vega/beam"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://git.viasat.com/vega/beam/tree/master/libs/react-claude-plugin",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"beam": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": [
|
|
17
|
+
"-y",
|
|
18
|
+
"@viasat/beam-react-mcp@2.39.0"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# ๐ค @viasat/beam-react-claude-plugin
|
|
2
|
+
|
|
3
|
+
A Claude Code plugin that keeps Claude honest about the Beam Design System. Instead
|
|
4
|
+
of guessing component names, props, and tokens, Claude pulls them from Beam's own
|
|
5
|
+
sources.
|
|
6
|
+
|
|
7
|
+
## โจ What it does
|
|
8
|
+
|
|
9
|
+
Inside any project that depends on `@viasat/beam-react`, the plugin adds:
|
|
10
|
+
|
|
11
|
+
| Skill | Type | Purpose |
|
|
12
|
+
| --------- | ------------ | -------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| `beam-ui` | Auto-invoked | Build, modify, refactor, or debug UI using Beam components โ and answer questions or give recommendations about Beam |
|
|
14
|
+
|
|
15
|
+
Each skill carries a short critical-rules block (the source-of-truth hierarchy,
|
|
16
|
+
token rules, and composition rules) and defers to
|
|
17
|
+
`references/rules-preamble.md` for the full procedure. The plugin also runs the
|
|
18
|
+
Beam MCP server via `npx`, which gives Claude structured tool access to component
|
|
19
|
+
props, stories, and concept docs.
|
|
20
|
+
|
|
21
|
+
## โฌ๏ธ Installing it
|
|
22
|
+
|
|
23
|
+
### ๐ข Via Beam internal Claude plugin marketplace
|
|
24
|
+
|
|
25
|
+
On VPN, add the Beam repo as a marketplace:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
/plugin marketplace add git.viasat.com/vega/beam
|
|
29
|
+
/plugin install beam-react-claude-plugin
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### ๐ฆ Via npm
|
|
33
|
+
|
|
34
|
+
Off VPN, install from npm and add the bundled marketplace:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install --save-dev @viasat/beam-react-claude-plugin
|
|
38
|
+
/plugin marketplace add ./node_modules/@viasat/beam-react-claude-plugin
|
|
39
|
+
/plugin install beam-react-claude-plugin@beam
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## ๐ Updating
|
|
43
|
+
|
|
44
|
+
### ๐ข Via Beam internal Claude plugin marketplace
|
|
45
|
+
|
|
46
|
+
To update on VPN use:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
/plugin update beam-react-claude-plugin
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Restart Claude Code
|
|
53
|
+
|
|
54
|
+
### ๐ฆ Via npm
|
|
55
|
+
|
|
56
|
+
Off VPN, update the npm package and then the marketplace:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm i @viasat/beam-react-claude-plugin@latest
|
|
60
|
+
/plugin marketplace update beam
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Restart Claude Code
|
|
64
|
+
|
|
65
|
+
## ๐ฅ๏ธ Non Claude Code users
|
|
66
|
+
|
|
67
|
+
On a different editor? The MCP runs on its own, no plugin required โ see
|
|
68
|
+
[`@viasat/beam-react-mcp`](https://www.npmjs.com/package/@viasat/beam-react-mcp).
|
|
69
|
+
|
|
70
|
+
## โ
Requirements
|
|
71
|
+
|
|
72
|
+
- A project with `@viasat/beam-react` in `package.json` dependencies (skills check this before activating).
|
|
73
|
+
- Node.js and npm/npx available to run the `@viasat/beam-react-mcp` server (primary).
|
|
74
|
+
- Network access to `https://react.beam.viasat.com/llms.txt` (fallback when the MCP server is unavailable).
|
|
75
|
+
|
|
76
|
+
## ๐ License
|
|
77
|
+
|
|
78
|
+
MIT. ยฉ Viasat.
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@viasat/beam-react-claude-plugin",
|
|
3
|
+
"version": "2.39.0",
|
|
4
|
+
"description": "Claude Code plugin that reduces AI hallucinations on Beam usage. Ships skills, reference docs, and a user-invocable token audit command.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Viasat",
|
|
7
|
+
"homepage": "https://react.beam.viasat.com/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://git.viasat.com/vega/beam",
|
|
11
|
+
"directory": "libs/react-claude-plugin"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://git.viasat.com/vega/beam/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"claude-code",
|
|
18
|
+
"plugin",
|
|
19
|
+
"design-system",
|
|
20
|
+
"beam",
|
|
21
|
+
"viasat"
|
|
22
|
+
],
|
|
23
|
+
"files": [
|
|
24
|
+
".claude-plugin/",
|
|
25
|
+
"skills/",
|
|
26
|
+
"references/",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Data sources for the Beam Claude Plugin
|
|
2
|
+
|
|
3
|
+
How the plugin's skills fetch authoritative Beam information at runtime.
|
|
4
|
+
|
|
5
|
+
## Source-of-truth hierarchy
|
|
6
|
+
|
|
7
|
+
Use these in order. Never skip upward.
|
|
8
|
+
|
|
9
|
+
1. **MCP server (beam)** โ PRIMARY. Structured JSON, offline-capable, auto-started by plugin.
|
|
10
|
+
2. **Deployed `llms.txt`** at `https://react.beam.viasat.com/llms.txt` โ fallback when MCP server unavailable.
|
|
11
|
+
3. **Local `node_modules/@viasat/beam-react`** (and `@viasat/beam-tokens` for tokens) TypeScript definitions โ fallback when llms.txt is unreachable.
|
|
12
|
+
4. **Model knowledge** โ forbidden.
|
|
13
|
+
|
|
14
|
+
## MCP server
|
|
15
|
+
|
|
16
|
+
The `@viasat/beam-react-mcp` server provides structured, offline access to Beam component APIs, props, usage examples, and concept docs. It is auto-started by the plugin via the `mcpServers` config in `plugin.json`.
|
|
17
|
+
|
|
18
|
+
Data comes from `beam-manifest.json`, bundled in the npm package. Zero network calls at runtime.
|
|
19
|
+
|
|
20
|
+
## Fetching llms.txt (fallback) โ use curl, not WebFetch
|
|
21
|
+
|
|
22
|
+
When MCP is unavailable, fall back to llms.txt. **Use `curl` via Bash. Do NOT use the WebFetch tool.** WebFetch refuses to reproduce content verbatim and returns a summarized/categorized rewrite, which destroys the exact URLs, prop names, and descriptions you need. `curl` returns the raw markdown intact.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
curl -fsSL https://react.beam.viasat.com/llms.txt
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The `-f` flag makes curl exit non-zero on HTTP errors (4xx/5xx) so failures are detectable.
|
|
29
|
+
|
|
30
|
+
### Index structure
|
|
31
|
+
|
|
32
|
+
The index page is a flat list of links per section. Each entry has a URL and a one-line description. Always fetch the index first to discover what exists, then fetch only the specific pages you need.
|
|
33
|
+
|
|
34
|
+
URL patterns:
|
|
35
|
+
|
|
36
|
+
| Section | URL pattern | Example |
|
|
37
|
+
| ---------- | ---------------------------- | ------------------------------------------------ |
|
|
38
|
+
| Components | `llms/components-<name>.txt` | `llms/components-button.txt` |
|
|
39
|
+
| Forms | `llms/forms-<name>.txt` | `llms/forms-autocomplete.txt` |
|
|
40
|
+
| Layout | `llms/layout-<name>.txt` | `llms/layout-pagelayout.txt` |
|
|
41
|
+
| Concepts | `llms/concepts-<name>.txt` | `llms/concepts-theming.txt` |
|
|
42
|
+
| Tokens | `llms/tokens-<category>.txt` | `llms/tokens-color.txt`, `llms/tokens-space.txt` |
|
|
43
|
+
|
|
44
|
+
Sub-components use a flattened slug: `Avatar.Group` โ `components-avatar-avatar-group.txt`, `Menu.Trigger` โ `components-menu-menu-trigger.txt`. Confirm the exact slug from the index.
|
|
45
|
+
|
|
46
|
+
**Examples pages:** some โ not all โ components have a companion examples page at `llms/components-<name>-examples.txt` (e.g. `components-actionlist-examples.txt`, `components-menu-examples.txt`). Don't assume it exists for a given component โ check the index entry first. If no entry, there is no examples page; rely on the main component page.
|
|
47
|
+
|
|
48
|
+
Particularly relevant: **`llms/concepts-using-beam-with-ai.txt`** โ the official Beam guide on AI consumption of llms.txt. Read it once to ground all AI-driven work in Beam.
|
|
49
|
+
|
|
50
|
+
If a section or page is missing from the index, do not assume it exists. Be defensive about parsing.
|
|
51
|
+
|
|
52
|
+
## node_modules fallback
|
|
53
|
+
|
|
54
|
+
When both MCP and llms.txt are unavailable, read the installed packages' TypeScript definitions.
|
|
55
|
+
|
|
56
|
+
### Locating the packages
|
|
57
|
+
|
|
58
|
+
| Layout | Path |
|
|
59
|
+
| ------------------ | -------------------------------------------------------------------------- |
|
|
60
|
+
| npm / yarn classic | `node_modules/@viasat/beam-react/` |
|
|
61
|
+
| pnpm | `node_modules/.pnpm/@viasat+beam-react@*/node_modules/@viasat/beam-react/` |
|
|
62
|
+
| yarn berry (PnP) | No flat layout โ ask the user |
|
|
63
|
+
|
|
64
|
+
Same patterns for `@viasat/beam-tokens`.
|
|
65
|
+
|
|
66
|
+
### Which files matter
|
|
67
|
+
|
|
68
|
+
**`@viasat/beam-react`:**
|
|
69
|
+
|
|
70
|
+
- `index.d.ts` โ top-level barrel exports. Discover what components exist.
|
|
71
|
+
- `lib/<Component>/<Component>.d.ts` โ actual prop types with JSDoc descriptions on each prop (mirrors the prop descriptions in llms.txt).
|
|
72
|
+
- `lib/<Component>/index.d.ts` โ sub-barrel for the component.
|
|
73
|
+
- `lib/<Component>/<Component>.figma.d.ts` โ Code Connect metadata (rarely needed).
|
|
74
|
+
|
|
75
|
+
**`@viasat/beam-tokens`** (separate package):
|
|
76
|
+
|
|
77
|
+
- `types/lib/index.d.ts` โ token type declarations (entry point).
|
|
78
|
+
- `tokens.css`, `tokens.scss` โ the actual token values as CSS custom properties / SCSS variables.
|
|
79
|
+
- `themes/` โ per-theme overrides.
|
|
80
|
+
|
|
81
|
+
### What's extractable vs missing
|
|
82
|
+
|
|
83
|
+
| Available from node_modules | Missing |
|
|
84
|
+
| ------------------------------------------------------ | -------------------------------------- |
|
|
85
|
+
| Component names and types | Story / usage examples |
|
|
86
|
+
| Prop names, types, defaults, JSDoc descriptions | Visual screenshots |
|
|
87
|
+
| Token declarations and raw values (from `beam-tokens`) | MDX concept docs (theming, a11y, etc.) |
|
|
88
|
+
|
|
89
|
+
## Fidelity caveats
|
|
90
|
+
|
|
91
|
+
When using a fallback source, tell the user which tier you're on:
|
|
92
|
+
|
|
93
|
+
**Tier 1 (MCP):** Full fidelity โ structured props, stories, concept docs.
|
|
94
|
+
|
|
95
|
+
**Tier 2 (llms.txt):** Full fidelity โ same content as MCP, raw markdown format.
|
|
96
|
+
> "The Beam MCP server is unavailable โ falling back to llms.txt. If you weren't expecting this, please report it in **#beam-help** so the team can investigate."
|
|
97
|
+
|
|
98
|
+
**Tier 3 (node_modules):** Degraded โ no stories, no concept docs.
|
|
99
|
+
> "MCP and llms.txt unreachable โ used node_modules. Story examples and concept docs unavailable; verify visually."
|
|
100
|
+
|
|
101
|
+
The user must know when data quality drops below the primary tier.
|
|
102
|
+
|
|
103
|
+
## Error handling
|
|
104
|
+
|
|
105
|
+
If ALL data sources fail:
|
|
106
|
+
|
|
107
|
+
1. Do not proceed.
|
|
108
|
+
2. Tell the user explicitly what was attempted and what failed.
|
|
109
|
+
3. Ask the user how to proceed: install the dep, check network, switch repos, etc.
|
|
110
|
+
4. Do not generate code from memory.
|
|
111
|
+
|
|
112
|
+
Example user-facing message:
|
|
113
|
+
|
|
114
|
+
> I couldn't fetch Beam component data. I tried:
|
|
115
|
+
>
|
|
116
|
+
> 1. MCP server (beam) โ server not running or not configured.
|
|
117
|
+
> 2. `https://react.beam.viasat.com/llms.txt` โ fetch failed: ENETUNREACH.
|
|
118
|
+
> 3. Local `node_modules/@viasat/beam-react` โ package not installed.
|
|
119
|
+
>
|
|
120
|
+
> Beam isn't in my training data, so I can't safely generate code. Want to install the package, check the network, or work on something else?
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Beam rules (canonical preamble)
|
|
2
|
+
|
|
3
|
+
## What Beam is
|
|
4
|
+
|
|
5
|
+
Beam is Viasat's production multi-framework design system: React components (`@viasat/beam-react`), tokens (`@viasat/beam-tokens`), icons, fonts, and styles. It is opinionated about composition and tokens. It is not a CSS framework and not a wrapper around any third-party UI library. Beam's component API surface is large and evolves between releases โ your training data does not include it.
|
|
6
|
+
|
|
7
|
+
## Source-of-truth hierarchy
|
|
8
|
+
|
|
9
|
+
Use these data sources in order; never skip a tier upward:
|
|
10
|
+
|
|
11
|
+
1. **MCP server (beam)** โ PRIMARY. Structured JSON, offline-capable, auto-started by plugin.
|
|
12
|
+
2. **Deployed `llms.txt`** (`https://react.beam.viasat.com/llms.txt`) โ fallback when MCP unavailable. Fetch with `curl`, never the WebFetch tool (it summarizes and drops the exact URLs and prop strings you need).
|
|
13
|
+
3. **Local `node_modules/@viasat/beam-react`** (+ `@viasat/beam-tokens` for tokens) TypeScript definitions โ fallback when llms.txt is also unreachable.
|
|
14
|
+
4. **Model knowledge** โ forbidden. Beam is not in your training data. Never fabricate component names, prop names, or token values from memory.
|
|
15
|
+
|
|
16
|
+
See `references/data-sources.md` for the full procedure (MCP tools, curl usage, index structure, node_modules paths across npm/yarn/pnpm, fidelity caveats).
|
|
17
|
+
|
|
18
|
+
## Core rules
|
|
19
|
+
|
|
20
|
+
### Token rule
|
|
21
|
+
|
|
22
|
+
Never hard-code design values:
|
|
23
|
+
|
|
24
|
+
- No hex colors (`#ABC123`)
|
|
25
|
+
- No `rgb()` / `rgba()` / `hsl()` / `hsla()` literals
|
|
26
|
+
- No named CSS colors (except `transparent` and `currentColor`)
|
|
27
|
+
- For spacing, typography, or radii: use a token; if none fits, fall back to `rem` โ never raw `px`
|
|
28
|
+
- No hard-coded `font-family`, `font-size`, or `font-weight` literals when token alternatives exist
|
|
29
|
+
|
|
30
|
+
See `references/tokens.md` for the taxonomy and lookup procedure.
|
|
31
|
+
|
|
32
|
+
### Composition rule
|
|
33
|
+
|
|
34
|
+
Prefer composing existing Beam components over creating new ones or "doing your own thing." When composition can't reach what you need, build custom from Beam primitives + tokens โ never from scratch. If the gap is library-shaped (multiple consumers would benefit, pattern is stable), flag it as a candidate for a new Beam component and ask the user before writing custom code.
|
|
35
|
+
|
|
36
|
+
### Honesty / uncertainty rule
|
|
37
|
+
|
|
38
|
+
If llms.txt is unreachable AND `node_modules/@viasat/beam-react` does not contain the answer, stop and tell the user. Do not invent component names, prop names, import paths, or token values. Saying "I don't know" is better than fabricating.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Beam tokens (procedure reference)
|
|
2
|
+
|
|
3
|
+
Taxonomy and lookup procedure for Beam tokens. Does NOT enumerate token values โ fetch them at runtime from the MCP server (primary) or the deployed `llms.txt` Tokens section (fallback).
|
|
4
|
+
|
|
5
|
+
For the full source-of-truth hierarchy, see `references/rules-preamble.md` and `references/data-sources.md`.
|
|
6
|
+
|
|
7
|
+
## Token taxonomy
|
|
8
|
+
|
|
9
|
+
Author UI with these three classes, chosen by intent.
|
|
10
|
+
|
|
11
|
+
### Semantic
|
|
12
|
+
|
|
13
|
+
Tokens that encode meaning, not appearance. Use these by default for any UI surface.
|
|
14
|
+
|
|
15
|
+
- Examples of intent (look up actual names): "background of the page," "color of a destructive action," "text on a primary action," "spacing between form fields."
|
|
16
|
+
- Rule of thumb: if you can describe the use in business or user-facing terms, it's semantic.
|
|
17
|
+
- Naming convention: `bm-sem-<type>-<role>-<variant>` (e.g., `bm-sem-color-surface-00`).
|
|
18
|
+
|
|
19
|
+
### Expressive
|
|
20
|
+
|
|
21
|
+
Tokens that encode brand/visual identity beyond pure semantics โ accents, illustrative palettes, decorative gradients. Use these for marketing surfaces, branded sections, hero content.
|
|
22
|
+
|
|
23
|
+
- Rule of thumb: if you'd describe it as "looks Viasat-branded" rather than "indicates an error," it's expressive.
|
|
24
|
+
|
|
25
|
+
### Dataviz
|
|
26
|
+
|
|
27
|
+
Tokens for data visualization: chart series colors, axis lines, grid backgrounds. Distinct from semantic because viz palettes need perceptual distinguishability across many series.
|
|
28
|
+
|
|
29
|
+
- Rule of thumb: if it goes into a chart, table-heatmap, or similar, it's dataviz.
|
|
30
|
+
|
|
31
|
+
### Lower-level tiers (don't author against directly)
|
|
32
|
+
|
|
33
|
+
Beam also defines `primitive` (raw values), `theme` (theme-layer mappings), `comp` (component-internal), and `utility` tokens. These are valid `--bm-*` tokens โ recognize them when auditing โ but don't reach for `primitive`/`theme`/`comp` directly when writing UI. Author against the semantic/expressive/dataviz layer above, which resolves down to them.
|
|
34
|
+
|
|
35
|
+
## The "do not hard-code" rule
|
|
36
|
+
|
|
37
|
+
These are violations regardless of value:
|
|
38
|
+
|
|
39
|
+
- Hex literals: `#ABC123`, `#1a2`, `#abcd1234`
|
|
40
|
+
- `rgb()`, `rgba()`, `hsl()`, `hsla()`
|
|
41
|
+
- Named CSS colors except `transparent` and `currentColor` (e.g., `red`, `blue`, `aliceblue` โ all forbidden)
|
|
42
|
+
- Raw `px` for spacing, typography, or radii โ prefer a token; when no token fits, use `rem`
|
|
43
|
+
- Hard-coded `font-family`, `font-size`, `font-weight` when token alternatives exist
|
|
44
|
+
|
|
45
|
+
Resolution when no token fits: for **colors**, ask the user โ never drop to a hex. For **dimensional values** (spacing, typography, radii), `rem` is the sanctioned fallback. Don't fabricate token names.
|
|
46
|
+
|
|
47
|
+
## Lookup procedure
|
|
48
|
+
|
|
49
|
+
### Primary (MCP)
|
|
50
|
+
|
|
51
|
+
Use the MCP server's token tools โ available automatically when the plugin is loaded. Prefer this over llms.txt.
|
|
52
|
+
|
|
53
|
+
### Fallback (llms.txt)
|
|
54
|
+
|
|
55
|
+
If MCP is unavailable, fetch the relevant token category page with `curl` (not WebFetch โ see `references/data-sources.md`):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
curl -fsSL https://react.beam.viasat.com/llms/tokens-color.txt
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Each category page contains a markdown table of `| Token | Value | Description |`.
|
|
62
|
+
|
|
63
|
+
**Token categories** (from the deployed llms.txt index):
|
|
64
|
+
|
|
65
|
+
- `llms/tokens-border-radius.txt`
|
|
66
|
+
- `llms/tokens-border-width.txt`
|
|
67
|
+
- `llms/tokens-color.txt`
|
|
68
|
+
- `llms/tokens-compact-typography.txt`
|
|
69
|
+
- `llms/tokens-opacity.txt`
|
|
70
|
+
- `llms/tokens-shadow.txt`
|
|
71
|
+
- `llms/tokens-size.txt`
|
|
72
|
+
- `llms/tokens-space.txt`
|
|
73
|
+
- `llms/tokens-typography.txt`
|
|
74
|
+
|
|
75
|
+
If a category you expected isn't listed, verify against the live index (`curl -fsSL https://react.beam.viasat.com/llms.txt`) โ the list above may evolve.
|
|
76
|
+
|
|
77
|
+
### Last resort (node_modules)
|
|
78
|
+
|
|
79
|
+
If both MCP and llms.txt are unreachable, the installed `@viasat/beam-tokens` package is the source. (Tokens are a separate package from `@viasat/beam-react`.)
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Type declarations
|
|
83
|
+
grep -E '^\s*(export )?(const|type|interface)' node_modules/@viasat/beam-tokens/types/lib/index.d.ts
|
|
84
|
+
|
|
85
|
+
# Actual values (CSS custom properties)
|
|
86
|
+
grep -E '^\s*--bm-' node_modules/@viasat/beam-tokens/tokens.css | head -50
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Read JSDoc above each declaration for usage hints.
|
|
90
|
+
|
|
91
|
+
### If both fail
|
|
92
|
+
|
|
93
|
+
Stop and tell the user. Do not invent token names. See the honesty rule in `references/rules-preamble.md`.
|
|
94
|
+
|
|
95
|
+
## What NOT to do
|
|
96
|
+
|
|
97
|
+
- โ Invent token names from memory.
|
|
98
|
+
- โ Hard-code a hex because the closest color token isn't perfect โ ask the user. (For dimensional values, `rem` is the sanctioned fallback; raw `px` is not.)
|
|
99
|
+
- โ Mix token systems (e.g., a semantic background with a hex border โ pick one).
|
|
100
|
+
- โ Use `:root` CSS overrides to redefine tokens unless explicitly migrating.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: beam-ui
|
|
3
|
+
description: Use when the user requests UI work (build, modify, refactor, debug, compose components or pages) or asks a design-system question (which component, which token, how to do X) in a project that depends on @viasat/beam-react. The user need not mention Beam โ if @viasat/beam-react is installed, all UI work belongs to Beam.
|
|
4
|
+
disallowed-tools: WebFetch
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# beam-ui
|
|
8
|
+
|
|
9
|
+
Beam isn't in your training data โ never write Beam code from memory. Fetch the live API, then build. Canonical rules live in `references/rules-preamble.md`.
|
|
10
|
+
|
|
11
|
+
## Activation gate
|
|
12
|
+
|
|
13
|
+
Read `package.json`. If `@viasat/beam-react` is not in `dependencies` or `devDependencies`, skip this skill.
|
|
14
|
+
|
|
15
|
+
## Load canonical rules
|
|
16
|
+
|
|
17
|
+
Read `references/rules-preamble.md` before acting โ source-of-truth hierarchy, token rule, composition rule, honesty rule, curl-not-WebFetch directive. It links `references/data-sources.md` (fetch procedure + URL patterns) and `references/tokens.md` (token taxonomy + lookup); follow those when relevant.
|
|
18
|
+
|
|
19
|
+
## MCP tools (beam server)
|
|
20
|
+
|
|
21
|
+
See `references/data-sources.md` ยง MCP server for the tool catalog and call order.
|
|
22
|
+
|
|
23
|
+
## Posture: BUILD vs ASK
|
|
24
|
+
|
|
25
|
+
- **BUILD** โ request requires writing/modifying files (build, add, create, modify, refactor, fix, debug, implement).
|
|
26
|
+
- **ASK** โ request is a question or recommendation (how, what, should, why, which, can I).
|
|
27
|
+
- **In doubt โ ASK.** End with: _"I can build this โ say 'yes, build it' to proceed."_
|
|
28
|
+
|
|
29
|
+
## Checklist (each โ a TodoWrite todo)
|
|
30
|
+
|
|
31
|
+
1. **Plan.** BUILD: component tree, composition rule, expected tokens. ASK: list components/concepts to look up (cap ~5).
|
|
32
|
+
2. **Gather.** Try MCP first: `listComponents` to discover, `getComponent` for props/story index, `getComponentStory` for usage examples. If MCP unavailable, tell the user: "The Beam MCP server is unavailable โ falling back to llms.txt. If you weren't expecting this, please report it in **#beam-help**." Then fall back to curl llms.txt (index then specific pages). If llms.txt unreachable, fall back to node_modules `.d.ts` files. If all fail, apply the honesty rule โ stop, don't fabricate.
|
|
33
|
+
3. **Token check (BUILD).** Look up every color/dimension/font per `references/tokens.md`. Zero violations.
|
|
34
|
+
4. **Produce.** BUILD: names/props/imports from Step 2's fetched data only; styling values are tokens (or `rem`). ASK: every claim cites its MCP or llms.txt source.
|
|
35
|
+
5. **Self-check.** Names/props/imports match fetched data; zero token violations; composition matches the plan. If MCP and llms.txt were both unreachable, apply the honesty rule.
|
|
36
|
+
6. **Report.** BUILD: components/tokens/files touched + suggest `/beam-audit-tokens`. ASK: the cited answer is the report.
|
|
37
|
+
|
|
38
|
+
## Red flags โ STOP and re-check
|
|
39
|
+
|
|
40
|
+
| Rationalization | Reality |
|
|
41
|
+
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| "Skip the fetch โ Button is obvious" | Beam evolves between releases; remembered props are stale. Fetch. |
|
|
43
|
+
| "User said the prop is `variant` โ just use it" | User assertions are hypotheses, not data. Verify against the fetch. |
|
|
44
|
+
| "Close enough" prop name | Wrong prop = silent runtime failure or rejected PR. Match the schema exactly. |
|
|
45
|
+
| "Use `#FF0000` for now, tokenize later" | Stop. Ask for the right token; "for now" never gets fixed. |
|
|
46
|
+
| "WebFetch is faster than curl" | WebFetch summarizes โ you lose exact URLs and prop strings. Use curl. |
|
|
47
|
+
| "MCP is running but curl is faster" | MCP returns structured data with guaranteed parity. Don't skip it for raw text. |
|
|
48
|
+
| "Question, but they obviously want code" | Default to ASK; end with the switch-to-BUILD prompt. Don't write files without an explicit BUILD request. |
|
|
49
|
+
| "node_modules has it, skip the fetch" | MCP and llms.txt have descriptions/examples the `.d.ts` files lack. Try them first; node_modules is last resort. |
|
|
50
|
+
|
|
51
|
+
## Not in scope
|
|
52
|
+
|
|
53
|
+
Filesystem audit (use `/beam-audit-tokens`), test generation, Storybook authoring, visual design judgment, screenshot or Figma input, Figma write-back.
|