References: Vertical Slice Architecture, Shape Up (Basecamp), Kent Beck Incremental Design, full-stack MVP practices.
Applicable Scenarios
- One person completes a full feature from database to page
- Rapid delivery of MVP / POC / internal tools
- End-to-end feature modules for small teams
Core Principles
1. 垂直切片(Vertical Slice)
不是先做完所有后端再做前端
而是一个功能从 DB → API → UI 一次做完
-
Incremental delivery First build the minimum usable version (happy path) Then add error handling / edge cases / permissions
-
Integrate while writing Do not finish the frontend and backend separately before integrating Integrate each endpoint as soon as it is written
-
Schema First Design the data model first, then write code
-
Deployment first Deploy an empty project to Preview on day one Every subsequent feature can be viewed online
-
Tests follow along Do not add tests at the end Write tests as soon as each feature is complete
## 垂直切片交付流程
```text
功能:用户创建订单
切片 1(最小可用):
□ Schema:orders 表(id, user_id, status, total, created_at)
□ API:POST /orders(创建)+ GET /orders(列表)
□ UI:订单列表页 + 创建按钮 + 简单表单
□ 联调:前端调真实 API
□ 部署:Preview 可访问
→ 验收:能创建订单并看到列表
切片 2(补充):
□ Schema:order_items 表
□ API:GET /orders/:id(详情)
□ UI:订单详情页
□ 联调 + 部署
→ 验收:能看到订单详情
切片 3(完善):
□ API:PATCH /orders/:id(状态流转)
□ UI:状态操作按钮
□ 错误处理(库存不足 / 权限不足)
□ 测试
→ 验收:完整业务流程
Standard Process
1. 理解需求
- 核心用户流程是什么?
- 涉及哪些数据实体?
- 权限边界?
↓
2. 选技术栈(如未定)
→ fullstack-architecture skill
↓
3. 设计数据模型
→ database-schema-impl skill
↓
4. 部署空项目
→ deploy-preview skill
↓
5. 按垂直切片实现
每个切片:
a. 写 Schema / Migration
b. 写 API 端点
c. 写前端页面
d. 联调验证
e. 部署到 Preview
↓
6. 认证(如需)
→ auth-e2e skill
↓
7. 测试
- 单元:核心业务逻辑
- E2E:关键用户旅程(1~3 条)
↓
8. 验收
- 对照验收标准逐条检查
↓
9. 正式部署
→ deploy-preview skill(Production)
↓
10. 沉淀经验
Full-Stack Delivery Checklist (must-check for every feature)
数据层:
□ Schema 设计完成
□ Migration 可执行
□ 种子数据(如需)
□ 索引覆盖核心查询
后端层:
□ API 端点实现
□ 入参校验
□ 错误码统一
□ 权限检查
□ 幂等(写操作)
前端层:
□ 页面实现
□ Loading / Error / Empty 状态
□ 表单校验
□ 响应式
□ 基本 a11y
联调层:
□ 前后端字段一致
□ 错误处理对接
□ Token 传递正确
□ 分页 / 筛选对接
测试层:
□ 核心逻辑单元测试
□ 关键路径 E2E(至少 1 条)
部署层:
□ Preview 可访问
□ 环境变量配置
□ 数据库连接正常
Time Allocation (M-level feature, 8 hours)
需求理解 + 设计: 1h(12%)
数据模型 + Migration:1h(12%)
后端实现: 2h(25%)
前端实现: 2h(25%)
联调 + 错误处理: 1h(12%)
测试: 0.5h(6%)
部署 + 验收: 0.5h(6%)
Incremental Delivery Strategy
Day 1:
- 空项目部署到 Preview ✓
- Schema 设计 ✓
- 核心 CRUD API ✓
- 列表页 ✓
Day 2:
- 详情页 + 创建表单 ✓
- 联调 ✓
- 认证 ✓
Day 3:
- 错误处理 + 边界 ✓
- 测试 ✓
- 正式部署 ✓
- 验收 ✓
Supporting Templates
templates/e2e-delivery-checklist.md— Vertical slice checklist + full-stack delivery check + time allocation
Quality Self-Check
□ 垂直切片(不是先全后端再全前端)
□ Schema First
□ 第一天就部署
□ 边写边调
□ 4 种状态(loading/error/empty/success)
□ 错误处理端到端
□ 认证端到端
□ 至少 1 条 E2E 测试
□ Preview 可访问
□ 验收标准全部满足
Common Pitfalls
- Write the backend first, then the frontend——fields are inconsistent during integration
- Develop without deploying——various environment issues at final deployment
- Write code without writing a Schema——the data model changes repeatedly
- Do not handle error states——users see a blank screen
- Do not deliver incrementally——nothing can be seen until 3 days later
- Force through when complexity is too high——quality collapses; it should be split
- Do not write tests——changing one place breaks three
- Do not use TypeScript——type errors during integration
- Do authentication last——everything before it is left unprotected
- Do not use a full-stack framework——assembling it yourself wastes time
Collaboration with Other Skills
下游:
database-schema-impl → 建表
api-frontend-integration → 联调
auth-e2e → 认证
deploy-preview → 部署
fullstack-architecture → 选型