null-safety
/null-safety
Dodaje adnotacje nullability i kontrole NullAway w Spring Boot 4 oraz Spring Framework 7, z JSpecify.
- Autor
- rrezartprebreza ↗
- Repozytorium
- spring-boot-skills ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 22.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 4
- Skrypty
- 2
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 22.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 2 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: examples/bad-null-contract.java, examples/good-package-info.java
Co robi i kiedy
Dodaje adnotacje nullability i kontrole NullAway w Spring Boot 4 oraz Spring Framework 7, z JSpecify.
Oryginalny opis (EN)
Use when annotating nullability in Spring Boot 4 / Spring Framework 7, migrating to JSpecify, integrating Kotlin, or enabling build-time null checks with NullAway.
Jak działa
- Mark packages and annotate exceptions
- Gotchas
Podgląd SKILL.md
---
name: null-safety
description: >
Use when annotating nullability in Spring Boot 4 / Spring Framework 7, migrating to JSpecify,
integrating Kotlin, or enabling build-time null checks with NullAway.
---
# Null Safety with JSpecify (Boot 4)
Spring Framework 7 adopts JSpecify for nullability. Use `org.jspecify.annotations` for new code
and migrate away from the older Spring nullability annotations at module boundaries.
## Mark packages and annotate exceptions
```java
@NullMarked
package com.example.orders;
import org.jspecify.annotations.NullMarked;
```
Inside a null-marked package, types are non-null by default. Annotate only genuine exceptions:
```java
@Nullable
Order findActive(String customerEmail) { ... }
List<@Nullable String> namesWithGaps; // non-null list, nullable elements
@Nullable List<String> maybeNoList; // nullable list, non-null elements
```
Use `Object @Nullable []` for a nullable array and `@Nullable Object[]` for a non-null array whose
elements may be null. Add the JSpecify dependency through the Boot dependency management.
JSpecify is metadata. IntelliJ can inspect it, while NullAway with `JSpecifyMode=true` can enforce
the contract during compilation. Kotlin consumes the annotations as real nullability.
## Gotchas
- Agent uses `org.springframework.lang.Nullable` in new Framework 7 code - prefer JSpecify.
- Agent annotates every parameter with `@NonNull` - use package-level `@NullMarked` and mark exceptions.
- Agent writes `@Nullable List<String>` for nullable elements - use `List<@Nullable String>`.
- Agent puts `@Nullable` on the wrong side of an array type - distinguish nullable arrays from nullable elements.
- Agent expects annotations alone to fail the build - add NullAway or enable IDE inspections.
- Agent forgets `package-info.java` - without `@NullMarked`, most checks remain unknown.
- Agent mixes JSpecify and legacy Spring annotations in one module - migrate the module consistently.
Pliki w paczce (4)
- SKILL.md 2 KB
- agents/openai.yaml 1 KB
- examples/bad-null-contract.java 1 KB
- examples/good-package-info.java 1 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · rrezartprebreza/spring-boot-skills | 100 | MIT |
| rrezartprebreza/spring-boot-skills | 100 | MIT |
Migawka bazy z 28.10.2026 · wersja paczki 27c41744a70c (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100code-reviewer
Przegląda kod Spring Boot (pull request, diff, moduł): wolne endpointy i zapytania (N+1, JPA, Hibernate), bezpieczeństwo, null-safety JSpecify, granice architektury, migrację do Boot 4 i skuteczność testów. - 90jspecify-skill
Dodaje do projektu Java adnotacje jspecify i konfiguruje Maven lub Gradle do sprawdzania nullability, by unikać NullPointerException. - 100java
Stosuje standardy Javy i JVM: records i sealed types, null-safety JSpecify z NullAway, niemutowalność, virtual threads, bramki Error Prone, ArchUnit i PIT oraz testy JUnit 6. - 100spring-boot-team-harness
Ustawia wspólne reguły dla agentów kodujących w zespole, z bramkami ./mvnw verify przed scaleniem zmian w Spring Boot 4. - 100spring-boot-expert
Wspiera pracę z Spring Boot, Spring Framework, API REST i mikroserwisami w Javie. - 100spring-boot-kotlin
Pilnuje wzorców Spring Boot w Kotlinie, w tym korutyn, WebFlux, JPA i zabezpieczeń.