Files
vibe_coding/.cursor/rules/skill-full-feature.mdc
2026-03-05 21:27:11 +08:00

79 lines
2.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: >
端到端功能开发技能。当需要从数据库到 API 到 UI 全链路开发完整功能时激活。
编排 database-migration、api-scaffold、component-scaffold 等技能协同工作。
alwaysApply: false
---
# Full Feature Workflow
> 本文件是精简执行摘要。完整流程、模板和深度参考见:
> Read `.cursor/skills/full-feature/SKILL.md`
依赖技能:`component-scaffold`、`vue-testing`
## 执行流程
### Phase 1: 规划
拆分功能为子任务:
- 数据层:数据模型和数据库变更
- 后端 APIController / Service / Repository
- 前端 UI组件和页面
- 测试:每层测试
输出执行计划后确认再开始。
### Phase 2: 数据层
1. 生成迁移:`php bin/hyperf.php gen:migration create_<table>_table`
2. 编写迁移(遵循高并发表设计规范)
3. 执行迁移 + 生成 Model
4. 补充 Model 关联和类型转换
参考Cursor 已通过 `skill-database-migration` 规则自动加载。
如需模板细节Read `.cursor/skills/database-migration/references/migration-patterns.md`
### Phase 3: 后端 API 层
1. Controller接收请求→ Service业务逻辑→ Repository → FormRequest
2. 注册路由 + 挂载中间件
3. 编写 PHPUnit 测试
参考Cursor 已通过 `skill-backend-scaffold` 规则自动加载。
如需模板细节Read `.cursor/skills/api-scaffold/references/code-templates.md`
### Phase 4: 前端 UI 层
1. 封装 API 接口(`src/api/<module>/`
2. 创建列表页 + 表单组件 + 详情页
3. 配置 Vue Router 路由
4. 连接 Pinia Store如需跨页面状态
参考Cursor 已通过 `skill-component-scaffold` 和 `skill-vue-page` 规则自动加载。
如需模板细节Read `.cursor/skills/component-scaffold/references/component-templates.md`
### Phase 5: 集成验证
1. 后端测试:`composer test`
2. 前端 Lint`npm run lint`
3. 手动测试 CRUD 全路径
### Phase 6: 收尾
更新文档data-model.md、api-contracts.md→ Git commit
## 执行原则
- **自底向上**:数据层 → 后端 API → 前端 UI
- **每步验证**:每个 Phase 完成后运行测试
- **可中断**:每个 Phase 独立可提交
## 验证
- [ ] 后端测试全部通过
- [ ] 前端 ESLint 无报错
- [ ] 功能端到端可用CRUD 全路径)
- [ ] 代码遵循项目现有模式
- [ ] 文档已更新