| name | code-reviewer |
| description | Automated code review that checks code quality, Clean Architecture compliance, DDD patterns, coding standards, and spec traceability. |
Code Reviewer Skill
่งธ็ผๆๆฉ
- Pull Request ๅตๅปบๆๆดๆฐ
- ้็ผไบบๅก่ซๆฑไปฃ็ขผๅฏฉๆฅ
- CI/CD Pipeline ๅ่ณช้ๆชป
- ่
multi-model-reviewer ๅไฝๆ
ๆ ธๅฟไปปๅ
- ๆถๆงๅ่ฆๆงๆชขๆฅ๏ผ้ฉ่ญ Clean Architecture ๅๅฑค
- ็ทจ็ขผๆจๆบๆชขๆฅ๏ผ่ช่จ็นๅฎ็็ทจ็ขผ่ฆ็ฏ
- ่ฆๆ ผๅฐ็
ง๏ผ็จๅผๅฏฆไฝๆฏๅฆ็ฌฆๅ่ฆๆ ผๅฎ็พฉ
- ๆธฌ่ฉฆ่ฆ่๏ผ็ขบ่ช้้ต่ทฏๅพๆๆธฌ่ฉฆ
ๅฏฉๆฅ็ถญๅบฆ
1. Clean Architecture ๅ่ฆๆง
architecture_checks:
layer_dependency:
name: "ไพ่ณดๆนๅ"
rule: "ๅคๅฑคๅช่ฝไพ่ณดๅ
งๅฑค๏ผๅ
งๅฑคไธๅพไพ่ณดๅคๅฑค"
layers:
- adapter (ๅค) โ usecase โ entity (ๅ
ง)
violations:
- "Entity ไธๅพ import UseCase"
- "UseCase ไธๅพ import Adapter"
package_structure:
name: "ๅฅไปถ็ตๆง"
rule: "็ฌฆๅ {aggregate}/{layer}/{component} ็ตๆง"
expected:
- "{aggregate}/adapter/in/web/"
- "{aggregate}/adapter/out/persistence/"
- "{aggregate}/entity/"
- "{aggregate}/usecase/port/"
- "{aggregate}/usecase/service/"
2. DDD ๆจกๅผๆชขๆฅ
ddd_checks:
aggregate_root:
name: "Aggregate Root ่ญๅฅ"
rule: "Aggregate Root ๅฟ
้ ๆงๅถๅญๅฏฆ้ซ็็ๅฝ้ฑๆ"
markers:
- "@AggregateRoot annotation"
- "private constructor for child entities"
value_object:
name: "Value Object ไธ่ฎๆง"
rule: "Value Object ๅฟ
้ immutable"
checks:
- "record class ๆ final fields"
- "no setters"
- "equals/hashCode based on all fields"
domain_event:
name: "Domain Event ๆจๆบ"
rule: "็ฌฆๅ domain-event-standard.yaml"
checks:
- "sealed interface DomainEvent"
- "includes standard metadata"
- "occurredOn timestamp"
3. ่ช่จ็นๅฎๆจๆบ
ๅ่ๅฐๆ็็ทจ็ขผๆจๆบ๏ผ
| ่ช่จ | ๅ่ๆไปถ |
|---|
| Java | skills/coding-standards/references/JAVA_CLEAN_ARCH.md |
| TypeScript | skills/coding-standards/references/TYPESCRIPT.md |
| Go | skills/coding-standards/references/GOLANG.md |
| Rust | skills/coding-standards/references/RUST.md |
ๅฏฉๆฅๆชขๆฅๆธ
ๅฎ
Use Case Service
usecase_checks:
- id: UC1
name: "ๅฎไธ่ท่ฒฌ"
rule: "ไธๅ Service ๅช่็ไธๅ Use Case"
- id: UC2
name: "Port ไพ่ณด"
rule: "้้ Port interface ไพ่ณดๅค้จ่ณๆบ"
- id: UC3
name: "่ผธๅ
ฅ้ฉ่ญ"
rule: "Input DTO ๅจ UseCase ๅฑค้ฉ่ญ"
- id: UC4
name: "Domain Event ็ผๅธ"
rule: "็ๆ
่ฎๆดๅพ็ผๅธๅฐๆ Domain Event"
- id: UC5
name: "ไบคๆ้็"
rule: "Aggregate ๆไฝๅจๅฎไธไบคๆๅ
งๅฎๆ"
Aggregate Entity
aggregate_checks:
- id: AG1
name: "Invariant ไฟ่ญท"
rule: "ๆๆ public ๆนๆณๅฟ
้ ็ถญ่ญท invariants"
- id: AG2
name: "็งๆๅปบๆงๅญ"
rule: "Child Entity ไฝฟ็จ private/package constructor"
- id: AG3
name: "็ๆ
ๅฐ่ฃ"
rule: "ไธ็ดๆฅๆด้ฒๅฏ่ฎ้ๅ"
- id: AG4
name: "Factory Method"
rule: "่ค้็ฉไปถไฝฟ็จ Factory ๅตๅปบ"
Repository/Adapter
adapter_checks:
- id: AD1
name: "Port ๅฏฆไฝ"
rule: "Adapter ๅฟ
้ ๅฏฆไฝๅฐๆ็ Port interface"
- id: AD2
name: "ไพ่ณดๆณจๅ
ฅ"
rule: "้้ Constructor Injection"
- id: AD3
name: "้ฏ่ชค่ฝๆ"
rule: "Infrastructure ้ฏ่ชค่ฝๆ็บ Domain ้ฏ่ชค"
่ผธๅบๆ ผๅผ
ๅฏฉๆฅๅ ฑๅ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CODE REVIEW REPORT โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ File: CreateWorkflowService.java โ
โ Aggregate: Workflow โ
โ Layer: usecase/service โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ โ
โ โ
UC1: Single Responsibility PASS โ
โ โ
UC2: Port Dependency PASS โ
โ โ
UC3: Input Validation PASS โ
โ โ ๏ธ UC4: Domain Event Publication WARNING โ
โ โโ Event 'WorkflowCreated' missing 'metadata' field โ
โ โ
UC5: Transaction Boundary PASS โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ TOTAL: 4/5 PASS, 1 WARNING โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ๅ้ก่ฉณๆ
review_issues:
- id: CR-001
file: "CreateWorkflowService.java"
line: 45
severity: warning
check: UC4
message: "Domain Event 'WorkflowCreated' missing 'metadata' field"
current_code: |
return new WorkflowCreated(
workflow.getId(),
workflow.getBoardId(),
workflow.getName()
);
suggested_fix: |
return new WorkflowCreated(
workflow.getId(),
workflow.getBoardId(),
workflow.getName(),
EventMetadata.now() // Add metadata
);
spec_reference: "aggregate.yaml#domain_events.WorkflowCreated"
่ๅ
ถไป Skills ๅไฝ
โโโโโโโโโโโโโโโโโโโโโโโ
โ code-reviewer โ โโโ ๆฌ Skill
โ (ไปฃ็ขผๅฏฉๆฅ) โ
โโโโโโโโโโโโฌโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ arch-guard โ โcoding-standards โ โ multi-model- โ
โ (ๆถๆงๅฎ่ญท) โ โ (็ทจ็ขผๆจๆบ) โ โ reviewer โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
้
็ฝฎๆชๆก
.code-review.yaml
language: java
architecture: clean-architecture
checks:
architecture:
enabled: true
strict: true
coding_standards:
enabled: true
config: ".coding-standards.yaml"
spec_compliance:
enabled: true
spec_dir: "docs/specs/"
ignore:
files:
- "**/test/**"
- "**/generated/**"
rules:
- UC5
severity_thresholds:
error: 0
warning: 5