/null-safety
Use when annotating nullability in Spring Boot 3 / Spring Framework 6 code, integrating Kotlin, or adding static nullability checks without assuming Spring Framework 7 JSpecify defaults.
$ npx -y skills add rrezartprebreza/spring-boot-skills --skill null-safety --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/null-safety
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use when annotating nullability in Spring Boot 3 / Spring Framework 6 code, integrating Kotlin, or adding static nullability checks without assuming Spring Framework 7 JSpecify defaults.
SKILL.md
null-safety.SKILL.mdname: null-safety
description: >
Use when annotating nullability in Spring Boot 3 / Spring Framework 6 code, integrating Kotlin,
or adding static nullability checks without assuming Spring Framework 7 JSpecify defaults.
Null Safety (Boot 3 / Framework 6)
Use the nullability model supported by the project. Spring Framework 6 commonly uses `org.springframework.lang.Nullable`, `@NonNull`, and package-level `@NonNullApi`. JSpecify can be introduced deliberately, but do not assume Framework 7 migration semantics in a Boot 3 module.
@NonNullApi
package com.example.orders;
import org.springframework.lang.NonNullApi;
Annotate genuine nullable results and parameters with `@Nullable`. Keep repository return types explicit, validate external input at boundaries, and use Kotlin compiler settings that match the annotations when Java and Kotlin are mixed. If the project standardizes JSpecify independently, apply it consistently at module boundaries and document the chosen checker.
Gotchas
- Agent assumes Framework 7 JSpecify defaults - Boot 3 projects usually use Spring's legacy annotations.
- Agent uses `@NonNullApi` without importing the package annotation - package metadata must compile and be checked in.
- Agent marks every value `@NonNull` - establish a package default and annotate only nullable exceptions.
- Agent treats annotations as runtime validation - use Bean Validation or explicit checks for input validation.
- Agent changes a repository's nullable contract without updating callers - preserve `Optional`, nullable, and empty collection semantics.
- Agent mixes JSpecify and Spring annotations without a migration plan - choose one module boundary policy.
Read more
name: null-safety description: > Use when annotating nullability in Spring Boot 3 / Spring Framework 6 code, integrating Kotlin, or adding static nullability checks without assuming Spring Framework 7 JSpecify defaults.
Null Safety (Boot 3 / Framework 6)
Use the nullability model supported by the project. Spring Framework 6 commonly uses `org.springframework.lang.Nullable`, `@NonNull`, and package-level `@NonNullApi`. JSpecify can be introduced deliberately, but do not assume Framework 7 migration semantics in a Boot 3 module.
@NonNullApi package com.example.orders; import org.springframework.lang.NonNullApi;
Annotate genuine nullable results and parameters with `@Nullable`. Keep repository return types explicit, validate external input at boundaries, and use Kotlin compiler settings that match the annotations when Java and Kotlin are mixed. If the project standardizes JSpecify independently, apply it consistently at module boundaries and document the chosen checker.
Gotchas
- Agent assumes Framework 7 JSpecify defaults - Boot 3 projects usually use Spring's legacy annotations.
- Agent uses `@NonNullApi` without importing the package annotation - package metadata must compile and be checked in.
- Agent marks every value `@NonNull` - establish a package default and annotate only nullable exceptions.
- Agent treats annotations as runtime validation - use Bean Validation or explicit checks for input validation.
- Agent changes a repository's nullable contract without updating callers - preserve `Optional`, nullable, and empty collection semantics.
- Agent mixes JSpecify and Spring annotations without a migration plan - choose one module boundary policy.
Production-grade Claude Code and Codex skills for Spring Boot developers
Other skills on spring-boot-skills.
- /ai-observability
Use when adding monitoring, metrics, logging, or tracing to Spring AI or LLM integration code. Covers token tracking, latency measurement, cost estimation, and prompt/response logging. Use when user mentions AI monitoring, token costs, or LLM observability.
Open skill - /api-versioning
Use when versioning Spring MVC or WebFlux APIs in Spring Boot 3 / Spring Framework 6. Covers explicit URL, header, and media-type strategies, compatibility rules, and deprecation handling.
Open skill - /domain-driven-design
Use when working with domain models, aggregates, value objects, domain events, or repositories in a DDD-style project. Ensures rich domain model over anemic CRUD.
Open skill - /flyway-migrations
Use when creating database migrations, schema changes, seed data, or any SQL that modifies database structure. Covers Flyway naming conventions, versioning, and safe migration patterns.
Open skill - /hateoas
Use when adding hypermedia links to REST responses, building self-describing APIs, or implementing Spring HATEOAS. Use when you see EntityModel, CollectionModel, or RepresentationModel in the project.
Open skill - /hexagonal-architecture
Use when the project follows hexagonal (ports & adapters) architecture. Prevents domain code from depending on Spring or JPA. Use when you see packages like domain/, application/, infrastructure/, or adapters/ in the project structure.
Open skill

