111-java-maven-dependencies

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Add Maven dependencies for improved code quality

添加用于提升代码质量的Maven依赖

Add essential Maven dependencies that enhance code quality and safety through a consultative, question-driven approach. This is an interactive SKILL.
What is covered in this Skill?
  • JSpecify: (nullness annotations,
    provided
    scope)
  • Error Prone + NullAway: (enhanced static analysis with compile-time null checking)
  • VAVR: (functional programming with Try/Either and immutable collections)
  • ArchUnit: (architecture rule enforcement,
    test
    scope)
通过咨询式、以问题为导向的方式添加可提升代码质量与安全性的必要Maven依赖。这是一个交互式SKILL
本Skill涵盖哪些内容?
  • JSpecify:(空值注解,
    provided
    作用域)
  • Error Prone + NullAway:(增强型静态分析,支持编译时空值检查)
  • VAVR:(函数式编程,包含Try/Either与不可变集合)
  • ArchUnit:(架构规则强制执行,
    test
    作用域)

Constraints

约束条件

Before adding Maven dependencies, ensure the project is in a valid state. Use a consultative, question-driven flow that adds only what the user selects.
  • MANDATORY: Run
    ./mvnw validate
    or
    mvn validate
    before any changes
  • SAFETY: If validation fails, stop and ask the user to fix issues—do not proceed until resolved
  • BEFORE ASKING QUESTIONS: Read the reference to use the exact wording and options from the template. Ask questions one-by-one in strict order (JSpecify → Enhanced Compiler Analysis (conditional) → VAVR → ArchUnit) and add only what the user selects. Use consultative language, present trade-offs, and wait for user responses before implementing
在添加Maven依赖之前,请确保项目处于有效状态。采用咨询式、以问题为导向的流程,仅添加用户选择的内容。
  • 强制要求:在进行任何更改前运行
    ./mvnw validate
    mvn validate
  • 安全要求:如果验证失败,请停止操作并要求用户修复问题——在问题解决前不得继续
  • 提问前准备:查阅参考文档,使用模板中的准确措辞与选项。严格按照顺序逐一提问(JSpecify → 增强型编译器分析(可选)→ VAVR → ArchUnit),仅添加用户选择的内容。使用咨询性语言,说明利弊,在实施前等待用户回复

When to use this skill

何时使用本Skill

  • Add Maven dependencies
  • Add JSpecify nullness dependencies
  • Add Error Prone NullAway dependencies
  • Add VAVR functional dependencies
  • Add ArchUnit architecture testing dependencies
  • 添加Maven依赖
  • 添加JSpecify空值依赖
  • 添加Error Prone NullAway依赖
  • 添加VAVR函数式依赖
  • 添加ArchUnit架构测试依赖

Reference

参考资料

For detailed guidance, examples, and constraints, see references/111-java-maven-dependencies.md.
如需详细指南、示例和约束条件,请参阅 references/111-java-maven-dependencies.md