Fix design system color mapping and restore stack search supportfix: restore design system colors and stack search#182
Conversation
Map design system output to colors.csv headers and restore documented stack CSV support in source and bundled assets
accesspath27-lgtm
left a comment
There was a problem hiding this comment.
Code Review: Fix design system color mapping and restore stack search
BLOCKER: Color mapping fix is incorrect
The current colors.csv headers on main are:
Primary (Hex), Secondary (Hex), CTA (Hex), Background (Hex), Text (Hex)
The PR changes the code from best_color.get("Primary (Hex)") to best_color.get("Primary") — claiming the CSV headers are Primary, Secondary, Accent, Background, Foreground. But colors.csv is not modified in this PR. The actual headers still contain (Hex) suffixes and use CTA/Text, not Accent/Foreground.
This means the PR breaks color mapping — every color lookup will fall back to hardcoded defaults.
Stack discovery: Good idea, minor concerns
- Positive: Replacing the hardcoded
STACK_CONFIGdict with_discover_stack_config()that globsstacks/*.csvis a solid improvement. - Risk: Runs at module import time. If
STACKS_DIRdoesn't exist, it silently returns an empty dict. Consider a warning or fallback. - Risk: Assumes
filepath.stemmatches the expected--stackCLI argument — a CSV namedReact Native.csvwould produce aReact Nativekey instead ofreact-native.
Missing CLI bundle sync
12 new stack CSVs are added under src/ui-ux-pro-max/data/stacks/ but the CLI bundle at cli/assets/data/stacks/ also needs them. Without this, the CLI will have different stacks than the source.
Tests
- The color test hardcodes specific hex values (
#7C3AED, etc.) — these will break if CSV data changes. Consider testing for valid hex codes rather than exact matches. - Tests assume both
src/andcli/scripts are runnable, but onlysrc/gets the new stack CSVs.
Other
- README update listing
--stackvalues is helpful - Whitespace-only changes in
search.pyshould be a separate commit STACK_HELPmoved to module level is a nice touch
Required changes
- Fix the color mapping to match actual CSV headers (
Primary (Hex),Secondary (Hex),CTA (Hex),Background (Hex),Text (Hex)), OR also modifycolors.csvto use the new headers - Sync new stack CSVs to
cli/assets/data/stacks/as well
accesspath27-lgtm
left a comment
There was a problem hiding this comment.
Updated Review — Approving
My previous review was incorrect. The diff was truncated (160KB+) and I missed that colors.csv is updated in both src/ and cli/ locations with the new headers (Primary, Secondary, Accent, Background, Foreground). The CLI stacks directory is also already synced.
Verified
- ✅
src/ui-ux-pro-max/data/colors.csv— headers match code (Primary,Secondary,Accent,Background,Foreground) - ✅
cli/assets/data/colors.csv— same headers, consistent - ✅
design_system.py— both copies correctly reference new headers - ✅
core.py— dynamic stack discovery works for all 13 stacks - ✅
search.py—--stackhelp text auto-generated from discovered stacks - ✅ Design system search returns real colors (
#7C3AED,#A78BFA,#F43F5E,#0F0F23,#E2E8F0), not fallback defaults - ✅ Stack search works for
nextjs,react,html-tailwind(tested both src and CLI) - ✅ All regression tests pass (2/2)
Notes
- This is a large PR (227 files, +793/-28 shown in summary but much more in reality) — the bulk is new stack CSVs and skill additions
- The
_discover_stack_config()approach is clean and extensible - Apologies for the false negative on the color mapping — the truncated diff was misleading
LGTM 👍
|
Thanks for the approval and the kind words! Glad everything checks out. Appreciate your help reviewing this big PR. |
|
@claude review |
|
I'll analyze this and get back to you. |


Summary
colors.csvheaders (Primary,Secondary,Accent,Background,Foreground)--stacksupport by syncing the missing stack CSV files intosrcand loading available stacks dynamicallyTest Plan
python3 -m unittest discover -s tests -p 'test_*.py' -vpython3 src/ui-ux-pro-max/scripts/search.py "gaming app" --design-system -f markdownpython3 src/ui-ux-pro-max/scripts/search.py "App Router" --stack nextjspython3 cli/assets/scripts/search.py "gaming app" --design-system -f markdown