Skip to content

chore: add DESIGN.md design-identity spec with generated token block and drift check#768

Open
QuintonJason wants to merge 1 commit into
mainfrom
chore/design-md-spec
Open

chore: add DESIGN.md design-identity spec with generated token block and drift check#768
QuintonJason wants to merge 1 commit into
mainfrom
chore/design-md-spec

Conversation

@QuintonJason

@QuintonJason QuintonJason commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a DESIGN.md at the repo root following the google-labs-code/design.md convention — a single machine-readable + human-readable file that lets coding agents reproduce Pine's visual identity with precision (exact token values plus the rationale behind them).

The file has two layers:

  1. tokens: AUTOGEN block — raw values pulled verbatim from the source of truth (@kajabi-ui/styles core.json/semantic.json + _motion.scss): full color palette, 8px spacing scale, radius/shadow ramps, typography scale, semantic z-index, motion, and intent colors. Never hand-edited.
  2. Curated semantic layer + prose — semantic color roles, typography guidance, and token mappings for all ~35 pds-* components, plus the standard design.md sections (Overview → Do's and Don'ts).

To keep the generated block honest, this PR also adds:

  • scripts/generate-design-md.mjs — zero-dependency generator. Default mode rewrites the AUTOGEN block from upstream tokens; --check mode (CI) exits non-zero on drift.
  • npm run design.tokens script.
  • A CI drift step in the test-lint composite action (runs on every PR).
  • A pre-push lefthook command for fast local feedback.

Component token mappings were verified against each component's compiled CSS, which corrected several inferences (e.g. Pine's primary button is dark grey-900, not purple — purple is the accent variant).

No new dependencies. No runtime/component code changes.

Fixes #(n/a)

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • tested manually
  • other: ran npm run design.tokens (generates block), --check (passes), a negative drift test (correctly fails + restores), and npm run lint.all (0 errors)

Test Configuration:

  • OS: macOS
  • Node: 22.x

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Design has QA'ed and approved this PR

Note

Low Risk
Documentation and tooling only; drift checks are read-only and do not affect builds or shipped UI.

Overview
Adds root DESIGN.md following the design.md convention: a machine-readable YAML front matter plus prose for Pine’s visual identity. The tokens: section between AUTOGEN:tokens markers is generated from @kajabi-ui/styles JSON and _motion.scss; the rest (semantic colors, ~35 pds-* component mappings, overview/do’s/don’ts) is hand-maintained.

Introduces scripts/generate-design-md.mjs (no extra deps): default mode rewrites only the AUTOGEN block; --check fails if committed tokens are stale. npm run design.tokens wires the script. CI runs npm run design.tokens -- --check in the test-lint composite action; lefthook runs the same on pre-push.

No runtime or component code changes.

Reviewed by Cursor Bugbot for commit 0bf2d32. Bugbot is set up for automated code reviews on this repo. Configure here.

@QuintonJason QuintonJason requested a review from a team as a code owner June 22, 2026 18:39
@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for pine-design-system ready!

Name Link
🔨 Latest commit 0bf2d32
🔍 Latest deploy log https://app.netlify.com/projects/pine-design-system/deploys/6a398180fc5abf0007792a21
😎 Deploy Preview https://deploy-preview-768--pine-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

const START = '# AUTOGEN:tokens:start';
const END = '# AUTOGEN:tokens:end';

const readJSON = (f) => JSON.parse(readFileSync(resolve(TOKENS, f), 'utf8'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Potential file inclusion attack via reading file - medium severity
If an attacker can control the input leading into the ReadFile function, they might be able to read sensitive files and launch further attacks with that information.

Show fix

Remediation: Ignore this issue only after you've verified or sanitized the input going into this function. This issue is only relevant in the backend, not in the frontend!

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

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.

1 participant