glmv-prd-to-app

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GLM-V PRD-to-App: Full-Stack Application Builder

GLM-V PRD-to-App:全栈应用构建器

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 /workspace/start.sh
.

语言:使用用户提问时的语言回复,代码注释也要匹配。
基于PRD、原型和资源构建完整的、可部署的Web应用。最终产物必须可以通过单条命令
bash /workspace/start.sh
完全复现。

Phase 0: Material Discovery & Analysis

第0阶段:材料发现与分析

Before anything else, understand what you're working with.
在开始任何工作前,先明确你要处理的内容。

0a. Locate all inputs

0a. 定位所有输入

/workspace/prd.md              ← Product requirement document
/workspace/prototypes/*.jpg    ← UI prototype images (the visual truth)
/workspace/resources/**/*      ← Images, videos, icons, and other assets
If the materials are in a different location, adapt accordingly. Read the PRD fully.
/workspace/prd.md              ← 产品需求文档
/workspace/prototypes/*.jpg    ← UI原型图(视觉层面的唯一标准)
/workspace/resources/**/*      ← 图片、视频、图标和其他素材
如果材料存放在其他位置,对应调整即可。请完整阅读PRD内容。

0b. Deep prototype analysis

0b. 深度原型分析

For every prototype image:
  1. Read each image using the Read tool — you are multimodal, examine them directly.
  2. 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
  3. Build a page map showing navigation flow between prototype pages.
针对每一张原型图:
  1. 使用Read工具读取每一张图片——你是多模态模型,可以直接分析图片。
  2. 为每张图片记录以下内容:
    • 页面标识:这张图代表的是哪个页面/视图
    • 布局结构:头部、侧边栏、主内容区、页脚、弹窗
    • 组件清单:每一个按钮、表单、卡片、表格、列表、导航元素
    • 内容清单:所有可见的文本、数字、标签、占位符内容
    • 颜色提取:主色、辅助色、强调色、背景色、文字颜色(十六进制值)
    • 排版:字体大小、字重、层级关系
    • 交互状态:hover效果、激活标签、选中项、开关状态
    • 数据模式:列表/表格/卡片的数据来源——这将指导种子数据的生成
  3. 构建页面地图,展示原型页面之间的导航流向。

0c. Resource inventory

0c. 资源盘点

List all files in
/workspace/resources/
and map each to where it appears in the prototypes. Every resource file must be used in the final application where relevant.

列出
/workspace/resources/
下的所有文件,将每个文件对应到它在原型中出现的位置。所有相关的资源文件都必须在最终应用中用到。

Phase 1: System Design Document

第1阶段:系统设计文档

Produce a comprehensive design document at
/workspace/docs/design.md
.
/workspace/docs/design.md
路径下生成一份完整的设计文档。

1a. Data Model

1a. 数据模型

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
Example:
products table:
  id          SERIAL PRIMARY KEY
  name        VARCHAR(200) NOT NULL    ← from product card title
  price       DECIMAL(10,2) NOT NULL   ← from product card price label
  image_url   TEXT NOT NULL             ← from product card image
  category_id INTEGER REFERENCES categories(id) ← from category filter
  ...
为每个实体指定:
  • 表/集合名称
  • 所有字段的类型、约束、默认值
  • 关联关系(外键、多对多)
  • 查询模式所需的索引
  • 内容映射:哪些原型元素对应哪些字段
示例:
products table:
  id          SERIAL PRIMARY KEY
  name        VARCHAR(200) NOT NULL    ← 来自商品卡片标题
  price       DECIMAL(10,2) NOT NULL   ← 来自商品卡片价格标签
  image_url   TEXT NOT NULL             ← 来自商品卡片图片
  category_id INTEGER REFERENCES categories(id) ← 来自分类筛选器
  ...

1b. API Design

1b. API设计

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
为每个页面交互定义API端点:
  • 请求方法 + 路径
  • 请求参数/请求体schema
  • 响应schema及示例
  • 触发该API的原型交互
  • 错误响应

1c. Frontend Architecture

1c. 前端架构

  • Component hierarchy (tree structure)
  • Route definitions mapping to prototype pages
  • State management approach
  • How each prototype page maps to components
  • 组件层级(树状结构)
  • 对应原型页面的路由定义
  • 状态管理方案
  • 每个原型页面对应组件的映射关系

1d. Technology Stack

1d. 技术栈

Choose based on PRD complexity. Recommended defaults:
LayerChoiceWhen to use
FrontendReact + TypeScript + ViteDefault for SPAs
FrontendNext.jsIf SSR/SEO needed
StylingTailwind CSSDefault
BackendNode.js + ExpressSimple APIs
BackendPython + FastAPIIf PRD mentions Python
DatabaseSQLiteSimple apps, <10 tables
DatabasePostgreSQLComplex apps, relationships
ORMPrisma (Node) / SQLAlchemy (Python)Match backend
Document the choice and reasoning.
根据PRD的复杂度选择技术栈,推荐默认配置:
层级选择适用场景
前端React + TypeScript + Vite单页应用默认选择
前端Next.js需要SSR/SEO的场景
样式Tailwind CSS默认选择
后端Node.js + Express简单API场景
后端Python + FastAPI若PRD提到Python的场景
数据库SQLite简单应用,表数量<10
数据库PostgreSQL复杂应用,多关联关系
ORMPrisma (Node) / SQLAlchemy (Python)和后端技术栈匹配
记录选择结果和选型理由。

1e. Directory Structure

1e. 目录结构

/workspace/
├── frontend/          ← or client/
│   ├── src/
│   │   ├── components/
│   │   ├── pages/
│   │   ├── hooks/
│   │   ├── services/   ← API client
│   │   ├── types/
│   │   └── assets/     ← copied from /workspace/resources
│   └── ...
├── backend/           ← or server/
│   ├── src/
│   │   ├── routes/
│   │   ├── models/
│   │   ├── controllers/
│   │   ├── middleware/
│   │   └── seed/
│   └── ...
├── docs/
│   ├── design.md
│   └── README.md
├── start.sh
└── prd.md

/workspace/
├── frontend/          ← 或 client/
│   ├── src/
│   │   ├── components/
│   │   ├── pages/
│   │   ├── hooks/
│   │   ├── services/   ← API客户端
│   │   ├── types/
│   │   └── assets/     ← 从/workspace/resources复制而来
│   └── ...
├── backend/           ← 或 server/
│   ├── src/
│   │   ├── routes/
│   │   ├── models/
│   │   ├── controllers/
│   │   ├── middleware/
│   │   └── seed/
│   └── ...
├── docs/
│   ├── design.md
│   └── README.md
├── start.sh
└── prd.md

Phase 2: Seed Data Generation

第2阶段:种子数据生成

Seed data is critical — it makes the app look real from the first launch.
种子数据至关重要——它能让应用首次启动就呈现真实效果。

Rules

规则

  1. Extract from prototypes: Every piece of visible text, image, number in the prototype images must appear in seed data. Read each prototype image again and transcribe content.
  2. Complete coverage:
    • Every list/table must have the exact number of items shown in prototypes
    • Every card must have the content matching the prototype
    • Every dropdown must have options matching the prototype
    • Navigation items must match prototype navigation
    • Statistics/counters must match prototype numbers
  3. Use resource files: Map resource files (images, videos, icons) from
    /workspace/resources/
    to seed data entries. Use relative paths or copy to public/static dir.
  4. No placeholders: No "Lorem ipsum", no "Test Item 1", no
    placeholder.com
    images.
  5. Support all states: Include data that exercises empty states, loaded states, error scenarios as specified in the PRD.
  1. 从原型提取:原型图中每一处可见的文本、图片、数字都必须出现在种子数据中。重新读取每张原型图,转录所有内容。
  2. 完整覆盖
    • 每个列表/表格的条目数量必须和原型展示的完全一致
    • 每张卡片的内容必须和原型匹配
    • 每个下拉框的选项必须和原型匹配
    • 导航项必须和原型导航匹配
    • 统计数据/计数器数值必须和原型匹配
  3. 使用资源文件:将
    /workspace/resources/
    下的资源文件(图片、视频、图标)映射到种子数据条目。使用相对路径,或者复制到public/static目录。
  4. 无占位符:不允许使用“Lorem ipsum”、“测试条目1”,也不允许使用
    placeholder.com
    的图片。
  5. 支持所有状态:包含PRD中规定的空状态、加载状态、错误场景所需的相关数据。

Output

输出

Save seed data as:
  • SQL seed files, or
  • JSON fixtures, or
  • ORM seed scripts
Place in
/workspace/backend/src/seed/
(or equivalent).

将种子数据保存为以下格式:
  • SQL种子文件,或
  • JSON fixture,或
  • ORM种子脚本
存放在
/workspace/backend/src/seed/
目录(或等效路径)下。

Phase 3: Backend Implementation

第3阶段:后端实现

3a. Database schema

3a. 数据库schema

  • Create migration files for all tables
  • Include proper constraints, indexes, foreign keys
  • Run migrations to verify they work
  • 为所有表创建迁移文件
  • 包含正确的约束、索引、外键
  • 运行迁移验证可用性

3b. API endpoints

3b. API端点

For each endpoint from the design doc:
  1. Implement route handler
  2. Add input validation (validate types, required fields, ranges)
  3. Add error handling with proper HTTP status codes
  4. Test with curl or equivalent to verify response format
为设计文档中的每个端点:
  1. 实现路由处理逻辑
  2. 添加输入校验(校验类型、必填字段、数值范围)
  3. 添加错误处理,返回正确的HTTP状态码
  4. 用curl或等效工具测试,验证响应格式

3c. Seed data loading

3c. 种子数据加载

  • Implement a seed script that:
    • Clears existing data (for idempotent re-seeding)
    • Inserts all seed data in correct dependency order
    • Copies resource files to the correct static serving location
  • Verify seed data loads without errors
实现种子脚本,满足以下要求:
  • 清除现有数据(保证重写种子的幂等性)
  • 按照正确的依赖顺序插入所有种子数据
  • 将资源文件复制到正确的静态资源服务路径
  • 验证种子数据加载无错误

3d. Static file serving

3d. 静态文件服务

  • Configure the backend to serve resource files (images, videos, etc.)
  • Ensure frontend can access them via proper URLs

  • 配置后端服务资源文件(图片、视频等)
  • 确保前端可以通过正确的URL访问这些资源

Phase 4: Frontend Implementation

第4阶段:前端实现

This is where visual fidelity matters most. The prototypes are the definitive reference.
这个阶段视觉还原度最重要,原型是唯一参考标准

4a. Global styles and tokens

4a. 全局样式和设计令牌

Before building components, establish:
  • Color variables matching prototype colors
  • Typography scale matching prototype fonts
  • Spacing/sizing system matching prototype spacing
  • Common component styles (buttons, cards, inputs, etc.)
在构建组件前,先确定:
  • 匹配原型颜色的颜色变量
  • 匹配原型字体的排版缩放规则
  • 匹配原型间距的间距/尺寸体系
  • 通用组件样式(按钮、卡片、输入框等)

4b. Page-by-page implementation

4b. 逐页面实现

For each prototype image, in order:
  1. Re-read the prototype image — keep it fresh in your context
  2. Build the page component matching the layout exactly:
    • Match spacing and proportions
    • Match colors and typography
    • Match visual hierarchy
    • Match content placement
  3. Wire up API calls to the backend
  4. Implement all interactions visible or implied:
    • Navigation between pages
    • Form submissions
    • Search and filter
    • Sorting
    • Modals and dialogs
    • Loading states
    • Error states
    • Hover effects
    • Active/selected states
按顺序处理每张原型图
  1. 重新查看原型图——确保你对原型的记忆准确
  2. 构建页面组件,完全匹配布局:
    • 匹配间距和比例
    • 匹配颜色和排版
    • 匹配视觉层级
    • 匹配内容位置
  3. 对接后端API调用
  4. 实现所有可见或隐含的交互:
    • 页面间导航
    • 表单提交
    • 搜索和筛选
    • 排序
    • 弹窗和对话框
    • 加载状态
    • 错误状态
    • hover效果
    • 激活/选中状态

4c. Resource integration

4c. 资源整合

  • Copy all resources from
    /workspace/resources/
    to frontend assets
  • Reference them correctly in components
  • Ensure images render at proper sizes matching prototypes
  • 将所有资源从
    /workspace/resources/
    复制到前端静态资源目录
  • 在组件中正确引用
  • 确保图片渲染尺寸和原型匹配

4d. Responsive considerations

4d. 响应式适配

  • Match the viewport width shown in prototypes
  • If prototypes show mobile views, implement responsive breakpoints

  • 匹配原型展示的视口宽度
  • 如果原型有移动端视图,实现响应式断点

Phase 5: Visual Verification Loop

第5阶段:视觉校验循环

This phase is what separates a good implementation from a great one. Repeat this loop for every page.
这个阶段是优秀实现和普通实现的区别所在。每个页面都要重复这个循环

5a. Render the page to a screenshot

5a. 渲染页面截图

Use Playwright to capture the running application:
bash
python ${SKILL_DIR}/scripts/render_page.py \
  --url "http://localhost:3000/page-path" \
  --output "/workspace/docs/screenshots/page_name.png" \
  --width 1280
使用Playwright捕获运行中的应用页面:
bash
python ${SKILL_DIR}/scripts/render_page.py \
  --url "http://localhost:3000/page-path" \
  --output "/workspace/docs/screenshots/page_name.png" \
  --width 1280

5b. Visual comparison

5b. 视觉对比

Read both images (prototype and screenshot) side by side:
  1. Read the prototype image from
    /workspace/prototypes/
  2. Read the rendered screenshot
  3. Compare systematically:
    • Layout: Are sections in the right positions?
    • Colors: Do colors match?
    • Typography: Are font sizes/weights correct?
    • Content: Is all prototype content present?
    • Spacing: Are margins and paddings close?
    • Images: Are all images rendering?
    • Components: Are all UI components present and correct?
同时查看原型图和截图两张图片,进行对比:
  1. 读取
    /workspace/prototypes/
    下的原型图
  2. 读取渲染后的截图
  3. 系统性对比:
    • 布局:各模块位置是否正确?
    • 颜色:颜色是否匹配?
    • 排版:字体大小/字重是否正确?
    • 内容:原型的所有内容是否都存在?
    • 间距:边距和内边距是否接近?
    • 图片:所有图片是否正常渲染?
    • 组件:所有UI组件是否存在且样式正确?

5c. Fix discrepancies

5c. 修复差异

For each difference found:
  1. Identify the specific CSS/component change needed
  2. Apply the fix
  3. Re-render and re-compare
针对每个发现的差异:
  1. 确定需要修改的CSS/组件内容
  2. 应用修复
  3. 重新渲染并再次对比

5d. Repeat until satisfied

5d. 重复直到满足要求

Max 3 iterations per page. Focus on the most impactful differences first.

每个页面最多迭代3次,优先修复影响最大的差异。

Phase 6: Integration Testing

第6阶段:集成测试

6a. API health check

6a. API健康检查

Run the API health checker to verify all endpoints:
bash
python ${SKILL_DIR}/scripts/check_api.py \
  --base-url "http://localhost:3000/api" \
  --endpoints-file "/workspace/docs/endpoints.json"
Or manually test each endpoint with curl:
bash
curl -s http://localhost:3000/api/products | head -c 200
运行API健康检查工具验证所有端点:
bash
python ${SKILL_DIR}/scripts/check_api.py \
  --base-url "http://localhost:3000/api" \
  --endpoints-file "/workspace/docs/endpoints.json"
或者用curl手动测试每个端点:
bash
curl -s http://localhost:3000/api/products | head -c 200

6b. End-to-end flow verification

6b. 端到端流程验证

Walk through every user flow defined in the PRD:
  1. Open the app at
    http://localhost:3000
  2. Navigate to each page
  3. Test each interactive feature
  4. Verify data loads from the database
  5. Verify forms submit correctly
  6. Verify search/filter/sort work
遍历PRD中定义的所有用户流程:
  1. 打开应用地址
    http://localhost:3000
  2. 导航到每个页面
  3. 测试每个交互功能
  4. 验证数据从数据库正常加载
  5. 验证表单提交正常
  6. 验证搜索/筛选/排序功能正常

6c. Fix any issues found

6c. 修复所有发现的问题

Address integration issues: CORS, API URL mismatches, data format mismatches, etc.

解决集成问题:CORS、API地址不匹配、数据格式不匹配等。

Phase 7: Deployment Script

第7阶段:部署脚本

Generate
/workspace/start.sh
— the single command that makes everything work from scratch.
生成
/workspace/start.sh
——这是可以从零开始启动整个应用的单条命令。

Requirements

要求

The script must:
  1. Be fully self-contained — no prior setup assumed
  2. Work in a fresh environment
  3. Install all system dependencies (Node.js, Python, DB, etc.)
  4. Clean any previous state
  5. Set up the database from scratch
  6. Run all migrations
  7. Load all seed data
  8. Build the frontend (if needed)
  9. Start both backend and frontend
  10. Make the app available at
    http://localhost:3000
脚本必须满足:
  1. 完全自包含——无需任何前置配置
  2. 可以在全新环境中运行
  3. 安装所有系统依赖(Node.js、Python、数据库等)
  4. 清理所有之前的状态
  5. 从零开始搭建数据库
  6. 运行所有迁移
  7. 加载所有种子数据
  8. 构建前端(如果需要)
  9. 同时启动后端和前端
  10. 应用可通过
    http://localhost:3000
    访问

Template

模板

bash
#!/bin/bash
set -e

echo "=== PRD-to-App: Starting deployment ==="
bash
#!/bin/bash
set -e

echo "=== PRD-to-App: 开始部署 ==="

1. System dependencies

1. 系统依赖

echo "[1/7] Checking system dependencies..."
echo "[1/7] 检查系统依赖..."

Install Node.js, npm, etc. if missing

如果缺失则安装Node.js、npm等

Install database if needed

如果需要则安装数据库

2. Backend setup

2. 后端配置

echo "[2/7] Setting up backend..." cd /workspace/backend npm install # or pip install -r requirements.txt
echo "[2/7] 配置后端..." cd /workspace/backend npm install # 或 pip install -r requirements.txt

3. Database initialization

3. 数据库初始化

echo "[3/7] Initializing database..."
echo "[3/7] 初始化数据库..."

Drop existing DB / reset

删除现有数据库/重置

Run migrations

运行迁移

Load seed data

加载种子数据

4. Frontend setup

4. 前端配置

echo "[4/7] Setting up frontend..." cd /workspace/frontend npm install
echo "[4/7] 配置前端..." cd /workspace/frontend npm install

5. Copy resources

5. 复制资源

echo "[5/7] Copying resource files..."
echo "[5/7] 复制资源文件..."

cp -r /workspace/resources/* /workspace/frontend/public/assets/

cp -r /workspace/resources/* /workspace/frontend/public/assets/

6. Start backend

6. 启动后端

echo "[6/7] Starting backend server..." cd /workspace/backend npm run dev & # or equivalent BACKEND_PID=$!
echo "[6/7] 启动后端服务..." cd /workspace/backend npm run dev & # 或等效命令 BACKEND_PID=$!

7. Start frontend

7. 启动前端

echo "[7/7] Starting frontend..." cd /workspace/frontend PORT=3000 npm run dev & FRONTEND_PID=$!
echo "" echo "=== Application is running at http://localhost:3000 ===" echo "Backend PID: $BACKEND_PID" echo "Frontend PID: $FRONTEND_PID" echo "To stop: kill $BACKEND_PID $FRONTEND_PID"
wait
undefined
echo "[7/7] 启动前端..." cd /workspace/frontend PORT=3000 npm run dev & FRONTEND_PID=$!
echo "" echo "=== 应用已运行,访问地址:http://localhost:3000 ===" echo "后端进程ID: $BACKEND_PID" echo "前端进程ID: $FRONTEND_PID" echo "停止命令: kill $BACKEND_PID $FRONTEND_PID"
wait
undefined

Verification

验证

After generating start.sh:
  1. chmod +x /workspace/start.sh
  2. Run it:
    bash /workspace/start.sh
  3. Wait for startup
  4. Verify
    http://localhost:3000
    responds
  5. Spot-check a few API endpoints
  6. Fix any startup issues

生成start.sh后:
  1. 执行
    chmod +x /workspace/start.sh
  2. 运行脚本:
    bash /workspace/start.sh
  3. 等待启动完成
  4. 验证
    http://localhost:3000
    可以正常访问
  5. 抽样测试几个API端点
  6. 修复所有启动问题

Phase 8: Documentation

第8阶段:文档

8a. Software Design Document (
/workspace/docs/design.md
)

8a. 软件设计文档(
/workspace/docs/design.md

Already created in Phase 1 — update with any changes made during implementation:
  • Final system architecture
  • Final data model (with any fields added during dev)
  • Technology stack
  • Deployment architecture
  • API reference
这是第1阶段已经生成的文件,根据实现过程中的变更更新内容:
  • 最终系统架构
  • 最终数据模型(包含开发过程中新增的字段)
  • 技术栈
  • 部署架构
  • API参考

8b. README (
/workspace/README.md
)

8b. README(
/workspace/README.md

markdown
undefined
markdown
undefined

[Project Name]

[项目名称]

Overview

概述

[From PRD product overview]
[来自PRD的产品概述]

Technology Stack

技术栈

  • Frontend: ...
  • Backend: ...
  • Database: ...
  • 前端: ...
  • 后端: ...
  • 数据库: ...

Quick Start

快速开始

```bash bash start.sh ``` Then visit http://localhost:3000
```bash bash start.sh ``` 启动后访问 http://localhost:3000

Project Structure

项目结构

[Directory tree]
[目录树]

Database

数据库

[Schema overview, how to re-seed]
[schema概述,如何重新生成种子数据]

API Reference

API参考

[Key endpoints]

---
[核心端点说明]

---

Deliverables Checklist

交付物检查清单

Before declaring done, verify every item:
  • All PRD features implemented — no features skipped
  • All prototype pages built — no pages merged or omitted
  • Visual match with prototypes — verified via screenshot comparison
  • All resource files used where they appear in prototypes
  • Seed data matches prototype content exactly
  • All API endpoints working and returning correct data
  • All interactive elements functional (forms, search, filters, modals, navigation)
  • bash /workspace/start.sh
    works from a clean state
  • App accessible at
    http://localhost:3000
  • Design document complete
  • README with deployment instructions

在宣告完成前,验证所有条目:
  • 所有PRD功能已实现——没有遗漏功能
  • 所有原型页面已构建——没有合并或省略页面
  • 视觉效果和原型匹配——已通过截图对比验证
  • 所有在原型中出现的资源文件都已使用
  • 种子数据和原型内容完全匹配
  • 所有API端点正常工作,返回正确数据
  • 所有交互元素功能正常(表单、搜索、筛选、弹窗、导航)
  • 可在干净环境中通过
    bash /workspace/start.sh
    正常启动
  • 应用可通过
    http://localhost:3000
    访问
  • 设计文档完整
  • 包含带部署说明的README

Critical Principles

核心原则

  1. Prototypes are truth — when PRD text and prototype images conflict, the prototype wins for visual/layout decisions.
  2. No shortcuts on data — every piece of content visible in prototypes must come from the database via APIs. No hardcoded data in frontend components.
  3. Complete implementation — every page, every feature, every interaction. Don't skip "minor" features. Don't merge separate pages into one.
  4. Resources must be used — if the prototype shows an image and a matching file exists in
    /workspace/resources/
    , use that file. Don't substitute with placeholder URLs.
  5. Reproducibility
    start.sh
    must work from absolute zero. If it needs Node 18+, it installs Node 18+. If it needs PostgreSQL, it sets up PostgreSQL.
  6. Verify, don't assume — use the visual verification loop (Phase 5) to actually compare your output against prototypes. Use API checks to verify endpoints. Run start.sh to verify deployment.
  1. 原型是唯一标准——当PRD文字描述和原型图冲突时,视觉/布局决策以原型为准。
  2. 数据层面不允许捷径——原型中所有可见内容都必须通过API从数据库获取,前端组件中不允许硬编码数据。
  3. 完整实现——每个页面、每个功能、每个交互都要实现。不要跳过“次要”功能,不要把多个独立页面合并成一个。
  4. 必须使用资源文件——如果原型展示了某张图片,且
    /workspace/resources/
    下存在对应文件,必须使用该文件,不允许替换为占位符URL。
  5. 可复现性——
    start.sh
    必须可以从零开始正常运行。如果需要Node 18+,脚本要自动安装Node 18+;如果需要PostgreSQL,脚本要自动搭建PostgreSQL。
  6. 验证而非假设——使用第5阶段的视觉校验循环,实际对比你的输出和原型。使用API检查工具验证端点,运行start.sh验证部署流程。