agentleFS
alvaroofernaandezalvaroofernaandez/dotfiles/skills/design-refactor/SKILL.md

design-refactor

Skill5 starsChanged 2 days agoMITView on GitHub

Improve an EXISTING UI: normalise components, migrate to shadcn/ui + Radix, replace native select/date/dialog controls, polish a screen without breaking behaviour. For polish and design-debt cleanup.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Native interactive elements are never acceptable: No native date picker, no raw <select>, no browser <dialog>, no confirm().

    line 16
  2. Distinctive:

    Verify it, do not assert it:

    line 40
  3. Distinctive:

    Run the gates and report their output:

    line 42
  4. Very specific:

    Run the gates against a states harness, then render it with aval shot and look at the screenshots.

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Design refactor

The improve-what-exists half of the design pipeline. design-pipeline governs new surfaces; this one takes a surface that already works and makes it good, without changing routes, data flow or markup semantics — except to fix accessibility.

The rule that overrides taste here

Native interactive elements are never acceptable. No native date picker, no raw <select>, no browser <dialog>, no confirm(). Always a custom shadcn/Radix component. reference/native-to-shadcn.md gives the replacement for each one, the Select-vs-Combobox decision, the react-hook-form Controller pitfall, and the behaviour a swap must not lose.

aval design gate native src/

Exits non-zero on any hit. components/ui/** is exempt — that is where the Radix wrappers legitimately live.

Order of work

Audit, then apply in order: tokens, typography and spacing, component states, motion. Never the reverse: restyling components before the tokens are consolidated just re-hardcodes the same drift in new places.

Consistency is the whole job

Consolidate to ONE shared token theme and make every page consume it. A redesign that leaves different pages on different palettes has failed.

Verify it, do not assert it:

Run the gates and report their output:

aval design gate hardcodes src/                       # literal colours/sizes that should be tokens
aval design gate theme-refs --theme theme.css src/    # var(--x) pointing at nothing
aval design gate pairs tokens/colors.json             # every fg/bg pair, light and dark

Micro-interactions

Motion is added last and only with a stated reason. Defaults that survive review: 100ms for a state echo, 200ms for an entrance, ease-out on enter and ease-in on exit, transform and opacity only — never width, height or top. Every animation needs a prefers-reduced-motion branch; check it in the render; no gate covers it.

Verification is not optional

Run the gates against a states harness, then render it with aval shot and look at the screenshots. That is the step that catches what no gate does: mismatched stroke weights, a control that reads too heavy, a transition artefact mid-animation.

Report real output as [design-audit]. A gate you did not run is reported as not run, never as a pass.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.