跳到正文
cccskills
免费在 GitHub 公开中文介绍

java-development

按照项目现有的 JDK 版本和构建规范开发、构建与维护普通 Java 项目。涵盖 Maven、Gradle、依赖管理、日志、异常处理、代码检查和打包,并通过项目构建验证改动。

原文查看原文说明

Day-to-day plain Java development without a framework: Maven and Gradle usage and wrappers, project layout, dependency and vulnerability management, modern Java idioms by JDK version (records, sealed types, pattern matching, virtual threads), SLF4J logging, error and null handling, immutability, concurrency basics, static analysis and formatting (Spotless, Error Prone, -Xlint), packaging (jar, jlink, jpackage) and GitHub Actions CI. Use when writing, building, reviewing or maintaining ordinary Java code.

集成工具GitHub

实测评分 未实测

查看安装方法

适用场景

  • 按项目 JDK 版本实现功能
  • 排查 Maven 或 Gradle 依赖冲突
  • 检查日志和异常处理
  • 构建 JAR 或应用安装包

中文介绍

功能

此技能支持不依赖特定框架的 Java 实现、构建、审查和维护。它会先查看项目已有的设置与源代码规范,再按照现有 Maven 或 Gradle 配置开展工作。涉及内容包括依赖整理、日志、异常与空值处理、并发基础,以及选择当前 JDK 版本支持的语言功能。它还可以使用项目已经配置的代码检查和格式化工具,并协助生成 JAR 等交付文件。

适用场景

修改现有项目并遵循其惯例、调查依赖冲突或排查构建失败时,可以使用此技能。它也能帮助判断 records、虚拟线程等功能是否适用于项目的 Java 版本。完成变更后,会通过项目自身的构建流程进行验证。

使用示例

  • “按照这个项目使用的 Java 版本实现这段逻辑。”
  • “帮我找出 Maven 依赖冲突的原因。”
  • “按照现有规范检查日志和异常处理。”

注意事项

需要项目适用的 JDK,以及 Maven 或 Gradle;如果项目提供了 Wrapper,应使用它。升级 Java 或依赖、修改公开 API、添加运行时库或构建工具、变更 CI 前需要先确认。只有明确选择时才使用预览功能。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
A良好明确要求升级以及修改 API 或 CI 前先确认。
安装难易度所需工具和 API 密钥是否少且有说明
A良好说明需要 JDK 和 Maven 或 Gradle,并指出优先使用 Wrapper。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月25日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(4)

  • SKILL.md7.7 KB
  • references/build-and-dependencies.md5.3 KB
  • references/modern-java.md5.3 KB
  • references/quality-and-packaging.md8.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Java Development (plain Java)

Everyday guidance for Java projects that are not tied to a framework. If the project uses Spring Boot, Quarkus, Helidon or similar, prefer that framework's skills for framework concerns and use this one for the plain-Java parts.

Rules that always apply

  1. Detect before you write. Read pom.xml/build.gradle*, .mvn/, gradle/, .java-version/.sdkmanrc, .editorconfig, CI files, and a few source files. Match the build tool, Java release, formatter, naming, logging and test libraries already in use.
  2. Never upgrade implicitly. Do not change the Java release, build-tool version, plugin or dependency versions, or add a formatter/linter/static analyzer the project lacks, as a side effect of another task. Suggest it and ask. Version upgrades are their own task (java-upgrade, if installed).
  3. Use the wrapper (./mvnw, ./gradlew) when present; otherwise the installed mvn/gradle. Do not commit a wrapper unprompted.
  4. Verify with a build. After any change run the project's own verification (./mvnw -B verify or ./gradlew build) and report the result. Run a narrower command first while iterating. If you could not run it, say so.
  5. Ask the user before: changing public APIs or serialized/DB/wire formats, raising the Java release, adding runtime dependencies, adding tools to the build, deleting or weakening tests, changing CI, or when two reasonable designs have different trade-offs.
  6. Prefer the standard library and small, explicit code over new dependencies. No Lombok unless already used.

Pick idioms by the project's Java release

Check maven.compiler.release/<release>, java.toolchain, or sourceCompatibility; never use a feature newer than that release. Summary (details and snippets in references/modern-java.md):

ReleaseYou can use
8lambdas, streams, Optional, java.time
11var, String.isBlank/strip/lines, java.net.http.HttpClient, List.of/Map.of (9)
17records, sealed classes, text blocks, switch expressions, instanceof patterns
21pattern matching for switch, record patterns, virtual threads, SequencedCollection (getFirst/getLast/reversed)
22-24unnamed variables _ (22), Stream.gather (24)
25scoped values, instance main/compact source files, module import declarations (all final)

Structured concurrency (StructuredTaskScope) is still a preview API in 25 and 27 (verified: needs --enable-preview); do not use it in production code unless the user opts in to preview features.

Build tools in practice

  • Maven: ./mvnw -B verify (compile, unit tests, integration tests, packaging), -pl <module> -am for one module, dependency:tree, -DskipTests only when the user asks. Gradle: ./gradlew build, test --tests 'pkg.Class', dependencies, dependencyInsight --dependency <name>.
  • Standard layout: src/main/java, src/main/resources, src/test/java, src/test/resources; package by feature, one top-level type per file, no split packages.
  • Set the Java version explicitly (maven.compiler.release / Gradle toolchain with options.release) and UTF-8 encoding; do not rely on the JDK that happens to run the build.
  • Wrapper, BOM and dependency:tree/versions: usage, version catalogs and multi-module layout: references/build-and-dependencies.md.

Dependencies and vulnerabilities

  • Import BOMs (junit-bom, testcontainers-bom, the framework's BOM) instead of repeating versions; one version per library across modules.
  • Inspect before changing: mvn dependency:tree -Dincludes=group:artifact / gradlew dependencyInsight. Resolve conflicts with dependencyManagement or Gradle constraints, not by excluding randomly.
  • Check updates with mvn versions:display-dependency-updates (add -Dmaven.version.ignore to hide alpha/beta/RC) and report them; do not apply major upgrades without asking.
  • Vulnerabilities: use what the project has (Dependabot/Renovate alerts, OWASP dependency-check, OSV-Scanner, GitHub dependency review). Suggest one if none exists; do not add it silently. Keep secrets out of scanner config; NVD-based scanners need an API key to be practical.

Version-dependent failures (verified)

  • JDK 23+ no longer runs annotation processors implicitly (Lombok, MapStruct, Dagger...): -proc:none is the default unless -processor, --processor-path or --processor-module-path is given. Declare the processor path in the build (Maven annotationProcessorPaths, Gradle annotationProcessor) or pass -proc:full. JDK 21+ prints a warning when it detects implicit use; -proc:full is also backported to 17.0.11, 11.0.23 and 8u411. Source: https://inside.java/2024/06/18/quality-heads-up/.
  • Virtual threads and synchronized: on JDK 21-23 a virtual thread that blocks inside synchronized is pinned to its carrier; JEP 491 removes nearly all such pinning in JDK 24+. On 21-23 prefer ReentrantLock around blocking calls. Source: https://openjdk.org/jeps/491.
  • Error Prone on JDK 16+ needs the --add-exports/--add-opens javac flags, and on JDK 21 -XDaddTypeAnnotationsToSymbol=true (see the quality reference).
  • Never use a language feature newer than the project's release (see the table above).

Static analysis and formatting (only if already present, or the user agrees)

Respect what is configured: if the project uses Spotless/Checkstyle/SpotBugs/Error Prone, run them and fix findings; if not, do not add them. When asked to introduce them, start with -Xlint:all and Spotless (formatter only), then Error Prone. Verified configs for Maven and Gradle on JDK 21 and 25 (including the JDK-21-only -XDaddTypeAnnotationsToSymbol=true requirement and Maven .mvn/jvm.config flags) are in references/quality-and-packaging.md. Never reformat the whole codebase in an unrelated change.

Packaging and CI

  • Plain library jar: mvn package/gradlew jar. Runnable app: shaded/fat jar or lib/ directory plus manifest Main-Class; custom runtime with jlink; native installer/app-image with jpackage (verified on macOS, see references/quality-and-packaging.md).
  • GitHub Actions: actions/checkout, actions/setup-java with distribution: temurin, an explicit java-version, built-in dependency cache, then ./mvnw -B verify or ./gradlew build. Snippet and notes in references/quality-and-packaging.md. Do not change CI without asking.

Related skills (use when installed)

java-junit (unit tests), java-testcontainers (integration tests with Docker), java-hibernate-jpa (persistence), java-debugging (failures and stack traces), java-diagnostics (performance, memory, threads, JFR), java-upgrade (JDK/framework upgrades), lsp-setup (Java language server for navigation and refactoring).

References

  • references/modern-java.md: idioms and verified snippets (records, sealed types, switch patterns, text blocks, virtual threads, SequencedCollection, unnamed variables), preview status, pitfalls.
  • references/build-and-dependencies.md: Maven/Gradle commands, wrappers, BOMs, conflict diagnosis, update checking, Dependabot/Renovate, vulnerability scanning.
  • references/quality-and-packaging.md: logging setup, -Xlint, Spotless, Error Prone, Checkstyle/SpotBugs notes, jar/jlink/jpackage, GitHub Actions.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

扫描现有项目的代码与配置,生成涵盖技术栈、结构、架构、规范、集成、测试和风险的七份文档。为结论标注文件依据和未知项,并指出计划描述与实际实现的差异。

  • 了解陌生代码库
  • 准备项目交接文档
  • 对照设计资料与实际实现
github/awesome-copilot4万2026年10月24日 更新

acreadiness-assess

免费有简介

使用AgentRC评估代码仓库对AI智能体的准备情况,并生成可独立打开的HTML报告。查看九个方面的评分和优先改进建议,也可按组织自定评分政策。

  • 引入AI智能体前检查准备情况
  • 根据评估结果安排改进优先级
  • 按组织自定政策评分
github/awesome-copilot4万2026年10月24日 更新

使用AgentRC分析项目代码中的语言、框架和开发惯例,生成或更新AI编程代理的指令文件。可集中写入一个文件,也可按主题和项目区域拆分,并在写入前预览改动。

  • 创建VS Code Copilot指令
  • 将开发规则变更写入指令
  • 按单体仓库区域整理规则
github/awesome-copilot4万2026年10月24日 更新

acreadiness-policy

免费有简介

按团队或组织标准调整AgentRC准备度评估。可选择或创建JSON策略,调整检查权重、停用无关检查、设置通过率,并在CI流程中设定自动检查门槛。

  • 制定组织共用的评估标准
  • 只评估AI相关的准备情况
  • 调整特定检查项的权重
github/awesome-copilot4万2026年10月24日 更新

ad-campaign-analyzer

免费有简介

分析你提供的广告成效数据,找出浪费支出和表现较好的广告,并整理暂停、加预算或继续测试的候选项。还可比较不同平台、评估A/B测试差异,并提出预算调整建议。

  • 找出应暂停的广告或关键词
  • 发现适合增加预算的广告系列
  • 判断A/B测试的数据是否足够
github/awesome-copilot4万2026年10月24日 更新

为指定代码文件添加学习注释,解释语法、编程概念和设计选择;可按读者水平调整讲解深度和重复频率,并保持文件结构、编码与语法。

  • 为现有代码添加初学者说明
  • 解释语法或设计选择的原因
  • 按读者经验调整注释内容
github/awesome-copilot4万2026年10月24日 更新

查看 github 的全部技能

报告此技能的问题