@hupan56/wlkj 2.2.4 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,141 +1,141 @@
1
- ---
2
- name: prototype-generator
3
- description: "生成匹配项目 UI 风格的交互式 HTML 原型(Web 端 fywl-ui 用 Vben Admin + Ant Design Vue;APP 端 Carmg-H5 用 Vant 3)。Generate interactive HTML prototypes matching project UI style. 用户说'做个原型''画个 mockup''看看效果''出个界面预览'时触发。"
4
- trigger: "user asks for prototype, mockup, UI preview, or when PRD needs visual illustration"
5
- ---
6
-
7
- # Prototype Generator
8
-
9
- Generate production-ready HTML prototypes that match the project's actual UI style.
10
-
11
- ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
12
-
13
- - `.qoder/.developer` — 决定产出存到 `workspace/members/{dev}/drafts/`
14
- - 若 `.qoder/.current-task` 存在,原型命名带上任务关键词
15
- - 平台(Web/APP/Both)必须明确;如未指定,先问用户(见 prd-generator Step 0)
16
-
17
- ## Step 0: Know the Platform
18
-
19
- The platform MUST already be decided (asked by /wl-prd Step 0).
20
- If you don't know it, STOP and ask the user (Web 管理端 / APP 移动端 / 两端都要).
21
-
22
- | Platform | Project | Template | Design Tokens |
23
- |----------|---------|----------|---------------|
24
- | Web | fywl-ui | .qoder/templates/prototype-web.html | data/index/vben-style-reference.json (HSL) |
25
- | APP | Carmg-H5 | .qoder/templates/prototype-app.html | Vant 3 variables (in template) |
26
- | Both | both | both templates | generate 2 files: -web.html and -app.html |
27
-
28
- ## Style Sources (Priority Order)
29
-
30
- 1. **data/code/** - Existing Vue code from the TARGET project (HIGHEST priority)
31
- 2. **data/index/vben-style-reference.json** - Vben design tokens (Web)
32
- / Vant variables baked into prototype-app.html (APP)
33
- 3. **data/index/chart-style-reference.json** - Dashboard/big-screen/chart
34
- idioms (REQUIRED for dashboard/看板/大屏/统计类原型)
35
- 4. **data/style/** - PDF design specs (only if a token is missing above)
36
-
37
- If code conflicts with PDF, CODE WINS. The templates already contain the
38
- correct tokens — do NOT invent colors or copy Ant Design defaults
39
- (#1890ff is NOT this project's primary).
40
-
41
- ## ⚠️ NEW-FEATURE prototypes MUST also anchor to real pages
42
-
43
- For a feature with NO existing page (e.g. brainstorm/new dashboard), the
44
- style must STILL come from the system, never from generic admin templates:
45
-
46
- 1. Find the closest in-system page family:
47
- `search_index.py --style <type> --platform <p>` + read 1-2 real pages
48
- 2. Dashboard/看板/大屏类: read data/index/chart-style-reference.json and
49
- choose the idiom — 大屏深蓝风 (dashboard/monitor 先例: 全国地图/驾驶舱)
50
- or 浅色卡片风 (dashboard/workbench 先例: 工作台统计卡)
51
- 3. Use REAL business vocabulary from the index (e.g. 异常三分类
52
- 人员作业异常/车辆异常/费用异常 comes from workbench/components/abnormal.vue)
53
- 4. In the prototype header comment, cite which real files the style came from
54
- — if you cannot name a source file, you have NOT done step 1.
55
-
56
- ## Step 1: Determine Prototype Type
57
-
58
- Read the requirement to decide:
59
- - **Table page**: List with search form + data grid + actions
60
- - **Form page**: Create/edit form with validation
61
- - **Detail page**: Read-only data display
62
- - **Modal/Drawer**: Popup form
63
- - **Dashboard**: Charts + summary cards
64
-
65
- ## Step 2: Load Style Context
66
-
67
- ```bash
68
- # Find real example pages of this type in the target project
69
- python .qoder/scripts/search_index.py --style <table|form|detail|modal|dashboard> --platform <web|app>
70
-
71
- # Find similar existing pages by business keyword
72
- python .qoder/scripts/search_index.py <keyword> --platform <web|app>
73
-
74
- # Find field definitions (real field names + Chinese labels)
75
- python .qoder/scripts/search_index.py --field <field_name>
76
- ```
77
-
78
- Then read the TOP 2-3 most similar existing Vue files to extract:
79
- - Table column titles/fields and widths
80
- - Form field layouts and component types
81
- - Button styles and positions
82
-
83
- ## Step 3: Fill the Template
84
-
85
- Read the platform template and replace its placeholders:
86
-
87
- **prototype-web.html** (Web, Vben Admin HSL variables, sidebar layout, VxeGrid table):
88
- - `{{TITLE}}` - browser tab title
89
- - `{{MODULE_NAME}}` - sidebar/breadcrumb module name
90
- - `{{PAGE_NAME}}` - page name in breadcrumb
91
- - `{{SEARCH_FORM_FIELDS}}` - search form items (label + input/select)
92
- - `{{TABLE_HEADERS}}` - `<th>` cells using REAL column titles from code
93
- - `{{TABLE_ROWS}}` - `<tr>` rows with realistic sample data
94
-
95
- **prototype-app.html** (APP, Vant 3 variables, 375px, NavBar + TabBar):
96
- - `{{TITLE}}` - browser tab title
97
- - `{{PAGE_TITLE}}` - NavBar title
98
- - `{{LIST_ITEMS}}` - list cells (van-cell style)
99
- - `{{ITEM_TITLE}}` / `{{ITEM_DESC}}` - cell content
100
-
101
- Key design tokens already in the templates (do not override):
102
- - Web primary: `hsl(212 100% 45%)` via `--primary` (from vben-style-reference.json)
103
- - APP primary: `--van-primary-color: #1989fa`
104
-
105
- ## ⚠️ Icons: NEVER emoji, ALWAYS the project's real icon system
106
-
107
- Source of truth: **data/index/icon-reference.json** (real usage counts +
108
- ready-to-paste SVGs extracted from the actual projects).
109
-
110
- - **Web (fywl-ui)**: Ant Design icons. Inline the SVG from icon-reference.json:
111
- ```html
112
- <span class="anticon">{svg from icon-reference.json web.svg.outlined[...]}</span>
113
- <style>.anticon svg{width:1em;height:1em;fill:currentColor}</style>
114
- ```
115
- Most-used in the real app: Download(303x), Plus(171x), Delete, Search, Edit...
116
- - **APP (Carmg-H5)**: Vant font icons:
117
- ```html
118
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@4/lib/index.css">
119
- <i class="van-icon van-icon-search"></i>
120
- ```
121
- Most-used: arrow-down, arrow, plus, cross, search...
122
- - An emoji (👤🚛💰⚠️...) anywhere in a prototype = automatic style FAIL.
123
-
124
- ## Step 4: Highlight Changes + Interactivity
125
-
126
- - Mark NEW/CHANGED elements with the template's `highlight-new` class
127
- (subtle border + legend), so reviewers see the diff at a glance
128
- - Minimal JavaScript: row click highlight, form expand/collapse,
129
- tab switching, modal open/close, validation hints
130
- - Single self-contained HTML file, no external dependencies
131
-
132
- ## Rules
133
-
134
- 1. **ALWAYS match the TARGET platform style** - colors, spacing, fonts come
135
- from the template + real code, never from memory
136
- 2. **NEVER invent new patterns** - if the project uses VxeGrid, mimic VxeGrid
137
- 3. **Use REAL fields** - column titles and field names must come from the
138
- actual code found in Step 2, not made up
139
- 4. **Prototype must be interactive** - clickable buttons, fillable forms, hover states
140
- 5. **Save to** `workspace/members/{developer}/drafts/prototype-{feature}.html`
141
- (Both platforms -> `prototype-{feature}-web.html` + `prototype-{feature}-app.html`)
1
+ ---
2
+ name: prototype-generator
3
+ description: "生成匹配项目 UI 风格的交互式 HTML 原型(Web 端 fywl-ui 用 Vben Admin + Ant Design Vue;APP 端 Carmg-H5 用 Vant 3)。Generate interactive HTML prototypes matching project UI style. 用户说'做个原型''画个 mockup''看看效果''出个界面预览'时触发。"
4
+ trigger: "user asks for prototype, mockup, UI preview, or when PRD needs visual illustration"
5
+ ---
6
+
7
+ # Prototype Generator
8
+
9
+ Generate production-ready HTML prototypes that match the project's actual UI style.
10
+
11
+ ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
12
+
13
+ - `.qoder/.developer` — 决定产出存到 `workspace/members/{dev}/drafts/`
14
+ - 若 `.qoder/.current-task` 存在,原型命名带上任务关键词
15
+ - 平台(Web/APP/Both)必须明确;如未指定,先问用户(见 prd-generator Step 0)
16
+
17
+ ## Step 0: Know the Platform
18
+
19
+ The platform MUST already be decided (asked by /wl-prd Step 0).
20
+ If you don't know it, STOP and ask the user (Web 管理端 / APP 移动端 / 两端都要).
21
+
22
+ | Platform | Project | Template | Design Tokens |
23
+ |----------|---------|----------|---------------|
24
+ | Web | fywl-ui | .qoder/templates/prototype-web.html | data/index/vben-style-reference.json (HSL) |
25
+ | APP | Carmg-H5 | .qoder/templates/prototype-app.html | Vant 3 variables (in template) |
26
+ | Both | both | both templates | generate 2 files: -web.html and -app.html |
27
+
28
+ ## Style Sources (Priority Order)
29
+
30
+ 1. **data/code/** - Existing Vue code from the TARGET project (HIGHEST priority)
31
+ 2. **data/index/vben-style-reference.json** - Vben design tokens (Web)
32
+ / Vant variables baked into prototype-app.html (APP)
33
+ 3. **data/index/chart-style-reference.json** - Dashboard/big-screen/chart
34
+ idioms (REQUIRED for dashboard/看板/大屏/统计类原型)
35
+ 4. **data/style/** - PDF design specs (only if a token is missing above)
36
+
37
+ If code conflicts with PDF, CODE WINS. The templates already contain the
38
+ correct tokens — do NOT invent colors or copy Ant Design defaults
39
+ (#1890ff is NOT this project's primary).
40
+
41
+ ## ⚠️ NEW-FEATURE prototypes MUST also anchor to real pages
42
+
43
+ For a feature with NO existing page (e.g. brainstorm/new dashboard), the
44
+ style must STILL come from the system, never from generic admin templates:
45
+
46
+ 1. Find the closest in-system page family:
47
+ `search_index.py --style <type> --platform <p>` + read 1-2 real pages
48
+ 2. Dashboard/看板/大屏类: read data/index/chart-style-reference.json and
49
+ choose the idiom — 大屏深蓝风 (dashboard/monitor 先例: 全国地图/驾驶舱)
50
+ or 浅色卡片风 (dashboard/workbench 先例: 工作台统计卡)
51
+ 3. Use REAL business vocabulary from the index (e.g. 异常三分类
52
+ 人员作业异常/车辆异常/费用异常 comes from workbench/components/abnormal.vue)
53
+ 4. In the prototype header comment, cite which real files the style came from
54
+ — if you cannot name a source file, you have NOT done step 1.
55
+
56
+ ## Step 1: Determine Prototype Type
57
+
58
+ Read the requirement to decide:
59
+ - **Table page**: List with search form + data grid + actions
60
+ - **Form page**: Create/edit form with validation
61
+ - **Detail page**: Read-only data display
62
+ - **Modal/Drawer**: Popup form
63
+ - **Dashboard**: Charts + summary cards
64
+
65
+ ## Step 2: Load Style Context
66
+
67
+ ```bash
68
+ # Find real example pages of this type in the target project
69
+ python .qoder/scripts/search_index.py --style <table|form|detail|modal|dashboard> --platform <web|app>
70
+
71
+ # Find similar existing pages by business keyword
72
+ python .qoder/scripts/search_index.py <keyword> --platform <web|app>
73
+
74
+ # Find field definitions (real field names + Chinese labels)
75
+ python .qoder/scripts/search_index.py --field <field_name>
76
+ ```
77
+
78
+ Then read the TOP 2-3 most similar existing Vue files to extract:
79
+ - Table column titles/fields and widths
80
+ - Form field layouts and component types
81
+ - Button styles and positions
82
+
83
+ ## Step 3: Fill the Template
84
+
85
+ Read the platform template and replace its placeholders:
86
+
87
+ **prototype-web.html** (Web, Vben Admin HSL variables, sidebar layout, VxeGrid table):
88
+ - `{{TITLE}}` - browser tab title
89
+ - `{{MODULE_NAME}}` - sidebar/breadcrumb module name
90
+ - `{{PAGE_NAME}}` - page name in breadcrumb
91
+ - `{{SEARCH_FORM_FIELDS}}` - search form items (label + input/select)
92
+ - `{{TABLE_HEADERS}}` - `<th>` cells using REAL column titles from code
93
+ - `{{TABLE_ROWS}}` - `<tr>` rows with realistic sample data
94
+
95
+ **prototype-app.html** (APP, Vant 3 variables, 375px, NavBar + TabBar):
96
+ - `{{TITLE}}` - browser tab title
97
+ - `{{PAGE_TITLE}}` - NavBar title
98
+ - `{{LIST_ITEMS}}` - list cells (van-cell style)
99
+ - `{{ITEM_TITLE}}` / `{{ITEM_DESC}}` - cell content
100
+
101
+ Key design tokens already in the templates (do not override):
102
+ - Web primary: `hsl(212 100% 45%)` via `--primary` (from vben-style-reference.json)
103
+ - APP primary: `--van-primary-color: #1989fa`
104
+
105
+ ## ⚠️ Icons: NEVER emoji, ALWAYS the project's real icon system
106
+
107
+ Source of truth: **data/index/icon-reference.json** (real usage counts +
108
+ ready-to-paste SVGs extracted from the actual projects).
109
+
110
+ - **Web (fywl-ui)**: Ant Design icons. Inline the SVG from icon-reference.json:
111
+ ```html
112
+ <span class="anticon">{svg from icon-reference.json web.svg.outlined[...]}</span>
113
+ <style>.anticon svg{width:1em;height:1em;fill:currentColor}</style>
114
+ ```
115
+ Most-used in the real app: Download(303x), Plus(171x), Delete, Search, Edit...
116
+ - **APP (Carmg-H5)**: Vant font icons:
117
+ ```html
118
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@4/lib/index.css">
119
+ <i class="van-icon van-icon-search"></i>
120
+ ```
121
+ Most-used: arrow-down, arrow, plus, cross, search...
122
+ - An emoji (👤🚛💰⚠️...) anywhere in a prototype = automatic style FAIL.
123
+
124
+ ## Step 4: Highlight Changes + Interactivity
125
+
126
+ - Mark NEW/CHANGED elements with the template's `highlight-new` class
127
+ (subtle border + legend), so reviewers see the diff at a glance
128
+ - Minimal JavaScript: row click highlight, form expand/collapse,
129
+ tab switching, modal open/close, validation hints
130
+ - Single self-contained HTML file, no external dependencies
131
+
132
+ ## Rules
133
+
134
+ 1. **ALWAYS match the TARGET platform style** - colors, spacing, fonts come
135
+ from the template + real code, never from memory
136
+ 2. **NEVER invent new patterns** - if the project uses VxeGrid, mimic VxeGrid
137
+ 3. **Use REAL fields** - column titles and field names must come from the
138
+ actual code found in Step 2, not made up
139
+ 4. **Prototype must be interactive** - clickable buttons, fillable forms, hover states
140
+ 5. **Save to** `workspace/members/{developer}/drafts/prototype-{feature}.html`
141
+ (Both platforms -> `prototype-{feature}-web.html` + `prototype-{feature}-app.html`)
@@ -1,69 +1,69 @@
1
- ---
2
- name: spec-coder
3
- description: "严格按开发 Spec 实现代码。Implement code strictly following development Spec. 用户说'开始写代码''按规格实现''实现这个接口''把这个需求做出来'时触发。需用户确认(DANGEROUS)。"
4
- trigger: "Spec 已确认待实现时;用户说'开始写代码''按spec实现''/wl-code'"
5
- ---
6
-
7
- # Spec Coder
8
-
9
- 严格按开发 Spec 实现代码,生成符合团队规范的代码。
10
-
11
- > ⚠️ 这是 DANGEROUS 操作(会写源码)。执行前必须向用户确认。
12
-
13
- ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
14
-
15
- - `.qoder/.developer` — 当前开发者
16
- - `.qoder/.current-task` — 当前任务(含任务相关的 Spec 路径)
17
- - Spec 文件位置:`workspace/specs/REQ-{ID}-*.spec.md` 或 `workspace/tasks/{task-id}/spec.md`
18
- - 目标代码库:`data/code/`(fywl-ics 后端 / fywl-ui 前端 / Carmg-H5 移动端)
19
-
20
- ## Step 1: 定位 Spec
21
-
22
- ```bash
23
- ls workspace/specs/ # 全局 specs
24
- ls workspace/tasks/ # 任务内的 specs
25
- ```
26
-
27
- 如有多份 Spec,问用户现在实现哪一份。
28
-
29
- ## Step 2: 读取上下文
30
-
31
- 1. **Spec 文件**(必需):开发规格
32
- 2. **PRD 文件**(推荐):原始需求,理解业务背景
33
- 3. **现有代码风格**(必需):用 search_index.py 找相关模块真实代码作参考
34
- ```bash
35
- python .qoder/scripts/search_index.py <模块关键词>
36
- ```
37
- 读 top 2-3 个相似文件,照着它们的命名/结构/异常处理写
38
- 4. **架构/数据字典**(如存在):`.qoder/context/architecture.md`、`data-dictionary.md`
39
- 不存在就跳过,从现有代码推断
40
-
41
- ## Step 3: 按 Spec 实现
42
-
43
- 严格按 Spec 规格编码:
44
- - **数据层**: Entity → Mapper → Service → Controller
45
- - **接口层**: RESTful API,参数校验(JSR-303),统一 `Result<T>` 返回格式
46
- - **业务层**: 按 Spec 业务逻辑实现
47
- - **异常处理**: 按 Spec 定义的异常场景
48
- - **金额**: 一律 `BigDecimal`,不用 double/float
49
-
50
- ## Step 4: 自检
51
-
52
- - 所有 Spec 定义的接口都已实现
53
- - 数据库字段与 Spec 一致
54
- - 命名/结构跟现有同类代码一致(不另起炉灶)
55
- - 无 TODO/FIXME 残留
56
-
57
- ## Step 5: 提示生成测试
58
-
59
- 实现完成后提示:
60
- ```
61
- 代码实现完成。说"写单元测试"可生成单元测试;说"提交"可走 commit 流程。
62
- ```
63
-
64
- ## 编码原则
65
-
66
- 1. 先读后写(读现有代码再动手)
67
- 2. Spec 是契约,严格实现
68
- 3. 发现 Spec 问题提出建议,不自行修改
1
+ ---
2
+ name: spec-coder
3
+ description: "严格按开发 Spec 实现代码。Implement code strictly following development Spec. 用户说'开始写代码''按规格实现''实现这个接口''把这个需求做出来'时触发。需用户确认(DANGEROUS)。"
4
+ trigger: "Spec 已确认待实现时;用户说'开始写代码''按spec实现''/wl-code'"
5
+ ---
6
+
7
+ # Spec Coder
8
+
9
+ 严格按开发 Spec 实现代码,生成符合团队规范的代码。
10
+
11
+ > ⚠️ 这是 DANGEROUS 操作(会写源码)。执行前必须向用户确认。
12
+
13
+ ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
14
+
15
+ - `.qoder/.developer` — 当前开发者
16
+ - `.qoder/.current-task` — 当前任务(含任务相关的 Spec 路径)
17
+ - Spec 文件位置:`workspace/specs/REQ-{ID}-*.spec.md` 或 `workspace/tasks/{task-id}/spec.md`
18
+ - 目标代码库:`data/code/`(fywl-ics 后端 / fywl-ui 前端 / Carmg-H5 移动端)
19
+
20
+ ## Step 1: 定位 Spec
21
+
22
+ ```bash
23
+ ls workspace/specs/ # 全局 specs
24
+ ls workspace/tasks/ # 任务内的 specs
25
+ ```
26
+
27
+ 如有多份 Spec,问用户现在实现哪一份。
28
+
29
+ ## Step 2: 读取上下文
30
+
31
+ 1. **Spec 文件**(必需):开发规格
32
+ 2. **PRD 文件**(推荐):原始需求,理解业务背景
33
+ 3. **现有代码风格**(必需):用 search_index.py 找相关模块真实代码作参考
34
+ ```bash
35
+ python .qoder/scripts/search_index.py <模块关键词>
36
+ ```
37
+ 读 top 2-3 个相似文件,照着它们的命名/结构/异常处理写
38
+ 4. **架构/数据字典**(如存在):`.qoder/context/architecture.md`、`data-dictionary.md`
39
+ 不存在就跳过,从现有代码推断
40
+
41
+ ## Step 3: 按 Spec 实现
42
+
43
+ 严格按 Spec 规格编码:
44
+ - **数据层**: Entity → Mapper → Service → Controller
45
+ - **接口层**: RESTful API,参数校验(JSR-303),统一 `Result<T>` 返回格式
46
+ - **业务层**: 按 Spec 业务逻辑实现
47
+ - **异常处理**: 按 Spec 定义的异常场景
48
+ - **金额**: 一律 `BigDecimal`,不用 double/float
49
+
50
+ ## Step 4: 自检
51
+
52
+ - 所有 Spec 定义的接口都已实现
53
+ - 数据库字段与 Spec 一致
54
+ - 命名/结构跟现有同类代码一致(不另起炉灶)
55
+ - 无 TODO/FIXME 残留
56
+
57
+ ## Step 5: 提示生成测试
58
+
59
+ 实现完成后提示:
60
+ ```
61
+ 代码实现完成。说"写单元测试"可生成单元测试;说"提交"可走 commit 流程。
62
+ ```
63
+
64
+ ## 编码原则
65
+
66
+ 1. 先读后写(读现有代码再动手)
67
+ 2. Spec 是契约,严格实现
68
+ 3. 发现 Spec 问题提出建议,不自行修改
69
69
  4. 命名/风格跟周围代码走,不引入新范式
@@ -1,67 +1,67 @@
1
- ---
2
- name: spec-generator
3
- description: "从已确认的 PRD 自动生成开发 Spec 文档(技术规格说明)。Auto-generate development Spec documents from confirmed PRDs. 用户说'生成规格''写spec''出技术方案''把PRD转成开发文档'时触发。"
4
- trigger: "PRD 被确认/发布后自动触发;或用户说'生成Spec''写技术规格''/wl-spec'"
5
- ---
6
-
7
- # Spec Generator
8
-
9
- 从已确认的 PRD 生成开发 Spec 文档,遵循团队技术规范。
10
-
11
- ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
12
-
13
- - `.qoder/.developer` — 当前开发者
14
- - `.qoder/.current-task` — 当前任务(决定 spec 存到哪个 task 目录)
15
- - 扫描 PRD 来源目录:`data/docs/prd/`(已发布)+ `workspace/members/{dev}/drafts/REQ-*.md`(草稿)
16
- 找出还没有对应 Spec 的 PRD
17
- - 风格/字段参考:`python .qoder/scripts/search_index.py --field <字段名>` 查现有字段命名约定
18
- - 团队 Java 约定(MyBatis Plus + RESTful + BigDecimal 金额)写在本 skill 的 Step 3
19
-
20
- ## Step 1: 定位 PRD
21
-
22
- ```bash
23
- # 列出已发布的 PRD
24
- ls data/docs/prd/REQ-*.md
25
- # 列出当前开发者的草稿 PRD
26
- ls workspace/members/{developer}/drafts/REQ-*.md
27
- ```
28
-
29
- 找出"有 PRD 但无 Spec"的需求。如果有多份,问用户先做哪个。
30
-
31
- ## Step 2: 读取上下文
32
-
33
- 按优先级读取:
34
- 1. **PRD 文件**(必需):需求源
35
- 2. **历史 Spec**(推荐):扫 `workspace/specs/` 看同类需求的写法,照着写
36
- 3. **现有代码风格**(推荐):用 search_index.py 找相关模块的真实代码做参考
37
- 4. **数据字典**(如有):`.qoder/context/data-dictionary.md`(不存在则跳过,从现有 Entity 类推断)
38
-
39
- ## Step 3: 分析并生成
40
-
41
- 从 PRD 提取:
42
- - 每个用户故事 → 一个或多个 API 接口
43
- - 验收标准 → 接口入参/出参/错误场景
44
- - 数据需求 → 数据库表设计
45
- - 非功能性需求 → 约束章节
46
-
47
- ## Step 4: 输出
48
-
49
- 写到 `workspace/specs/REQ-{ID}-{module}.spec.md`(或 task 目录 `workspace/tasks/{task-id}/spec.md`)
50
-
51
- 规则:
52
- - 每条 PRD 验收标准都映射到一个 Spec 测试用例
53
- - API 路径遵循 RESTful 约定
54
- - 表名遵循 `t_{module}_{entity}`
55
- - 金额字段必须用 `BigDecimal`
56
- - 不写 PRD 未定义的功能
57
- - Entity → Mapper → Service → Controller 全栈结构
58
-
59
- ## Step 5: 通知
60
-
61
- 报告给被分配的开发者评审。
62
-
63
- ## 触发条件
64
-
65
- - 手动:用户说"生成 Spec"、"写技术规格"、"/wl-spec"
66
- - 任务驱动:PRD 评审通过后,下一步通常就是生成 Spec
1
+ ---
2
+ name: spec-generator
3
+ description: "从已确认的 PRD 自动生成开发 Spec 文档(技术规格说明)。Auto-generate development Spec documents from confirmed PRDs. 用户说'生成规格''写spec''出技术方案''把PRD转成开发文档'时触发。"
4
+ trigger: "PRD 被确认/发布后自动触发;或用户说'生成Spec''写技术规格''/wl-spec'"
5
+ ---
6
+
7
+ # Spec Generator
8
+
9
+ 从已确认的 PRD 生成开发 Spec 文档,遵循团队技术规范。
10
+
11
+ ## ⚙️ 自取上下文(Quest / QoderWork 无 hook 注入,必须自读)
12
+
13
+ - `.qoder/.developer` — 当前开发者
14
+ - `.qoder/.current-task` — 当前任务(决定 spec 存到哪个 task 目录)
15
+ - 扫描 PRD 来源目录:`data/docs/prd/`(已发布)+ `workspace/members/{dev}/drafts/REQ-*.md`(草稿)
16
+ 找出还没有对应 Spec 的 PRD
17
+ - 风格/字段参考:`python .qoder/scripts/search_index.py --field <字段名>` 查现有字段命名约定
18
+ - 团队 Java 约定(MyBatis Plus + RESTful + BigDecimal 金额)写在本 skill 的 Step 3
19
+
20
+ ## Step 1: 定位 PRD
21
+
22
+ ```bash
23
+ # 列出已发布的 PRD
24
+ ls data/docs/prd/REQ-*.md
25
+ # 列出当前开发者的草稿 PRD
26
+ ls workspace/members/{developer}/drafts/REQ-*.md
27
+ ```
28
+
29
+ 找出"有 PRD 但无 Spec"的需求。如果有多份,问用户先做哪个。
30
+
31
+ ## Step 2: 读取上下文
32
+
33
+ 按优先级读取:
34
+ 1. **PRD 文件**(必需):需求源
35
+ 2. **历史 Spec**(推荐):扫 `workspace/specs/` 看同类需求的写法,照着写
36
+ 3. **现有代码风格**(推荐):用 search_index.py 找相关模块的真实代码做参考
37
+ 4. **数据字典**(如有):`.qoder/context/data-dictionary.md`(不存在则跳过,从现有 Entity 类推断)
38
+
39
+ ## Step 3: 分析并生成
40
+
41
+ 从 PRD 提取:
42
+ - 每个用户故事 → 一个或多个 API 接口
43
+ - 验收标准 → 接口入参/出参/错误场景
44
+ - 数据需求 → 数据库表设计
45
+ - 非功能性需求 → 约束章节
46
+
47
+ ## Step 4: 输出
48
+
49
+ 写到 `workspace/specs/REQ-{ID}-{module}.spec.md`(或 task 目录 `workspace/tasks/{task-id}/spec.md`)
50
+
51
+ 规则:
52
+ - 每条 PRD 验收标准都映射到一个 Spec 测试用例
53
+ - API 路径遵循 RESTful 约定
54
+ - 表名遵循 `t_{module}_{entity}`
55
+ - 金额字段必须用 `BigDecimal`
56
+ - 不写 PRD 未定义的功能
57
+ - Entity → Mapper → Service → Controller 全栈结构
58
+
59
+ ## Step 5: 通知
60
+
61
+ 报告给被分配的开发者评审。
62
+
63
+ ## 触发条件
64
+
65
+ - 手动:用户说"生成 Spec"、"写技术规格"、"/wl-spec"
66
+ - 任务驱动:PRD 评审通过后,下一步通常就是生成 Spec
67
67
  - 子 agent:可被 prd-generator 在 PRD 确认后调度