Originally posted at Vibki - link to post
If you've ever dreamed of a way to create a UI designer that builds your app screens before you even start developing, this is the blog post for you. In this post, you will see how to implement a designer using Claude Code and Pencil.
Why do we need it?
Great question! We could just tell Claude what our app is about and then have it modify the UI as we tweak the code. However, there are several reasons why that isn't a good idea:
- Time: The most obvious reason is wasted time. The UI design process can be lengthy. If you have to refactor the code after every single screen creation, it takes much longer than just designing the UI first and developing it afterward.
- Separation of Concerns: As we've mentioned on the blog many times, we need to keep the context window as small as possible. It's important to split processes into smaller tasks. This is why handling UI design in a separate context before developing it is a great approach.
- Expert Domains: It's considered a best practice to create agents with specific expertise to handle single types of tasks. For example, a designer agent handles the UI design, while a frontend developer agent deals with component creation.
So, how do we do this magic?
💡 Note: The following workflow is specific to Claude Code, but you can modify it to use with your favourite AI tool.
Step 1: Installation
- Go to https://www.pencil.dev/downloads
- Download the Pencil Desktop app or Extension.
In Claude Code, the MCP installation happens automatically. However, if it doesn't work for you, add this to your MCP configuration:
"pencil": {
"command": "/path/to-your-pencil-desktop/mcp-server-windows-x64.exe",
"transport": "stdio",
"args": [
"--app",
"desktop"
],
"env": {}
}
- Open pencil App
- Create a new
.penfile and save it in your project folder.
Step 2: Install the Frontend-Design Claude Code Plugin
- Open Claude Code.
- Run the
/plugincommand. - Search for
frontend-designand install it.
Step 3: Create Your New Design
- Before your main prompt, write something like: "I want to use frontend-design."
- Ask it to generate your design. For example: "Create an app design for a todo app."
- Review the output and fix it if needed.
Read more about AI Engineering at Vibki.
Top comments (0)