Skip to content

feat(design): DL-1 unified design-language token layer (pmoves/design/) - #1827

Merged
POWERFULMOVES merged 12 commits into
mainfrom
feat/dl-1-unified-design-tokens
Jun 17, 2026
Merged

POWERFULMOVES merged 12 commits into
mainfrom
feat/dl-1-unified-design-tokens

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Jun 16, 2026

Copy link
Copy Markdown
Owner

What

DL-1 of the unified design language: a build-time token layer (pmoves/design/) that reads the canonical persona registry (pmoves/config/agent_signatures.yaml) and emits CSS variables + a typed TS map, with a CSP-clean preview proving both themes.

Reframes the unified-UI effort from "pick a palette" to "wire the per-persona theme engine that already exists" (registry → BoTZ Gateway theme API → agent_terminal_theme.py CLI). This PR adds the web consumer that was missing.

  • Spec (DL-0): docs/superpowers/specs/2026-06-15-pmoves-unified-design-language.md
  • Plan (DL-1): docs/superpowers/plans/2026-06-16-dl-1-design-token-layer.md

How

  • generate.py (uv) merges base neutrals + per-theme overlays + registry-sourced accents → build/tokens.<theme>.css (:root[data-theme] vars) + build/tokens.ts.
  • Two themes: pmoves-armor (default, cool — --pm-accent #7C3AED) and darkxside-skin (warm — --pm-accent #E11D48, DARKXSIDE ). Accents resolve from the registry at build time (not hard-coded).
  • theme-provider.js — dependency-free data-theme swap. preview.html/.css/.js — CSP-clean showcase + motif kit (shard=CGP point, hex=MOF pore, =signature).
  • make -C pmoves design-tokens regenerates (idempotent).

Lane boundary (credits 4090 W1)

The theme engine is 4090-claude's W1 deliverable (PRs #1065/#1101). This PR is purely additive: it reads agent_signatures.yaml read-only and modifies none of agent_terminal_theme.py, botz_cli.py, their tests, or the /v1/agent/* gateway routes. 15 files changed — 14 under pmoves/design/ + one appended pmoves/Makefile target. CLAIM logged in AGNOTE4482PHI.t1.md.

Verification

  • pytest pmoves/design/tests/5/5 green (TDD: tests written failing-first per task).
  • make -C pmoves design-tokens → idempotent (no working-tree diff after regen).
  • Live browser (Playwright): toggle flips pmoves-armor (--pm-accent #7C3AED) ↔ darkxside-skin (--pm-accent #E11D48); both themes render swatches + recolored motif kit correctly.

Deviations (all in-lane, documented in the build report)

  1. uv --no-project on all invocations — the repo's pmoves/pyproject.toml is malformed (project.name unset); fixing it is out of this lane.
  2. Scoped pmoves/design/.gitignore with !build/ — root .gitignore ignores build/ globally; build output is committed so consumers need no build step.

Follow-on lanes (open call to claim — NOT this PR)

research/DL_FOLLOWON_LANES_2026-06-16.md: DL-1b CHIT-tour re-skin (+ absorb #1697), DL-2 token roll to Notebook/A2UI/CF, DL-3 persona-adaptive runtime + Showtime live skin, DL-4 CF→A2UI demonstrative rebuild.

Review

Requesting 4090 pair-review as W1 theme-lane owner. Note: fonts are tokens (Orbitron/Exo2 defaults); self-hosting the woff2 is a DL-2 add. Final merge on the OPERATOR (DARKXSIDE) gate.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced themable design system with two available themes: "PMOVES Armor" and "DarkXside Skin"
    • Added theme switching and toggle capabilities
    • Launched design token preview interface for visual inspection
  • Documentation

    • Added unified design language specification and implementation guides
    • Documented design token architecture and regeneration procedures
  • Tests

    • Added comprehensive test suite for design token generation and theme resolution

hunnibear and others added 8 commits June 16, 2026 15:05
Source-of-truth design spec. Reframes the unified-UI effort from 'pick a
palette' to 'wire the per-persona theme engine that already exists'
(agent_signatures.yaml -> BoTZ Gateway theme API -> agent_terminal_theme.py).

Decisions: D1 tokens from the persona registry; D2 Model A base (one cool
PMOVES armor) with B/C layered; D2b two registers (agent stark / human
warm-cool); D2c fonts are tokens (Orbitron/Exo2 defaults, modular); D3 motif
kit (shard=CGP point, hex=MOF pore, cymatic=DARKXSIDE skin); D5 CF site -> A2UI
demonstrative rebuild (later phase). North Star: POWERFULMOVES = DARKXSIDE
(bio/head) + PMOVES (digital/body), Headmaster-formed, Drift-piloted; Gumby soul.

Phasing DL-0..DL-4. Credits 4090 W1 theme lane; DL-1 is purely additive.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…90 W1)

CLAIM for the DL-1 web design-token layer. Additive: creates pmoves/design/,
reads agent_signatures.yaml read-only, touches no 4090-owned files. Invites
4090 pair-review as W1 theme-lane owner.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove unused imports/param + scope Pyright import-resolution ignores in the
token-layer tests (5/5 still green). Add research/DL_FOLLOWON_LANES_2026-06-16.md
— open call to claim DL-1b (tour re-skin) / DL-2 (token roll) / DL-3
(persona-adaptive + Showtime) / DL-4 (CF->A2UI demonstrative).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@POWERFULMOVES, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 48 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 58bf69cc-e277-434f-9425-4968074e9879

📥 Commits

Reviewing files that changed from the base of the PR and between 12e179d and 0c8a750.

📒 Files selected for processing (8)
  • docs/superpowers/specs/2026-06-15-pmoves-unified-design-language.md
  • pmoves/Makefile
  • pmoves/design/build/tokens.darkxside-skin.css
  • pmoves/design/build/tokens.pmoves-armor.css
  • pmoves/design/build/tokens.ts
  • pmoves/design/tests/test_generate.py
  • pmoves/design/tokens.base.json
  • research/DL_FOLLOWON_LANES_2026-06-16.md
📝 Walkthrough

Walkthrough

Introduces the pmoves/design/ namespace implementing DL-1: a build-time Python generator reads agent_signatures.yaml, merges base token JSON with per-theme JSON overlays, and emits per-theme CSS custom-property files plus a typed TypeScript token map. Adds a dependency-free JS theme-provider, a local preview page, pytest coverage, a Makefile target, and accompanying spec/plan documentation.

Changes

DL-1 Design Token Layer

Layer / File(s) Summary
Design spec and implementation plan
docs/superpowers/specs/2026-06-15-pmoves-unified-design-language.md, docs/superpowers/plans/2026-06-16-dl-1-design-token-layer.md
Unified design language spec formalizes the --pm-* token convention, two-register theming model, DL-0–DL-4 phased delivery, and per-surface application plan. DL-1 plan document specifies the full TDD build sequence, token contract shapes, generator API, preview page, README requirements, and out-of-scope follow-on lanes.
Token source files: base tokens and theme definitions
pmoves/design/tokens.base.json, pmoves/design/themes/pmoves-armor.json, pmoves/design/themes/darkxside-skin.json
tokens.base.json defines the canonical color, radius, spacing, ease, and font base set. Two theme JSON files supply accent agent IDs and background-color overrides that the generator merges with the base and registry data.
Python generator: registry loading, resolution, and emission
pmoves/design/generate.py
Adds the full generator pipeline: path constants and an unsafe-character regex, load_registry()/field-validator, resolve_theme() combining base + registry accents + theme overrides with safety checks, emit_css() with default :root special-casing, emit_ts() producing the themes const and ThemeName type, and main() iterating theme files to write all build outputs.
Generator test suite
pmoves/design/tests/test_generate.py
Pytest suite covers resolve_theme for both themes, KeyError on missing agent or field, emit_css selector and :root:not([data-theme]) fallback assertions, emit_ts export shape, and a security negative test rejecting hostile CSS-breaking characters via ValueError.
Generated build artifacts: CSS themes and TypeScript map
pmoves/design/build/tokens.pmoves-armor.css, pmoves/design/build/tokens.darkxside-skin.css, pmoves/design/build/tokens.ts, pmoves/design/.gitignore
Committed generator outputs: per-theme --pm-* CSS custom-property blocks, the themes/ThemeName TypeScript module, and a .gitignore rule that tracks build/ for downstream consumers.
Runtime theme-provider and preview page
pmoves/design/theme-provider.js, pmoves/design/preview.html, pmoves/design/preview.css, pmoves/design/preview.js
Dependency-free theme-provider.js exports setTheme, currentTheme, and toggleTheme. The CSP-clean preview page links both generated CSS files, renders token swatches and a motif kit, and wires a toggle button via preview.js.
Makefile targets, README, agent note, and follow-on lanes
pmoves/Makefile, pmoves/design/README.md, pmoves/docs/AGENTS/AGNOTE4482PHI.t1.md, research/DL_FOLLOWON_LANES_2026-06-16.md
Adds design-tokens and design-tokens-check Make targets running the generator via uv. README documents registry contract, regeneration workflow, token naming, and A/B/C ownership. Agent note records the DL-1 claim/update with PR reference. Follow-on lanes document specifies DL-1b through DL-4 scope and gating dependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • POWERFULMOVES/PMOVES.AI#711: Extends the darkxside signature in agent_signatures.yaml, which generate.py reads to resolve --pm-accent and --pm-signature tokens for both themes.
  • POWERFULMOVES/PMOVES.AI#1603: Adds new agent identities to the same agent_signatures.yaml registry that the DL-1 generator consumes as its token source of truth.

Poem

🐇 ✦ Hop, hop — the token trail is set,
CSS vars cascade without regret.
A YAML registry, a Python wand,
Two themes emerge — both dark and armored bond.
setTheme, toggleTheme, the rabbit cheers,
Design tokens flow for many years! 🎨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: introducing DL-1, a unified design-language token layer in pmoves/design/.
Description check ✅ Passed The PR description comprehensively covers all required template sections: Summary (with bullet points explaining what changed and why), Testing (with verification commands and test results), Required Checks (CHIT contract and documentation), Review Coordination (4090 pair-review requested), and Follow-up Tasks (DL-1b through DL-4 lanes documented separately).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dl-1-unified-design-tokens

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

hunnibear and others added 2 commits June 16, 2026 15:31
… pair-review)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t check

Addresses the approve-with-nits review of #1827:
- W2: reject CSS/TS-breaking token values (; } " newline) so a typo in the
  registry fails loudly instead of silently committing broken build/ output.
- N2: clear error when a referenced agent is missing a required field
  (color/accent), symmetric with the unknown-agent error.
- W1: 'make design-tokens-check' fails if committed build/ drifted from the
  generator (deterministic output, cheap guard). +2 tests (7/7 green).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@POWERFULMOVES POWERFULMOVES left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — approve-with-nits (findings addressed)

Reviewed via pr-review-toolkit:code-reviewer against origin/main...HEAD. Verdict: approve-with-nits; the token layer is correct, deterministic, CSP-clean, and tested. Confirmed-good: CSP-cleanliness (no inline style/script bodies, ES modules, no remote URLs), override precedence (overrides applied last), valid default-theme selector, cross-platform pathlib+utf-8+sorted() determinism, end-to-end naming contract.

Three findings; all now fixed on head (commit pushed):

  • W1 — build/ drift had no guard. Committed output could silently diverge from source if someone edits a theme/registry and forgets to regenerate. → Added make -C pmoves design-tokens-check (regenerates + git diff --exit-code -- design/build). Deterministic, so it's a cheap CI-wireable guard.
  • W2 — registry values written verbatim into CSS/TS. A typo/hostile value with ; } " or newline would produce broken build/ that still commits clean (silent failure). → Added a _safe() guard rejecting those chars (single quotes/commas/parens still allowed for font stacks + rgba()); raises a clear ValueError. +test.
  • N2 — missing color/accent on a present agent raised a bare KeyError('color')._field() now raises agent 'x' missing required theme field 'accent', symmetric with the unknown-agent error. +test.

N1 (toggle hardcodes the two theme names) is acceptable for the 2-theme preview and is superseded when DL-3 wires setPersona() off the generated themes map. Tests now 7/7.

Note: requesting 4090 pair-review as W1 theme-lane owner before the OPERATOR (DARKXSIDE) merge gate.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/superpowers/specs/2026-06-15-pmoves-unified-design-language.md`:
- Around line 48-68: The code fences in the REGISTRY diagram (starting at line
48) and the other diagram section (starting at line 136) are missing language
labels, which violates the MD040 markdownlint rule. Add the language label
"text" to each opening fence marker by changing the three backticks (```) to
```text on both diagram blocks to satisfy the markdown linter while maintaining
the diagram clarity.
- Around line 143-145: The documentation file lists tokens.css as a generated
artifact, but the actual build system generates theme-specific files named
tokens.<theme>.css plus tokens.ts. Update the diagram in the file to reflect the
actual generated CSS artifacts with the proper naming pattern
(tokens.<theme>.css) instead of the incorrect tokens.css reference, ensuring the
documentation accurately represents what the build system produces.

In `@pmoves/design/build/tokens.darkxside-skin.css`:
- Line 11: The pm-font-display token definition in the source file
pmoves/design/tokens.base.json contains an unquoted Orbitron font name, which
creates an inconsistency with the quoted 'Orbitron' used in globals.css. Locate
the pm-font-display token definition in pmoves/design/tokens.base.json and quote
the Orbitron font name as 'Orbitron' to maintain consistency with the existing
convention. This change will automatically propagate to all generated CSS token
files during the build process.

In `@pmoves/design/build/tokens.pmoves-armor.css`:
- Line 11: The font name `Orbitron` in the `--pm-font-display` CSS custom
property is unquoted while other fonts in the same stack like `Exo 2` are
quoted. Add single quotes around `Orbitron` to match the quoting convention of
the other font names in the font stack and ensure consistency across all font
definitions in the base token.

In `@pmoves/design/tests/test_generate.py`:
- Around line 30-34: Replace the try-except blocks that use assert False with
pytest.raises() context managers in three locations in this test file. Instead
of wrapping the resolve_theme call in a try-except and asserting False, use
pytest.raises(KeyError) as a context manager to catch the expected exception.
After the with block exits, assert the expected error message content by
checking excinfo.value. Apply this same pattern to all three problematic test
cases mentioned (around lines 30-34, 66, and 77) to ensure exceptions are
reliably tested even under optimized Python execution.

In `@pmoves/Makefile`:
- Around line 3925-3931: The design-tokens-check target uses git diff to
validate that the design/build directory hasn't drifted from generated output,
but git diff only detects changes to tracked files, so newly generated but
untracked artifacts in design/build will not be caught. Mark both the
design-tokens and design-tokens-check targets as .PHONY so they always execute,
and update the validation logic to include untracked files in the drift
detection (consider using git status or combining git diff with a check for
untracked files in the design/build directory).

In `@research/DL_FOLLOWON_LANES_2026-06-16.md`:
- Around line 28-31: Mirror the operational topology details from this DL-3 lane
document into the canonical context files to prevent documentation drift. Add
the Showtime event subscription details (showtime.all_green.v1 and the
:9225/sse/events endpoint) to the appropriate canonical documentation:
specifically, add the NATS event subject showtime.all_green.v1 to
.claude/context/nats-subjects.md and add the Showtime service port/endpoint
details to .claude/context/services-catalog.md. This ensures topology facts are
maintained in a single source of truth and keeps lane planning docs synchronized
with the service catalog.
- Around line 12-13: The markdown documentation for the DL-1 output section in
the lane summary is incomplete and does not reflect all token families generated
by pmoves/design/generate.py. Locate the token inventory list in the DL-1 output
description (currently showing
--pm-bg/-surface/-ink/-accent/-accent-soft/-accent-2/-signature/-radius/-font-*)
and add the missing --pm-space-* token family to ensure the documentation
accurately represents all token contracts emitted by the generate.py script.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 15110fa3-ed26-45e4-a458-d0790949ef67

📥 Commits

Reviewing files that changed from the base of the PR and between 1d5696c and 12e179d.

📒 Files selected for processing (19)
  • docs/superpowers/plans/2026-06-16-dl-1-design-token-layer.md
  • docs/superpowers/specs/2026-06-15-pmoves-unified-design-language.md
  • pmoves/Makefile
  • pmoves/design/.gitignore
  • pmoves/design/README.md
  • pmoves/design/build/tokens.darkxside-skin.css
  • pmoves/design/build/tokens.pmoves-armor.css
  • pmoves/design/build/tokens.ts
  • pmoves/design/generate.py
  • pmoves/design/preview.css
  • pmoves/design/preview.html
  • pmoves/design/preview.js
  • pmoves/design/tests/test_generate.py
  • pmoves/design/theme-provider.js
  • pmoves/design/themes/darkxside-skin.json
  • pmoves/design/themes/pmoves-armor.json
  • pmoves/design/tokens.base.json
  • pmoves/docs/AGENTS/AGNOTE4482PHI.t1.md
  • research/DL_FOLLOWON_LANES_2026-06-16.md

Comment thread docs/superpowers/specs/2026-06-15-pmoves-unified-design-language.md Outdated
Comment thread docs/superpowers/specs/2026-06-15-pmoves-unified-design-language.md
Comment thread pmoves/design/build/tokens.darkxside-skin.css Outdated
Comment thread pmoves/design/build/tokens.pmoves-armor.css Outdated
Comment thread pmoves/design/tests/test_generate.py Outdated
Comment thread pmoves/Makefile
Comment thread research/DL_FOLLOWON_LANES_2026-06-16.md Outdated
Comment thread research/DL_FOLLOWON_LANES_2026-06-16.md
… drift gate, docs)

CodeRabbit trim of PR #1827:
- Quote 'Orbitron' in tokens.base.json (consistency w/ globals.css) + regenerate
  both theme CSS files and tokens.ts.
- test_generate.py: replace 'assert False' in except handlers with pytest.raises()
  so failures aren't masked under python -O.
- design-tokens-check: mark phony + 'git add --intent-to-add' so the drift gate
  also catches NEW untracked build/ artifacts (plain git diff sees only tracked).
- spec doc: label diagram fences (MD040) and correct tokens.css -> tokens.<theme>.css.
- research lane doc: add the --pm-space-* family to the token inventory.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Jun 17, 2026

Copy link
Copy Markdown

Triage — coderabbitai[bot] review on PR #1827 (read-only signal for /pr-trim)

No P0 or P1 findings from coderabbitai[bot].

P2: 2, P3: 6

P2 findings:

  • pmoves/Makefile:3937 — drift gate uses git diff only; newly untracked design/build/ artifacts escape the check and can silently land unreviewed.
  • pmoves/design/tests/test_generate.py:32,66,77assert False inside bare except blocks is elided under -O; tests silently pass on regression if run in optimised mode.

P3 (6 nits/style): MD040 unlabelled fences in spec doc (×2), wrong artifact name tokens.css in diagram, unquoted Orbitron in both generated CSS files (×2), missing --pm-space-* in lane doc inventory.

@POWERFULMOVES
POWERFULMOVES merged commit 50b58d7 into main Jun 17, 2026
19 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the feat/dl-1-unified-design-tokens branch June 17, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants