Design from code
This page helps you build a design from an app that already exists. It also helps you keep the design up to date when the code changes. Your code does not change.
It works for web, Android, iOS and Flutter code.
How to build a design from code
- Open the start screen.
- Click Design from code….
- Paste a GitHub link, or pick a project folder on your computer.
- Wait while the chat reads the code.
- Read the plan. Tick the items that you want.
- Click Build. The button shows the number of items, such as Build 3 items.
Brsh copies a GitHub link with your own git login. Your code stays as it is.
The chat builds in this order: tokens (your colours, spacing and type), then components, then screens. The wizard in the chat shows five steps: Source, Scan, First cut, Build and Next. At the end, a report lists what Brsh made and what it left out.
Example: you tick the Sign-in flow. Brsh builds its buttons first. Then it builds the Login screen.
You can also type /code-to-design in the chat. Add a scope if you like, such as "the login flow".
How to keep the design up to date
- Open a file that has a design from code.
- Connect the code folder with File › Import from GitHub…. Or type
/code-syncin the chat. - Read the list of changes.
- Say yes to the changes that you want.
Each layer made from code remembers its source file and the version of that file. So Brsh looks only at the files that changed.
The list has one line for each change. For example: Button · padding 0 24 → 0 20 · src/components/Button.styles.ts. It also has "New in code" and "Removed from code".
Brsh applies only what you accept. It never deletes a layer.
After that, Brsh lists where the design differs from the code. The code changes only when you use Design to code.
Notes
- Brsh asks one question at the end of the plan when the file has no design system yet. Read it with care.
- For AI tools that connect to Brsh, the commands are
/brsh:code-to-designand/brsh:code-sync. - The full steps that the agent follows are in code-to-design.md. The steps for the way back are in design-to-code.md.