Fix .claude/skills data drift, harden search engine, tighten SKILL.md#412
Conversation
|
As the author of #242 (the .NET desktop stacks), I hit this exact bug: after a marketplace install, |
|
Thanks for the thorough work @sunilchandarjr — this PR addresses real drift issues we've been tracking (6 missing stacks in However, this PR has merge conflicts with
What looks good from the description:
Will need verification after rebase:
Once rebased and CI is green, I'll do a full review. Marking as blocked until then. |
The sync tooling (cli/scripts/sync-assets.mjs) only ever verified
cli/assets/ against src/ui-ux-pro-max/. It never checked
.claude/skills/ui-ux-pro-max/{data,scripts} -- the copy Claude Code
actually loads when this repo is installed as a plugin. That copy had
silently drifted: 6 of 22 registered stacks (javafx/wpf/winui/avalonia/
uno/uwp) had no CSV at all (every search 404'd), and colors/products/
styles/typography/4 stack CSVs had stale, smaller content than src/.
Fixes:
- Extend sync-assets.mjs (and the "Check asset sync" CI workflow's
trigger paths) to also sync/verify .claude/skills/ui-ux-pro-max/
{data,scripts} against src/ui-ux-pro-max/. Restored that copy from
src/ (the documented source of truth) to close the gap.
- core.py: tokenizer no longer drops 2-letter domain terms without a
stopword list (previously either lost "ui"/"ux" entirely, or kept
every 2-letter stopword with no filtering); add a small synonym
normalization layer (e-commerce/ecommerce, a11y/accessibility, etc.);
0-result searches now return nearest-vocabulary suggestions instead
of silent emptiness; CSV loads + BM25 indexes are cached by file
mtime instead of rebuilt on every call within a --design-system run;
domain auto-detection now weights multi-word keyword matches and
breaks ties deterministically instead of by dict order, and reports
the runner-up domain.
- design_system.py: --persist no longer silently overwrites an
existing MASTER.md -- skips (with a clear message) unless --force is
passed. generate_design_system() now returns a dict (text/design_
system/persistence) instead of a bare string, enabling --json output
for --design-system.
- search.py: field truncation is now per-column (code samples and
checklists are never truncated); added --full and --force flags and
--json support for --design-system.
- Added validate_data.py (stdlib-only) checking CSV_CONFIG/STACK_CONFIG
columns actually exist in their CSV headers and Decision_Rules JSON
parses -- catches the kind of drift above at the domain-schema level
(complements, doesn't replace, the existing structural
scripts/validate-csv.py). Added a 16-case unittest suite for core.py/
design_system.py (previously zero test coverage for the search
engine itself).
- SKILL.md: replaced relative `python3 skills/...` invocations (wrong
cwd assumption, and python3 doesn't exist on stock Windows) with
${CLAUDE_PLUGIN_ROOT}-anchored paths and a python/python3/py fallback
note; moved the ~250-line Quick Reference and App-UI pro-rules/
checklist into references/quick-reference.md and references/pro-
rules.md (loaded on demand) cutting SKILL.md from 703 to ~170 lines;
fixed the --persist path in the docs to match the code (design-
system/<slug>/MASTER.md, not design-system/MASTER.md); reconciled all
style/palette/font/product/stack counts against actual CSV row
counts (several had drifted, e.g. 67 UI styles -> 84, 161 palettes ->
192) in SKILL.md, plugin.json, and README.md.
Known follow-up not addressed here: README's "Available Styles (67)"
curated breakdown list is stale relative to the 84 styles now in
styles.csv (17 new styles added without updating that list) -- left
untouched since backfilling it accurately requires design judgment
about category placement, not a mechanical fix. threejs.csv is also
missing the "No" index column present in every other stack CSV
(harmless for search, flagged by validate_data.py).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
748bad8 to
cd1a0d8
Compare
Summary
While auditing the plugin for reliability, I found that
.claude/skills/ui-ux-pro-max/{data,scripts}-- the copy Claude Code actually loads when this repo is installed as a plugin -- had silently drifted fromsrc/ui-ux-pro-max/(the documented source of truth).cli/scripts/sync-assets.mjsand the "Check asset sync" workflow only ever coveredcli/assets/; nothing checked the Claude Code skill copy. As a result:javafx,wpf,winui,avalonia,uno,uwp) had no CSV at all in that copy -- every search against them returned "Stack file not found".colors.csv,products.csv,styles.csv,typography.csv, and 4 stack CSVs (angular,astro,laravel,nuxt-ui) had stale, smaller content thansrc/(e.g.colors.csvhad 160 rows vs. 192 insrc/).Beyond fixing that drift, I also hardened the search engine and tightened
SKILL.mdwhile I was in there:sync-assets.mjs(and CI trigger paths) to also sync/verify.claude/skills/ui-ux-pro-max/{data,scripts}againstsrc/, so this can't silently drift again.ui,ux,3d,gsap) without a proper stopword list; added a small synonym-normalization layer (e-commerce/ecommerce,a11y/accessibility, etc.); 0-result searches now return nearest-vocabulary suggestions instead of silent emptiness; CSV/BM25 indexes are cached by file mtime instead of rebuilt on every call inside a single--design-systemrun; domain auto-detection weights multi-word keyword matches and breaks ties deterministically (previously depended on dict ordering), and reports the runner-up domain.--persistno longer silently overwrites an existingMASTER.md-- it skips (with a clear message) unless--forceis passed.generate_design_system()now returns a dict (text/design_system/persistence) instead of a bare string, enabling--jsonoutput for--design-system.--full,--force, and--jsonsupport for--design-system.validate_data.py(stdlib-only) which checks thatCSV_CONFIG/STACK_CONFIGcolumns actually exist in their CSV headers and thatDecision_RulesJSON parses -- this complements (doesn't replace) the existingscripts/validate-csv.py, which checks structural CSV integrity but not domain-schema alignment. Added a 16-caseunittestsuite forcore.py/design_system.py, which had zero test coverage.python3 skills/...invocations (wrong cwd assumption for a plugin install, andpython3doesn't exist on stock Windows) with${CLAUDE_PLUGIN_ROOT}-anchored paths plus apython/python3/pyfallback note; moved the ~250-line Quick Reference and App-UI pro-rules/checklist intoreferences/quick-reference.mdandreferences/pro-rules.md(loaded on demand), cutting SKILL.md from 703 to ~170 lines; fixed the documented--persistpath to match the code (design-system/<slug>/MASTER.md, notdesign-system/MASTER.md); reconciled style/palette/font/product/stack counts against actual CSV row counts in SKILL.md,plugin.json, andREADME.md(several had drifted, e.g. "67 UI styles" -> 84, "161 palettes" -> 192).Known follow-ups not addressed here
styles.csv(17 new styles were added without updating that categorized list). Left untouched since backfilling it accurately requires design judgment about category placement, not a mechanical fix.data/stacks/threejs.csvis missing theNoindex column present in every other stack CSV. Harmless for search (not part of any search/output column), flagged by the newvalidate_data.py.Test plan
bash scripts/smoke-domains.sh-- 12/12 domains OKbash scripts/smoke-stacks.sh-- 22/22 stacks OKpython scripts/validate-csv.py-- passesnode cli/scripts/sync-assets.mjs --check-- in sync (now covering.claude/skills/too)python -m unittest discover -s src/ui-ux-pro-max/scripts/tests-- 16/16 passingpython src/ui-ux-pro-max/scripts/validate_data.py-- 1 known finding (threejs.csv, noted above)--design-system,--persist/--force,--json, zero-result suggestions, and all 22 stacks/12 domains viasearch.pydirectly🤖 Generated with Claude Code