بنقرة واحدة
pdd-code-reviewer
PDD框架下的代码审查Skill,验证功能点实现是否符合开发规格和验收标准。当需要代码审查或验证代码质量时自动触发。支持中文触发:代码审查、代码review、PDD审查、质量检查。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
PDD框架下的代码审查Skill,验证功能点实现是否符合开发规格和验收标准。当需要代码审查或验证代码质量时自动触发。支持中文触发:代码审查、代码review、PDD审查、质量检查。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
"PDD框架下的业务分析Skill,运用专业方法论进行需求分析和业务建模。当用户输入/analyze、/audit、/doc等命令,或需要对业务流程、管理制度、Excel表单进行专业分析时触发。支持中文触发:业务分析、需求分析、需求建模、5W1H分析、MECE、流程分析。"
"PDD熵减智能体,持续监控和偿还技术债务,防止系统腐化。当用户需要代码清理、文档更新、技术债务管理、架构对齐、熵减、垃圾回收、清理技术债务时自动触发。即使用户只说'熵减'、'清理技术债务'或'垃圾回收',也应触发此Skill。支持中文触发:熵减、技术债务、代码清理、文档更新、架构对齐、垃圾回收。"
根据开发规格实现功能点代码的核心Skill。当用户想要开始编码实现、根据规格文档生成代码、实现功能点时调用此Skill。此Skill会自动调用pdd-template-engine生成基础代码框架,然后由software-engineer补充业务逻辑。即使只有规格文档没有明确说'实现',只要涉及代码生成、功能开发,都应触发此Skill。支持中文触发:实现功能点、编码实现、开始编码、功能开发、代码实现、PDD实现。
PRD驱动开发的主入口Skill,协调整个开发流程。当用户想要基于PRD文档进行功能开发、从需求文档生成代码、执行PDD方法论流程、开发业务模块、实现完整功能、'搞个功能'、'资产转让'、'国有产权转让'、'帮我搞个资产转让的功能'时必须调用此Skill。即使用户没有明确说'使用PDD',只要涉及PRD文档、需求文档、功能点开发、规格文档、模块开发、根据文档开发、业务功能实现、'开发ZCCZ'、'我想开发'、'搞个功能'等场景,都应触发此Skill。此Skill会自动协调pdd-ba、pdd-extract-features、pdd-generate-spec、pdd-implement-feature等子Skill完成从需求分析到代码交付的完整流程。注意:单一接口设计、调试问题、文档查询等场景不应触发此Skill。支持中文触发:PRD驱动开发、PDD开发、功能开发、启动PDD。
"交通事故责任评估与判定专业技能。当用户需要交通事故责任分析、事故现场照片评估、交通法规咨询、事故责任划分、法律依据查询时触发此技能。适用于车辆碰撞事故、行人事故、非机动车事故等各类道路交通事故的责任认定场景。无论用户使用'交通事故'、'车祸'、'责任判定'、'交通法规'、'事故定责'等何种表述,只要涉及交通事故评估或责任认定,均应调用此技能。支持中文触发:交通事故、车祸、责任判定、交通法规、事故定责、责任划分、事故评估、追尾、碰撞、违章、赔偿。"
自动化重构专家技能,将收集到的质量改进任务转化为具体的代码操作。当用户需要代码重构、消除重复、简化复杂度时自动触发。即使用户只说'重构代码'、'消除重复'或'简化代码',也应触发此Skill。支持中文触发:重构代码、消除重复、简化复杂度、自动重构、代码重构、PDD重构。
| name | pdd-code-reviewer |
| description | PDD框架下的代码审查Skill,验证功能点实现是否符合开发规格和验收标准。当需要代码审查或验证代码质量时自动触发。支持中文触发:代码审查、代码review、PDD审查、质量检查。 |
| license | MIT |
| compatibility | 需要先完成代码实现 |
| metadata | {"author":"neuqik@hotmail.com","version":"2.1","parent":"pdd-main"} |
输入: 代码文件 | 开发规格(spec.md) | 验收标准(checklist.md)
输出: 审查报告(docs/reviews/review-{timestamp}.md) | 问题列表(issues)
| 架构师技能 | 触发条件 | 服务内容 |
|---|---|---|
| software-architect | 发现架构偏离、接口设计问题 | 架构建议、设计模式 |
| system-architect | 发现系统架构问题 | 系统架构评审 |
| Architect Skill | Trigger Condition | Service Content |
|---|---|---|
| software-architect | Architecture deviation, interface design issues detected | Architecture advice, design patterns |
| system-architect | System architecture issues detected | System architecture review |
| 专家技能 | 触发条件 | 服务内容 |
|---|---|---|
| expert-code-quality | 发现代码异味、重构需求 | 重构方案、设计模式 |
| expert-ruoyi | 发现若依框架使用问题 | 框架最佳实践 |
| expert-mysql | 发现SQL问题 | 优化建议 |
| Expert Skill | Trigger Condition | Service Content |
|---|---|---|
| expert-code-quality | Code smells, refactoring needs detected | Refactoring plans, design patterns |
| expert-ruoyi | RuoYi framework usage issues detected | Framework best practices |
| expert-mysql | SQL issues detected | Optimization suggestions |
必须进行基础审查: 所有代码文件必须经过基础审查 | 对照规格验证实现完整性
按需调用架构师: 发现模块边界不清 | 发现接口设计偏离 | 发现架构模式问题
按需调用专家: 发现代码质量问题 | 发现框架使用问题 | 发现数据库设计问题
Mandatory Basic Review: All code files must undergo basic review | Verify implementation completeness against specs
On-demand Architect Invocation: Unclear module boundaries detected | Interface design deviation detected | Architecture pattern issues detected
On-demand Expert Invocation: Code quality issues detected | Framework usage issues detected | Database design issues detected
完整模式定义参见
config/bug-patterns.yaml,以下为检查清单摘要
Full pattern definitions in
config/bug-patterns.yaml, below is a checklist summary
功能实现与规格严重不符 | 核心业务流程有错误 | 严重的安全漏洞 | 数据一致性问题
Severe deviation from spec implementation | Core business flow errors | Critical security vulnerabilities | Data consistency issues
代码可读性问题 | 错误处理不完善 | 潜在性能问题 | 不符合编码规范
Code readability issues | Incomplete error handling | Potential performance issues | Coding standard violations
代码优化建议 | 重构建议 | 最佳实践推荐
Code optimization suggestions | Refactoring recommendations | Best practice recommendations
后端(Controller/Service/Mapper/Domain) | 前端(Vue组件/API接口) | 数据库脚本(SQL)
Backend (Controller/Service/Mapper/Domain) | Frontend (Vue components/API interfaces) | Database scripts (SQL)
从 dev-specs/FP-{序号}/spec.md 读取规格定义
Read spec definitions from dev-specs/FP-{sequence}/spec.md
a. 接口审查: 接口路径/请求方法/参数处理/响应结构是否正确匹配规格
b. 业务逻辑审查: 处理流程/状态转换/校验规则是否正确
c. 数据模型审查: 字段映射/类型定义/审计字段是否完整
d. Bug模式库匹配: 读取 config/bug-patterns.yaml 中的Bug模式库,逐条检查代码是否触犯已知模式(PATTERN-001PATTERN-007, PATTERN-R001R007)
e. UX一致性审查: 对照PRD组件映射表检查表单组件、Options API使用、布局一致性
a. API Review: Do API paths/request methods/parameter handling/response structures correctly match specs
b. Business Logic Review: Are processing flows/state transitions/validation rules correct
c. Data Model Review: Are field mappings/type definitions/audit fields complete
d. Bug Pattern Library Matching: Read bug pattern library from config/bug-patterns.yaml, check code against known patterns (PATTERN-001007, PATTERN-R001R007)
e. UX Consistency Review: Check form components, Options API usage, layout consistency against PRD component mapping
调用 expert-code-quality(如发现代码质量问题): 代码异味检测 | 重构建议 | 设计模式推荐
Invoke expert-code-quality (if code quality issues detected): Code smell detection | Refactoring suggestions | Design pattern recommendations
调用 software-architect(如发现架构问题): 模块边界检查 | 接口设计检查 | 架构模式检查
Invoke software-architect (if architecture issues detected): Module boundary check | Interface design check | Architecture pattern check
输出到 docs/reviews/review-{timestamp}.md:
# 代码审查报告
## 基本信息
| 项目 | 内容 |
|------|------|
| 功能点 | FP-XXX-NNN |
| 审查日期 | {日期} |
| 审查人 | AI |
## 审查结果
### 通过项 | CRITICAL问题 | WARNING问题 | SUGGESTION问题
(包含: 序号/问题描述/文件/建议)
### Bug模式库匹配结果
> 完整模式定义: `config/bug-patterns.yaml`
| PATTERN编号 | 是否触犯 | 文件位置 | 说明 |
|------------|---------|---------|------|
| PATTERN-001 | ☐是 ☐否 | | datetime字段类型 |
| PATTERN-002 | ☐是 ☐否 | | /options路由顺序 |
| PATTERN-003 | ☐是 ☐否 | | 枚举编码规范 |
| PATTERN-004 | ☐是 ☐否 | | safeAlert使用 |
| PATTERN-005 | ☐是 ☐否 | | my-tasks查询条件 |
| PATTERN-007 | ☐是 ☐否 | | 编号生成检查 |
| PATTERN-R001 | ☐是 ☐否 | | 若依权限注解 |
| PATTERN-R002 | ☐是 ☐否 | | 若依菜单配置 |
| PATTERN-R003 | ☐是 ☐否 | | 若依数据权限 |
| PATTERN-R005 | ☐是 ☐否 | | 若依参数校验 |
| PATTERN-R006 | ☐是 ☐否 | | 若依XSS防护 |
| PATTERN-R008 | ☐是 ☐否 | | API路径拼接一致性 |
| PATTERN-R009 | ☐是 ☐否 | | 附件参数类型 |
| PATTERN-R010 | ☐是 ☐否 | | 审批日志记录 |
| PATTERN-R011 | ☐是 ☐否 | | 状态字典同步 |
| PATTERN-R012 | ☐是 ☐否 | | MyBatis多参数@Param |
### UX一致性审查结果
| 检查项 | 是否通过 | 说明 |
|--------|---------|------|
| 表单组件映射 | ☐是 ☐否 | |
| Options API使用 | ☐是 ☐否 | |
| 列表页布局一致性 | ☐是 ☐否 | |
| 权限控制(RuoYi) | ☐是 ☐否 | |
| 错误提示方式 | ☐是 ☐否 | |
## 结论
- [ ] 通过审查
- [ ] 需要修复后重新审查
Output to docs/reviews/review-{timestamp}.md:
# Code Review Report
## Basic Information
| Item | Content |
|------|---------|
| Feature Point | FP-XXX-NNN |
| Review Date | {date} |
| Reviewer | AI |
## Review Results
### Passed Items | CRITICAL Issues | WARNING Issues | SUGGESTION Issues
(Includes: sequence number/description/file/suggestion)
### Bug Pattern Library Matching Results
> Full pattern definitions: `config/bug-patterns.yaml`
| PATTERN ID | Violated? | File Location | Notes |
|------------|-----------|---------------|-------|
| PATTERN-001 | ☐Yes ☐No | | datetime field type |
| PATTERN-002 | ☐Yes ☐No | | /options route order |
| PATTERN-003 | ☐Yes ☐No | | Enum coding convention |
| PATTERN-004 | ☐Yes ☐No | | safeAlert usage |
| PATTERN-005 | ☐Yes ☐No | | my-tasks query condition |
| PATTERN-007 | ☐Yes ☐No | | ID generation check |
| PATTERN-R001 | ☐Yes ☐No | | RuoYi permission annotation |
| PATTERN-R002 | ☐Yes ☐No | | RuoYi menu configuration |
| PATTERN-R003 | ☐Yes ☐No | | RuoYi data scope |
| PATTERN-R005 | ☐Yes ☐No | | RuoYi parameter validation |
| PATTERN-R006 | ☐Yes ☐No | | RuoYi XSS protection |
| PATTERN-R008 | ☐Yes ☐No | | API path concatenation consistency |
| PATTERN-R009 | ☐Yes ☐No | | File upload parameter type |
| PATTERN-R010 | ☐Yes ☐No | | Approval log recording |
| PATTERN-R011 | ☐Yes ☐No | | Status dictionary sync |
| PATTERN-R012 | ☐Yes ☐No | | MyBatis multi-param @Param |
### UX Consistency Review Results
| Check Item | Passed? | Notes |
|------------|---------|-------|
| Form component mapping | ☐Yes ☐No | |
| Options API usage | ☐Yes ☐No | |
| List page layout consistency | ☐Yes ☐No | |
| Permission control (RuoYi) | ☐Yes ☐No | |
| Error message method | ☐Yes ☐No | |
## Conclusion
- [ ] Passed review
- [ ] Requires fix and re-review
{"critical": [...], "warning": [...], "suggestion": [...]}
{"critical": [...], "warning": [...], "suggestion": [...]}
| 技能 | 定位 | 核心职责 | 阻塞性 |
|---|---|---|---|
| pdd-code-reviewer | 流程合规性审查 | 验证代码是否实现规格要求 | Critical问题阻塞 |
| expert-code-quality | 代码质量深度分析 | 识别代码异味、推荐设计模式、重构建议 | 不阻塞流程 |
| Skill | Position | Core Responsibility | Blocking |
|---|---|---|---|
| pdd-code-reviewer | Process compliance review | Verify code implements spec requirements | Critical issues block |
| expert-code-quality | Code quality deep analysis | Identify code smells, recommend design patterns, refactoring suggestions | Non-blocking |
代码实现完成 → pdd-code-reviewer(合规性审查) → [有Critical]返回修复 | [无Critical] → expert-code-quality(质量深度分析) → 生成质量改进任务(improvement-tasks.md,不阻塞) → 进入pdd-verify-feature
Code implementation complete → pdd-code-reviewer (compliance review) → [Has Critical] return for fix | [No Critical] → expert-code-quality (quality deep analysis) → Generate quality improvement tasks (improvement-tasks.md, non-blocking) → Enter pdd-verify-feature
| 问题来源 | 级别 | 是否阻塞 | 处理方式 |
|---|---|---|---|
| pdd-code-reviewer | Critical | ✅ 阻塞 | 必须修复后才能继续 |
| pdd-code-reviewer | Warning/Suggestion | ❌ 不阻塞 | 记录,建议修复/可选优化 |
| expert-code-quality | 任何级别 | ❌ 不阻塞 | 记录到质量改进清单 |
质量改进任务处理时机: 模块所有功能点完成后统一处理 | 输出: dev-specs/FP-{模块}-{序号}/improvement-tasks.md
| Issue Source | Level | Blocking? | Handling Method |
|---|---|---|---|
| pdd-code-reviewer | Critical | ✅ Block | Must fix before proceeding |
| pdd-code-reviewer | Warning/Suggestion | ❌ Non-blocking | Record, suggest fix/optional optimization |
| expert-code-quality | Any level | ❌ Non-blocking | Record to quality improvement list |
Quality Improvement Task Timing: Process uniformly after all feature points in module are complete | Output: dev-specs/FP-{module}-{sequence}/improvement-tasks.md
| 协作技能 | 协作方式 | 传入数据 | 期望输出 |
|---|---|---|---|
| software-architect | Consultation | 架构问题 | 架构建议 |
| system-architect | Consultation | 系统问题 | 系统建议 |
| expert-code-quality | Consultation | 代码问题 | 重构方案 |
| pdd-implement-feature | Loop | 问题列表 | 修复后的代码 |
| pdd-verify-feature | Sequential | 审查通过的代码 | 验收报告 |
| Collaborating Skill | Collaboration Mode | Input Data | Expected Output |
|---|---|---|---|
| software-architect | Consultation | Architecture issues | Architecture advice |
| system-architect | Consultation | System issues | System advice |
| expert-code-quality | Consultation | Code issues | Refactoring plan |
| pdd-implement-feature | Loop | Issue list | Fixed code |
| pdd-verify-feature | Sequential | Code passed review | Acceptance report |
规格对照优先: 代码审查的核心是验证实现是否符合规格,而非评判代码"好坏"。所有Critical问题必须基于规格的明确要求。
职责边界清晰: pdd-code-reviewer负责合规性审查(是否实现了规格要求),代码质量深度分析(设计模式、重构建议)委托给expert-code-quality,不得越界做深度质量分析。
问题必须可操作: 每个问题都必须包含具体的文件位置、问题描述和修复建议,不得给出模糊的"代码质量有待提高"式反馈。
架构问题必升级: 发现模块边界不清、接口设计偏离等架构问题时,必须调用software-architect或system-architect,不得自行做出架构判断。
Critical阻塞原则: Critical问题必须修复后才能通过审查,不得因"时间紧"而降级为Warning或忽略。
Spec-First Principle: The core of code review is to verify whether implementation conforms to specs, not to judge whether code is "good" or "bad". All CRITICAL issues must be based on explicit spec requirements.
Clear Responsibility Boundaries: pdd-code-reviewer is responsible for compliance review (whether spec requirements are implemented). Deep code quality analysis (design patterns, refactoring suggestions) should be delegated to expert-code-quality. Do not overstep into deep quality analysis.
Issues Must Be Actionable: Every issue must include specific file location, issue description, and fix suggestion. Do not give vague feedback like "code quality needs improvement".
Architecture Issues Must Escalate: When architecture issues such as unclear module boundaries or interface design deviation are detected, must invoke software-architect or system-architect. Do not make architecture judgments independently.
CRITICAL Blocking Principle: CRITICAL issues must be fixed before passing review. Do not downgrade to Warning or ignore due to "tight schedule".
❌ 以个人编码偏好提出Critical问题 | ❌ 在code-reviewer中深入分析代码异味并提出重构方案 | ❌ 写"Service层实现有问题"而不指出具体方法 | ❌ 发现模块依赖方向错误但不调用software-architect | ❌ SQL注入风险标记为Suggestion级别
❌ Raising CRITICAL issues based on personal coding preferences | ❌ Deeply analyzing code smells and proposing refactoring plans in code-reviewer | ❌ Writing "Service layer implementation has problems" without specifying the exact method | ❌ Detecting module dependency direction errors but not invoking software-architect | ❌ Marking SQL injection risks as Suggestion level
✅ 每个Critical问题引用spec.md具体章节 | ✅ 发现代码异味时转交expert-code-quality深度分析 | ✅ 问题描述精确:"TransferApplyServiceImpl.java:142 缺少底价校验逻辑,规格要求参考BR-001" | ✅ 发现模块依赖错误时调用software-architect | ✅ SQL注入问题标记为Critical并阻止通过
✅ Each CRITICAL issue references specific sections in spec.md | ✅ Delegate to expert-code-quality for deep analysis when code smells are detected | ✅ Precise issue description: "TransferApplyServiceImpl.java:142 Missing floor price validation logic, refer to BR-001 in specs" | ✅ Invoke software-architect when module dependency errors are detected | ✅ Mark SQL injection as CRITICAL and block passage
| # | Trap / 陷阱 | Question / 请问自己 | Action / 应该怎么做 |
|---|---|---|---|
| 1 | "这段代码写法不好看" / "This code doesn't look good" | 代码风格偏好不是Critical问题的依据,除非违反项目规范 / Code style preference is not a basis for CRITICAL issues unless it violates project standards | 区分"风格偏好"和"规范违规",只有后者才能作为Critical问题 / Distinguish between "style preference" and "standard violation"; only the latter can be a CRITICAL issue |
| 2 | "这个重构很重要,我直接提吧" / "This refactoring is important, I'll just propose it" | 重构建议属于质量分析范畴,应在expert-code-quality阶段处理 / Refactoring suggestions belong to quality analysis and should be handled in expert-code-quality phase | 记录为Suggestion级别的改进建议,不阻塞当前流程 / Record as Suggestion-level improvement, do not block current workflow |
| 3 | "架构问题我大概知道怎么改,直接说吧" / "I roughly know how to fix this architecture issue, let me just say it" | 架构决策影响范围广,需要专业评估 / Architecture decisions have wide impact and require professional evaluation | 必须调用架构师技能获取正式建议后再整合到报告中 / Must invoke architect skills to get formal advice before integrating into report |
| 4 | "这个问题有点严重,但不想让实现者返工" / "This issue is somewhat serious, but I don't want the implementer to rework" | 放宽标准会导致缺陷流入生产环境,后续修复成本更高 / Relaxing standards will cause defects to enter production, with higher future fix costs | 坚持按标准分级,Critical就是Critical,不能因人情放宽 / Stick to standard classification; CRITICAL is CRITICAL, cannot relax due to personal relationships |
| 5 | "这个安全问题应该不会触发吧" / "This security issue probably won't be triggered" | 安全问题一旦被利用就是重大事故,不能抱侥幸心态 / Once exploited, security issues become major incidents; cannot rely on luck | 所有安全漏洞(SQL注入/XSS/权限绕过)一律定为Critical / All security vulnerabilities (SQL injection/XSS/authorization bypass) must be classified as CRITICAL |
config/bug-patterns.yaml 中的severity级别标记问题并引用PATTERN编号🔴 CRITICAL → 立即停止,报告问题详情,等待指示 | 🟡 WARN → 记录警告到审查日志,尝试自动修复,在最终报告中标注 | 🔵 INFO → 记录信息,正常继续
🔴 CRITICAL → Stop immediately, report issue details, await instructions | 🟡 WARN → Log warning to review log, attempt auto-fix, annotate in final report | 🔵 INFO → Record information, continue normally