Skip to content

feat(skill): pf design token check skill#108

Open
jcmill wants to merge 1 commit into
patternfly:mainfrom
jcmill:feat/101-pf-token-check-skill
Open

feat(skill): pf design token check skill#108
jcmill wants to merge 1 commit into
patternfly:mainfrom
jcmill:feat/101-pf-token-check-skill

Conversation

@jcmill
Copy link
Copy Markdown
Contributor

@jcmill jcmill commented Jun 5, 2026

resolves: #101

This skill detects hardcoded css values that should use a PatternFly design token. Works across CSS, SCSS, CSS in JS, React and inline styles.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for the design token validation skill, covering setup, usage examples, token hierarchy workflows, and migration guidance from legacy tools.

@jcmill jcmill requested a review from jpuzz0 June 5, 2026 20:14
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Too much diff to scan? Review this PR in Change Stack to start with the highest-impact changes.

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds comprehensive documentation for the pf-design-token-check skill, a code validation tool that detects hardcoded CSS values and recommends equivalent PatternFly design tokens. The documentation spans skill specification, detection logic, token resolution workflow, output format, user guides, and reference material including tool comparison and test examples.

Changes

pf-design-token-check Skill Documentation

Layer / File(s) Summary
Skill Role and Token Hierarchy
plugins/react/skills/pf-design-token-check/SKILL.md
Establishes the skill's objective to detect hardcoded styling values and prioritize semantic tokens over base, palette, and raw values in recommendations.
Detection Patterns and Exception Handling
plugins/react/skills/pf-design-token-check/SKILL.md
Defines regex patterns and property filters for detecting colors, spacing, typography, shadows, and border-radius violations; specifies supported file formats (CSS/SCSS, CSS-in-JS, React/HTML inline styles) and exception rules (var(--pf-...), token files, comments, test data).
Token Mapping and Chain Traversal
plugins/react/skills/pf-design-token-check/SKILL.md
Documents the token lookup workflow, including property-to-category mapping (spacing, text, motion, icon, color, border, shadow, z-index), token file search paths, and instructions for following token chains to semantic tokens or proposing semantic token names when needed.
Violation Format and Illustrative Examples
plugins/react/skills/pf-design-token-check/SKILL.md
Specifies the required violation output structure (overall counts, per-violation fields, token hierarchy, recommendation text) and provides concrete examples of detected violations across all token categories with before/after token recommendations and a summary workflow checklist.
README and Usage Documentation
plugins/react/skills/pf-design-token-check/README.md
User-facing documentation explaining the skill's purpose, supported value categories, token hierarchy workflow, property-to-token mapping, usage commands for single/multiple files and React components, and sample violation output with links to related reference material.
Reference Documentation and Testing Examples
plugins/react/skills/pf-design-token-check/reference/comparison.md, plugins/react/skills/pf-design-token-check/reference/example-violations.md
Supporting reference material including a comparison table between pf-design-token-check and the legacy pf-raw-colors-scan tool (scope, token recommendation quality, migration guidance) and example SCSS, CSS-in-JS, and React inline-style code snippets demonstrating violations across all token categories.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • jpuzz0
  • lboehling
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: implementing a new PatternFly design token check skill for the React plugin.
Linked Issues check ✅ Passed The PR implements all AC from issue #101: skill exists in react plugin, detects hardcoded colors/spacing/typography/shadows, suggests correct PF tokens, and works on CSS/SCSS/CSS-in-JS/inline styles.
Out of Scope Changes check ✅ Passed All changes are documentation files (README, SKILL.md, comparison, examples) directly supporting the new pf-design-token-check skill implementation with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped anthropics/claude-plugins-official.


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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (5)
plugins/react/skills/pf-design-token-check/SKILL.md (3)

3-3: ⚡ Quick win

Nitpick: Align skill description with required “Use when …” formula.

The description starts correctly with an action verb, but it should include an explicit trigger-context sentence beginning with “Use when …” to match repo skill-discovery rules.
As per coding guidelines, “description includes trigger contexts in a ‘Use when’ clause.”

🤖 Prompt for 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.

In `@plugins/react/skills/pf-design-token-check/SKILL.md` at line 3, Update the
skill description in SKILL.md to follow the repo's "Use when …" formula by
appending a trigger-context sentence that begins with "Use when …" and describes
when the checker should run (e.g., when reviewing CSS/SCSS/CSS-in-JS or inline
styles for hardcoded color, spacing, typography, or shadow values that have PF
token equivalents); keep the existing action-verb lead and ensure the new
sentence clearly states the trigger context for the skill.

139-139: ⚡ Quick win

Nitpick: Fix malformed token filename example.

Line 139 lists tokens-.scss, which looks like a typo and can mislead token-file search behavior in usage docs.
As per coding guidelines, skill instructions should be clear and outcome-oriented; malformed references reduce reliability.

🤖 Prompt for 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.

In `@plugins/react/skills/pf-design-token-check/SKILL.md` at line 139, Replace the
malformed token filename example `tokens-.scss` with the correct dark-theme
filename (e.g., `tokens-dark.scss`) in SKILL.md; search for other occurrences of
`tokens-.scss` in the file and update them to `tokens-dark.scss` (or the actual
dark-theme token filename used by the project) so documentation and token-file
search examples are accurate and consistent.

210-210: ⚡ Quick win

Nitpick: Add language tags to fenced code blocks (MD040).

These fences are missing language identifiers; adding text, css, or md (as appropriate) resolves the current markdownlint warnings.

Also applies to: 224-224, 229-229, 250-250, 266-266

🤖 Prompt for 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.

In `@plugins/react/skills/pf-design-token-check/SKILL.md` at line 210, In SKILL.md
update each fenced code block that currently has plain triple backticks to
include an appropriate language tag (e.g., text, css, md) to satisfy MD040;
locate the example/code fences around the token examples and replace ``` with
language-tagged fences like ```text or ```css as appropriate so markdownlint
stops flagging them (apply this change to all similar fences noted in the
comment).
plugins/react/skills/pf-design-token-check/reference/comparison.md (1)

42-42: ⚡ Quick win

Nitpick: Add language identifiers to code fences (MD040).

These blocks should include a language label to satisfy markdownlint and improve rendering clarity.

Also applies to: 52-52, 73-73

🤖 Prompt for 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.

In `@plugins/react/skills/pf-design-token-check/reference/comparison.md` at line
42, The markdown contains bare code fences ("```") in comparison.md that trigger
MD040; update each triple-backtick block (the fences shown as "```" at the
example code blocks) to include the appropriate language identifier (for example
```json, ```css, ```js as applicable) so each code fence is labeled and
markdownlint passes.
plugins/react/skills/pf-design-token-check/README.md (1)

83-83: ⚡ Quick win

Nitpick: Specify languages for fenced code blocks (MD040).

Please add fence languages (text, bash, etc.) to clear markdownlint warnings and keep docs consistent.

Also applies to: 112-112, 120-120

🤖 Prompt for 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.

In `@plugins/react/skills/pf-design-token-check/README.md` at line 83, Update the
fenced code blocks in the README.md that currently use bare ``` by adding
explicit languages (for example change ``` to ```bash for shell/CLI examples and
to ```text for plain output/snippets) so markdownlint MD040 is satisfied; locate
the anonymous fences around the CLI examples and output/examples and add the
appropriate language token after the opening backticks.
🤖 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.

Nitpick comments:
In `@plugins/react/skills/pf-design-token-check/README.md`:
- Line 83: Update the fenced code blocks in the README.md that currently use
bare ``` by adding explicit languages (for example change ``` to ```bash for
shell/CLI examples and to ```text for plain output/snippets) so markdownlint
MD040 is satisfied; locate the anonymous fences around the CLI examples and
output/examples and add the appropriate language token after the opening
backticks.

In `@plugins/react/skills/pf-design-token-check/reference/comparison.md`:
- Line 42: The markdown contains bare code fences ("```") in comparison.md that
trigger MD040; update each triple-backtick block (the fences shown as "```" at
the example code blocks) to include the appropriate language identifier (for
example ```json, ```css, ```js as applicable) so each code fence is labeled and
markdownlint passes.

In `@plugins/react/skills/pf-design-token-check/SKILL.md`:
- Line 3: Update the skill description in SKILL.md to follow the repo's "Use
when …" formula by appending a trigger-context sentence that begins with "Use
when …" and describes when the checker should run (e.g., when reviewing
CSS/SCSS/CSS-in-JS or inline styles for hardcoded color, spacing, typography, or
shadow values that have PF token equivalents); keep the existing action-verb
lead and ensure the new sentence clearly states the trigger context for the
skill.
- Line 139: Replace the malformed token filename example `tokens-.scss` with the
correct dark-theme filename (e.g., `tokens-dark.scss`) in SKILL.md; search for
other occurrences of `tokens-.scss` in the file and update them to
`tokens-dark.scss` (or the actual dark-theme token filename used by the project)
so documentation and token-file search examples are accurate and consistent.
- Line 210: In SKILL.md update each fenced code block that currently has plain
triple backticks to include an appropriate language tag (e.g., text, css, md) to
satisfy MD040; locate the example/code fences around the token examples and
replace ``` with language-tagged fences like ```text or ```css as appropriate so
markdownlint stops flagging them (apply this change to all similar fences noted
in the comment).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: acdde748-1ec4-48be-aa10-a3c1099a4b03

📥 Commits

Reviewing files that changed from the base of the PR and between 19575c7 and d7904fc.

📒 Files selected for processing (4)
  • plugins/react/skills/pf-design-token-check/README.md
  • plugins/react/skills/pf-design-token-check/SKILL.md
  • plugins/react/skills/pf-design-token-check/reference/comparison.md
  • plugins/react/skills/pf-design-token-check/reference/example-violations.md

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.

Create pf-design-token-check skill

1 participant