jspecify-skill
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "jspecify-skill" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-85343c7d8d34395cf1605238fe7c70bf40bc57df45ce26f939f2e5f31b9acc57. Verify the upstream source and version against https://github.com/sivaprasadreddy/sivalabs-agent-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Handles nullability and JSpecify support in Java projects: used to add JSpecify support, prevent NullPointerExceptions, and improve nullability handling; will add JSpecify dependencies and configure Maven or Gradle builds to automatically perform nullability checks.
Introduction source: third_party · sivaprasadreddy · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Jspecify provides a set of annotations to explicitly declare the nullness expectations of the Java code.
- Testing
- Not tested
Browse files
Frontmatter
name: jspecify-skill
description: >
Use this skill when asked to perform any of the following actions in a Java project:
- To add jspecify support
- To prevent NullPointerExceptions
- To better handle Nullability
This skill will add jspecify dependency, configure Maven or Gradle build to automatically use jspecify for checking Nullability issues.Jspecify provides a set of annotations to explicitly declare the nullness expectations of the Java code.
Add jSpecify support in Maven projects
If you are using Maven, then add the jspecify dependency in pom.xml.
In pom.xml, update or add the nullability-maven-plugin, to include the following configuration.
<dependencies>
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>am.ik.maven</groupId>
<artifactId>nullability-maven-plugin</artifactId>
<version>0.4.2</version>
<extensions>true</extensions>
<configuration>
<checking>tests</checking>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<testOutputDirectory>${project.basedir}/src/test/java</testOutputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>configure</goal>
<goal>generate-package-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Add jSpecify support in Gradle projects
If you are using Gradle, then add the jspecify dependency.
In build.gradle or build.gradle.kts, update or add the following jspecify configuration.
plugins {
id("net.ltgt.errorprone") version "5.1.0"
id("net.ltgt.nullaway") version "3.1.0"
}
tasks.withType(JavaCompile).configureEach {
options.errorprone {
disableAllChecks = true // Other error prone checks are disabled
error("RequireExplicitNullMarking") // Require @NullMarked or @NullUnmarked on everything
nullaway {
error()
}
}
// Keep a JDK 25 baseline
options.release = 25
}
nullaway {
onlyNullMarked = true
jspecifyMode = true
}
dependencies {
implementation("org.jspecify:jspecify:1.0.0")
errorprone("com.google.errorprone:error_prone_core:2.50.0")
errorprone("com.uber.nullaway:nullaway:0.13.7")
}
Add @NullMarked to package-info.java files
In every java package under the application main source code (src/main/java),
create package-info.java if not exists already, and add the @NullMarked annotation as follows:
@org.jspecify.annotations.NullMarked
package com.mycompnay.myproject;
If package-info.java file already exists, update the file to add @org.jspecify.annotations.NullMarked annotation.
DO NOT REMOVE ANY OTHER EXISTING CODE IN package-info.java FILE.
Verify jSpecify support
If python is installed, after adding the jSpecify support, run scripts/verify_nullmarked.py
to check if all non-empty packages has package-info.java file or not.
Migrating an existing codebase from other annotation libraries
If the project already uses another nullability annotation library (JSR-305 / javax, Jakarta,
JetBrains, Spring, Android, FindBugs/SpotBugs, Checker Framework, or Eclipse JDT), migrate those
annotations to JSpecify before adding @NullMarked. The OpenRewrite MigrateToJSpecify recipe
automates the common cases (javax, Jakarta, JetBrains, Micrometer, Micronaut); the rest are a short
manual mapping. See references/annotation-migration.md.
Incremental adoption for large codebases
Flipping every package to @NullMarked at once is impractical on a large or legacy codebase.
@NullUnmarked lets you enforce NullAway on a growing perimeter while the rest stays untouched.
Because the build above enables OnlyNullMarked mode, packages without @NullMarked are simply
ignored — so adoption is driven purely by adding markers, one package at a time. Strategies,
progress tracking, common NullAway errors, and redundant null-guard removal are in
references/incremental-adoption.md.
Kotlin interop (optional)
If the project also has Kotlin sources, the Kotlin compiler (K2) reads JSpecify annotations on Java APIs and surfaces accurate nullability instead of platform types. See references/kotlin-interop.md.
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对 Java 项目中防止 NullPointerException 和增强可空性处理的明确需求,提供完整闭环操作
- 涵盖 Maven 和 Gradle 两种主流构建工具的配置方案,实用性强
Highlights
- 触发词精准完整,覆盖添加 JSpecify 支持、防止 NPE、处理可空性等多种变体,边界清晰
Highlights
- 结构清晰,分多个 Phase 并提供完整代码示例,frontmatter 完整
Areas to improve
-
引用文件缺失 Reported severity: Major
SKILL.md 引用了 scripts/verify_nullmarked.py 文件,但 ZIP 包中未提供,导致验证功能无法执行
Recommendation: 请补充 scripts/verify_nullmarked.py 文件,或移除相关引用
-
引用文件缺失 Reported severity: Major
SKILL.md 引用了 references/annotation-migration.md 文件,但 ZIP 包中未提供,用户无法查阅迁移指南
Recommendation: 请补充 references/annotation-migration.md 文件,或移除相关引用
-
引用文件缺失 Reported severity: Major
SKILL.md 引用了 references/incremental-adoption.md 文件,但 ZIP 包中未提供,用户无法查阅增量采用策略
Recommendation: 请补充 references/incremental-adoption.md 文件,或移除相关引用
-
引用文件缺失 Reported severity: Major
SKILL.md 引用了 references/kotlin-interop.md 文件,但 ZIP 包中未提供,用户无法查阅 Kotlin 互操作说明
Recommendation: 请补充 references/kotlin-interop.md 文件,或移除相关引用
Highlights
- 提供了 Maven/Gradle 的具体配置代码,参数明确,工具来源清晰
- 覆盖了迁移现有注解库和增量采用等合理预期场景
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.