chore: add DESIGN.md design-identity spec with generated token block and drift check#768
Open
QuintonJason wants to merge 1 commit into
Open
chore: add DESIGN.md design-identity spec with generated token block and drift check#768QuintonJason wants to merge 1 commit into
QuintonJason wants to merge 1 commit into
Conversation
✅ Deploy Preview for pine-design-system ready!
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')); |
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
DESIGN.mdat 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:
tokens:AUTOGEN block — raw values pulled verbatim from the source of truth (@kajabi-ui/stylescore.json/semantic.json+_motion.scss): full color palette, 8px spacing scale, radius/shadow ramps, typography scale, semanticz-index, motion, and intent colors. Never hand-edited.pds-*components, plus the standarddesign.mdsections (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;--checkmode (CI) exits non-zero on drift.npm run design.tokensscript.test-lintcomposite action (runs on every PR).pre-pushlefthook 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 theaccentvariant).No new dependencies. No runtime/component code changes.
Fixes #(n/a)
Type of change
How Has This Been Tested?
npm run design.tokens(generates block),--check(passes), a negative drift test (correctly fails + restores), andnpm run lint.all(0 errors)Test Configuration:
Checklist:
Note
Low Risk
Documentation and tooling only; drift checks are read-only and do not affect builds or shipped UI.
Overview
Adds root
DESIGN.mdfollowing the design.md convention: a machine-readable YAML front matter plus prose for Pine’s visual identity. Thetokens:section betweenAUTOGEN:tokensmarkers is generated from@kajabi-ui/stylesJSON and_motion.scss; the rest (semantic colors, ~35pds-*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;--checkfails if committed tokens are stale.npm run design.tokenswires the script. CI runsnpm run design.tokens -- --checkin thetest-lintcomposite 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.