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,332 @@
1
+ ---
2
+ name: pdd-implement-feature
3
+ description: Implement feature point code based on development specifications. Call this Skill when users want to start coding implementation. 支持中文触发:实现功能点、编码实现、开始编码、功能开发、代码实现、PDD实现。
4
+ license: MIT
5
+ compatibility: Requires specification generation to be completed first
6
+ metadata:
7
+ author: neuqik@hotmail.com
8
+ version: "2.0"
9
+ parent: pdd-main
10
+ ---
11
+
12
+ # Feature Point Implementation - 基于开发规格的功能点实现 / Feature Point Code Implementation Based on Development Specifications
13
+
14
+ **输入**: spec.md(开发规格) | checklist.md(验收标准) | test-cases.md(测试用例,可选)
15
+ **Input**: spec.md (Development Spec) | checklist.md (Acceptance Criteria) | test-cases.md (Test Cases, Optional)
16
+
17
+ **输出**: 代码文件 | 验收报告
18
+ **Output**: Code Files | Acceptance Report
19
+
20
+ ## 技能集成 / Skill Integration
21
+
22
+ ### 🇨🇳 Software Engineer 调用
23
+
24
+ | 调用时机 | 服务内容 |
25
+ |---------|---------|
26
+ | 代码实现 | 基于规格执行代码实现 |
27
+ | 单元测试 | 编写单元测试和集成测试 |
28
+ | 代码重构 | 按编码规范优化代码 |
29
+ | 缺陷修复 | 错误处理和问题解决 |
30
+
31
+ ### 🇺🇸 Software Engineer Invocation
32
+
33
+ | Trigger | Service |
34
+ |---------|---------|
35
+ | Code Implementation | Execute code implementation based on specifications |
36
+ | Unit Testing | Write unit tests and integration tests |
37
+ | Code Refactoring | Optimize code per coding standards |
38
+ | Defect Fixing | Error handling and issue resolution |
39
+
40
+ ### 🇨🇳 Expert Skill 调用(按需)
41
+
42
+ | 专家技能 | 触发条件 | 期望输出 |
43
+ |---------|---------|---------|
44
+ | **expert-ruoyi** | 若依框架问题 | 解决方案+最佳实践 |
45
+ | **expert-activiti** | 工作流问题 | BPMN设计建议 |
46
+ | **expert-mysql** | 数据库问题 | SQL优化方案 |
47
+ | **expert-code-quality** | 代码质量问题 | 重构方案 |
48
+
49
+ ### 🇺🇸 Expert Skill Invocation (On-Demand)
50
+
51
+ | Expert Skill | Trigger Condition | Expected Output |
52
+ |-------------|------------------|-----------------|
53
+ | **expert-ruoyi** | RuoYi framework issues | Solution + Best Practices |
54
+ | **expert-activiti** | Workflow issues | BPMN design recommendations |
55
+ | **expert-mysql** | Database issues | SQL optimization plan |
56
+ | **expert-code-quality** | Code quality issues | Refactoring plan |
57
+
58
+ ## 流程步骤 / Process Steps
59
+
60
+ ### 🇨🇳 Step 1: 读取开发规格
61
+ 从 `dev-specs/FP-{序号}/spec.md` 读取: 接口定义 | 数据模型 | 业务逻辑 | 测试用例
62
+
63
+ ### 🇺🇸 Step 1: Read Development Specification
64
+ Read from `dev-specs/FP-{sequence}/spec.md`: API Definitions | Data Models | Business Logic | Test Cases
65
+
66
+ ### 🇨🇳 Step 2: 读取验收标准
67
+ 从 `dev-specs/FP-{序号}/checklist.md` 读取验收项
68
+
69
+ ### 🇺🇸 Step 2: Read Acceptance Criteria
70
+ Read acceptance items from `dev-specs/FP-{sequence}/checklist.md`
71
+
72
+ ### 🇨🇳 Step 3: 确定实现顺序
73
+ 依赖顺序: 数据模型→数据库脚本 → 后端接口(Controller/Service/Mapper) → 前端页面(Vue组件)
74
+
75
+ ### 🇺🇸 Step 3: Determine Implementation Order
76
+ Dependency order: Data Model → Database Scripts → Backend APIs (Controller/Service/Mapper) → Frontend Pages (Vue Components)
77
+
78
+ ### 🇨🇳 Step 4: 生成数据库脚本
79
+ 基于数据模型生成SQL(含审计字段: create_time/update_time/create_by/update_by/del_flag/status)
80
+
81
+ ### 🇺🇸 Step 4: Generate Database Scripts
82
+ Generate SQL based on data model (including audit fields: create_time/update_time/create_by/update_by/del_flag/status)
83
+
84
+ ### 🇨🇳 Step 5: 生成后端代码(委托 software-engineer)
85
+ Domain实体类(@Data/@TableName) | Mapper接口(@Mapper/BaseMapper) | Service接口和实现(@Service/ServiceImpl) | Controller(@RestController/@RequestMapping)
86
+
87
+ ### 🇺🇸 Step 5: Generate Backend Code (Delegate to software-engineer)
88
+ Domain Entity Classes (@Data/@TableName) | Mapper Interfaces (@Mapper/BaseMapper) | Service Interface & Implementation (@Service/ServiceImpl) | Controller (@RestController/@RequestMapping)
89
+
90
+ ### 🇨🇳 Step 6: 生成前端代码(委托 software-engineer)
91
+ API接口(request封装) | Vue组件(template/script/data/methods)
92
+
93
+ ### 🇺🇸 Step 6: Generate Frontend Code (Delegate to software-engineer)
94
+ API Interfaces (request wrapper) | Vue Components (template/script/data/methods)
95
+
96
+ ### 🇨🇳 Step 7: 实现业务逻辑
97
+ 处理流程 | 校验规则 | 状态转换 | 异常处理
98
+
99
+ **专家咨询(按需)**: RuoYi问题→expert-ruoyi | 数据库问题→expert-mysql
100
+
101
+ ### 🇺🇸 Step 7: Implement Business Logic
102
+ Process Flow | Validation Rules | State Transitions | Exception Handling
103
+
104
+ **Expert Consultation (On-Demand)**: RuoYi Issues → expert-ruoyi | Database Issues → expert-mysql
105
+
106
+ ### 🇨🇳 Step 8: 运行测试验证
107
+ 单元测试 | 接口测试 | 集成测试
108
+
109
+ ### 🇺🇸 Step 8: Run Test Verification
110
+ Unit Tests | API Tests | Integration Tests
111
+
112
+ ### 🇨🇳 Step 9: 更新验收状态
113
+ 更新checklist.md中的验收状态
114
+
115
+ ### 🇺🇸 Step 9: Update Acceptance Status
116
+ Update acceptance status in checklist.md
117
+
118
+ ### 🇨🇳 Step 10: 生成验收报告
119
+ 输出: 业务验收 | 技术验收 | 问题日志 | 结论(通过/不通过)
120
+
121
+ ### 🇺🇸 Step 10: Generate Acceptance Report
122
+ Output: Business Acceptance | Technical Acceptance | Issue Log | Conclusion (Pass/Fail)
123
+
124
+ ## 代码标准 / Code Standards
125
+
126
+ ### 🇨🇳 后端标准
127
+ 类名PascalCase | 方法名camelCase | 常量UPPER_SNAKE_CASE | 注释Javadoc格式
128
+
129
+ ### 🇺🇸 Backend Standards
130
+ Class names PascalCase | Method names camelCase | Constants UPPER_SNAKE_CASE | Comments in Javadoc format
131
+
132
+ ### 🇨🇳 前端标准
133
+ 组件名PascalCase | 方法名camelCase | CSS类名kebab-case | ES6+语法
134
+
135
+ ### 🇺🇸 Frontend Standards
136
+ Component names PascalCase | Method names camelCase | CSS class names kebab-case | ES6+ syntax
137
+
138
+ ### 🇨🇳 software-engineer 标准
139
+ 先读现有代码风格再写新代码 | 错误处理优先 | 保持最小化 | PR-ready代码
140
+
141
+ ### 🇺🇸 software-engineer Standards
142
+ Read existing code style before writing new code | Error handling first | Keep it minimal | PR-ready code
143
+
144
+ ## PR管理提示(功能点完成后)/ PR Management Tips (After Feature Point Completion)
145
+
146
+ ### 🇨🇳
147
+ 完成并验证通过后,**提示**用户可手动调用PR管理技能:
148
+ - `/pdd-pr-create {change-id}` - 创建PR并执行自动审查
149
+ - `/pdd-pr-review {change-id}` - 查看PR审查结果
150
+ - `/pdd-pr-merge {change-id}` - 合并PR并归档
151
+
152
+ **重要**: PDD框架**不会自动调用** pdd-pr-* 技能,需用户**手动决定**是否使用PR管理功能。
153
+
154
+ ### 🇺🇸
155
+ After completion and verification, **prompt** the user to manually invoke PR management skills:
156
+ - `/pdd-pr-create {change-id}` - Create PR and execute auto-review
157
+ - `/pdd-pr-review {change-id}` - View PR review results
158
+ - `/pdd-pr-merge {change-id}` - Merge PR and archive
159
+
160
+ **Important**: The PDD framework **will NOT automatically call** pdd-pr-* skills. Users must **manually decide** whether to use PR management features.
161
+
162
+ ## 错误处理与回退规范 / Error Handling & Rollback Rules
163
+
164
+ ### 🇨🇳 错误分级
165
+ Critical(必须修复,阻塞流程) | Warning(建议修复,非阻塞) | Suggestion(可选优化)
166
+
167
+ ### 🇺🇸 Error Classification
168
+ Critical (Must fix, blocks process) | Warning (Recommended fix, non-blocking) | Suggestion (Optional optimization)
169
+
170
+ ### 🇨🇳 重试策略
171
+ 限制: 每个功能点最多3次 | 超限: 暂停流程,等待人工决策
172
+
173
+ ### 🇺🇸 Retry Strategy
174
+ Limit: Max 3 retries per feature point | Exceeded: Pause process, await human decision
175
+
176
+ ### 🇨🇳 回退规则
177
+ pdd-code-reviewer审查失败 → 返回pdd-implement-feature重新实现 | pdd-verify-feature验证失败 → 返回pdd-implement-feature重新验证
178
+
179
+ ### 🇺🇸 Rollback Rules
180
+ pdd-code-reviewer review failed → Return to pdd-implement-feature for re-implementation | pdd-verify-feature verification failed → Return to pdd-implement-feature for re-verification
181
+
182
+ ### 🇨🇳 失败记录
183
+ 位置: `dev-specs/FP-{模块}-{序号}/review-report.md`
184
+ 内容: 失败时间/阶段/原因/尝试次数/相关错误日志
185
+
186
+ ### 🇺🇸 Failure Record
187
+ Location: `dev-specs/FP-{module}-{sequence}/review-report.md`
188
+ Content: Failure time / Stage / Reason / Attempt count / Related error logs
189
+
190
+ ## Guardrails
191
+
192
+ ### 🇨🇳
193
+ - 代码必须符合项目标准
194
+ - 必须实现规格中定义的所有接口
195
+ - 必须处理规格中定义的所有异常
196
+ - 必须通过所有验收项才能标记完成
197
+ - 代码变更后必须同步更新规格文档
198
+ - **遇到技术问题时必须咨询专家技能**
199
+ - **代码实现必须遵循software-engineer标准**
200
+ - **功能点完成后提示用户可用PR管理技能,但不自动调用**
201
+
202
+ ### 🇺🇸
203
+ - Code must comply with project standards
204
+ - All interfaces defined in the specification must be implemented
205
+ - All exceptions defined in the specification must be handled
206
+ - Must pass all acceptance items before marking as complete
207
+ - Specification documents must be updated synchronously after code changes
208
+ - **Must consult expert skills when encountering technical issues**
209
+ - **Code implementation must follow software-engineer standards**
210
+ - **After feature point completion, prompt user about PR management skills but do not auto-invoke**
211
+
212
+ ---
213
+
214
+ ## Iron Law / 铁律
215
+
216
+ ### 🇨🇳
217
+
218
+ 1. **规格即法律**: 代码实现必须严格遵循spec.md的定义,不得擅自添加规格中未定义的功能,也不得遗漏规格要求的任何接口或字段。
219
+
220
+ 2. **委托不替代**: 遇到框架特定问题时,必须调用对应的expert技能获取方案,不得凭猜测或通用知识硬编码。
221
+
222
+ 3. **错误处理优先**: 业务逻辑实现前,必须先完成参数校验、异常处理、边界条件等防御性代码,不得只写"快乐路径"。
223
+
224
+ 4. **代码标准对齐**: 生成的代码风格必须与项目现有代码保持一致,编写前先阅读同类模块的现有代码。
225
+
226
+ 5. **验收驱动开发**: 每完成一个接口实现,立即对照checklist.md进行自检,不要等到全部写完再统一检查。
227
+
228
+ **违规示例**: ❌ 实现了规格中未定义的功能(功能蔓延) | ❌ 遇到若依权限注解问题时不调用expert-ruoyi | ❌ 只实现正常流程未处理异常情况 | ❌ 使用与项目不同的命名风格 | ❌ 写完所有代码后才运行发现编译错误
229
+
230
+ **合规示例**: ✅ 严格按照spec.md的接口列表逐个实现 | ✅ 遇到@PreAuthorize问题时调用expert-ruoyi | ✅ 每个Service方法开头进行参数校验 | ✅ 先阅读现有TransferApplyController保持相同风格 | ✅ 每完成一个Controller方法立即测试
231
+
232
+ ### 🇺🇸
233
+
234
+ 1. **Specification is Law**: Code implementation must strictly follow the definitions in spec.md. Do not arbitrarily add features not defined in the specification, nor omit any interfaces or fields required by the spec.
235
+
236
+ 2. **Delegate, Don't Substitute**: When encountering framework-specific issues, you must invoke the corresponding expert skill to obtain a solution. Do not hard-code based on guesses or generic knowledge.
237
+
238
+ 3. **Error Handling First**: Before implementing business logic, you must complete defensive code including parameter validation, exception handling, and boundary conditions. Do not only write the "happy path".
239
+
240
+ 4. **Code Standard Alignment**: The generated code style must be consistent with the existing project code. Read the existing code of similar modules before writing new code.
241
+
242
+ 5. **Acceptance-Driven Development**: After completing each interface implementation, immediately self-check against checklist.md. Do not wait until all code is written to perform a unified check.
243
+
244
+ **Violation Examples**: ❌ Implemented features not defined in the spec (feature creep) | ❌ Did not invoke expert-ruoyi when encountering RuoYi permission annotation issues | ❌ Only implemented normal flow without handling exceptions | ❌ Used naming conventions different from the project | ❌ Ran tests only after writing all code and discovered compilation errors
245
+
246
+ **Compliance Examples**: ✅ Implemented each interface one by one strictly following the spec.md interface list | ✅ Invoked expert-ruoyi when encountering @PreAuthorize issues | ✅ Performed parameter validation at the beginning of each Service method | ✅ Read existing TransferApplyController first to maintain consistent style | ✅ Tested immediately after completing each Controller method
247
+
248
+ ---
249
+
250
+ ## Rationalization Table / 理性化对照表
251
+
252
+ ### 🇨🇳
253
+
254
+ | # | 你可能的想法 / Trap | 请问自己 / Question | 应该怎么做 / Action |
255
+ |---|-------------------|-------------------|-------------------|
256
+ | 1 | "这个功能用户可能需要,顺便加上吧" | 未在规格中的功能是范围蔓延,会导致验收失败 | 严格按规格实现,额外需求走正式变更流程 |
257
+ | 2 | "这个框架问题我以前遇到过" | 框架版本差异可能导致旧方案失效 | 直接调用对应expert技能获取经过验证的解决方案 |
258
+ | 3 | "异常处理后面统一加" | 异常处理后置往往意味着永远不会加 | 在写业务逻辑前先搭建好异常处理骨架 |
259
+ | 4 | "项目代码风格太乱了,我按我的习惯写吧" | 不一致的代码风格会增加维护负担 | 先阅读现有代码,适配项目既有风格 |
260
+ | 5 | "先全部写完再一起测试" | 大批量代码调试难度远高于增量验证 | 采用TDD思维:实现一个就验证一个 |
261
+
262
+ **常见陷阱**:
263
+ 1. **"规格偏离"陷阱**: 实现过程中逐渐偏离规格要求 → 建立实现清单,每完成一项打勾并与规格对照
264
+ 2. **"框架硬扛"陷阱**: 遇到框架问题反复尝试而不求助专家 → 设定"3次尝试规则",3次未解决必须调用expert
265
+ 3. **"快乐路径"陷阱**: 只实现正常流程忽略异常处理 → 强制异常覆盖率:每个public方法必须有try-catch
266
+ 4. **"风格割裂"陷阱**: 新代码与项目现有代码风格不一致 → 实现"先读后写"规则
267
+
268
+ ### 🇺🇸
269
+
270
+ | # | You Might Think / Trap | Ask Yourself / Question | What To Do / Action |
271
+ |---|----------------------|----------------------|--------------------|
272
+ | 1 | "Users might need this feature, let me add it too" | Features not in the spec are scope creep and will cause acceptance failure | Implement strictly per spec; extra requirements go through formal change process |
273
+ | 2 | "I've encountered this framework issue before" | Framework version differences may render old solutions invalid | Invoke the corresponding expert skill to get a verified solution |
274
+ | 3 | "I'll add exception handling later" | Postponed exception handling often means it never gets added | Build the exception handling skeleton before writing business logic |
275
+ | 4 | "The project code style is messy, I'll write in my own style" | Inconsistent code style increases maintenance burden | Read existing code first and adapt to project conventions |
276
+ | 5 | "I'll test everything after writing all the code" | Debugging a large batch of code is far harder than incremental verification | Adopt TDD mindset: implement one, verify one |
277
+
278
+ **Common Traps**:
279
+ 1. **"Spec Drift" Trap**: Gradually deviating from spec requirements during implementation → Create an implementation checklist; check off each item against the spec
280
+ 2. **"Framework Stubbornness" Trap**: Repeatedly trying to solve framework issues without consulting experts → Enforce "3-attempt rule": must invoke expert after 3 failed attempts
281
+ 3. **"Happy Path" Trap**: Only implementing normal flow while ignoring exception handling → Enforce exception coverage: every public method must have try-catch
282
+ 4. **"Style Fragmentation" Trap**: New code inconsistent with existing project code style → Implement "read-first, write-later" rule
283
+
284
+ ---
285
+
286
+ ## Red Flags / 红旗警告
287
+
288
+ ### Layer 1: 输入检查 / Input Validation Guards
289
+
290
+ #### 🇨🇳
291
+ - **INPUT-IMPL-001**: spec.md或checklist.md不存在 → 🔴 CRITICAL → 终止并提示先生成开发规格
292
+ - **INPUT-IMPL-002**: spec.md缺少接口定义或数据模型章节 → 🔴 CRITICAL → 提示规格文档不完整
293
+ - **INPUT-IMPL-003**: 项目路径不存在或无法访问 → 🔴 CRITICAL → 终止并检查项目路径配置
294
+
295
+ #### 🇺🇸
296
+ - **INPUT-IMPL-001**: spec.md or checklist.md does not exist → 🔴 CRITICAL → Terminate and prompt to generate development specification first
297
+ - **INPUT-IMPL-002**: spec.md is missing API definitions or data model sections → 🔴 CRITICAL → Prompt that specification document is incomplete
298
+ - **INPUT-IMPL-003**: Project path does not exist or is inaccessible → 🔴 CRITICAL → Terminate and check project path configuration
299
+
300
+ ### Layer 2: 执行检查 / Execution Guards
301
+
302
+ #### 🇨🇳
303
+ - **EXEC-IMPL-001**: 实现了规格中未定义的接口或字段 → 🟡 WARN → 标记为"超出规格",请用户确认
304
+ - **EXEC-IMPL-002**: 遇到框架相关问题但未调用expert技能而自行硬编码 → 🔴 CRITICAL → 回退修改,调用expert获取正确方案
305
+ - **EXEC-IMPL-003**: 代码存在空指针风险(未做null检查) → 🟡 WARN → 补充null检查或Optional
306
+ - **EXEC-IMPL-004**: SQL语句存在注入风险(字符串拼接) → 🔴 CRITICAL → 必须使用参数化查询
307
+
308
+ #### 🇺🇸
309
+ - **EXEC-IMPL-001**: Implemented interfaces or fields not defined in the specification → 🟡 WARN → Mark as "out of scope" and request user confirmation
310
+ - **EXEC-IMPL-002**: Encountered framework-related issues but hard-coded without invoking expert skills → 🔴 CRITICAL → Rollback changes, invoke expert for correct solution
311
+ - **EXEC-IMPL-003**: Code has null pointer risk (no null checks performed) → 🟡 WARN → Add null checks or use Optional
312
+ - **EXEC-IMPL-004**: SQL statements have injection risk (string concatenation) → 🔴 CRITICAL → Must use parameterized queries
313
+
314
+ ### Layer 3: 输出检查 / Output Validation Guards
315
+
316
+ #### 🇨🇳
317
+ - **OUTPUT-IMPL-001**: 代码文件有语法错误(无法编译) → 🔴 CRITICAL → 修复后再标记完成
318
+ - **OUTPUT-IMPL-002**: 规格要求的接口未全部实现 → 🔴 CRITICAL → 补充遗漏的实现
319
+ - **OUTPUT-IMPL-003**: 代码文件路径不符合规范(如放在asset-system下) → 🔴 CRITICAL → 移动到正确路径
320
+
321
+ #### 🇺🇸
322
+ - **OUTPUT-IMPL-001**: Code files have syntax errors (cannot compile) → 🔴 CRITICAL → Fix before marking as complete
323
+ - **OUTPUT-IMPL-002**: Not all interfaces required by the specification are implemented → 🔴 CRITICAL → Supplement missing implementations
324
+ - **OUTPUT-IMPL-003**: Code file path does not conform to standards (e.g., placed under asset-system) → 🔴 CRITICAL → Move to correct path
325
+
326
+ ### 触发Red Flag时的处理流程 / Red Flag Trigger Handling
327
+
328
+ #### 🇨🇳
329
+ 🔴 CRITICAL → 立即停止,报告问题详情,等待指示 | 🟡 WARN → 记录警告,尝试自动修复,在报告中标注 | 🔵 INFO → 记录信息,正常继续
330
+
331
+ #### 🇺🇸
332
+ 🔴 CRITICAL → Stop immediately, report issue details, await instructions | 🟡 WARN → Record warning, attempt auto-fix, annotate in report | 🔵 INFO → Log information, continue normally
@@ -0,0 +1 @@
1
+ {"name": "pdd-implement-feature", "version": "1.0.0", "category": "core", "description": "Implement feature point code based on development specifications with proper error handling and architecture compliance. Call this Skill when users want to start coding implementation, write production-ready code, or translate specs into executable features. 支持中文触发:实现功能点、编码实现、开始编码、功能开发、代码实现、写代码、PDD实现。", "triggers": ["实现功能", "编码实现", "开始编码", "代码实现", "写代码", "implement feature", "code implementation", "write code", "start coding", "PDD implement"]}
@@ -0,0 +1 @@
1
+ [{"name": "SKILL.md-exists", "description": "技能文件存在且格式正确", "type": "structure", "expect": {"exists": true, "hasDescription": true}, "checks": {"file_exists": "SKILL.md"}}, {"name": "_meta.json-valid", "description": "元数据文件格式正确", "type": "structure", "expect": {"exists": true, "hasName": true, "hasVersion": true, "hasTriggers": true}, "checks": {"file_exists": "_meta.json"}}, {"name": "has-behavior-shaping", "description": "包含完整的行为塑造章节", "type": "quality", "expect": {"complete": true}, "contains": ["Iron Law", "Rationalization", "Red Flags"]}, {"name": "implementation-flow-defined", "description": "定义了功能点编码实现流程", "type": "content", "contains": ["实现", "编码", "代码", "开发规格", "spec"]}, {"name": "error-handling-specified", "description": "明确了错误处理和边界条件处理方式", "type": "content", "contains": ["错误处理", "异常", "边界", "error"]} ]