5.8 KiB
5.8 KiB
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/<MODULE>/<TICKET_KEY>/<TICKET_KEY>-review.md
Steps
1. Read the plan document
cat docs/<MODULE>/<TICKET_KEY>/<TICKET_KEY>-plan.md
Extract: planned changes, affected files, expected patterns, acceptance criteria.
2. Read the test plan (if exists)
cat docs/<MODULE>/<TICKET_KEY>/<TICKET_KEY>-testplan.md
Cross-reference: are all planned test cases implemented?
3. Get the diff
cd /Users/pplate/git/paisy-<TICKET_KEY>
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.
cd /Users/pplate/git/paisy-<TICKET_KEY>
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
cd /Users/pplate/git/paisy-<TICKET_KEY>
# 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<What>_<Scenario>_<Expected>()?
7. Run tests
cd /Users/pplate/git/paisy-<TICKET_KEY>
mvn test -pl java/modules/cs-modules/<MODULE> -f java/pom.xml
8. Generate review document
Write docs/<MODULE>/<TICKET_KEY>/<TICKET_KEY>-review.md:
# Code Review: <TICKET_KEY> — <Summary>
**Datum:** <today>
**Modul:** <MODULE>
**Reviewer:** Roo (Reviewer)
**Branch:** <branch name>
**Status:** ✅ Approved / ⚠️ Approved with comments / ❌ Changes requested
---
## Zusammenfassung
<1-2 sentence summary of the review outcome>
## Geprüfte Dateien
| Datei | Änderung | Bewertung |
|-------|---------|-----------|
| `<path>` | 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. **<file>:<line>** — <description of finding>
- Empfehlung: <suggested fix>
### ❌ Blocker (must fix)
1. **<file>:<line>** — <description of critical finding>
- Begründung: <why this must be fixed>
## Tests
- **Ausgeführt:** <N> Tests
- **Bestanden:** <N> ✅
- **Fehlgeschlagen:** <N> ❌
- **Build:** ✅ Grün / ❌ Rot
## Empfehlung
<Final recommendation: merge / fix and re-review / reject>
9. Store in BigMind
memory_store_fact(
category="codebase",
fact=f"{TICKET_KEY}: Code review completed — {status}. {findings_count} findings ({blockers} blockers)."
)
Expected Output
- Review document at
docs/<MODULE>/<TICKET_KEY>/<TICKET_KEY>-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-<TICKET_KEY> 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