Noureddine RAMDI / Spec-first web design with Claude Code: enforcing design contracts via DESIGN.md

Created Mon, 04 May 2026 10:23:01 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

KAOPU-XiaoPu/web-design

Every time you start a web project, you know the pain of design inconsistencies creeping in, especially when AI tools generate code from vague prompts. web-design tackles this with a spec-first workflow that turns input like a PRD, reference URL, or screenshot into a comprehensive DESIGN.md specification. This markdown file serves as a single source of truth for design decisions before any code is generated, helping to maintain consistency across pages and AI tools.

What web-design does and how it structures the workflow

web-design is a Claude Code SKILL that enforces a spec-first approach to web development. Instead of jumping straight to code generation from high-level prompts, it first produces a detailed DESIGN.md file covering nine key sections: color, typography, components, layout, motion, depth, do’s and don’ts, responsive behavior, and accessibility.

The architecture revolves around a three-phase workflow:

  1. Understanding inputs: web-design accepts a product requirements document (PRD), a reference URL, or even a screenshot as the starting point.
  2. Producing the design spec: it synthesizes these inputs into a structured DESIGN.md specification that captures all critical design aspects.
  3. Code generation with self-auditing: the code generation phase uses the DESIGN.md as a contract and generates HTML/CSS code. This output is audited against a 100-point quality checklist to ensure alignment with the spec.

Supporting this workflow, the repo includes utility scripts for Playwright crawling (to fetch site data), static token extraction, and fetching images from Unsplash, which assist in automating the design and code phases.

One notable demonstration of dogfooding is that the repo’s own landing page was built using the web-design SKILL, and its DESIGN.md file is included in the docs folder, showcasing the spec’s portability and real-world application.

How the spec-first DESIGN.md approach enforces design consistency

What distinguishes this repo is its emphasis on a single markdown file — DESIGN.md — as a portable, tool-agnostic design contract. This contrasts with many AI-assisted UI generators that produce code directly from loosely defined prompts, often leading to inconsistent results.

By encoding design details explicitly in markdown, web-design ensures AI agents have a clear, testable specification to follow. This reduces guesswork and variation in generated UI code, which is critical when multiple pages or teams are involved.

The code generation phase is tightly coupled with a self-auditing mechanism that scores the output against a 100-point quality checklist derived from the DESIGN.md. This feedback loop helps catch deviations early, improving reliability.

The repo trades off some flexibility for consistency. Because it relies on a structured DESIGN.md, it requires upfront effort to produce the spec and may not suit rapid prototyping where iteration speed is paramount. However, for projects where design fidelity and accessibility are priorities, this tradeoff is worthwhile.

Code quality within the repo reflects a clear separation of concerns: inputs are parsed and understood in isolation, the design spec is generated in a dedicated step, and code generation is modular with audit hooks. This modularity aids maintainability and allows the components to evolve independently.

Quick start with the web-design skill

The installation is straightforward for users familiar with Claude Code. You clone the repo into your Claude Code skills directory:

git clone https://github.com/KAOPU-XiaoPu/web-design ~/.claude/skills/web-design

Claude Code auto-discovers the skill on the next session start, allowing you to invoke the spec-first workflow seamlessly.

From there, you provide your input (PRD, reference URL, or screenshot), and the skill guides you through generating the DESIGN.md specification and then the audited code output.

Verdict: who should consider the web-design approach

web-design is a solid tool for teams or individual developers looking to integrate AI code generation into a controlled, spec-driven design workflow. Its DESIGN.md centric approach ensures design consistency and accessibility adherence that many AI UI generators struggle to maintain.

The reliance on Claude Code and the markdown spec format means it fits best into workflows already exploring or committed to Claude Code agents. The upfront effort to produce a detailed DESIGN.md can be a hurdle in fast-paced projects but pays off in reducing downstream rework and inconsistencies.

Overall, web-design is worth exploring if you want a structured bridge between product requirements and AI-generated UI code, with clear design contracts and quality auditing baked in. It’s less about rapid prototyping and more about reliable, consistent output driven by explicit design specifications.


→ GitHub Repo: KAOPU-XiaoPu/web-design ⭐ 265 · Python