Claude Cursor Skill

writing-java-kotlin

Idiomatic modern Java and Kotlin JVM development. Use when writing `.java`,

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download alexei-led-cc-thingz-src_skills_writing-java-kotlin-ce56bb4.zip · 3 KB
Part of alexei-led/cc-thingz — 91 skills

Install

skills CLI npx skills add https://github.com/alexei-led/cc-thingz/tree/master/src/skills/writing-java-kotlin
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install alexei-led-cc-thingz@llmmart
Git git clone https://github.com/alexei-led/cc-thingz.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole alexei-led/cc-thingz collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Java and Kotlin Development

Build baseline

  • Read the wrapper properties, settings.gradle*/build.gradle*/gradle.properties or pom.xml, and CI before relying on version-specific behavior.
  • Use ./gradlew/./mvnw when the repo has them; scope tests to the changed module (see testing.md).
  • The compile target is the declared Java toolchain and Kotlin jvmToolchain, not the shell's JAVA_HOME; without one, the running JDK compiles.
  • Toolchain, plugin, and dependency versions live in convention plugins, version catalogs, BOMs, or parent POMs, set once there. Raising the Java or Kotlin toolchain is a project-wide decision: ask, and change it in shared build config, not one module.
  • A request to use a preview feature is not approval to enable it: ask first, name a non-preview fallback, and, once approved, add --enable-preview to the build's compile and run/test tasks, not a local flag. Previews can be withdrawn between JDKs: string templates were withdrawn in JDK 23.
  • Wire coverage, mutation, or other heavy analysis as its own task or under check; never make test depend on or be finalized by the report, which would still run it on every plain test. Use a separate command or CI step, even when adding it is the task.

Defaults

  • Kotlin: structured concurrency only — no GlobalScope; pass a coroutineScope or an injected scope through the call chain. Test coroutine code with kotlinx-coroutines-test's runTest, not runBlocking or real delays. Keep blocking calls off event-loop and coroutine dispatcher threads unless the framework allows it.
  • Kotlin: resolve nullable Java platform types at the boundary instead of asserting past them with !!.
  • Java: say outright when virtual threads help (blocking I/O) versus don't (CPU-bound work); size CPU-bound work to a bounded pool near the processor count or a parallel stream. Never swallow InterruptedException — restore the flag or propagate it. No static state for config, clocks, clients, executors, or scopes.
  • Don't leak JPA entities, ORM sessions, or generated API models through domain interfaces; map to a DTO while the transaction is open, loading what it needs (fetch join or entity graph) instead of keeping the session open via spring.jpa.open-in-view.

References

  • testing.md: read when adding or reshaping tests, or when Gradle/Maven test runs are slow.
  • linting.md: read when changing formatters, ktlint, detekt, Spotless, or static analysis.

Done when the relevant build/test/lint checks pass on what you changed, or you name each check that did not run and why.

Files (cc-thingz)
  • .agentbundler
    • targets
      • claude.json 234 B
        {
          "frontmatterPatch": {
            "agent": "engineer",
            "allowed-tools": [
              "Read",
              "Bash",
              "Grep",
              "Glob",
              "Edit",
              "Write",
              "LS"
            ],
            "context": "fork",
            "user-invocable": false
          }
        }
        
  • references
    • linting.md 886 B
      # Java and Kotlin Linting
      
      - Spotless for deterministic formatting: `google-java-format` for Java, ktlint for Kotlin. Don't add a formatter that conflicts with existing config.
      - detekt for Kotlin static analysis when the project has rules or accepts the default profile.
      - Run Error Prone, Checkstyle, PMD, SpotBugs, and ArchUnit only when the task calls for them, not on every edit.
      
      File-scoped edit loop:
      
      ```bash
      google-java-format -i src/main/java/com/example/Foo.java
      ktlint --format src/main/kotlin/com/example/Foo.kt
      detekt --input src/main/kotlin/com/example/Foo.kt
      ```
      
      Project-scoped gate:
      
      ```bash
      ./gradlew spotlessApply detekt test
      ./mvnw -q spotless:apply test
      ```
      
      - Format before reporting style issues; fix findings at the cause, and ask before weakening a static-analysis rule.
      - Keep generated, vendored, build, and annotation-processor output out of lint targets.
      
    • testing.md 674 B
      # Java and Kotlin Testing
      
      Use the project's test stack (JUnit 5, Kotest, TestNG, Mockito, MockK, AssertJ); do not switch in scoped work. Match nearby assertion style.
      
      ```bash
      ./gradlew :module:test --tests 'com.example.FooTest'
      ./gradlew test --tests '*FooTest'
      ./mvnw -q -pl module -Dtest=FooTest test
      ./mvnw -q -Dtest=FooTest test
      ```
      
      - Edit loop: one module and matching test class; run the broader suite when the change crosses modules or build logic.
      - Database code: Testcontainers, a disposable DB, or the project's seam, not mocked query chains.
      - Java concurrency: control executors and synchronize deterministically; assert interrupt and cancellation behavior.
      
  • SKILL.md 3.1 KB
    ---
    description: Idiomatic modern Java and Kotlin JVM development. Use when writing `.java`,
      `.kt`, or `.kts` code; changing Gradle or Maven builds; or working on Spring, Micronaut,
      Quarkus, Ktor, Android JVM modules, JUnit, Mockito, Kotest, ktlint, detekt, or JVM
      CLI/services. Emphasizes JDK toolchains, null-safety, fast focused Gradle/Maven
      feedback, deterministic formatting, and minimal dependencies. NOT for JavaScript/TypeScript,
      C#/.NET, Python, shell scripts, or infra-only work.
    name: writing-java-kotlin
    ---
    
    # Java and Kotlin Development
    
    ## Build baseline
    
    - Read the wrapper properties, `settings.gradle*`/`build.gradle*`/`gradle.properties` or `pom.xml`, and CI before relying on version-specific behavior.
    - Use `./gradlew`/`./mvnw` when the repo has them; scope tests to the changed module (see testing.md).
    - The compile target is the declared Java toolchain and Kotlin `jvmToolchain`, not the shell's `JAVA_HOME`; without one, the running JDK compiles.
    - Toolchain, plugin, and dependency versions live in convention plugins, version catalogs, BOMs, or parent POMs, set once there. Raising the Java or Kotlin toolchain is a project-wide decision: ask, and change it in shared build config, not one module.
    - A request to use a preview feature is not approval to enable it: ask first, name a non-preview fallback, and, once approved, add `--enable-preview` to the build's compile and run/test tasks, not a local flag. Previews can be withdrawn between JDKs: string templates were withdrawn in JDK 23.
    - Wire coverage, mutation, or other heavy analysis as its own task or under `check`; never make `test` depend on or be finalized by the report, which would still run it on every plain `test`. Use a separate command or CI step, even when adding it is the task.
    
    ## Defaults
    
    - Kotlin: structured concurrency only — no `GlobalScope`; pass a `coroutineScope` or an injected scope through the call chain. Test coroutine code with `kotlinx-coroutines-test`'s `runTest`, not `runBlocking` or real delays. Keep blocking calls off event-loop and coroutine dispatcher threads unless the framework allows it.
    - Kotlin: resolve nullable Java platform types at the boundary instead of asserting past them with `!!`.
    - Java: say outright when virtual threads help (blocking I/O) versus don't (CPU-bound work); size CPU-bound work to a bounded pool near the processor count or a parallel stream. Never swallow `InterruptedException` — restore the flag or propagate it. No static state for config, clocks, clients, executors, or scopes.
    - Don't leak JPA entities, ORM sessions, or generated API models through domain interfaces; map to a DTO while the transaction is open, loading what it needs (fetch join or entity graph) instead of keeping the session open via `spring.jpa.open-in-view`.
    
    ## References
    
    - [testing.md](references/testing.md): read when adding or reshaping tests, or when Gradle/Maven test runs are slow.
    - [linting.md](references/linting.md): read when changing formatters, ktlint, detekt, Spotless, or static analysis.
    
    Done when the relevant build/test/lint checks pass on what you changed, or you name each check that did not run and why.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related