Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Language-specific super-code guidelines for java.
.claude/skills/lingxling-java/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-21 | ✗→✓ | ▲ Improved | 71% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 129% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 54% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 62% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 26% | 0% |
java// ❌ Imperative accumulation List<String> result = new ArrayList<>(); for (Item item : items) { if (item.isActive()) result.add(item.getName().toUpperCase()); } // ✅ List<String> result = items.stream() .filter(Item::isActive) .map(item -> item.getName().toUpperCase()) .toList(); // Java 16+; use .collect(Collectors.toList()) before
java// ❌ Manual grouping Map<String, List<Item>> grouped = new HashMap<>(); for (Item item : items) { grouped.computeIfAbsent(item.getCategory(), k -> new ArrayList<>()).add(item); } // ✅ Map<String, List<Item>> grouped = items.stream() .collect(Collectors.groupingBy(Item::getCategory));
java// ❌ Manual sum int total = 0; for (Order o : orders) total += o.getAmount(); // ✅ int total = orders.stream().mapToInt(Order::getAmount).sum();
Prefer method references (Item::isActive) over equivalent lambdas (item -> item.isActive()).
java// ❌ Null check chain String city = null; if (user != null && user.getAddress() != null) { city = user.getAddress().getCity(); } // ✅ String city = Optional.ofNullable(user) .map(User::getAddress) .map(Address::getCity) .orElse(null);
java// ❌ Optional.get() without isPresent() String name = optional.get(); // throws if empty // ✅ String name = optional.orElse("default"); // or: optional.orElseThrow(() -> new IllegalStateException("name required"));
java// ❌ Optional as a field or parameter (anti-pattern) class User { private Optional<String> nickname; } // ✅ — Optional is for return types only class User { private String nickname; } // nullable field public Optional<String> getNickname() { return Optional.ofNullable(nickname); }
java// ❌ Manual POJO class Point { private final int x, y; public Point(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public int getY() { return y; } // + equals, hashCode, toString... } // ✅ (Java 16+) record Point(int x, int y) {}
java// ❌ Builder pattern for a 2-field object User user = new User.Builder().name("Alice").age(30).build(); // ✅ — use record or constructor directly for small objects record User(String name, int age) {} var user = new User("Alice", 30);
Use record for any immutable data carrier. Keep builders only for objects with many optional fields.
java// ❌ Switch statement with fall-through and break String label; switch (status) { case ACTIVE: label = "Active"; break; case INACTIVE: label = "Inactive"; break; default: label = "Unknown"; } // ✅ (Java 14+) String label = switch (status) { case ACTIVE -> "Active"; case INACTIVE -> "Inactive"; default -> "Unknown"; };
java// ❌ instanceof + cast if (shape instanceof Circle) { Circle c = (Circle) shape; return c.radius() * c.radius() * Math.PI; } // ✅ Pattern matching (Java 16+) if (shape instanceof Circle c) { return c.radius() * c.radius() * Math.PI; }
java// ❌ Raw Thread creation Thread t = new Thread(() -> doWork()); t.start(); // ✅ ExecutorService exec = Executors.newVirtualThreadPerTaskExecutor(); // Java 21 exec.submit(() -> doWork());
java// ❌ synchronized on this for fine-grained state synchronized(this) { counter++; } // ✅ AtomicInteger counter = new AtomicInteger(); counter.incrementAndGet();
Prefer CompletableFuture.allOf() over blocking .get() chains for parallel async work.
java// ❌ Catching Exception to log and swallow try { risky(); } catch (Exception e) { log.error("error", e); } // ✅ — rethrow as unchecked if you can't handle it try { risky(); } catch (IOException e) { throw new UncheckedIOException(e); }
java// ❌ Checked exceptions declared on every method public void process() throws IOException, SQLException, ParseException { ... } // ✅ — wrap at the boundary; internal methods throw unchecked
| Anti-pattern | Preferred | |---|---| | new ArrayList<String>() (Java 7+) | new ArrayList<>() (diamond) | | "string".equals(variable) (Yoda) | Objects.equals(variable, "string") | | for (int i = 0; i < list.size(); i++) | enhanced for or stream | | StringBuffer in single-threaded code | StringBuilder | | e.printStackTrace() | log.error("msg", e) | | null return for "not found" | Optional<T> return type | | Public fields | private + accessor, or record | | Mutable static fields | avoid; use dependency injection | | instanceof + cast without pattern matching | pattern matching (Java 16+) |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-21 | fail→pass | 7,793 | 4,478 | -43% | 1 | 1 | 0% | 1,406 | 2,409 | +71% | 0 | 0 | — |
case-01 | fail→fail | 19,642 | 10,730 | -45% | 1 | 1 | 0% | 3,064 | 3,013 | -2% | 0 | 0 | — |
case-02 | fail→fail | 21,534 | 19,150 | -11% | 1 | 1 | 0% | 2,997 | 4,398 | +47% | 0 | 0 | — |
case-03 | fail→pass | 19,871 | 21,053 | +6% | 1 | 1 | 0% | 2,085 | 4,776 | +129% | 0 | 0 | — |
case-04 | pass→pass | 23,511 | 24,602 | +5% | 1 | 1 | 0% | 4,071 | 6,283 | +54% | 0 | 0 | — |
case-05 | pass→pass | 22,019 | 22,989 | +4% | 1 | 1 | 0% | 3,156 | 5,100 | +62% | 0 | 0 | — |
case-06 | pass→pass | 21,739 | 17,110 | -21% | 1 | 1 | 0% | 3,620 | 4,564 | +26% | 0 | 0 | — |
case-07 | pass→pass | 10,902 | 4,922 | -55% | 1 | 1 | 0% | 1,624 | 2,430 | +50% | 0 | 0 | — |
case-12 | pass→pass | 15,664 | 9,790 | -38% | 1 | 1 | 0% | 2,287 | 2,748 | +20% | 0 | 0 | — |
case-08 | fail→fail | 31,419 | 5,631 | -82% | 1 | 1 | 0% | 1,117 | 2,355 | +111% | 0 | 0 | — |
case-09 | pass→pass | 5,944 | 4,092 | -31% | 1 | 1 | 0% | 749 | 2,117 | +183% | 0 | 0 | — |
case-10 | pass→pass | 10,732 | 4,186 | -61% | 1 | 1 | 0% | 1,556 | 2,211 | +42% | 0 | 0 | — |
case-11 | pass→pass | 8,025 | 5,229 | -35% | 1 | 1 | 0% | 1,024 | 2,119 | +107% | 0 | 0 | — |
case-13 | pass→pass | 7,288 | 5,821 | -20% | 1 | 1 | 0% | 1,086 | 2,325 | +114% | 0 | 0 | — |
case-14 | pass→pass | 8,758 | 4,813 | -45% | 1 | 1 | 0% | 1,541 | 2,315 | +50% | 0 | 0 | — |
case-15 | pass→pass | 4,727 | 3,945 | -17% | 1 | 1 | 0% | 594 | 2,054 | +246% | 0 | 0 | — |
case-16 | pass→pass | 3,801 | 3,096 | -19% | 1 | 1 | 0% | 612 | 2,098 | +243% | 0 | 0 | — |
case-17 | pass→pass | 18,841 | 7,344 | -61% | 1 | 1 | 0% | 1,951 | 2,828 | +45% | 0 | 0 | — |
case-18 | fail→fail | 15,196 | 10,951 | -28% | 1 | 1 | 0% | 2,225 | 2,955 | +33% | 0 | 0 | — |
case-19 | pass→pass | 12,515 | 10,002 | -20% | 1 | 1 | 0% | 1,702 | 2,992 | +76% | 0 | 0 | — |
case-20 | pass→pass | 7,532 | 5,187 | -31% | 1 | 1 | 0% | 1,265 | 2,315 | +83% | 0 | 0 | — |
case-22 | pass→pass | 14,833 | 11,666 | -21% | 1 | 1 | 0% | 2,459 | 3,525 | +43% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.