A Design-Loop Skill: Claude Screenshots, Scores and Fixes Its Own UI
One short SKILL.md makes Claude Code take a screenshot of your page, score it on hierarchy, spacing, contrast, consistency and copy against DESIGN.md and a reference, apply the three biggest fixes, and repeat for at most three rounds before handing the decision back to you.
What you will learn
- Describe the design loop: screenshot, score, list three fixes, apply, repeat
- Write the whole loop as a short SKILL.md in .claude/skills/design-loop
- Pair the skill with a DESIGN.md rulebook whose rules can be checked from a screenshot
- Explain why the AI grades itself kindly and why the human makes the final call
Before you start
- Authoring a Claude Skill
- Reference-Driven Design: a DESIGN.md from a site you admire
A chef never serves a soup without tasting it. Taste, add a little salt, taste again, then serve. In this lesson we give Claude the same habit for a web page: one small, reusable skill that looks at your page, scores it, fixes it and tries again. And then it stops and lets you decide.
Four steps, at most three rounds
- Screenshot. The AI uses a browser tool to take a picture of your page. It can't judge what it can't see.
- Score. It checks the picture against your design rules file and a reference page you like, and scores five criteria: hierarchy, spacing, contrast, consistency and copy.
- List the fixes. Not twenty. Only the three biggest problems.
- Apply. It changes only those things, nothing else.
Then it goes back to step one and scores again, for at most three rounds. After that it stops and asks you to decide. That last part is the most important line in the whole skill.
The whole skill is one short text file
The skill lives at .claude/skills/design-loop/SKILL.md. Any editor works. This is the complete file from the project:
---
name: design-loop
description: Score a page against DESIGN.md and a reference, fix it, repeat at most 3 rounds.
---
1. Open the page with the browser tool and take a screenshot.
2. Read DESIGN.md and look at the reference image.
3. Score the screenshot from 1 to 10 on hierarchy, spacing, contrast, consistency and copy.
4. List the three biggest fixes, each with the file and the line to change.
5. Apply only those fixes. Do not redesign the page.
6. Take a new screenshot and score again.
7. Repeat until every score is 8 or more, but never more than 3 rounds.
8. Stop. Show the before and after screenshots and the scores, then ask the human to decide.
The two lines at the top are the frontmatter: the name, and the description Claude uses to decide when to pick this skill. The steps are plain sentences, no code. Claude reads them like a checklist. How skills are found and loaded is covered in Authoring a Claude Skill.
You can ask Claude Code to write the file for you:
Create a Claude Code skill at .claude/skills/design-loop/SKILL.md.
It should screenshot my page with a browser tool, score it from 1 to 10 on
hierarchy, spacing, contrast, consistency and copy against DESIGN.md and a
reference image, list the three biggest fixes, apply them, and repeat for at
most 3 rounds. At the end it must stop and ask me to decide.
Keep the steps short, about ten lines.
The rulebook: DESIGN.md
The skill scores against DESIGN.md, so its rules must be specific enough to check from a screenshot. "Card padding 16px" can be checked. "Make it nice" can't. Here's the sample Orbit rulebook, trimmed to the parts the scores use:
# Orbit design system (sample)
## Colour
- Background: slate 950 (`#020617`). Cards: slate 900 (`#0F172A`).
- Accent: violet 600 (`#7C3AED`). Use it for the one main action on a screen.
- Text contrast must be at least 4.5 to 1 against its background.
## Type
- Font: Inter. Page title 32px bold, section title 20px semibold, body 16px, hint 14px.
- One heading level per size. No more than three sizes on a screen.
## Spacing
- Use a 4px grid. Common steps: 8, 12, 16, 24, 32.
- Card padding 16px. Gap between cards 16px. Page padding 32px.
## Copy
- Short, plain words. Buttons start with a verb: "Invite member", "Save changes".
## Scoring (used by the design-loop skill)
Score 1 to 10 on five criteria: hierarchy, spacing, contrast, consistency, copy.
A page passes when every score is 8 or more. The human makes the final call.
Writing a DESIGN.md from a site you admire is its own lesson: Reference-Driven Design.
Run the loop
Use the design-loop skill on the Orbit dashboard at http://localhost:5173.
The reference image is reference/dashboard.png. Show me the scores for each
round and the screenshot before and after.
Scores should go up each round. The scorecard below uses example numbers from the lecture to show the idea, not a real run:
| Round | Hierarchy | Spacing | Contrast | Consistency | Copy | Total |
|---|---|---|---|---|---|---|
| 1 | 5 | 4 | 6 | 5 | 7 | 27 / 50 |
| 2 | 7 | 7 | 8 | 6 | 7 | 35 / 50 |
| 3 | 8+ | 8+ | 8+ | 8+ | 8+ | 41 / 50, passes |
If the scores don't rise, something is wrong, and the skill should tell you.
The AI grades itself kindly
A high score doesn't mean the design is good. Three reasons:
- It likes its own work. It made the change, so it tends to approve it, like a student marking their own exam.
- It follows the rules. It checks the design file, but it can't feel whether the page looks right.
- Scores creep up. An 8 in round three might have been a 6 in round one.
So your eye comes last. Open the page, look at it, and decide. This self-preference problem is the same one LLM judges have in general; see LLM Judge Bias. A good follow-up prompt makes the skill show its doubts:
The skill says the page passes. List the three things you are least sure about,
and tell me what to look at with my own eyes.
And if a round changes too much, tighten the file:
The loop changed too much in one round. Edit SKILL.md so each round applies at
most three fixes and never touches the layout structure.
Your design-loop checklist
- Write a short
DESIGN.mdwith rules you can check. - Add a reference page you like.
- Put the skill file in
.claude/skills/design-loop/. - Run it and stop after three rounds.
- Look at the result with your own eyes.
The skill is a helper. You are the judge.
Try it yourself
Add the skill to one of your projects and run it on a single page. Before you read the scores, write down your own three biggest problems with the page, then compare your list with the skill's fixes from round one.
Related course on Udemy
The Python Architect Masterclass: Full Stack to AI Engineer
Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)Related posts
CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages
Three needs in one repo: a test command, a rule that Claude must never read .env, and a shared deploy skill. See which file each belongs in, how the settings layers merge, and what a plugin manifest carries.
Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It
Pack a support team's ticket-triage routine into one skill folder, then watch three requests load one, two or all three levels: the catalog, the SKILL.md body, and a script whose code never enters the context.
One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
Change one line in a repo and ask where it lands. A small resolver for bookshop-bot shows that a new model id in settings.json reaches only CI, a prompt bump reaches dev and CI, and a prod block edit reaches only prod.
Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges
Follow one prompt edit from a branch to a merge: version prompts and the model pin like code, keep the API key in GitHub Secrets, gate changes by path, let Claude review the diff, and leave the merge to a person.
