# Skill: code-review Structured code review against implementation plan. ## Invoked by 🔍 Reviewer mode ## Required Inputs | Input | Source | Example | |-------|--------|---------| | `TICKET_KEY` | Jira issue key | `ESIDEPAISY-12081` | | `MODULE` | PAISY module name | `eau`, `eubp`, `svmeldungen` | ## Output Markdown file: `docs///-review.md` ## Steps ### 1. Read the plan document ```bash cat docs///-plan.md ``` Extract: planned changes, affected files, expected patterns, acceptance criteria. ### 2. Read the test plan (if exists) ```bash cat docs///-testplan.md ``` Cross-reference: are all planned test cases implemented? ### 3. Get the diff ```bash cd /Users/pplate/git/paisy- git diff origin/current --name-only git diff origin/current --stat git diff origin/current ``` ### 4. Read changed files For each changed file, read the full file to understand context — not just the diff hunks. ```bash cd /Users/pplate/git/paisy- git diff origin/current --name-only | while read f; do echo "=== $f ==="; done ``` ### 5. Run the review checklist For each changed file, verify: | # | Check | What to look for | |---|-------|-----------------| | 1 | Plan compliance | All plan items implemented? Nothing missing, nothing extra? | | 2 | Pattern correctness | Correct PAISY patterns used? (AbstractMeldung, Datenbaustein, ServiceCenter, EMFactory, JAXB) | | 3 | No `src.gen/` changes | Generated sources must never be modified manually | | 4 | Logging | `@Slf4j` or `@Log4j2` with parameterized messages (`log.debug("x: {}", v)`) — no string concatenation | | 5 | German domain terms | Domain terms preserved: `Fehlzeiten`, `Lohnkonto`, `Vorlaufsatz`, `Nachlaufsatz` | | 6 | Error handling | PAISY `F;` responses checked before parsing? Null-safe patterns? | | 7 | Date handling | Correct formatters? Empty date checks (`00.00.0000`, `0000000`, `9999999`)? | | 8 | Test coverage | Every new/modified public method has a test? Edge cases covered? | | 9 | Flyway migrations | Correct naming convention? Dual H2/Oracle? Type mapping correct? | | 10 | No hardcoded values | No hardcoded BBNR, sprint IDs, Epic keys, instance names? | | 11 | Field visibility | `protected` for shared fields, `private` with Lombok for DTOs? | | 12 | Annotations | Correct use of `@Service`/`@Lazy`, `@Transactional`, `@XmlElement`? | ### 6. Check test quality ```bash cd /Users/pplate/git/paisy- # Find new/modified test files git diff origin/current --name-only | grep -E "Test\.java$" ``` For each test file: - Meaningful assertions (not just `assertNotNull`)? - Edge cases covered? - Mocking done correctly (Mockito patterns)? - Test naming convention: `test__()`? ### 7. Run tests ```bash cd /Users/pplate/git/paisy- mvn test -pl java/modules/cs-modules/ -f java/pom.xml ``` ### 8. Generate review document Write `docs///-review.md`: ```markdown # Code Review: — **Datum:** **Modul:** **Reviewer:** Roo (Reviewer) **Branch:** **Status:** ✅ Approved / ⚠️ Approved with comments / ❌ Changes requested --- ## Zusammenfassung <1-2 sentence summary of the review outcome> ## Geprüfte Dateien | Datei | Änderung | Bewertung | |-------|---------|-----------| | `` | Neu/Geändert | ✅ / ⚠️ / ❌ | ## Checkliste | # | Prüfpunkt | Ergebnis | Anmerkung | |---|-----------|----------|-----------| | 1 | Plan-Konformität | ✅ | Alle geplanten Änderungen umgesetzt | | 2 | Pattern-Korrektheit | ✅ | AbstractMeldung korrekt erweitert | | 3 | Keine src.gen/ Änderungen | ✅ | — | | 4 | Logging | ⚠️ | Zeile 42: String-Konkatenation → parameterized | | 5 | Deutsche Domänenbegriffe | ✅ | — | | 6 | Fehlerbehandlung | ✅ | F;-Prüfung vorhanden | | 7 | Datumsbehandlung | ✅ | — | | 8 | Testabdeckung | ✅ | 7 Tests, alle bestanden | | 9 | Flyway-Migrationen | ✅ | H2 + Oracle korrekt | | 10 | Keine Hardcoded-Werte | ✅ | — | | 11 | Feld-Sichtbarkeit | ✅ | — | | 12 | Annotationen | ✅ | — | ## Befunde ### ⚠️ Hinweise (non-blocking) 1. **:** — - Empfehlung: ### ❌ Blocker (must fix) 1. **:** — - Begründung: ## Tests - **Ausgeführt:** Tests - **Bestanden:** ✅ - **Fehlgeschlagen:** ❌ - **Build:** ✅ Grün / ❌ Rot ## Empfehlung ``` ### 9. Store in BigMind ```python memory_store_fact( category="codebase", fact=f"{TICKET_KEY}: Code review completed — {status}. {findings_count} findings ({blockers} blockers)." ) ``` ## Expected Output - Review document at `docs///-review.md` - All tests executed and results documented - Clear recommendation: merge / fix / reject ## Error Handling | Error | Resolution | |-------|------------| | No plan document found | Review without plan — note in review that plan was missing | | Build fails | Document build failure as blocker, don't proceed with detailed review | | No tests found | Flag as blocker — every change needs tests | | Worktree not found | Check if `/Users/pplate/git/paisy-` exists, or use main repo with branch checkout | ## Severity Levels | Level | Symbol | Meaning | Action | |-------|--------|---------|--------| | Blocker | ❌ | Must fix before merge | Changes requested | | Warning | ⚠️ | Should fix, not blocking | Approved with comments | | Info | ℹ️ | Suggestion for improvement | Approved | | OK | ✅ | No issues | — | ## Language - Review document: **German** - Code references (class names, methods, patterns): English as-is - Checklist items: German