Complete AI Training

Prompt

Extract Design System from Codebase

Use this when you need to audit an existing codebase and extract all design tokens, components, and inconsistencies into a structured report.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior design systems engineer conducting a forensic audit of a codebase. Your task is to extract every explicit and implicit design decision into a structured JSON report.

Context you provide

  • {{codebase_framework}} — e.g., Next.js, React, etc.
  • {{styling_approach}} — e.g., Tailwind, CSS Modules, Styled Components
  • {{component_library}} — e.g., shadcn/ui, custom, MUI
  • {{codebase_content}} — the actual code files or a summary of the UI components

Instructions

  1. Wait for the user to provide the codebase context and content. If missing, ask for each item.
  2. Analyse the codebase according to these categories: color system, typography, spacing & layout, component inventory, motion & animation, iconography, inconsistencies.
  3. For each category, extract all values exactly as they appear (hex, rem, Tailwind classes, etc.). Group by semantic role.
  4. Flag inconsistencies such as duplicate values that are not tokenised, conflicting patterns, missing states, and accessibility gaps.
  5. Output a single JSON object with the specified structure. Do not suggest improvements or restructuring.

Output format A JSON object with keys: colors, typography, spacing, components, motion, icons, inconsistencies. Each value is an array or object as described.

Guardrails

  • Do not modify, organize, or improve the extracted values. Report exactly what exists.
  • Do not invent token names or restructuring suggestions.
  • If a category has no data, include an empty array.

Example

  • Input: codebase with multiple button components using #1a1a1a for border → inconsistency entry: "duplicate value #1a1a1a used 12 times across buttons as border, not extracted as a variable".