From 4e1bb0f82ac48327343ad8422597a134a2004dda Mon Sep 17 00:00:00 2001 From: Ironsp <1522278303@qq.com> Date: Mon, 28 Sep 2026 09:21:34 +0800 Subject: [PATCH] =?UTF-8?q?feat=20skills=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/skills/auto-dev/SKILL.md | 240 +++++ .claude/skills/karpathy-guidelines/SKILL.md | 77 ++ .gitignore | 3 +- AGENTS.md | 65 ++ docs/PRD.md | 412 ++++++++ docs/dev-plan.md | 170 +++ docs/page-architecture.md | 206 ++++ docs/prototype/个人中心-演示.html | 922 +++++++++++++++++ docs/prototype/合同管理-演示.html | 846 +++++++++++++++ docs/prototype/在线客服-演示.html | 677 ++++++++++++ docs/prototype/案例库-演示.html | 962 +++++++++++++++++ docs/prototype/消息中心-演示.html | 847 +++++++++++++++ docs/prototype/登录-演示.html | 800 +++++++++++++++ docs/prototype/财务中心-演示.html | 997 ++++++++++++++++++ docs/prototype/需求填报-演示.html | 759 ++++++++++++++ docs/prototype/项目中心-演示.html | 944 +++++++++++++++++ docs/prototype/首页-演示.html | 1023 +++++++++++++++++++ 17 files changed, 9948 insertions(+), 2 deletions(-) create mode 100644 .claude/skills/auto-dev/SKILL.md create mode 100644 .claude/skills/karpathy-guidelines/SKILL.md create mode 100644 AGENTS.md create mode 100644 docs/PRD.md create mode 100644 docs/dev-plan.md create mode 100644 docs/page-architecture.md create mode 100644 docs/prototype/个人中心-演示.html create mode 100644 docs/prototype/合同管理-演示.html create mode 100644 docs/prototype/在线客服-演示.html create mode 100644 docs/prototype/案例库-演示.html create mode 100644 docs/prototype/消息中心-演示.html create mode 100644 docs/prototype/登录-演示.html create mode 100644 docs/prototype/财务中心-演示.html create mode 100644 docs/prototype/需求填报-演示.html create mode 100644 docs/prototype/项目中心-演示.html create mode 100644 docs/prototype/首页-演示.html diff --git a/.claude/skills/auto-dev/SKILL.md b/.claude/skills/auto-dev/SKILL.md new file mode 100644 index 0000000..4484b44 --- /dev/null +++ b/.claude/skills/auto-dev/SKILL.md @@ -0,0 +1,240 @@ +--- +name: auto-dev +description: zc-web 自动化开发全流程 skill。覆盖从原型图/PRD → 蓝湖 MCP 设计稿读取 → API 接口文档 → 页面代码生成 → 组件拆分 → store/api 生成 → 自动验证修正的完整链路。当用户提到"自动化开发"、"从原型生成代码"、"蓝湖设计稿生成页面"、"PRD生成页面"、"虫子开发"、"自动拆分组件"、"生成store"时使用。 +version: 1.0.0 +--- + +# zc-web 自动化开发全流程 + +> 本 skill 驱动从设计稿/PRD 到可运行代码的完整自动化管线。所有生成的代码必须严格遵循 [vue-project-structure](vue-project-structure) skill 的规范。 + +## 前置条件 + +1. **项目结构确认**:用 `codegraph_files` 确认 `src/` 目录现有结构 +2. **加载 vue-project-structure skill**:所有代码生成必须遵循其分层架构和数据流规范 +3. **蓝湖 MCP 就绪**:确认 `lanhu` MCP 服务已启动(`curl http://localhost:8000/mcp`) + +--- + +## 阶段一:PRD 生成 + +### 从原型图生成 PRD 文档 + +使用项目根目录的 `read_prototype.js` 读取原型文件: + +```bash +node read_prototype.js [原型文件路径] +``` + +然后根据原型中的布局和交互逻辑,生成 PRD 文档放入 `doc/` 文件夹。 + +**PRD 内容要求**: + +- 页面清单及功能描述 +- 每个页面的交互逻辑 +- 数据字段定义 +- 组件拆分建议 + +**提示词模板**: + +``` +运行 ./read_prototype.js [原型文件路径] 读取原型代码,然后根据其中的布局和交互逻辑,为我生成一份 PRD 文档。放在doc文件夹中 +``` + +--- + +## 阶段二:蓝湖 MCP 设计稿读取 + +### 连接验证 + +```javascript +请帮我用 MCP 看看这个蓝湖设计稿:[蓝湖链接] +``` + +### 批量读取设计稿数据 + +```javascript +请通过蓝湖 MCP 读取以下设计稿的结构化数据,提取每个页面的: +- 组件尺寸、间距、色值、字体等标注参数 +- 全局设计规范(颜色变量、字号体系) +- 切图资源(SVG/PNG),按图层语义化命名 +- 布局嵌套结构和循环体检测 +蓝湖链接:[蓝湖项目链接] +``` + +**输出要求**: + +- 设计参数表(色值、字号、间距、圆角、阴影) +- 组件结构树(嵌套关系、循环体标记) +- 资源清单(图片/图标路径及语义化命名) + +--- + +## 阶段三:PRD → 页面结构规划 + +```javascript +以下是我的产品需求文档,请帮我: +- 梳理出所有需要的页面清单,按功能模块分组 +- 规划 uni-app / Vue3 项目的页面路由结构 +- 识别哪些模块可以复用,哪些是页面独有 +- 输出每个页面的核心功能点和数据字段 +PRD 内容:[PRD文件路径或内容] +``` + +**输出物**: + +- 页面清单表(模块 → 页面 → 功能点 → 数据字段) +- 路由规划(`pages.json` 或 `router/routes.ts` 结构) +- 复用性分析(哪些组件/逻辑可抽取为公共) + +--- + +## 阶段四:AI 生成页面代码并自动拆分组件 + +基于 PRD 页面规划和蓝湖 MCP 设计稿数据,生成完整页面代码。 + +### 目录结构规范(zc-web) + +``` +views// +├── index.vue # 页面主组件(路由入口) +├── index.ts # 页面出口 barrel +└── cpns/ # 页面独有组件 + ├── .vue + └── ... +``` + +配套文件: + +``` +api/.ts # 接口层 +stores/modules/.ts # 数据层(Pinia) +types/business/.d.ts # 实体类型 +``` + +### 组件拆分原则 + +1. **单一职责**:一个组件只做一件事,超过 300 行必须拆分 +2. **三层架构**: + - 页面容器(`index.vue`):只负责调度和数据分发,不写业务逻辑 + - 业务子组件(`cpns/`):当前页面私有,只接收 props + emit 事件 + - 公共基础组件(`components/`):全局复用 +3. **按数据维度拆分**:同一批接口数据渲染的区域放一个组件,不同数据源必须拆分 +4. **弹窗/抽屉/复杂表单**:一律单独抽离为子组件 + +### 生成要求 + +- 父页面只做组件引入、props 分发、事件中转 +- 子组件只接收 props 和通过 emit 向上抛事件,不直接调接口 +- 样式使用 `
\ No newline at end of file diff --git a/docs/prototype/合同管理-演示.html b/docs/prototype/合同管理-演示.html new file mode 100644 index 0000000..acf9eac --- /dev/null +++ b/docs/prototype/合同管理-演示.html @@ -0,0 +1,846 @@ +合同管理-演示
\ No newline at end of file diff --git a/docs/prototype/在线客服-演示.html b/docs/prototype/在线客服-演示.html new file mode 100644 index 0000000..ba9fae8 --- /dev/null +++ b/docs/prototype/在线客服-演示.html @@ -0,0 +1,677 @@ +在线客服-演示
\ No newline at end of file diff --git a/docs/prototype/案例库-演示.html b/docs/prototype/案例库-演示.html new file mode 100644 index 0000000..0fd7075 --- /dev/null +++ b/docs/prototype/案例库-演示.html @@ -0,0 +1,962 @@ +案例库-演示
\ No newline at end of file diff --git a/docs/prototype/消息中心-演示.html b/docs/prototype/消息中心-演示.html new file mode 100644 index 0000000..73999cd --- /dev/null +++ b/docs/prototype/消息中心-演示.html @@ -0,0 +1,847 @@ +消息中心-演示
\ No newline at end of file diff --git a/docs/prototype/登录-演示.html b/docs/prototype/登录-演示.html new file mode 100644 index 0000000..62a85f9 --- /dev/null +++ b/docs/prototype/登录-演示.html @@ -0,0 +1,800 @@ +登录-演示
\ No newline at end of file diff --git a/docs/prototype/财务中心-演示.html b/docs/prototype/财务中心-演示.html new file mode 100644 index 0000000..5f3ecbd --- /dev/null +++ b/docs/prototype/财务中心-演示.html @@ -0,0 +1,997 @@ +财务中心-演示
\ No newline at end of file diff --git a/docs/prototype/需求填报-演示.html b/docs/prototype/需求填报-演示.html new file mode 100644 index 0000000..1a91b89 --- /dev/null +++ b/docs/prototype/需求填报-演示.html @@ -0,0 +1,759 @@ +需求填报-演示
\ No newline at end of file diff --git a/docs/prototype/项目中心-演示.html b/docs/prototype/项目中心-演示.html new file mode 100644 index 0000000..213b59a --- /dev/null +++ b/docs/prototype/项目中心-演示.html @@ -0,0 +1,944 @@ +项目中心-演示
\ No newline at end of file diff --git a/docs/prototype/首页-演示.html b/docs/prototype/首页-演示.html new file mode 100644 index 0000000..35ca76a --- /dev/null +++ b/docs/prototype/首页-演示.html @@ -0,0 +1,1023 @@ +首页-演示
\ No newline at end of file