assets/skills/review/architect/SKILL.md
DDD architecture compliance review with automated checks and review loop. Use when user says "architect-review", "architecture review", "review architecture", "check architecture", "review ddd", "ddd review".
npx skillsauth add phuthuycoding/moicle review-architectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit a codebase (or a single domain) against DDD rules with automated checks, manual review, and a fix loop until score ≥ B.
/feature-new or /feature-refactor/review-pr/review-branch@security-audit agent/review-architect <architecture> [domain]
/review-architect # auto-detect stack
Examples: /review-architect go-backend wallet, /review-architect react-frontend.
Aliases: ddd → ddd-architecture, go → go-backend, react → react-frontend, flutter → flutter-mobile, laravel → laravel-backend, remix → remix-fullstack, nestjs → nodejs-nestjs, mono → monorepo.
Files live at .claude/architecture/{name}.md (project) → ~/.claude/architecture/{name}.md (global).
RESOLVE → LOAD RULES → AUTOMATED CHECKS → MANUAL REVIEW → REPORT → FIX LOOP
~/.claude/architecture/_shared/stack-detection.mdRead ddd-architecture.md (core) + the stack doc. Extract:
Run the stack-specific check scripts from the architecture doc. They follow this universal pattern (adapt per stack):
echo "R1: Build" ; {build} && echo PASS || echo FAIL
echo "R2: Lint/Vet" ; {lint} && echo PASS || echo FAIL
echo "R3: Domain pure" ; {grep_forbidden in domain/} && echo FAIL || echo PASS
echo "R4: No cross-dom" ; {grep_domain_A in domain_B} && echo FAIL || echo PASS
echo "R5: No cycles" ; {cycle_check} && echo FAIL || echo PASS
echo "R6: Tests exist" ; {find_tests_in_domain} | wc -l
echo "R7: Tests pass" ; {test} && echo PASS || echo FAIL
echo "R8: Wiring reg" ; {check_routes_registered}
echo "R9: Event names" ; {check_event_consistency}
echo "R10: Async ctx" ; {check_no_request_context_in_goroutines}
Record PASS/FAIL per check. Continue to Phase 3 either way — manual review catches what automated misses.
Focus on architecture structure, not business correctness. 10 areas:
domain/{domain}/ exists with proper subdirsentities/, ports/, usecases/ at minimumvalueobjects/ separate (not mixed in entities)events/ separate, 1 file per eventports/{transport}/, services/, listeners/modules/, flat structure)New{Entity} / create())valueobjects/, not entitiesports/ dir exists (no inline interfaces in usecases)URLParser not ShopeeURLParser)deps.go inline interfaceson_{event} naming)~/.claude/architecture/_shared/severity-levels.md)## Architecture Review: {architecture} / {domain}
### Automated (R1-R10)
| # | Check | Status |
|---|-------|--------|
| R1 | Build | PASS/FAIL |
| ... | ... | ... |
### Manual review
| Area | Status | Violations |
|------|--------|------------|
| Directory (D1-D7) | OK / ISSUE | ... |
| Entities (E1-E5) | OK / ISSUE | ... |
| ... | ... | ... |
### Violations
1. [SEVERITY] code:file:line — description
2. ...
### Recommended fixes
1. ...
### Overall Score: {A/B/C/D/F}
| Score | Criteria | |-------|----------| | A | 0 violations, all R1-R10 PASS | | B | 0 CRITICAL/HIGH, max 3 MEDIUM | | C | 0 CRITICAL, max 2 HIGH | | D | Has CRITICAL or 3+ HIGH | | F | Multiple CRITICAL — architecture broken |
LOOP:
1. Fix all violations
2. Re-run automated checks (Phase 2)
3. Re-run manual review (Phase 3)
4. IF violations severity ≥ MEDIUM → GOTO 1
5. IF only LOW or none → BREAK, final report
Verify after each iteration: build passes, tests pass, domain purity holds.
/feature-new and /feature-refactor call this skill at the end of their workflows. When called from another skill:
| When | Use |
|------|-----|
| Full PR review (arch + code + security + tests) | /review-pr |
| Self-review own branch before push | /review-branch |
| Refactor to fix violations | /feature-refactor |
| Add tests if missing | /review-tdd |
| Called from /feature-new / /feature-refactor | automatic |
| Phase | Agent | Purpose |
|-------|-------|---------|
| LOAD | @clean-architect | Interpret architecture rules |
| AUTOMATED | @devops | Build / lint / test scripts |
| MANUAL | @code-reviewer | Spot violations |
| FIX | Stack-specific dev agent | Apply fixes |
development
Test-Driven Development workflow. Use when doing TDD, writing tests first, or when user says "tdd", "test first", "test driven", "red green refactor".
development
Thorough pull request review workflow with architecture compliance checks. Use when reviewing pull requests, checking code changes, or when user says "review pr", "check pr", "review code", "pr review", "review pull request".
development
Review local branch changes for architecture compliance, conventions, and code quality before pushing/PR. Stack-aware — detects the project stack and applies the matching rules. Use when user says "review changes", "review branch", "check branch", "check changes", "review my code", "review before pr".
development
Research solutions on the internet for a given topic or the current conversation context. Use when user says "research", "tìm giải pháp", "search solution", "investigate", "find best practice", "so sánh giải pháp".