기존 코드베이스에서 디자인 시스템 자동 추출하는 프롬프트
프로젝트가 커질수록 색상, 간격, 타이포그래피가 제각각이라 리팩토링 엄두가 나지 않습니다. 이 프롬프트는 전체 코드를 스캔해 모든 디자인 결정을 구조화된 JSON 보고서로 한 번에 뽑아줍니다. 추출된 보고서로 디자인 시스템 구축 전 현황을 정확히 파악하고 일관된 리팩토링 계획을 세울 수 있습니다.
11월 29일, prompts.chat 에서 추천을 가장 많이 받은 프롬프트 1개를 골라 한국어로 옮겼어요. 복사해서 ChatGPT·Claude·Gemini에 붙여 넣으면 바로 써요.
한눈에 보기
| 번호 | 프롬프트 | 이럴 때 | 추천 |
|---|---|---|---|
| 1 | 코드베이스 디자인 시스템 추출 | 레거시 프로젝트를 디자인 시스템으로 정리하기 전 전체 현황을 파악할 때 | 3 |
1. 코드베이스 디자인 시스템 추출
기존 프로젝트 코드를 분석해 색상, 타이포그래피, 간격, 컴포넌트 등 모든 디자인 결정을 JSON 보고서로 자동 추출합니다. 리팩토링이나 디자인 시스템 구축 전 현황 파악에 씁니다.
- 레거시 프로젝트를 디자인 시스템으로 정리하기 전 전체 현황을 파악할 때
- 여러 개발자가 작업해 스타일이 뒤섞인 코드베이스의 불일치를 찾을 때
- 새 팀원이 프로젝트 디자인 토큰을 빠르게 이해해야 할 때
당신은 기존 코드베이스를 법의학적으로 감사하는 시니어 디자인 시스템 엔지니어다. 당신의 임무는 코드에 내재된 모든 디자인 의사결정 — 명시적이든 암시적이든 — 을 추출하는 것이다.
## 프로젝트 컨텍스트
- **프레임워크:** [Next.js / React / 기타]
- **스타일링 접근:** [Tailwind / CSS Modules / Styled Components / 기타]
- **컴포넌트 라이브러리:** [shadcn/ui / 커스텀 / MUI / 기타]
- **코드베이스 위치:** [경로 또는 "업로드된 파일들"]
## 추출 범위
전체 코드베이스를 분석하고 다음을 구조화된 JSON 리포트로 추출하라:
### 1. 색상 시스템
- 사용된 모든 색상 값 (hex, rgb, hsl, CSS 변수, Tailwind 클래스)
- 그룹화: primary, secondary, accent, neutral, semantic (success/warning/error/info)
- 불일치 플래그 (예: 테두리에 쓰인 3가지 다른 회색)
- 불투명도 변형과 다크 모드 매핑(존재 시) 기록
- 실제 CSS 변수 정의와 폴백 값 추출
### 2. 타이포그래피
- 폰트 패밀리 (로드된 폰트, 폴백 스택, Google Fonts 임포트)
- 폰트 크기 (사용된 모든 고유 크기, px/rem/Tailwind 클래스 단위)
- 폰트 패밀리별 사용된 폰트 굵기
- 각 폰트 크기와 짝지어진 줄 높이
- 자간 값
- 조합된 텍스트 스타일 (예: "heading-large" = Inter 32px/700/1.2)
- 반응형 타이포그래피 규칙 (모바일 vs 데스크톱 크기)
### 3. 간격 & 레이아웃
- 간격 스케일 (사용된 모든 margin/padding/gap 값)
- 컨테이너 너비와 최대 너비
- 그리드 시스템 (컬럼, 거터, 브레이크포인트)
- 브레이크포인트 정의
- Z-index 레이어와 용도
- 보더 라디우스 값
### 4. 컴포넌트 인벤토리
발견된 각 재사용 컴포넌트마다:
- 컴포넌트 이름과 파일 경로
- Props 인터페이스 (가능한 경우 TypeScript 타입)
- 시각적 변형 (크기, 색상, 상태)
- 내부적으로 사용된 간격과 크기 토큰
- 다른 컴포넌트 의존성
- 코드베이스 전반에서의 사용 횟수 (대략적)
### 5. 모션 & 애니메이션
- 트랜지션 지속 시간과 타이밍 함수
- 애니메이션 키프레임
- 호버/포커스/액티브 상태 트랜지션
- 페이지 트랜지션 패턴
- 스크롤 기반 애니메이션 (Framer Motion, GSAP 등 라이브러리 사용 시)
### 6. 아이콘 & 에셋
- 아이콘 시스템 (Lucide, Heroicons, 커스텀 SVG 등)
- 사용된 아이콘 크기
- 파비콘과 로고 변형
### 7. 불일치 리포트
- 토큰이어야 할 중복 값 (예: `#1a1a1a`가 47회 사용되었으나 변수가 아님)
- 충돌하는 패턴 (예: 일부 버튼은 패딩 기반 크기, 다른 버튼은 고정 높이)
- 누락된 상태 (호버/포커스/비활성 상태가 없는 컴포넌트)
- 접근성 공백 (포커스 링 누락, 부족한 색상 대비)
## 출력 포맷
다음 구조의 단일 JSON 객체로 반환하라:
{
"colors": { "primary": [], "secondary": [], ... },
"typography": { "families": [], "scale": [], "styles": [] },
"spacing": { "scale": [], "containers": [], "breakpoints": [] },
"components": [ { "name": "", "path": "", "props": {}, "variants": [] } ],
"motion": { "durations": [], "easings": [], "animations": [] },
"icons": { "system": "", "sizes": [], "count": 0 },
"inconsistencies": [ { "type": "", "description": "", "severity": "high|medium|low" } ]
}
아직 아무 것도 정리하거나 개선하려 하지 마라.
토큰 이름이나 재구조를 제안하지 마라.
존재하는 것을 있는 그대로 추출하기만 하라.영어 원문 보기
You are a senior design systems engineer conducting a forensic audit of an existing codebase. Your task is to extract every design decision embedded in the code — explicit or implicit.
## Project Context
- **Framework:** [Next.js / React / etc.]
- **Styling approach:** [Tailwind / CSS Modules / Styled Components / etc.]
- **Component library:** [shadcn/ui / custom / MUI / etc.]
- **Codebase location:** [path or "uploaded files"]
## Extraction Scope
Analyze the entire codebase and extract the following into a structured JSON report:
### 1. Color System
- Every color value used (hex, rgb, hsl, css variables, Tailwind classes)
- Group by: primary, secondary, accent, neutral, semantic (success/warning/error/info)
- Flag inconsistencies (e.g., 3 different grays used for borders)
- Note opacity variations and dark mode mappings if present
- Extract the actual CSS variable definitions and their fallback values
### 2. Typography
- Font families (loaded fonts, fallback stacks, Google Fonts imports)
- Font sizes (every unique size used, in px/rem/Tailwind classes)
- Font weights used per font family
- Line heights paired with each font size
- Letter spacing values
- Text styles as used combinations (e.g., "heading-large" = Inter 32px/700/1.2)
- Responsive typography rules (mobile vs desktop sizes)
### 3. Spacing & Layout
- Spacing scale (every margin/padding/gap value used)
- Container widths and max-widths
- Grid system (columns, gutters, breakpoints)
- Breakpoint definitions
- Z-index layers and their purpose
- Border radius values
### 4. Components Inventory
For each reusable component found:
- Component name and file path
- Props interface (TypeScript types if available)
- Visual variants (size, color, state)
- Internal spacing and sizing tokens used
- Dependencies on other components
- Usage count across the codebase (approximate)
### 5. Motion & Animation
- Transition durations and timing functions
- Animation keyframes
- Hover/focus/active state transitions
- Page transition patterns
- Scroll-based animations (if any library like Framer Motion, GSAP is used)
### 6. Iconography & Assets
- Icon system (Lucide, Heroicons, custom SVGs, etc.)
- Icon sizes used
- Favicon and logo variants
### 7. Inconsistencies Report
- Duplicate values that should be tokens (e.g., `#1a1a1a` used 47 times but not a variable)
- Conflicting patterns (e.g., some buttons use padding-based sizing, others use fixed height)
- Missing states (components without hover/focus/disabled states)
- Accessibility gaps (missing focus rings, insufficient color contrast)
## Output Format
Return a single JSON object with this structure:
{
"colors": { "primary": [], "secondary": [], ... },
"typography": { "families": [], "scale": [], "styles": [] },
"spacing": { "scale": [], "containers": [], "breakpoints": [] },
"components": [ { "name": "", "path": "", "props": {}, "variants": [] } ],
"motion": { "durations": [], "easings": [], "animations": [] },
"icons": { "system": "", "sizes": [], "count": 0 },
"inconsistencies": [ { "type": "", "description": "", "severity": "high|medium|low" } ]
}
Do NOT attempt to organize or improve anything yet.
Do NOT suggest token names or restructuring.
Just extract what exists, exactly as it is.| 바꿀 칸 | 넣을 것 |
|---|---|
| [Next.js / React / etc.] | 프로젝트가 쓰는 프레임워크 이름을 적으세요(예: Next.js, React, Vue). |
| [Tailwind / CSS Modules / Styled Components / etc.] | 스타일링 방식을 적으세요(예: Tailwind CSS, CSS Modules, Styled Components). |
| [shadcn/ui / custom / MUI / etc.] | 쓰고 있는 컴포넌트 라이브러리를 적으세요(예: shadcn/ui, MUI, 직접 만든 것). |
| [path or "uploaded files"] | 분석할 코드 경로나 '업로드된 파일들'이라고 적으세요. |
1단계
대화형 AI(ChatGPT, Claude 등)에 프롬프트를 복사해 붙여넣으세요.
2단계
대괄호 네 칸을 프로젝트 실제 정보로 바꾸세요.
3단계
코드 파일을 업로드하거나 경로를 알려주면 AI가 JSON 보고서를 만들어 줍니다.
자주 막히는 곳
답이 영어로 나와요
프롬프트 맨 끝에 답은 한국어로 해 줘. 한 줄을 붙이세요.
[대괄호] 칸을 안 바꾸고 보냈어요
AI가 칸 이름을 그대로 쓰거나 되물어요. 같은 대화에 바꿀 내용을 적어 보내면 이어서 고쳐 줘요.
이미지 프롬프트는 어디에 넣나요?
ChatGPT·Gemini처럼 이미지를 만드는 AI에 붙여 넣으세요. 글만 쓰는 AI에서는 그림이 나오지 않아요.
알아 둘 한계
- 한국어 번역은 AI가 했어요. 뜻이 어색하면 [영어 원문 보기]의 원문을 그대로 써도 돼요.
- 같은 프롬프트라도 AI마다 결과가 조금씩 달라요. 마음에 들 때까지 한두 번 고쳐 달라고 하세요.
- 추천 수는 글을 쓴 날 기준이에요.