9 Commits

Author SHA1 Message Date
Lin Junrong
ec1f2a9027
fix(design-system): resolve palette and anti-patterns against the style's mode (#428) (#434)
generate() ranked style, palette and anti-patterns independently, so a
dark-primary style could come back with a light palette and a
"Dark mode by default" anti-pattern in the same output. The palette is
what users copy into CSS variables, so the output shipped a light theme
with dark-theme styling instructions attached.

Resolve the mode first -- from the query keywords and the style's own
Light/Dark Mode columns -- then pick a palette whose Background matches
it and drop mode-contradicting anti-pattern clauses.

Only the dark case filters palettes. Light keeps the existing top-hit
behaviour so queries that never mention a mode are untouched, and dark
falls back to the top hit when colors.csv has no dark ramp for the
product type.

Adds scripts/tests/test_design_system_mode.py (stdlib unittest, matching
test_core.py) and syncs cli/assets + .claude/skills via sync-assets.mjs.
2026-07-31 18:00:15 +07:00
sunilchandarjr
f8ac5e1266
Fix .claude/skills data drift, harden search engine, tighten SKILL.md (#412)
Merged by github-maintain cron. Approved by @clark-cant and @jizc. Pre-existing pytest failure on main (ui-styling/shadcn test) is unrelated to PR scope.
2026-07-15 01:32:50 +07:00
Andras Polgar
3da52ff1ca
security: harden skill against agent-audit risk patterns (#417)
Addresses the behavioral patterns that plausibly triggered the Gen
(Agent Trust Hub) High Risk rating on skills.sh, without changing
runtime functionality:

- Prerequisites no longer instruct agents to run sudo/brew/apt/winget
  install commands; agents must ask the user to install Python instead
  (SKILL.md, skill-content.md template, README.md, README.zh.md)
- Soften coercive invocation language ("Must Use" -> "Primary Use
  Cases") and replace keyword-stuffed frontmatter descriptions with
  factual ones (SKILL.md, quick-reference.md, claude/droid.json,
  plugin.json)
- Remove design.csv, draft.csv and _sync_all.py: unused by the runtime
  (not registered in core.py CSV_CONFIG) and containing prompt-shaped
  "System Prompt: ... You are ..." blocks that read as injection risk
- Fix path traversal in --persist: new safe_slug() restricts project
  and page names to [a-z0-9_-], so ../ in -p/--page can no longer
  escape the design-system/ output folder

Verified: validate-csv.py (35 files), smoke-domains (12/12),
smoke-stacks (22/22), check:assets in sync, persist traversal attempt
stays confined.

Co-authored-by: Andras Polgar <5525341+ruredi@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 21:30:06 +07:00
文敏華
6a6167691a Rename motion domain to gsap to avoid collision with PR #296
PR #296 (feat/emil-motion-principles) independently registers a "motion"
domain key in CSV_CONFIG/detect_domain for motion-principles.csv (37
design-principle rows). Both PRs adding the same dict key would cause
one to silently overwrite the other's domain registration if merged
independently, per the automated review on this PR.

The two domains are complementary, not duplicate (design principles vs.
ready-to-use GSAP code snippets), so this renames this PR's domain from
"motion" to "gsap" - a more precise name given every row is GSAP-specific
implementation code. The --motion CLI dial and its "Subtle/Standard/
Complex" tiers are unaffected (unrelated to the domain key; only the
`--domain gsap` search endpoint and its internal lookup changed). No
regressions: --design-system output with no dials set remains
byte-identical to before this feature.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-02 23:36:44 +08:00
文敏華
bd9329c9cb Add motion domain and design dials to design-system generator
Adds a new searchable `motion` domain (motion.csv, 16 GSAP animation
skeletons across hover/scroll-reveal/stagger/page-transition/parallax/
loading, each tagged Subtle/Standard/Complex) plus three optional 1-10
dials on `--design-system` — --variance, --motion, --density — inspired
by taste-skill's DESIGN_VARIANCE/MOTION_INTENSITY/VISUAL_DENSITY sliders.

- --variance biases style search/selection toward centered-minimal (low)
  or bold-asymmetric (high) categories
- --motion attaches a matching GSAP snippet (code + framework notes +
  do/don't) from motion.csv
- --density overrides the --space-* token scale in ASCII/markdown/MASTER.md
  output (spacious <-> dense/dashboard)

All three dials are optional and additive; output with no dials set is
byte-identical to before (verified via regression diff). Synced into
.claude/skills/ui-ux-pro-max and cli/assets alongside src/ui-ux-pro-max
(source of truth) so all three installed copies stay consistent.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-01 22:54:02 +08:00
Alexander
d86f44368d
fix(scripts): force UTF-8 stdout/stderr in design_system.py on Windows (#390)
design_system.py prints box-drawing characters and swatches (--, OK marks,
block swatches), but unlike search.py it never reconfigured stdout. On a
non-UTF-8 Windows console (cp1252/gbk) running the CLI crashes with
UnicodeEncodeError, the same failure reported in #112 for search.py.

Mirror the wrapper search.py already uses: re-wrap stdout/stderr in a
UTF-8 TextIOWrapper when the console encoding is not UTF-8. Applied to
the source of truth and the synced cli/assets copy.

Verified: the CLI runs clean under PYTHONIOENCODING=cp1252 (exit 0, no
UnicodeEncodeError) while still emitting the box/swatch output;
check:assets passes.

Related to #112 (search.py is already fixed on main; this covers the
remaining design_system.py instance).
2026-06-25 18:30:49 +07:00
Alexander
3a12b63bd8
fix(scripts): guard persist_design_system against None project_name (#388)
persist_design_system crashed with AttributeError: 'NoneType' object has
no attribute 'lower' when the design_system dict carries an explicit
project_name of None (the default of generate(query, project_name=None)).
dict.get("project_name", "default") only substitutes the default for a
MISSING key, not a present-but-None value, so project_name.lower() blew
up.

Coalesce falsy values (None/""/missing) to "default" before slugifying.
Applied to both the source of truth and the bundled cli/assets copy.

The "search blindness" half of #159 (core.py tokenize length filter) is
already resolved on main (`len(w) >= 2`), so this targets the remaining
crash only.

Closes #159

Co-authored-by: YangKuoshih <155388493+YangKuoshih@users.noreply.github.com>
2026-06-25 15:43:33 +07:00
Jens
e3102cb7ed Improve design system output with Unicode borders, ANSI color swatches, extended palette, and dark/light mode
Upgrade the design system terminal output from basic ASCII to Unicode box-drawing characters,
add ANSI true color swatches with graceful fallback, expand the color palette from 5 to 10
colors (Primary, On Primary, Secondary, Accent, Background, Foreground, Muted, Border,
Destructive, Ring) with CSS variable names, and surface Light/Dark mode support from styles.csv.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 11:08:47 +01:00
Viet Tran
b2a05eceeb
feat: reorganize codebase with single source of truth + merge prompts into styles (#116)
BREAKING CHANGES:
- Moved canonical data/scripts to src/ui-ux-pro-max/
- Removed duplicate folders (.codex/, .gemini/, .trae/, .codebuddy/, .continue/, skills/, .qoder/)
- CLI now uses template system instead of copying pre-built folders

New features:
- Merged prompts.csv into styles.csv with 4 new columns:
  - AI Prompt Keywords
  - CSS/Technical Keywords
  - Implementation Checklist
  - Design System Variables
- All 67 styles now have complete prompt data
- Added Astro stack (53 guidelines)
- Added 10 new 2025 UI trend styles

CLI changes:
- New template rendering system (cli/src/utils/template.ts)
- Reduced cli/assets from ~34MB to ~564KB
- Assets now contain only: data/, scripts/, templates/

File structure:
- src/ui-ux-pro-max/ - Single source of truth
- .claude/skills/ - Symlinks to src/ for development
- .shared/ - Symlink to src/ui-ux-pro-max/

Bumped CLI version: 2.1.3 → 2.2.0

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 22:05:41 +07:00