java-language
БесплатноБез исполняемых скриптовНе проверенModern Java 21+ language standards including Records, Pattern Matching, and Virtual Threads. Use for Java language constructs or Java-to-Java upgrades; defer…
от HoangNguyen0403★ 598 звёзд на GitHubОб этом скилле
Java Language Patterns
Priority: P0 (CRITICAL)
Implementation Guidelines
- Records: Use record for immutable DTOs/Value Objects. Records auto-generate equals, hashCode, toString. Avoid Lombok @Data on Pojos.
- Local Variables: Use
varfor inferred types. Explicitly type interface variables. - Switch: Use Switch Expressions (->) and Pattern Matching over complex if/else chains.
- Text Blocks: Use
"""(text blocks, Java 15+) for JSON, SQL, or multi-line strings; the opening"""must be followed by a line terminator, and closing-delimiter placement sets incidental indentation. - Pattern Matching: Use
instanceofwith pattern binding:if (obj instanceof String s). - Sealed Classes: Use sealed interface/class with permits clause for domain-driven restricted hierarchies. Switch expressions then exhaustive switch (compiler-verified).
- Collections: Use
List.of(),Map.of(), andSet.of()for immutable collections. - Streams: Use
stream()pipelines for functional transformations. Use.toList()(Java 16+). - Optional: Utilize
Optional<T>for return types. Use.ifPresentOrElse()or.orElseThrow(). - Virtual Threads: Favor
Executors.newVirtualThreadPerTaskExecutor()for I/O-heavy workloads (stable since 21). - Preview APIs:
StructuredTaskScopeand other preview features need an explicit project opt-in, an exact JDK pin, and--enable-previewat compile and runtime; never present them as a stable default on a JDK where they are still preview. See concurrency reference.
Anti-Patterns
- No Nulls: Return Optional or empty collections; avoid null parameters.
- No Raw Types: Always use generics; never use raw List or Map.
- No Old Switch: Use switch expressions (->); avoid fall-through.
- No Manual get/set: Use Records or value objects instead.
- No unbounded blocking in monitors: On JDK 21–23 blocking inside
synchronizedpins the carrier; JDK 24+ (JEP 491) removes that. PreferReentrantLockfor timed/try/interruptible locking, not merely to dodge pinning — and do not bansynchronizedwholesale.
References
Установить java-language в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл java-language?
Modern Java 21+ language standards including Records, Pattern Matching, and Virtual Threads. Use for Java language constructs or Java-to-Java upgrades; defer Kotlin, tests, formatting/build tools, CompletableFuture, builder patterns, and isolated null-handling questions.
Как установить скилл java-language?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл java-language запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic