Who it is forA developer who uses Codex or Cursor to generate front-end code and keeps getting centered-everything layouts, one spacing value, and indigo buttons.
The problemGenerated UI is built piece by piece, so global design problems are not caught while the code is being written.
The outcomeThe assistant reads the design rules at session start, uses placeholder color tokens instead of hard-coded palette colors, and labels extension rules that come from outside the book.
What you need first
- Claude Code, or another AI coding assistant that can read files in the project
- Git, to clone the repository
- Python 3.9 or newer for the scripts (no third-party packages needed)
- A web project with HTML, CSS, or a framework such as Tailwind, for the review and token steps
Steps
- Clone the repository into the project folder with
git clone https://github.com/edisonmbli/refactoring-ui-skill.git .refactoring-ui. - For Codex or other tools that read AGENTS.md, run
cp .refactoring-ui/templates/AGENTS.md AGENTS.md, or merge the file into your existing AGENTS.md. - For Cursor, run
mkdir -p .cursor/rules && cp .refactoring-ui/templates/cursor/refactoring-ui.mdc .cursor/rules/. - Start a new session and ask the assistant to build a small screen, then check that it uses token names such as bg-{primary}-600 rather than a fixed palette class.
- Ask for a review pass after generation to catch issues the generator missed.
Prompt for your agent
Using the design rules in the .refactoring-ui folder from the edisonmbli/refactoring-ui-skill repo, build the screen described in <screen-brief> in <project-path>. Return the changed files and a short list of which rules were applied. Verify that no hard-coded palette color classes appear in the output.
Caveat. The README says Cursor loads the rule by file-type matching and that these paths change often, so check the current tool documentation if the file is not picked up.
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page