PRD-to-App: Full-Stack Application Builder
Language: Respond in the same language the user uses. Code comments should match.
Build a complete, deployed web application from PRD + prototypes + resources.
The result must be fully reproducible via a single bash start.sh.
Origin: Adapted from zai-org/GLM-skills/glmv-prd-to-app (Apache 2.0).
ZHIPU API dependencies removed; replaced with Playwright + look_at for prototype analysis.
Phase 0: Material Discovery & Analysis
Before anything else, understand what you're working with.
0a. Locate all inputs
./prd.md ← Product requirement document
./prototypes/*.jpg|*.png ← UI prototype images (the visual truth)
./resources/**/* ← Images, videos, icons, and other assets
If the materials are in a different location, adapt accordingly. Read the PRD fully.
0b. Deep prototype analysis
For every prototype image:
Read the image using the look_at tool (or Read tool for images) — examine it directly.
Extract: page identity, layout structure, component inventory, content inventory,
color extraction (hex values), typography, interactive states, data patterns.
For each image, document:
- Page identity: which page/view this represents
- Layout structure: header, sidebar, main content, footer, modals
- Component inventory: every button, form, card, table, list, nav element
- Content inventory: all visible text, numbers, labels, placeholder content
- Color extraction: primary, secondary, accent, background, text colors (hex values)
- Typography: font sizes, weights, hierarchy observed
- Interactive states: hover effects, active tabs, selected items, toggles
- Data patterns: what data populates lists/tables/cards — this drives seed data
Build a page map showing navigation flow between prototype pages.
0c. Resource inventory
List all files in ./resources/ and map each to where it appears in the prototypes.
Every resource file must be used in the final application where relevant.
Phase 1: System Design Document
Produce a comprehensive design document at ./docs/design.md.
1a. Data Model
For each entity, specify:
- Table/collection name
- All fields with types, constraints, defaults
- Relationships (foreign keys, many-to-many)
- Indexes needed for query patterns
- Content mapping: which prototype elements map to which fields
1b. API Design
For every page interaction, define an API endpoint:
- Method + path
- Request params/body schema
- Response schema with example
- Which prototype interaction triggers this API
- Error responses
1c. Frontend Architecture
- Component hierarchy (tree structure)
- Route definitions mapping to prototype pages
- State management approach
- How each prototype page maps to components
1d. Technology Stack
Choose based on PRD complexity:
| Layer |
Choice |
When to use |
| Frontend |
React + TypeScript + Vite |
Default for SPAs |
| Frontend |
Next.js |
If SSR/SEO needed |
| Styling |
Tailwind CSS |
Default |
| Backend |
Node.js + Express |
Simple APIs |
| Backend |
Python + FastAPI |
If PRD mentions Python |
| Database |
SQLite |
Simple apps, <10 tables |
| Database |
PostgreSQL |
Complex apps, relationships |
| ORM |
Prisma (Node) / SQLAlchemy (Python) |
Match backend |
Phase 2: Seed Data Generation
Rules
- Extract from prototypes: Every piece of visible text, image, number in the prototype
images must appear in seed data. Re-read each prototype image and transcribe content.
- Complete coverage: Every list/table/card/dropdown must match prototype content exactly.
- Use resource files: Map resource files from
./resources/ to seed data entries.
- No placeholders: No "Lorem ipsum", no "Test Item 1", no placeholder images.
- Support all states: Include data for empty states, loaded states, error scenarios.
Phase 3: Backend Implementation
3a. Database schema — migrations with constraints, indexes, foreign keys
3b. API endpoints — route handlers, validation, error handling, curl-tested
3c. Seed data loading — idempotent re-seeding, dependency order
3d. Static file serving — backend serves resource files
Phase 4: Frontend Implementation
4a. Global styles and tokens — color variables, typography, spacing from prototypes
4b. Page-by-page implementation
For each prototype image:
- Re-read the prototype image
- Build page component matching layout exactly
- Wire up API calls
- Implement all interactions (navigation, forms, search, filter, sort, modals, states)
4c. Resource integration — copy from ./resources/, reference correctly
4d. Responsive — match prototype viewport, breakpoints if mobile views shown
Phase 5: Visual Verification Loop
Repeat for every page. Max 3 iterations.
5a. Render page to screenshot
Start local server, capture with Playwright:
python3 -c "
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page(viewport={'width': 1280, 'height': 800})
page.goto('http://localhost:3000/page-path')
page.wait_for_load_state('networkidle')
page.screenshot(path='docs/screenshots/page_name.png', full_page=True)
browser.close()
"
5b. Visual comparison
Read prototype image and screenshot side by side. Compare:
- Layout, colors, typography, content, spacing, images, components
5c. Fix discrepancies → re-render → re-compare
Phase 6: Integration Testing
6a. API health check — curl each endpoint, verify status codes
6b. E2E flow — walk through every user flow from PRD
6c. Fix issues — CORS, URL mismatches, data format problems
Phase 7: Deployment Script
Generate ./start.sh — fully self-contained, works from absolute zero.
Requirements: install deps → setup DB → migrations → seed → build frontend → start both → app at :3000
Phase 8: Documentation
./docs/design.md — final architecture, data model, API reference
./README.md — overview, stack, quick start, structure
Deliverables Checklist
Critical Principles
- Prototypes are truth — prototype wins over PRD text for visual/layout decisions
- No shortcuts on data — all visible content from database via APIs
- Complete implementation — every page, feature, interaction
- Resources must be used — matching files from
./resources/
- Reproducibility —
start.sh works from absolute zero
- Verify, don't assume — screenshot comparison + API checks + startup test
1---2name: prd-to-app3description: Build a complete, production-ready full-stack web application from PRD documents, prototype images, and resource files. Handles the entire pipeline: system design, database schema, seed data, backend API, frontend UI, visual verification against prototypes, and deployment script generation. Use this skill whenever the user: - Provides a PRD (product requirement document) and wants a working app built - Says "build from PRD", "implement this product", "develop this app from requirements" - Has prototype images + requirements and wants full-stack implementation - Wants to turn product specifications into a running web application Triggers: 'prd to app', 'из prd в приложение', 'разработай по prd', 'сделай приложение по макетам', 'build from prd', 'implement from prd'.4license: MIT5---67# PRD-to-App: Full-Stack Application Builder89> **Language**: Respond in the same language the user uses. Code comments should match.1011Build a complete, deployed web application from PRD + prototypes + resources.12The result must be fully reproducible via a single `bash start.sh`.1314**Origin**: Adapted from `zai-org/GLM-skills/glmv-prd-to-app` (Apache 2.0).15ZHIPU API dependencies removed; replaced with Playwright + look_at for prototype analysis.1617---1819## Phase 0: Material Discovery & Analysis2021Before anything else, understand what you're working with.2223### 0a. Locate all inputs2425```26./prd.md ← Product requirement document27./prototypes/*.jpg|*.png ← UI prototype images (the visual truth)28./resources/**/* ← Images, videos, icons, and other assets29```3031If the materials are in a different location, adapt accordingly. Read the PRD fully.3233### 0b. Deep prototype analysis3435For **every** prototype image:36371. **Read the image** using the `look_at` tool (or `Read` tool for images) — examine it directly.38 Extract: page identity, layout structure, component inventory, content inventory,39 color extraction (hex values), typography, interactive states, data patterns.40412. For each image, document:42 - **Page identity**: which page/view this represents43 - **Layout structure**: header, sidebar, main content, footer, modals44 - **Component inventory**: every button, form, card, table, list, nav element45 - **Content inventory**: all visible text, numbers, labels, placeholder content46 - **Color extraction**: primary, secondary, accent, background, text colors (hex values)47 - **Typography**: font sizes, weights, hierarchy observed48 - **Interactive states**: hover effects, active tabs, selected items, toggles49 - **Data patterns**: what data populates lists/tables/cards — this drives seed data50513. Build a **page map** showing navigation flow between prototype pages.5253### 0c. Resource inventory5455List all files in `./resources/` and map each to where it appears in the prototypes.56Every resource file must be used in the final application where relevant.5758---5960## Phase 1: System Design Document6162Produce a comprehensive design document at `./docs/design.md`.6364### 1a. Data Model6566For each entity, specify:67- Table/collection name68- All fields with types, constraints, defaults69- Relationships (foreign keys, many-to-many)70- Indexes needed for query patterns71- **Content mapping**: which prototype elements map to which fields7273### 1b. API Design7475For every page interaction, define an API endpoint:76- Method + path77- Request params/body schema78- Response schema with example79- Which prototype interaction triggers this API80- Error responses8182### 1c. Frontend Architecture8384- Component hierarchy (tree structure)85- Route definitions mapping to prototype pages86- State management approach87- How each prototype page maps to components8889### 1d. Technology Stack9091Choose based on PRD complexity:9293| Layer | Choice | When to use |94|-------|--------|-------------|95| Frontend | React + TypeScript + Vite | Default for SPAs |96| Frontend | Next.js | If SSR/SEO needed |97| Styling | Tailwind CSS | Default |98| Backend | Node.js + Express | Simple APIs |99| Backend | Python + FastAPI | If PRD mentions Python |100| Database | SQLite | Simple apps, <10 tables |101| Database | PostgreSQL | Complex apps, relationships |102| ORM | Prisma (Node) / SQLAlchemy (Python) | Match backend |103104---105106## Phase 2: Seed Data Generation107108### Rules1091101. **Extract from prototypes**: Every piece of visible text, image, number in the prototype111 images must appear in seed data. Re-read each prototype image and transcribe content.1122. **Complete coverage**: Every list/table/card/dropdown must match prototype content exactly.1133. **Use resource files**: Map resource files from `./resources/` to seed data entries.1144. **No placeholders**: No "Lorem ipsum", no "Test Item 1", no placeholder images.1155. **Support all states**: Include data for empty states, loaded states, error scenarios.116117---118119## Phase 3: Backend Implementation120121### 3a. Database schema — migrations with constraints, indexes, foreign keys122### 3b. API endpoints — route handlers, validation, error handling, curl-tested123### 3c. Seed data loading — idempotent re-seeding, dependency order124### 3d. Static file serving — backend serves resource files125126---127128## Phase 4: Frontend Implementation129130### 4a. Global styles and tokens — color variables, typography, spacing from prototypes131132### 4b. Page-by-page implementation133134For **each prototype image**:1351. Re-read the prototype image1362. Build page component matching layout exactly1373. Wire up API calls1384. Implement all interactions (navigation, forms, search, filter, sort, modals, states)139140### 4c. Resource integration — copy from `./resources/`, reference correctly141### 4d. Responsive — match prototype viewport, breakpoints if mobile views shown142143---144145## Phase 5: Visual Verification Loop146147**Repeat for every page. Max 3 iterations.**148149### 5a. Render page to screenshot150151Start local server, capture with Playwright:152153```bash154python3 -c "155from playwright.sync_api import sync_playwright156with sync_playwright() as p:157 browser = p.chromium.launch()158 page = browser.new_page(viewport={'width': 1280, 'height': 800})159 page.goto('http://localhost:3000/page-path')160 page.wait_for_load_state('networkidle')161 page.screenshot(path='docs/screenshots/page_name.png', full_page=True)162 browser.close()163"164```165166### 5b. Visual comparison167168Read prototype image and screenshot side by side. Compare:169- Layout, colors, typography, content, spacing, images, components170171### 5c. Fix discrepancies → re-render → re-compare172173---174175## Phase 6: Integration Testing176177### 6a. API health check — curl each endpoint, verify status codes178### 6b. E2E flow — walk through every user flow from PRD179### 6c. Fix issues — CORS, URL mismatches, data format problems180181---182183## Phase 7: Deployment Script184185Generate `./start.sh` — fully self-contained, works from absolute zero.186187Requirements: install deps → setup DB → migrations → seed → build frontend → start both → app at :3000188189---190191## Phase 8: Documentation192193- `./docs/design.md` — final architecture, data model, API reference194- `./README.md` — overview, stack, quick start, structure195196---197198## Deliverables Checklist199200- [ ] All PRD features implemented201- [ ] All prototype pages built202- [ ] Visual match verified via screenshots203- [ ] All resources used204- [ ] Seed data matches prototypes205- [ ] All API endpoints working206- [ ] All interactions functional207- [ ] `bash start.sh` works from clean state208- [ ] Documentation complete209210---211212## Critical Principles2132141. **Prototypes are truth** — prototype wins over PRD text for visual/layout decisions2152. **No shortcuts on data** — all visible content from database via APIs2163. **Complete implementation** — every page, feature, interaction2174. **Resources must be used** — matching files from `./resources/`2185. **Reproducibility** — `start.sh` works from absolute zero2196. **Verify, don't assume** — screenshot comparison + API checks + startup test