Skip to content

Commit 67273bf

Browse files
refactor: adopt shared OpenClaw design system (#200)
* chore: install OpenClaw design system * feat: consume shared design tokens * chore: automate design system updates * chore: pin design system to v0.0.1 * chore: pin design system to v0.0.1 * chore: pin design system to v0.0.1 * fix: use public design system installs * refactor: adopt canonical design system tokens * chore: generalize skills updater * chore: retry preview deployments * fix: align js-yaml with Astro
1 parent 408333e commit 67273bf

34 files changed

Lines changed: 1764 additions & 1038 deletions
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: openclaw-brand
3+
description: Apply OpenClaw visual identity to logos, typography, imagery, voice, documents, presentations, social graphics, and launch materials. Use when the task changes brand identity rather than ordinary product UI or public-page composition.
4+
---
5+
6+
# OpenClaw Brand
7+
8+
Use the canonical identity without turning every surface into a marketing page.
9+
10+
## Workflow
11+
12+
1. Read [identity.md](references/identity.md) for palette, typography, logo, and voice.
13+
2. Read [asset-rights.md](references/asset-rights.md) before copying or redistributing assets.
14+
3. Identify the artifact's audience and whether it is product, documentation, or marketing.
15+
4. Use semantic design tokens when the artifact is code.
16+
5. Keep status colors functional; do not use them as arbitrary decoration.
17+
6. Verify contrast, responsive cropping, and text legibility.
18+
7. Verify logo clearspace only when approved consumer-local guidance defines it;
19+
otherwise report that check as unavailable rather than inventing a measurement.
20+
21+
## Rules
22+
23+
- Use sentence case for headings, labels, buttons, and navigation.
24+
- Let OpenClaw coral carry primary brand emphasis.
25+
- Use sea-glass green as a restrained secondary accent.
26+
- Use neutral ink and warm-paper surfaces as the foundation.
27+
- Prefer Switzer-compatible sans-serif stacks for interface and body copy.
28+
- Reserve Sentient-compatible serif stacks for editorial accents and quotations.
29+
- Use system monospace for code unless the consumer already licenses another face.
30+
- Preserve logo proportions and colors. Do not rotate, distort, outline, or add effects.
31+
- Use real product, interface, community, or mascot imagery when imagery is needed.
32+
- Avoid generic technology gradients, decorative blobs, and ornamental glow as a substitute for content.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Asset Rights
2+
3+
This repository distributes CSS and guidance, not brand asset binaries.
4+
5+
## Current Rule
6+
7+
- Do not copy Switzer or Sentient font files into a consumer or release artifact.
8+
- Do not redistribute logos, lobster artwork, mascot files, photos, or
9+
illustrations without a repository-local license or explicit recorded grant.
10+
- A public URL or an asset already committed to a site is not proof of
11+
redistribution rights.
12+
- System and fallback font stacks are always acceptable.
13+
14+
## Before Adding An Asset
15+
16+
Record:
17+
18+
1. source and owner
19+
2. license or written permission
20+
3. allowed uses and redistribution terms
21+
4. required attribution
22+
5. the repository path where that evidence lives
23+
24+
If any item is unknown, keep the asset in the existing consumer and reference it
25+
only from that consumer.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# OpenClaw Identity
2+
3+
## Color
4+
5+
Use semantic variables in code. The palette names below explain the identity;
6+
they are not permission to replace semantic tokens with raw values.
7+
8+
| Role | Dark | Light |
9+
| --- | --- | --- |
10+
| Page | Ink `#101012` | Warm paper `#f6f5f3` |
11+
| Surface | Ink `#19191c` | Warm paper `#eceae6` |
12+
| Primary text | `#ededed` | `#17171a` |
13+
| Secondary text | `#bcbcc4` | `#46464e` |
14+
| Primary coral | `#f5654a` | `#d84a31` |
15+
| Secondary sea glass | `#4fc8ae` | `#14806e` |
16+
17+
Coral is the primary brand and action color. Sea glass is a secondary accent for
18+
focus, contrast, and occasional supporting emphasis. Neither replaces functional
19+
success, warning, error, or information colors.
20+
21+
## Typography
22+
23+
- Display and body: Switzer when the consumer holds a license, otherwise the
24+
`--oc-font-display` and `--oc-font-body` fallback stack.
25+
- Editorial accent: Sentient when licensed, otherwise `--oc-font-serif`.
26+
- Code: the consumer's licensed monospace or `--oc-font-mono`.
27+
- Use sentence case. Keep headings direct, concrete, and proportional to the
28+
surface that contains them.
29+
30+
## Voice
31+
32+
OpenClaw should sound capable, direct, curious, and human. Prefer plain verbs,
33+
specific nouns, and short explanations. Avoid inflated futurism, vague claims,
34+
and novelty language that obscures what the product does.
35+
36+
## Marks And Imagery
37+
38+
- Preserve the supplied logo's aspect ratio and colors. Apply clearspace only
39+
from approved consumer-local guidance; do not invent a measurement.
40+
- Do not reconstruct the logo from screenshots.
41+
- Use product interfaces, real community work, or approved mascot imagery.
42+
- Keep backgrounds useful to the subject; avoid generic gradients and glow.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: openclaw-design-audit
3+
description: Audit OpenClaw frontend code and rendered interfaces for design-system drift, token misuse, primitive reimplementation, accessibility problems, responsive defects, and off-brand copy. Use for design reviews, compliance checks, or scheduled audit-and-fix workflows.
4+
---
5+
6+
# OpenClaw Design Audit
7+
8+
Separate mechanical violations from judgment. Report suggestions as suggestions
9+
unless a documented rule makes them violations.
10+
11+
## Workflow
12+
13+
1. Read [rubric.md](references/rubric.md) and run every applicable category.
14+
2. Read the consumer's installed design-system version and current commit SHA.
15+
3. Read the version-matched
16+
[token contract](../openclaw-design-system/references/tokens.md) and
17+
[consumer adapters](../openclaw-design-system/references/consumer-adapters.md).
18+
4. Read the brand or marketing references when those categories apply.
19+
5. Run deterministic source checks before judgment-based review.
20+
6. Inspect representative rendered routes at desktop and mobile sizes.
21+
7. Check light and dark themes where supported.
22+
8. Emit the JSON and Markdown defined in [report-format.md](references/report-format.md).
23+
9. When asked to fix findings, apply only narrow changes allowed by [fix-policy.md](references/fix-policy.md).
24+
10. For scheduled ClawHub delivery, follow [github-pr-delivery.md](references/github-pr-delivery.md).
25+
26+
## Evidence
27+
28+
Each finding must include:
29+
30+
- file and line
31+
- category and severity
32+
- stable rule ID
33+
- concise remediation
34+
- design-system reference
35+
- whether the finding is mechanical or judgment-based
36+
37+
## Curation
38+
39+
- Include every error.
40+
- Rank warnings before informational findings, then by affected-file count.
41+
- Surface at most five non-error findings in the concise report.
42+
- Summarize remaining non-error findings by count.
43+
- Treat zero errors, zero warnings, and five or fewer informational findings as
44+
no significant drift.
45+
- Never invent source locations or visual evidence.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Audit Fix Policy
2+
3+
An audit may automatically fix a finding only when the change is narrow,
4+
deterministic, and covered by an existing rule.
5+
6+
## Allowed
7+
8+
- replace a raw value with an equivalent canonical semantic token
9+
- replace a new legacy alias with its canonical token
10+
- use an established local primitive instead of a duplicate raw control
11+
- add a missing accessible label when intent is unambiguous
12+
- repair clipping or overflow without changing information architecture
13+
- update the pinned design-system tag in a dedicated dependency change
14+
15+
## Requires Human Review
16+
17+
- copy, hierarchy, navigation, or information-architecture changes
18+
- new components or abstractions
19+
- broad visual redesign
20+
- deletion of compatibility aliases
21+
- asset or license interpretation
22+
- changes that intentionally alter current rendered behavior
23+
24+
Do not combine unrelated dependency, redesign, and audit fixes in one pull
25+
request. Preserve tests and include real browser evidence for rendered changes.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# GitHub Pull Request Delivery
2+
3+
The scheduled ClawHub audit opens a pull request directly against
4+
`openclaw/clawhub`. It does not create or update a tracker issue.
5+
6+
The schedule and credentials live in the consumer repository's GitHub Actions
7+
workflow. This design-system skill defines the audit and delivery contract; it
8+
does not schedule itself.
9+
10+
## Branch And Scope
11+
12+
- Use a stable automation branch such as `automation/design-audit`.
13+
- Start from current remote `main`.
14+
- Commit only the report and allowed deterministic fixes.
15+
- Do not overwrite unrelated human work on an existing branch.
16+
17+
## Procedure
18+
19+
1. Checkout `openclaw/clawhub` with full history and fetch remote `main`.
20+
2. Reset only the dedicated automation branch to `origin/main`.
21+
3. Install the design system at the workflow's pinned Git tag.
22+
4. Run source checks, browser checks, and report generation.
23+
5. Apply only fixes allowed by `fix-policy.md`.
24+
6. Write reports under the consumer's established audit-artifact path.
25+
7. If the decision table says `artifact only`, upload the reports and job
26+
summary without pushing a branch.
27+
8. Otherwise commit, force-push the dedicated automation branch with
28+
`--force-with-lease`, then use `gh pr create` or `gh pr edit` for the single
29+
open pull request owned by that branch.
30+
31+
## Pull Request
32+
33+
The title must identify the audit and date. The body includes:
34+
35+
- design-system version
36+
- audited ClawHub SHA
37+
- count by severity
38+
- commands and routes checked
39+
- concise expanded findings
40+
- whether fixes are included
41+
- paths to JSON, Markdown, and screenshot artifacts
42+
43+
If an open audit pull request exists, update it only when it owns the same stable
44+
automation branch. Close it without merge when a later clean run makes its
45+
findings obsolete.
46+
47+
## Decision Table
48+
49+
| Findings | Delivery |
50+
| --- | --- |
51+
| One or more errors | Open or update the pull request |
52+
| Zero errors and one or more warnings | Open or update the pull request |
53+
| Zero errors, zero warnings, more than five informational findings | Open or update the pull request |
54+
| Zero errors, zero warnings, five or fewer informational findings | Artifact and job summary only |
55+
| No findings | Artifact and job summary only; close an obsolete open audit PR |
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Audit Report Format
2+
3+
Produce both `design-audit.json` and `design-audit.md`.
4+
5+
## JSON
6+
7+
```json
8+
{
9+
"designSystemVersion": "v0.0.1",
10+
"consumerSha": "<sha>",
11+
"summary": {
12+
"errors": 0,
13+
"warnings": 0,
14+
"info": 0
15+
},
16+
"findings": [
17+
{
18+
"id": "token/raw-color",
19+
"severity": "warning",
20+
"kind": "mechanical",
21+
"file": "src/example.css",
22+
"line": 12,
23+
"message": "Use the semantic accent token.",
24+
"remediation": "Replace the raw coral value with var(--oc-accent-primary).",
25+
"reference": "openclaw-design-system/references/tokens.md"
26+
}
27+
]
28+
}
29+
```
30+
31+
Sort findings by severity, rule ID, file, then line. Keep stable IDs so recurring
32+
automation can compare runs.
33+
34+
## Markdown
35+
36+
Include:
37+
38+
1. audited design-system version and consumer SHA
39+
2. validation commands and rendered routes
40+
3. count by severity
41+
4. every error
42+
5. at most five warning or informational findings
43+
6. count of additional non-error findings not expanded
44+
45+
Use repository-relative file links. State explicitly when no significant drift
46+
was found.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Design Audit Rubric
2+
3+
## Mechanical Rules
4+
5+
| ID | Check |
6+
| --- | --- |
7+
| `token/raw-color` | New raw colors where a semantic token exists |
8+
| `token/undefined` | Custom properties used but not defined by package or consumer |
9+
| `token/legacy-alias` | New code depends on a migration-only alias |
10+
| `component/duplicate` | Raw control or primitive duplicates an established local primitive |
11+
| `component/state` | Missing hover, focus, disabled, loading, invalid, or selected state |
12+
| `layout/overflow` | Text or fixed-format UI clips or causes accidental horizontal scroll |
13+
| `a11y/name` | Interactive control lacks an accessible name |
14+
| `a11y/focus` | Keyboard focus is hidden, trapped, or incoherent |
15+
| `theme/parity` | Light or dark theme loses content, hierarchy, or contrast |
16+
| `asset/rights` | New distributable asset has no recorded rights |
17+
18+
## Judgment Checks
19+
20+
| ID | Check |
21+
| --- | --- |
22+
| `hierarchy/primary-action` | Competing primary actions obscure the decision |
23+
| `layout/card-overuse` | Sections or cards are unnecessarily nested or floated |
24+
| `typography/scale` | Type scale does not match its container or task density |
25+
| `brand/accent` | Coral, sea glass, or status colors are used without their intended role |
26+
| `marketing/subject` | First viewport hides the actual product, place, person, or offer |
27+
| `copy/clarity` | Interface text is vague, inflated, or does not name the action |
28+
29+
## Severity
30+
31+
- `error`: broken interaction, accessibility barrier, illegible theme, accidental
32+
overflow, missing asset rights, or deterministic contract violation.
33+
- `warning`: likely drift or inconsistency with meaningful user impact.
34+
- `info`: improvement with limited current impact.
35+
36+
Do not mark aesthetic preference as a violation. A finding needs source or
37+
rendered evidence and a documented rule.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: openclaw-design-system
3+
description: Build or modify OpenClaw application UI using canonical semantic tokens, themes, shared CSS foundations, consumer adapters, and established local primitives. Use for product interfaces, component styling, theme work, or design-token integration.
4+
---
5+
6+
# OpenClaw Design System
7+
8+
Use the shared package for foundations and framework-neutral visual primitives.
9+
Keep consumer-specific behavior, data, routes, and layout composition local.
10+
11+
## Workflow
12+
13+
1. Read [tokens.md](references/tokens.md) before choosing colors, spacing, type, radii, or shadows.
14+
2. Read [consumer-adapters.md](references/consumer-adapters.md) for the current framework.
15+
3. Inspect the consumer's existing shared primitives before creating a component.
16+
4. Use semantic tokens for UI intent; use palette primitives only for documented exceptions.
17+
5. Keep application behavior, routes, and information architecture unchanged unless the task says otherwise.
18+
6. Validate the affected routes with existing tests and real browser screenshots.
19+
20+
## Interface Rules
21+
22+
- Import the complete CSS contract or its focused exported entry points.
23+
- Compose shared classes from `components.css` before adding a one-off visual implementation.
24+
- Use local shared primitives before raw controls or one-off component implementations.
25+
- Keep one primary action per decision area.
26+
- Use familiar icons for icon-only commands and provide accessible names.
27+
- Use status colors for status, warning, success, error, and informational meaning.
28+
- Keep cards, controls, and repeated fixed-format elements dimensionally stable.
29+
- Avoid nested decorative cards and page sections styled as floating cards.
30+
- Keep surfaces, controls, and insets square through their semantic radius tokens.
31+
- Reserve round geometry for avatars, status dots, and other truly circular indicators.
32+
- Keep focus, hover, active, disabled, loading, and invalid states coherent.
33+
- Keep text within its container at supported viewport sizes.
34+
- Prefer dense, scan-friendly composition for operational product surfaces.
35+
36+
## Ownership
37+
38+
Move visual implementation into this repository when its interface is
39+
framework-neutral and useful across consumers. Keep runtime behavior and
40+
framework adapters local until at least two consumers need the same interface
41+
and behavior.

0 commit comments

Comments
 (0)