$npx -y skills add ducpm2303/claude-java-plugins --skill java-healthRuns a holistic code health check scoring Security, Tests, Performance and Quality with A-F grades. Use when user asks to "check health", "score this project", "health check", "how good is this code", "overall assessment", or "code quality score".
| 1 | Run a comprehensive health check on the Java code or project I've indicated. This is an aggregating command — it runs multiple review dimensions and produces a single scored report. |
| 2 | |
| 3 | ## Step 1 — Detect context |
| 4 | - Check `pom.xml` or `build.gradle` for: Java version, Spring Boot version, dependencies |
| 5 | - If a specific file is provided, scope the review to that file |
| 6 | - If no file is provided, review the overall project structure |
| 7 | |
| 8 | ## Step 2 — Run all dimensions in parallel (mentally) |
| 9 | |
| 10 | Assess each dimension independently, then score it: |
| 11 | |
| 12 | ### A. Security (0–25 points) |
| 13 | Check for: |
| 14 | - Hardcoded secrets or credentials (-5 each, max -15) |
| 15 | - SQL string concatenation (-5 each, max -10) |
| 16 | - Missing input validation on controller methods (-3 each, max -9) |
| 17 | - Weak password hashing (MD5/SHA-1) (-8) |
| 18 | - Sensitive data in logs (-4) |
| 19 | |
| 20 | Full score = 25. Deduct per finding. |
| 21 | |
| 22 | ### B. Test Structure Assessment (0–25 points) |
| 23 | |
| 24 | > **Note:** This is a *structural* assessment — Claude cannot run your test suite or measure real line coverage. For actual coverage numbers run `mvn test jacoco:report` or `./gradlew test jacocoTestReport`. |
| 25 | |
| 26 | Check for: |
| 27 | - Presence of test files for each service class (-5 per missing service test, max -15) |
| 28 | - Use of H2 instead of Testcontainers for DB integration tests (-5) |
| 29 | - Missing exception path tests (no test method with "throws", "exception", or "notFound" in name) (-3 per service class, max -9) |
| 30 | - Tests that mock the class under test (-4) |
| 31 | |
| 32 | Full score = 25. Deduct per finding. |
| 33 | |
| 34 | ### C. Performance (0–25 points) |
| 35 | Check for: |
| 36 | - `@OneToMany`/`@ManyToMany` without `FetchType.LAZY` (-6 each, max -12) |
| 37 | - Loops calling repository methods (N+1) (-8 each, max -16) |
| 38 | - `findAll()` without pagination on large entities (-5) |
| 39 | - `String` concatenation in loops (-3 each, max -6) |
| 40 | - `synchronized` on entire methods (-3 each, max -6) |
| 41 | |
| 42 | Full score = 25. Deduct per finding. |
| 43 | |
| 44 | ### D. Code Quality (0–25 points) |
| 45 | Check for: |
| 46 | - Methods longer than 20 lines (-3 each, max -12) |
| 47 | - Classes with more than one clear responsibility (-5 each, max -10) |
| 48 | - Magic numbers/strings not extracted to constants (-2 each, max -8) |
| 49 | - Missing Javadoc on public API methods (-1 each, max -5) |
| 50 | - Raw types (unparameterized generics) (-3 each, max -6) |
| 51 | |
| 52 | Full score = 25. Deduct per finding. |
| 53 | |
| 54 | ## Step 3 — Output the Health Report |
| 55 | |
| 56 | Format the report exactly like this: |
| 57 | |
| 58 | ``` |
| 59 | ╔══════════════════════════════════════════╗ |
| 60 | ║ JAVA HEALTH REPORT ║ |
| 61 | ║ Project: [project name or file name] ║ |
| 62 | ║ Java: [version] | Spring Boot: [version]║ |
| 63 | ╠══════════════════════════════════════════╣ |
| 64 | ║ Security [score]/25 [grade] ║ |
| 65 | ║ Test Coverage [score]/25 [grade] ║ |
| 66 | ║ Performance [score]/25 [grade] ║ |
| 67 | ║ Code Quality [score]/25 [grade] ║ |
| 68 | ╠══════════════════════════════════════════╣ |
| 69 | ║ TOTAL HEALTH [total]/100 [grade] ║ |
| 70 | ╚══════════════════════════════════════════╝ |
| 71 | ``` |
| 72 | |
| 73 | Grade scale: 23–25 = A, 18–22 = B, 13–17 = C, 8–12 = D, 0–7 = F |
| 74 | |
| 75 | ## Step 4 — Top 3 Actions |
| 76 | List the 3 highest-impact improvements ranked by score gain: |
| 77 | 1. **[Action]** — fixes [dimension], gains up to +[N] points |
| 78 | 2. **[Action]** — fixes [dimension], gains up to +[N] points |
| 79 | 3. **[Action]** — fixes [dimension], gains up to +[N] points |
| 80 | |
| 81 | ## Step 5 — Offer drill-downs |
| 82 | After the report, offer: |
| 83 | - "Run `/java-review` for detailed code quality findings" |
| 84 | - "Run `/java-security-check` or ask `java-security-reviewer` for a full OWASP analysis" |
| 85 | - "Run `/java-perf-check` or ask `java-performance-reviewer` for performance deep-dive" |
| 86 | - "Run `/java-test` to generate missing tests" |
| 87 | - "For real coverage numbers: `mvn test jacoco:report` or `./gradlew test jacocoTestReport`" |