Skip to content
Back to skills

Null Safety

ASecurity

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.

  • 272 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 1, 2026
ai-agentsgojavakotlinspringapi

Works with

  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 1, 2026

npx -y skills add rrezartprebreza/spring-boot-skills --skill null-safety --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Null Safety?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Null Safety
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rrezartprebreza-null-safety/badge)](https://www.skillsdirectory.com/skills/rrezartprebreza-null-safety)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.

```java
@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.

Files in this skill

  • SKILL.md1.7 KB
  • agents/openai.yaml185 B
  • examples/bad-null-contract.java116 B
  • examples/good-package-info.java85 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.