marketplace/bundles/pm-dev-java/skills/java-null-safety/SKILL.md
JSpecify null safety annotations with @NullMarked, @Nullable, and package-level configuration
npx skillsauth add cuioss/plan-marshall java-null-safetyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
REFERENCE MODE: This skill provides reference material. Load specific standards on-demand based on current task.
Null safety standards using JSpecify annotations for consistent, compiler-verifiable null contracts.
This skill requires JSpecify annotations:
org.jspecify:jspecify (NullMarked, Nullable, NonNull)<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
</dependency>
Important: Load this standard for any null safety work — package configuration, annotations, API return types.
Read: standards/null-safety-core.md
This provides rules for:
@NullMarked package-level configuration with package-info.java syntax@NullMarked, @Nullable, @NonNull)@Nullable returns)Load for implementation work — writing null-safe code, collections, testing, migration:
Read: standards/null-safety-patterns.md
This provides rules for:
@NullMarked| Rule | Guidance |
|------|----------|
| Package default | Always add @NullMarked to package-info.java |
| Return types | Never use @Nullable — use Optional<T> instead |
| Parameters | Use @Nullable sparingly; prefer method overloads |
| API boundaries | Objects.requireNonNull() for defensive checks |
| Collections | List<@Nullable String> for nullable elements |
package-info.java — starting point for new packages with @NullMarked:
Read: templates/package-info.java.tmpl
Replace ${YEAR}, ${PACKAGE}, and ${PACKAGE_DESCRIPTION} with actual values. The import-after-package ordering is critical — see standards/null-safety-core.md for why.
@NullMarked in package-info.java@Nullable used for return types (use Optional instead)pm-dev-java:junit-core skill)pm-dev-java:java-core - Core Java patternspm-dev-java:java-lombok - Lombok patterns (interop with null safety)tools
Plan-marshall-domain implementor of the ext-self-review-{domain} extension point. Surfaces deterministic candidates (regexes, user-facing strings, markdown sections, symmetric-pair functions, flag-guard pairs, contract sources, schema-bearing files) for pre-submission structural self-review.
development
The single shared contract every untrusted-external-content ingestion surface loads — reader/orchestrator/writer isolation, the deterministic validator script as the containment boundary, and the output-schema discipline for candidate structs parsed from web pages, GitHub issue/PR/comment bodies, and Sonar issue messages
development
Domain-invariant recipe for deliberate wide-scope simplification campaigns across a scope x thoroughness cell, with a T4+ relation-graph pre-deliverable
testing
A test skill for README generation