pdd-skills 3.0.0

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.
Files changed (261) hide show
  1. package/README.md +1478 -0
  2. package/bin/pdd.js +354 -0
  3. package/config/bpmn-rules.yaml +166 -0
  4. package/config/checkstyle.xml +105 -0
  5. package/config/eslint.config.js +48 -0
  6. package/config/pmd.xml +91 -0
  7. package/config/prd-rules.yaml +113 -0
  8. package/config/ruff.toml +45 -0
  9. package/config/sqlfluff.cfg +82 -0
  10. package/hooks/hook-executor.js +332 -0
  11. package/index.js +43 -0
  12. package/lib/api-routes.js +750 -0
  13. package/lib/api-server.js +408 -0
  14. package/lib/cache/cache-config.js +209 -0
  15. package/lib/cache/system-cache.js +852 -0
  16. package/lib/config-manager.js +373 -0
  17. package/lib/generate.js +528 -0
  18. package/lib/grpc/grpc-routes.js +1134 -0
  19. package/lib/grpc/grpc-server.js +912 -0
  20. package/lib/grpc/proto-definitions.js +1033 -0
  21. package/lib/init.js +172 -0
  22. package/lib/iteration/auto-fixer.js +1025 -0
  23. package/lib/iteration/auto-reviewer.js +923 -0
  24. package/lib/iteration/controller.js +577 -0
  25. package/lib/list.js +130 -0
  26. package/lib/mcp-server.js +548 -0
  27. package/lib/openclaw/api-integration.js +535 -0
  28. package/lib/openclaw/cli-integration.js +567 -0
  29. package/lib/openclaw/data-sync.js +845 -0
  30. package/lib/openclaw/openclaw-adapter.js +783 -0
  31. package/lib/plugin/example-plugins/code-stats/index.js +332 -0
  32. package/lib/plugin/example-plugins/code-stats/plugin.json +1 -0
  33. package/lib/plugin/example-plugins/custom-linter/index.js +472 -0
  34. package/lib/plugin/example-plugins/custom-linter/plugin.json +1 -0
  35. package/lib/plugin/example-plugins/hello-world/index.js +86 -0
  36. package/lib/plugin/example-plugins/hello-world/plugin.json +1 -0
  37. package/lib/plugin/plugin-manager.js +655 -0
  38. package/lib/plugin/plugin-sdk.js +565 -0
  39. package/lib/plugin/sandbox.js +627 -0
  40. package/lib/quality/rules/maintainability.js +418 -0
  41. package/lib/quality/rules/performance.js +498 -0
  42. package/lib/quality/rules/readability.js +441 -0
  43. package/lib/quality/rules/robustness.js +504 -0
  44. package/lib/quality/rules/security.js +444 -0
  45. package/lib/quality/scorer.js +576 -0
  46. package/lib/report.js +669 -0
  47. package/lib/sdk-base.js +301 -0
  48. package/lib/sdk-js.js +446 -0
  49. package/lib/sdk-python/README.md +546 -0
  50. package/lib/sdk-python/examples/basic_usage.py +450 -0
  51. package/lib/sdk-python/pdd_sdk/__init__.py +180 -0
  52. package/lib/sdk-python/pdd_sdk/client.py +1170 -0
  53. package/lib/sdk-python/pdd_sdk/events.py +423 -0
  54. package/lib/sdk-python/pdd_sdk/exceptions.py +158 -0
  55. package/lib/sdk-python/pdd_sdk/models.py +518 -0
  56. package/lib/sdk-python/pdd_sdk/utils.py +759 -0
  57. package/lib/token/budget-alert.js +367 -0
  58. package/lib/token/budget-manager.js +485 -0
  59. package/lib/update.js +54 -0
  60. package/lib/utils/logger.js +88 -0
  61. package/lib/verify.js +741 -0
  62. package/lib/version.js +52 -0
  63. package/lib/vm/README.md +102 -0
  64. package/lib/vm/dashboard/api-routes.js +669 -0
  65. package/lib/vm/dashboard/server.js +391 -0
  66. package/lib/vm/dashboard/sse.js +358 -0
  67. package/lib/vm/dashboard/static/css/dashboard.css +1378 -0
  68. package/lib/vm/dashboard/static/index.html +118 -0
  69. package/lib/vm/dashboard/static/js/app.js +949 -0
  70. package/lib/vm/dashboard/static/js/charts.js +913 -0
  71. package/lib/vm/dashboard/static/js/kanban-view.js +1053 -0
  72. package/lib/vm/dashboard/static/js/pipeline-view.js +463 -0
  73. package/lib/vm/dashboard/static/js/quality-view.js +598 -0
  74. package/lib/vm/dashboard/static/js/system-view.js +1021 -0
  75. package/lib/vm/data-provider.js +1191 -0
  76. package/lib/vm/event-bus.js +402 -0
  77. package/lib/vm/hooks/extract-hook.js +307 -0
  78. package/lib/vm/hooks/generate-hook.js +374 -0
  79. package/lib/vm/hooks/hook-interface.js +458 -0
  80. package/lib/vm/hooks/report-hook.js +331 -0
  81. package/lib/vm/hooks/verify-hook.js +454 -0
  82. package/lib/vm/models.js +1003 -0
  83. package/lib/vm/reconciler.js +855 -0
  84. package/lib/vm/scanner.js +988 -0
  85. package/lib/vm/state-schema.js +955 -0
  86. package/lib/vm/state-store.js +733 -0
  87. package/lib/vm/tui/components/card.js +339 -0
  88. package/lib/vm/tui/components/progress-bar.js +368 -0
  89. package/lib/vm/tui/components/sparkline.js +327 -0
  90. package/lib/vm/tui/components/status-light.js +294 -0
  91. package/lib/vm/tui/components/table.js +370 -0
  92. package/lib/vm/tui/input.js +335 -0
  93. package/lib/vm/tui/renderer.js +548 -0
  94. package/lib/vm/tui/screens/kanban-screen.js +397 -0
  95. package/lib/vm/tui/screens/overview-screen.js +357 -0
  96. package/lib/vm/tui/screens/quality-screen.js +336 -0
  97. package/lib/vm/tui/screens/system-screen.js +379 -0
  98. package/lib/vm/tui/tui.js +805 -0
  99. package/package.json +1 -0
  100. package/scripts/cso-analyzer.js +198 -0
  101. package/scripts/eval-runner.js +359 -0
  102. package/scripts/i18n-checker.js +109 -0
  103. package/scripts/linter/activiti-linter.js +272 -0
  104. package/scripts/linter/prd-linter.js +162 -0
  105. package/scripts/linter/report-generator.js +207 -0
  106. package/scripts/linter/run-linters.js +285 -0
  107. package/scripts/linter/sql-linter.js +166 -0
  108. package/scripts/token-analyzer.js +162 -0
  109. package/scripts/vm-test.js +180 -0
  110. package/skills/core/official-doc-writer/LICENSE +21 -0
  111. package/skills/core/official-doc-writer/README.md +232 -0
  112. package/skills/core/official-doc-writer/SKILL.md +475 -0
  113. package/skills/core/official-doc-writer/_meta.json +1 -0
  114. package/skills/core/official-doc-writer/document_generator.py +580 -0
  115. package/skills/core/official-doc-writer/evals/default-evals.json +1 -0
  116. package/skills/core/official-doc-writer/examples.md +150 -0
  117. package/skills/core/official-doc-writer/fonts/FONTS_LIST.md +45 -0
  118. package/skills/core/official-doc-writer/fonts/README.md +141 -0
  119. package/skills/core/official-doc-writer/fonts/SIMFANG.TTF +0 -0
  120. package/skills/core/official-doc-writer/fonts/SIMHEI.TTF +0 -0
  121. package/skills/core/official-doc-writer/fonts/SIMKAI.TTF +0 -0
  122. package/skills/core/official-doc-writer/fonts/SIMSUN.TTC +0 -0
  123. package/skills/core/official-doc-writer/fonts//346/226/271/346/255/243/345/260/217/346/240/207/345/256/213GBK.TTF +0 -0
  124. package/skills/core/official-doc-writer/references/GBT_9704-2012_/345/205/232/346/224/277/346/234/272/345/205/263/345/205/254/346/226/207/346/240/274/345/274/217.md +422 -0
  125. package/skills/core/official-doc-writer/scripts/__pycache__/generate_official_doc.cpython-313.pyc +0 -0
  126. package/skills/core/official-doc-writer/scripts/dialog_manager.py +564 -0
  127. package/skills/core/official-doc-writer/scripts/generate_official_doc.py +252 -0
  128. package/skills/core/official-doc-writer/scripts/install_fonts.py +390 -0
  129. package/skills/core/official-doc-writer/scripts/smart_prompts.py +363 -0
  130. package/skills/core/pdd-ba/SKILL.md +305 -0
  131. package/skills/core/pdd-ba/_meta.json +1 -0
  132. package/skills/core/pdd-ba/evals/default-evals.json +1 -0
  133. package/skills/core/pdd-code-reviewer/SKILL.md +378 -0
  134. package/skills/core/pdd-code-reviewer/_meta.json +1 -0
  135. package/skills/core/pdd-code-reviewer/evals/default-evals.json +1 -0
  136. package/skills/core/pdd-doc-change/SKILL.md +350 -0
  137. package/skills/core/pdd-doc-change/_meta.json +1 -0
  138. package/skills/core/pdd-doc-change/evals/default-evals.json +1 -0
  139. package/skills/core/pdd-doc-gardener/SKILL.md +248 -0
  140. package/skills/core/pdd-doc-gardener/_meta.json +1 -0
  141. package/skills/core/pdd-doc-gardener/evals/default-evals.json +1 -0
  142. package/skills/core/pdd-entropy-reduction/SKILL.md +360 -0
  143. package/skills/core/pdd-entropy-reduction/_meta.json +1 -0
  144. package/skills/core/pdd-entropy-reduction/evals/default-evals.json +1 -0
  145. package/skills/core/pdd-entropy-reduction/references/entropy-report-template.md +287 -0
  146. package/skills/core/pdd-entropy-reduction/references/golden-principles.md +573 -0
  147. package/skills/core/pdd-entropy-reduction/scripts/entropy_scan.py +712 -0
  148. package/skills/core/pdd-extract-features/SKILL.md +320 -0
  149. package/skills/core/pdd-extract-features/_meta.json +1 -0
  150. package/skills/core/pdd-extract-features/evals/default-evals.json +1 -0
  151. package/skills/core/pdd-generate-spec/SKILL.md +418 -0
  152. package/skills/core/pdd-generate-spec/_meta.json +1 -0
  153. package/skills/core/pdd-generate-spec/evals/default-evals.json +1 -0
  154. package/skills/core/pdd-implement-feature/SKILL.md +332 -0
  155. package/skills/core/pdd-implement-feature/_meta.json +1 -0
  156. package/skills/core/pdd-implement-feature/evals/default-evals.json +1 -0
  157. package/skills/core/pdd-main/SKILL.md +540 -0
  158. package/skills/core/pdd-main/_meta.json +1 -0
  159. package/skills/core/pdd-main/evals/default-evals.json +1 -0
  160. package/skills/core/pdd-main/evals/evals.json +215 -0
  161. package/skills/core/pdd-verify-feature/SKILL.md +474 -0
  162. package/skills/core/pdd-verify-feature/_meta.json +1 -0
  163. package/skills/core/pdd-verify-feature/evals/default-evals.json +1 -0
  164. package/skills/core/pdd-vm/evals/default-evals.json +1 -0
  165. package/skills/core/traffic-accident-assessor/LICENSE +29 -0
  166. package/skills/core/traffic-accident-assessor/SKILL.md +439 -0
  167. package/skills/core/traffic-accident-assessor/evals/evals.json +1 -0
  168. package/skills/core/traffic-accident-assessor/references/accident-types.md +369 -0
  169. package/skills/core/traffic-accident-assessor/references/liability-rules.md +287 -0
  170. package/skills/core/traffic-accident-assessor/references/traffic-laws.md +226 -0
  171. package/skills/core/traffic-accident-assessor/references//351/253/230/345/260/224/345/244/253/350/257/264/346/230/216/344/271/246.pdf +32576 -106
  172. package/skills/core/traffic-accident-assessor/scripts/generate_official_statement.py +588 -0
  173. package/skills/core/traffic-accident-assessor/scripts/generate_report.py +495 -0
  174. package/skills/core/traffic-accident-assessor/scripts/generate_statement.py +528 -0
  175. package/skills/core/traffic-accident-assessor.zip +0 -0
  176. package/skills/entropy/expert-arch-enforcer/SKILL.md +292 -0
  177. package/skills/entropy/expert-arch-enforcer/_meta.json +1 -0
  178. package/skills/entropy/expert-arch-enforcer/evals/default-evals.json +1 -0
  179. package/skills/entropy/expert-auto-refactor/SKILL.md +327 -0
  180. package/skills/entropy/expert-auto-refactor/_meta.json +1 -0
  181. package/skills/entropy/expert-auto-refactor/evals/default-evals.json +1 -0
  182. package/skills/entropy/expert-code-quality/SKILL.md +468 -0
  183. package/skills/entropy/expert-code-quality/_meta.json +1 -0
  184. package/skills/entropy/expert-code-quality/evals/default-evals.json +1 -0
  185. package/skills/entropy/expert-code-quality/evals/evals.json +109 -0
  186. package/skills/entropy/expert-code-quality/references/code-smells.md +605 -0
  187. package/skills/entropy/expert-code-quality/references/design-patterns.md +1111 -0
  188. package/skills/entropy/expert-code-quality/references/refactoring-catalog.md +1281 -0
  189. package/skills/entropy/expert-code-quality/references/solid-principles.md +524 -0
  190. package/skills/entropy/expert-entropy-auditor/SKILL.md +276 -0
  191. package/skills/entropy/expert-entropy-auditor/_meta.json +1 -0
  192. package/skills/entropy/expert-entropy-auditor/evals/default-evals.json +1 -0
  193. package/skills/expert/expert-activiti/SKILL.md +497 -0
  194. package/skills/expert/expert-activiti/_meta.json +1 -0
  195. package/skills/expert/expert-mysql/SKILL.md +832 -0
  196. package/skills/expert/expert-mysql/_meta.json +1 -0
  197. package/skills/expert/expert-performance/SKILL.md +379 -0
  198. package/skills/expert/expert-performance/_meta.json +1 -0
  199. package/skills/expert/expert-performance/evals/default-evals.json +1 -0
  200. package/skills/expert/expert-ruoyi/SKILL.md +472 -0
  201. package/skills/expert/expert-ruoyi/_meta.json +1 -0
  202. package/skills/expert/expert-security/SKILL.md +1341 -0
  203. package/skills/expert/expert-security/_meta.json +1 -0
  204. package/skills/expert/expert-security/evals/default-evals.json +1 -0
  205. package/skills/expert/software-architect/SKILL.md +350 -0
  206. package/skills/expert/software-architect/_meta.json +1 -0
  207. package/skills/expert/software-engineer/SKILL.md +437 -0
  208. package/skills/expert/software-engineer/_meta.json +1 -0
  209. package/skills/expert/software-engineer/architecture.md +130 -0
  210. package/skills/expert/software-engineer/patterns.md +151 -0
  211. package/skills/expert/software-engineer/testing.md +135 -0
  212. package/skills/expert/system-architect/SKILL.md +628 -0
  213. package/skills/expert/system-architect/_meta.json +1 -0
  214. package/skills/expert/system-architect/assets/templates/ARCHITECTURE.md +25 -0
  215. package/skills/expert/system-architect/assets/templates/README.md +44 -0
  216. package/skills/expert/system-architect/references/js-ts-standards.md +18 -0
  217. package/skills/expert/system-architect/references/python-standards.md +19 -0
  218. package/skills/expert/system-architect/references/scaffolding.md +61 -0
  219. package/skills/expert/system-architect/references/security-checklist.md +21 -0
  220. package/skills/openspec/openspec-apply-change/SKILL.md +156 -0
  221. package/skills/openspec/openspec-apply-change/_meta.json +1 -0
  222. package/skills/openspec/openspec-archive-change/SKILL.md +114 -0
  223. package/skills/openspec/openspec-archive-change/_meta.json +1 -0
  224. package/skills/openspec/openspec-bulk-archive-change/SKILL.md +246 -0
  225. package/skills/openspec/openspec-bulk-archive-change/_meta.json +1 -0
  226. package/skills/openspec/openspec-continue-change/SKILL.md +118 -0
  227. package/skills/openspec/openspec-continue-change/_meta.json +1 -0
  228. package/skills/openspec/openspec-explore/SKILL.md +288 -0
  229. package/skills/openspec/openspec-explore/_meta.json +1 -0
  230. package/skills/openspec/openspec-ff-change/SKILL.md +101 -0
  231. package/skills/openspec/openspec-ff-change/_meta.json +1 -0
  232. package/skills/openspec/openspec-new-change/SKILL.md +74 -0
  233. package/skills/openspec/openspec-new-change/_meta.json +1 -0
  234. package/skills/openspec/openspec-onboard/SKILL.md +554 -0
  235. package/skills/openspec/openspec-onboard/_meta.json +1 -0
  236. package/skills/openspec/openspec-sync-specs/SKILL.md +138 -0
  237. package/skills/openspec/openspec-sync-specs/_meta.json +1 -0
  238. package/skills/openspec/openspec-verify-change/SKILL.md +168 -0
  239. package/skills/openspec/openspec-verify-change/_meta.json +1 -0
  240. package/skills/pr/pdd-multi-review/SKILL.md +534 -0
  241. package/skills/pr/pdd-multi-review/_meta.json +1 -0
  242. package/skills/pr/pdd-pr-batch/SKILL.md +303 -0
  243. package/skills/pr/pdd-pr-batch/_meta.json +1 -0
  244. package/skills/pr/pdd-pr-create/SKILL.md +344 -0
  245. package/skills/pr/pdd-pr-create/_meta.json +1 -0
  246. package/skills/pr/pdd-pr-merge/SKILL.md +286 -0
  247. package/skills/pr/pdd-pr-merge/_meta.json +1 -0
  248. package/skills/pr/pdd-pr-review/SKILL.md +217 -0
  249. package/skills/pr/pdd-pr-review/_meta.json +1 -0
  250. package/skills/pr/pdd-task-manager/SKILL.md +636 -0
  251. package/skills/pr/pdd-task-manager/_meta.json +1 -0
  252. package/skills/pr/pdd-template-engine/SKILL.md +306 -0
  253. package/skills/pr/pdd-template-engine/_meta.json +1 -0
  254. package/templates/behavior-shaping/iron-law-template.md +87 -0
  255. package/templates/behavior-shaping/rationalization-template.md +62 -0
  256. package/templates/behavior-shaping/red-flags-template.md +70 -0
  257. package/templates/bilingual-template.md +139 -0
  258. package/templates/config/default.yaml +47 -0
  259. package/templates/project/default/README.md +31 -0
  260. package/templates/project/frontend/README.md +46 -0
  261. package/templates/project/java/README.md +48 -0
@@ -0,0 +1,418 @@
1
+ ---
2
+ name: pdd-generate-spec
3
+ description: 根据功能点矩阵生成开发规格和验收标准。当用户想要生成功能点的技术规格时调用此Skill。支持中文触发:生成规格、开发规格、技术规格、PDD规格。
4
+ license: MIT
5
+ compatibility: 需要功能点矩阵和业务分析报告
6
+ metadata:
7
+ author: "neuqik@hotmail.com"
8
+ version: "2.1"
9
+ parent: pdd-main
10
+ triggers:
11
+ - "生成开发规格" | "生成spec" | "/spec"
12
+ - "技术设计" | "接口设计" | "数据模型"
13
+ ---
14
+
15
+ # PDD-Generate Spec - 开发规格生成技能 / Development Specification Generation Skill
16
+
17
+ ## 核心概念 / Core Concepts
18
+
19
+ ### 🇨🇳
20
+
21
+ 根据功能点矩阵和业务分析报告,为每个功能点生成详细的开发规格文档(spec.md)和验收标准(checklist.md)。
22
+
23
+ **输入**: feature-matrix.md(功能点矩阵) | 业务分析报告 | **输出**: spec.md(开发规格) | checklist.md(验收标准) | **不负责**: 代码实现/测试执行
24
+
25
+ ### 🇺🇸
26
+
27
+ Based on the feature matrix and business analysis report, generate detailed development specification documents (spec.md) and acceptance criteria (checklist.md) for each feature point.
28
+
29
+ **Input**: feature-matrix.md (Feature Matrix) | Business Analysis Report | **Output**: spec.md (Development Specification) | checklist.md (Acceptance Criteria) | **Not Responsible For**: Code implementation / Test execution
30
+
31
+ ## 规格文档结构 / Specification Document Structure
32
+
33
+ ### 🇨🇳
34
+
35
+ ### spec.md 模板
36
+
37
+ ```markdown
38
+ # [模块名称] 开发规格
39
+
40
+ ## 基本信息
41
+ | 项目 | 内容 |
42
+ |------|------|
43
+ | 功能点ID | FP-XXX-NNN |
44
+ | 版本 | v1.0 |
45
+ | 日期 | YYYY-MM-DD |
46
+
47
+ ## 1. 接口定义
48
+
49
+ ### 1.1 API列表
50
+ | 序号 | 方法 | 路径 | 描述 | 认证 |
51
+
52
+ ### 1.2 接口详情
53
+ #### POST /api/{module}/create
54
+ **请求参数**: 字段名/类型/必填/说明
55
+ **响应结构**: code/msg/data
56
+ **错误码**: 错误码/描述/处理方式
57
+
58
+ ## 2. 数据模型
59
+
60
+ ### 2.1 实体关系图(文字描述)
61
+ 实体间的关系和依赖
62
+
63
+ ### 2.2 数据表设计
64
+ | 字段名 | 类型 | 必填 | 说明 |
65
+ |--------|------|------|------|
66
+
67
+ ### 2.3 枚举值定义
68
+ | 字段 | 值 | 含义 |
69
+
70
+ ## 3. 业务逻辑
71
+
72
+ ### 3.1 处理流程
73
+ 1.[步骤] → 2.[步骤] → 3.[步骤]
74
+
75
+ ### 3.2 业务规则
76
+ | 规则ID | 规则描述 | 约束类型 | 优先级 |
77
+
78
+ ### 3.3 状态转换
79
+ 当前状态 → 条件/事件 → 目标状态
80
+
81
+ ## 4. 前端页面设计
82
+
83
+ ### 4.1 页面清单
84
+ | 页面 | 路径 | 类型 |
85
+
86
+ ### 4.2 表单字段
87
+ | 字段名 | 组件类型 | 校验规则 |
88
+
89
+ ## 5. 权限与安全
90
+
91
+ ### 5.1 接口权限
92
+ | 路径 | 权限标识 | 角色 |
93
+
94
+ ### 5.2 数据权限
95
+ | 操作 | 数据范围 |
96
+ ```
97
+
98
+ ### checklist.md 模板
99
+
100
+ ```markdown
101
+ # [功能点名称] 验收标准
102
+
103
+ ## 业务验收标准
104
+ | 序号 | 验收项 | 预期结果 | 验证方法 |
105
+ |------|-------|---------|---------|
106
+
107
+ ## 技术验收标准
108
+ | 序号 | 验收项 | 标准 | 验证方法 |
109
+ |------|-------|------|---------|
110
+
111
+ ## 集成验收标准
112
+ | 序号 | 验收项 | 标准 | 验证方法 |
113
+ ```
114
+
115
+ ### 🇺🇸
116
+
117
+ ### spec.md Template
118
+
119
+ ```markdown
120
+ # [Module Name] Development Specification
121
+
122
+ ## Basic Information
123
+ | Item | Content |
124
+ |------|---------|
125
+ | Feature Point ID | FP-XXX-NNN |
126
+ | Version | v1.0 |
127
+ | Date | YYYY-MM-DD |
128
+
129
+ ## 1. API Definition
130
+
131
+ ### 1.1 API List
132
+ | No. | Method | Path | Description | Auth |
133
+
134
+ ### 1.2 API Details
135
+ #### POST /api/{module}/create
136
+ **Request Parameters**: Field Name / Type / Required / Description
137
+ **Response Structure**: code / msg / data
138
+ **Error Codes**: Error Code / Description / Handling
139
+
140
+ ## 2. Data Model
141
+
142
+ ### 2.1 Entity Relationship Diagram (Text Description)
143
+ Relationships and dependencies between entities
144
+
145
+ ### 2.2 Database Table Design
146
+ | Field Name | Type | Required | Description |
147
+ |------------|------|----------|-------------|
148
+
149
+ ### 2.3 Enumeration Value Definitions
150
+ | Field | Value | Meaning |
151
+
152
+ ## 3. Business Logic
153
+
154
+ ### 3.1 Processing Flow
155
+ 1.[Step] → 2.[Step] → 3.[Step]
156
+
157
+ ### 3.2 Business Rules
158
+ | Rule ID | Rule Description | Constraint Type | Priority |
159
+
160
+ ### 3.3 State Transitions
161
+ Current State → Condition/Event → Target State
162
+
163
+ ## 4. Frontend Page Design
164
+
165
+ ### 4.1 Page List
166
+ | Page | Path | Type |
167
+
168
+ ### 4.2 Form Fields
169
+ | Field Name | Component Type | Validation Rules |
170
+
171
+ ## 5. Permissions & Security
172
+
173
+ ### 5.1 API Permissions
174
+ | Path | Permission Identifier | Role |
175
+
176
+ ### 5.2 Data Permissions
177
+ | Operation | Data Scope |
178
+ ```
179
+
180
+ ### checklist.md Template
181
+
182
+ ```markdown
183
+ # [Feature Point Name] Acceptance Criteria
184
+
185
+ ## Business Acceptance Criteria
186
+ | No. | Acceptance Item | Expected Result | Verification Method |
187
+ |-----|----------------|-----------------|---------------------|
188
+
189
+ ## Technical Acceptance Criteria
190
+ | No. | Acceptance Item | Standard | Verification Method |
191
+ |-----|----------------|----------|---------------------|
192
+
193
+ ## Integration Acceptance Criteria
194
+ | No. | Acceptance Item | Standard | Verification Method |
195
+ ```
196
+
197
+ ## 生成流程 / Generation Process
198
+
199
+ ### 🇨🇳
200
+
201
+ ### Step 1: 读取功能点矩阵
202
+ 从 `dev-specs/feature-matrix.md` 读取功能点定义
203
+
204
+ ### Step 2: 分析功能点详情
205
+ 提取: 功能描述 | 输入字段 | 输出信息 | 业务规则 | 状态转换 | 测试策略
206
+
207
+ ### Step 3: 设计接口定义
208
+ RESTful规范 | HTTP方法语义 | URL命名规范 | 请求/响应格式 | 错误码体系
209
+
210
+ ### Step 4: 设计数据模型
211
+ 实体识别 | 属性定义 | 关系映射 | 索引设计 | 审计字段(create_time/update_time/create_by/update_by/del_flag/status)
212
+
213
+ ### Step 5: 定义业务逻辑
214
+ 核心流程 | 边界条件 | 异常处理 | 状态机转换
215
+
216
+ ### Step 6: 设计前端页面
217
+ 页面结构 | 表单布局 | 列表展示 | 交互流程
218
+
219
+ ### Step 7: 定义权限与安全
220
+ 接口权限 | 数据权限 | 输入校验 | SQL注入防护
221
+
222
+ ### Step 8: 编写验收标准
223
+ 业务场景覆盖 | 技术指标达标 | 集成测试通过
224
+
225
+ ### Step 9: 输出规格文档
226
+ 保存到 `dev-specs/FP-{序号}/spec.md` 和 `checklist.md`
227
+
228
+ ### 🇺🇸
229
+
230
+ ### Step 1: Read Feature Matrix
231
+ Read feature point definitions from `dev-specs/feature-matrix.md`
232
+
233
+ ### Step 2: Analyze Feature Point Details
234
+ Extract: Feature Description | Input Fields | Output Information | Business Rules | State Transitions | Test Strategy
235
+
236
+ ### Step 3: Design API Definitions
237
+ RESTful Conventions | HTTP Method Semantics | URL Naming Conventions | Request/Response Format | Error Code System
238
+
239
+ ### Step 4: Design Data Model
240
+ Entity Identification | Attribute Definition | Relationship Mapping | Index Design | Audit Fields (create_time/update_time/create_by/update_by/del_flag/status)
241
+
242
+ ### Step 5: Define Business Logic
243
+ Core Flow | Edge Cases | Exception Handling | State Machine Transitions
244
+
245
+ ### Step 6: Design Frontend Pages
246
+ Page Structure | Form Layout | List Display | Interaction Flow
247
+
248
+ ### Step 7: Define Permissions & Security
249
+ API Permissions | Data Permissions | Input Validation | SQL Injection Protection
250
+
251
+ ### Step 8: Write Acceptance Criteria
252
+ Business Scenario Coverage | Technical Metrics Compliance | Integration Test Pass
253
+
254
+ ### Step 9: Output Specification Documents
255
+ Save to `dev-specs/FP-{sequence}/spec.md` and `checklist.md`
256
+
257
+ ## Guardrails / 质量护栏
258
+
259
+ ### 🇨🇳
260
+
261
+ **必须遵守**: 接口定义必须符合RESTful规范 | 数据模型必须包含审计字段 | 业务规则必须标注优先级 | 验收标准必须可测试可验证
262
+
263
+ **避免事项**: ❌ 接口路径不符合RESTful规范 | ❌ 数据模型缺少审计字段 | ❌ 业务规则模糊无法验证 | ❌ 验收标准不可测试
264
+
265
+ ### 🇺🇸
266
+
267
+ **Must Follow**: API definitions must comply with RESTful conventions | Data models must include audit fields | Business rules must be marked with priority levels | Acceptance criteria must be testable and verifiable
268
+
269
+ **Avoid**: ❌ API paths that do not follow RESTful conventions | ❌ Data models missing audit fields | ❌ Business rules that are vague and unverifiable | ❌ Acceptance criteria that are not testable
270
+
271
+ ## 与其他技能协作 / Collaboration with Other Skills
272
+
273
+ ### 🇨🇳
274
+
275
+ | 协作技能 | 协作方式 | 传入数据 | 期望输出 |
276
+ |---------|---------|---------|---------|
277
+ | **pdd-extract-features** | Sequential | 功能点矩阵 | 功能点详情 |
278
+ | **pdd-ba** | Sequential | 业务分析报告 | 用例/流程/状态 |
279
+ | **system-architect** | Consultation | 架构需求 | 架构建议 |
280
+ | **software-architect** | Consultation | 模块需求 | 模块设计 |
281
+ | **pdd-implement-feature** | Sequential | spec.md + checklist.md | 代码实现 |
282
+
283
+ ### 🇺🇸
284
+
285
+ | Collaborating Skill | Collaboration Mode | Input Data | Expected Output |
286
+ |---------------------|-------------------|------------|-----------------|
287
+ | **pdd-extract-features** | Sequential | Feature Matrix | Feature Point Details |
288
+ | **pdd-ba** | Sequential | Business Analysis Report | Use Cases / Flows / States |
289
+ | **system-architect** | Consultation | Architecture Requirements | Architecture Recommendations |
290
+ | **software-architect** | Consultation | Module Requirements | Module Design |
291
+ | **pdd-implement-feature** | Sequential | spec.md + checklist.md | Code Implementation |
292
+
293
+ ## 人工审核规范 / Human Review Guidelines
294
+
295
+ ### 🇨🇳
296
+
297
+ **审核节点**: 开发规格生成完成后需要人工审核
298
+
299
+ **审核内容**: 接口设计合理性 | 数据模型完整性 | 业务逻辑正确性 | 验收标准完备性
300
+
301
+ **审核粒度**:
302
+ - **批量审核**: 快速浏览整体,标记需详细审核的内容
303
+ - **关键功能点详细审核**: P0优先级 | 复杂状态转换 | 外部系统集成 | 敏感数据处理
304
+
305
+ **输出文件**: `review-spec.md` | **结果类型**: passed / rejected / conditional
306
+
307
+ ### 🇺🇸
308
+
309
+ **Review Checkpoint**: Human review is required after development specification generation is complete
310
+
311
+ **Review Content**: API design rationality | Data model completeness | Business logic correctness | Acceptance criteria completeness
312
+
313
+ **Review Granularity**:
314
+ - **Batch Review**: Quickly scan the overall content and flag items requiring detailed review
315
+ - **Detailed Review for Critical Features**: P0 priority | Complex state transitions | External system integration | Sensitive data handling
316
+
317
+ **Output File**: `review-spec.md` | **Result Types**: passed / rejected / conditional
318
+
319
+ ---
320
+
321
+ ## Iron Law / 铁律
322
+
323
+ ### 🇨🇳
324
+
325
+ 1. **规格驱动实现**: 生成的spec.md必须是后续代码实现的唯一依据,所有接口定义、数据模型、业务规则都必须在规格中明确声明,不得让实现者自行推断。
326
+
327
+ 2. **验收标准可测试性**: checklist.md中的每条验收标准都必须是客观的、可验证的,不得出现"界面美观""响应迅速"等主观描述。
328
+
329
+ 3. **前后端一致性**: 规格中的接口定义必须同时适用于后端实现和前端调用,前端API层应能直接基于规格生成。
330
+
331
+ 4. **完整性与简洁性平衡**: 规格必须足够详细以指导实现(不遗漏关键细节),但也要避免过度详细导致维护成本过高。
332
+
333
+ 5. **变更追溯性**: 规格中每个决策(如选择某种数据结构、设计某个接口)都应有简要的理由说明或引用来源,便于后续审查和理解。
334
+
335
+ **违规示例**: ❌ 接口只写了路径而未定义请求参数和响应结构 | ❌ 验收标准写"用户体验良好"而非具体指标 | ❌ 后端规格与前端实际调用的字段名不一致 | ❌ 为了省事将规格写得过于简略导致实现者频繁询问 | ❌ 数据库设计了联合索引但未说明查询场景
336
+
337
+ **合规示例**: ✅ 每个接口都包含完整的请求/响应定义和错误码列表 | ✅ 验收标准明确:"列表接口响应时间<500ms(1000条数据)" | ✅ 前后端使用同一份接口规格作为开发依据 | ✅ 规格详细但不冗余:关键决策有注释,常规内容用表格呈现 | ✅ 索引设计附带说明:"支持按status+create_time的组合查询"
338
+
339
+ ### 🇺🇸
340
+
341
+ 1. **Specification-Driven Implementation**: The generated spec.md must be the sole basis for subsequent code implementation. All API definitions, data models, and business rules must be explicitly declared in the specification — implementers must not be left to make their own inferences.
342
+
343
+ 2. **Acceptance Criteria Testability**: Each acceptance criterion in checklist.md must be objective and verifiable. Subjective descriptions such as "beautiful UI" or "fast response" are prohibited.
344
+
345
+ 3. **Frontend-Backend Consistency**: API definitions in the specification must be applicable to both backend implementation and frontend invocation. The frontend API layer should be able to generate code directly based on the specification.
346
+
347
+ 4. **Balance of Completeness and Conciseness**: The specification must be sufficiently detailed to guide implementation (without omitting key details), but should avoid excessive detail that leads to high maintenance costs.
348
+
349
+ 5. **Change Traceability**: Every decision in the specification (such as choosing a data structure or designing an API) should include a brief rationale or reference source for subsequent review and understanding.
350
+
351
+ **Violation Examples**: ❌ An API only has a path defined without request parameters and response structure | ❌ Acceptance criterion says "good user experience" instead of specific metrics | ❌ Backend spec field names are inconsistent with what the frontend actually calls | ❌ Specification is overly brief to save effort, causing implementers to frequently ask questions | ❌ Database composite index is designed without explaining the query scenario
352
+
353
+ **Compliance Examples**: ✅ Every API includes complete request/response definitions and error code list | ✅ Acceptance criterion is explicit: "List API response time < 500ms (1000 records)" | ✅ Frontend and backend use the same API specification as development basis | ✅ Specification is detailed but not redundant: key decisions have comments, routine content uses tables | ✅ Index design includes explanation: "Supports combined queries by status + create_time"
354
+
355
+ ---
356
+
357
+ ## Rationalization Table / 理性化对照表
358
+
359
+ ### 🇨🇳
360
+
361
+ | # | 陷阱 / Trap | 请问自己 / Ask Yourself | 应该怎么做 / Action |
362
+ |---|------------|----------------------|---------------------|
363
+ | 1 | "这个接口很简单,写个路径就行了" / "This API is simple, just write the path" | 简单的接口也需要明确的参数定义,否则实现者会自行猜测 / Even simple APIs need clear parameter definitions, otherwise implementers will guess | 即使是最简单的CRUD接口也必须定义完整的请求/响应结构 / Even the simplest CRUD APIs must have complete request/response structure defined |
364
+ | 2 | "验收标准差不多就行,反正后面会测" / "Acceptance criteria is good enough, it will be tested later anyway" | 模糊的验收标准会导致验收阶段扯皮,且无法客观判断是否通过 / Vague acceptance criteria leads to disputes during acceptance and makes objective judgment impossible | 每条标准都必须量化或提供明确的判定方法 / Every criterion must be quantified or provide a clear determination method |
365
+ | 3 | "前端后面再对吧,先完成后端" / "Let's do frontend later, finish backend first" | 前后端不一致是集成阶段最常见的问题 / Frontend-backend inconsistency is the most common problem in integration phase | 规格生成时就必须同步考虑前后端,确保接口定义的双向适用性 / Frontend and backend must be considered together during spec generation to ensure bidirectional applicability |
366
+ | 4 | "这些细节实现者应该知道" / "Implementers should know these details" | 不同开发者有不同的理解和习惯,细节缺失会导致实现差异 / Different developers have different understandings and habits; missing details lead to implementation divergence | 将你认为"显而易见"的细节都显式写入规格,特别是边界条件 / Explicitly write all "obvious" details into the specification, especially edge cases |
367
+ | 5 | "规格写得太长没人看" / "The spec is too long, no one will read it" | 过于简略的规格会导致频繁沟通,反而浪费更多时间 / Overly brief specs cause frequent communication and waste more time | 采用分层详略策略:概览+详细表格,让读者可按需深入 / Adopt a layered detail strategy: overview + detailed tables, allowing readers to drill down as needed |
368
+
369
+ **常见陷阱 / Common Traps**:
370
+ 1. **"假 completeness"陷阱 / "Fake Completeness" Trap**: 看起来覆盖了所有章节但每章内容空洞 → 建立"章节质量检查":每章至少回答What/Who/How三个问题 / Appears to cover all sections but each section is empty → Establish "section quality check": each section must answer at least What/Who/How questions
371
+ 2. **"主观验收"陷阱 / "Subjective Acceptance" Trap**: 使用无法客观验证的描述作为验收标准 → 强制要求每条标准可通过自动化测试或明确步骤验证 / Uses unverifiable descriptions as acceptance criteria → Require every criterion to be verifiable via automated tests or explicit steps
372
+ 3. **"后端偏见"陷阱 / "Backend Bias" Trap**: 规格只关注后端实现而忽略前端需求 → 强制要求规格包含"前端适配"章节,明确Vue组件需要的数据结构 / Spec focuses only on backend implementation while ignoring frontend requirements → Require spec to include "Frontend Adaptation" section with data structures needed by Vue components
373
+ 4. **"快照思维"陷阱 / "Snapshot Thinking" Trap**: 将规格视为静态文档而不考虑变更管理 → 在规格模板中内置CHANGELOG区域,鼓励记录变更历史 / Treats spec as a static document without considering change management → Build CHANGELOG area into spec template to encourage recording change history
374
+
375
+ ### 🇺🇸
376
+
377
+ | # | Trap / 陷阱 | Question | Action |
378
+ |---|------------|----------|--------|
379
+ | 1 | "This API is simple, just write the path" / 这个接口很简单,写个路径就行了 | Even simple APIs need clear parameter definitions, otherwise implementers will guess / 简单的接口也需要明确的参数定义,否则实现者会自行猜测 | Even the simplest CRUD APIs must have complete request/response structure defined / 即使是最简单的CRUD接口也必须定义完整的请求/响应结构 |
380
+ | 2 | "Acceptance criteria is good enough, it will be tested later anyway" / 验收标准差不多就行,反正后面会测 | Vague acceptance criteria leads to disputes during acceptance and makes objective judgment impossible / 模糊的验收标准会导致验收阶段扯皮,且无法客观判断是否通过 | Every criterion must be quantified or provide a clear determination method / 每条标准都必须量化或提供明确的判定方法 |
381
+ | 3 | "Let's do frontend later, finish backend first" / 前端后面再对吧,先完成后端 | Frontend-backend inconsistency is the most common problem in integration phase / 前后端不一致是集成阶段最常见的问题 | Frontend and backend must be considered together during spec generation to ensure bidirectional applicability / 规格生成时就必须同步考虑前后端,确保接口定义的双向适用性 |
382
+ | 4 | "Implementers should know these details" / 这些细节实现者应该知道 | Different developers have different understandings and habits; missing details lead to implementation divergence / 不同开发者有不同的理解和习惯,细节缺失会导致实现差异 | Explicitly write all "obvious" details into the specification, especially edge cases / 将你认为"显而易见"的细节都显式写入规格,特别是边界条件 |
383
+ | 5 | "The spec is too long, no one will read it" / 规格写得太长没人看 | Overly brief specs cause frequent communication and waste more time / 过于简略的规格会导致频繁沟通,反而浪费更多时间 | Adopt a layered detail strategy: overview + detailed tables, allowing readers to drill down as needed / 采用分层详略策略:概览+详细表格,让读者可按需深入 |
384
+
385
+ **Common Traps / 常见陷阱**:
386
+ 1. **"Fake Completeness" Trap / "假 completeness"陷阱**: Appears to cover all sections but each section is empty → Establish "section quality check": each section must answer at least What/Who/How questions / 看起来覆盖了所有章节但每章内容空洞 → 建立"章节质量检查":每章至少回答What/Who/How三个问题
387
+ 2. **"Subjective Acceptance" Trap / "主观验收"陷阱**: Uses unverifiable descriptions as acceptance criteria → Require every criterion to be verifiable via automated tests or explicit steps / 使用无法客观验证的描述作为验收标准 → 强制要求每条标准可通过自动化测试或明确步骤验证
388
+ 3. **"Backend Bias" Trap / "后端偏见"陷阱**: Spec focuses only on backend implementation while ignoring frontend requirements → Require spec to include "Frontend Adaptation" section with data structures needed by Vue components / 规格只关注后端实现而忽略前端需求 → 强制要求规格包含"前端适配"章节,明确Vue组件需要的数据结构
389
+ 4. **"Snapshot Thinking" Trap / "快照思维"陷阱**: Treats spec as a static document without considering change management → Build CHANGELOG area into spec template to encourage recording change history / 将规格视为静态文档而不考虑变更管理 → 在规格模板中内置CHANGELOG区域,鼓励记录变更历史
390
+
391
+ ---
392
+
393
+ ## Red Flags / 红旗警告
394
+
395
+ ### Layer 1: 输入检查 / Input Validation Guards
396
+
397
+ - **INPUT-GS-001**: 功能点矩阵为空或缺少功能点详情 → 🔴 CRITICAL → 终止并提示先完成功能点提取 / Feature matrix is empty or missing feature point details → 🔴 CRITICAL → Terminate and prompt to complete feature extraction first
398
+ - **INPUT-GS-002**: 业务分析报告缺少用例或状态定义 → 🔴 CRITICAL → 提示补充完整的业务分析后再生成规格 / Business analysis report is missing use cases or state definitions → 🔴 CRITICAL → Prompt to supplement complete business analysis before generating specs
399
+ - **INPUT-GS-003**: 功能点的复杂度标记(P0/P1/P2)与实际描述不符 → 🟡 WARN → 记录并在规格中标注可能的复杂度评估偏差 / Feature point complexity marking (P0/P1/P2) does not match actual description → 🟡 WARN → Record and flag possible complexity assessment deviation in spec
400
+
401
+ ### Layer 2: 执行检查 / Execution Validation Guards
402
+
403
+ - **EXEC-GS-001**: 接口定义缺少请求参数或响应结构的详细说明 → 🔴 CRITICAL → 补充完整的接口定义 / API definition is missing detailed request parameters or response structure → 🔴 CRITICAL → Supplement complete API definition
404
+ - **EXEC-GS-002**: 数据模型缺少审计字段(create_time等)或主键定义 → 🔴 CRITICAL → 补充标准的审计字段和主键 / Data model is missing audit fields (create_time, etc.) or primary key definition → 🔴 CRITICAL → Supplement standard audit fields and primary key
405
+ - **EXEC-GS-003**: 验收标准存在无法客观验证的条目 → 🟡 WARN → 重写为可量化的或可明确判定的标准 / Acceptance criteria contains items that cannot be objectively verified → 🟡 WARN → Rewrite as quantifiable or clearly determinable criteria
406
+ - **EXEC-GS-004**: 规格中的业务规则与业务分析报告矛盾 → 🔴 CRITICAL → 以业务分析为准修正规格或记录冲突并请用户确认 / Business rules in spec contradict business analysis report → 🔴 CRITICAL → Correct spec based on business analysis or record conflict and ask user for confirmation
407
+
408
+ ### Layer 3: 输出检查 / Output Validation Guards
409
+
410
+ - **OUTPUT-GS-001**: spec.md缺少必要的章节(接口定义/数据模型/业务逻辑) → 🔴 CRITICAL → 补充缺失的章节 / spec.md is missing required sections (API definition/data model/business logic) → 🔴 CRITICAL → Supplement missing sections
411
+ - **OUTPUT-GS-002**: checklist.md的验收标准少于5条或明显不足以覆盖主要功能 → 🔴 CRITICAL → 补充更完善的验收标准 / checklist.md has fewer than 5 acceptance criteria or is clearly insufficient to cover main functionality → 🔴 CRITICAL → Supplement more comprehensive acceptance criteria
412
+ - **OUTPUT-GS-003**: 规格文件的保存路径不符合规范(不在dev-specs/FP-{序号}/下) → 🟡 WARN → 移动到正确的目录位置 / Spec file save path does not conform to standards (not under dev-specs/FP-{sequence}/) → 🟡 WARN → Move to correct directory location
413
+
414
+ ### 触发Red Flag时的处理流程 / Red Flag Trigger Handling Process
415
+
416
+ 🔴 CRITICAL → 立即停止,报告问题详情,等待指示 | 🟡 WARN → 记录警告到规格日志,尝试自动修复,在最终报告中标注 | 🔵 INFO → 记录信息,正常继续
417
+
418
+ 🔴 CRITICAL → Stop immediately, report problem details, wait for instructions / 立即停止,报告问题详情,等待指示 | 🟡 WARN → Log warning to spec log, attempt auto-fix, annotate in final report / 记录警告到规格日志,尝试自动修复,在最终报告中标注 | 🔵 INFO → Log information, continue normally / 记录信息,正常继续
@@ -0,0 +1 @@
1
+ {"name": "pdd-generate-spec", "version": "1.0.0", "category": "core", "description": "Generate development specifications with acceptance criteria from feature points using Given/When/Then format. Call this Skill when users need to create spec documents, define acceptance criteria, or translate features into technical requirements. 支持中文触发:生成规格、开发规格、验收标准、功能规格、技术规格。", "triggers": ["生成规格", "开发规格", "验收标准", "功能规格", "写规格", "generate spec", "development spec", "acceptance criteria", "tech specification"]}
@@ -0,0 +1 @@
1
+ [{"name": "SKILL.md-exists", "description": "技能文件存在", "type": "structure", "checks": {"file_exists": "SKILL.md"}}, {"name": "_meta.json-valid", "description": "元数据有效", "type": "structure", "checks": {"file_exists": "_meta.json"}}, {"name": "has-behavior-shaping", "description": "行为塑造完整", "type": "quality", "contains": ["Iron Law", "Rationalization", "Red Flags"]}, {"name": "spec-template-defined", "description": "规格文档模板已定义", "type": "content", "contains": ["规格", "spec", "模板", "template", "验收标准"]}, {"name": "acceptance-criteria-format", "description": "验收标准格式规范(Given/When/Then)", "type": "content", "contains": ["验收", "Given", "When", "Then", "AC"]}]