Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计通过

gradle-standards等级标准

Agent Skill

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。它适合让 Agent 分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码;涉及数据库、事务、并发或框架配置时,应先确认运行环境和回归测试范围。

总安装

432

周安装

18

GitHub Stars

38

下载量

144
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gradle-standards(等级标准)
来源仓库:https://github.com/bitsoex/bitso-java
仓库路径:skills/gradle-standards
安装命令:
npx skills add https://github.com/bitsoex/bitso-java --skill gradle-standards
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/bitsoex/bitso-java --skill gradle-standards

简介

提供企业级 Gradle 构建标准模板与规范检查工具。

  • 适合团队协作中统一编码风格、目录结构与发布流程。
  • 内置代码质量门禁,拦截不符合约定的提交内容。gradle-standards 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 使用前需同步团队制定的标准文档作为规则依据。
  • 注意:强制标准可能导致历史项目适配成本上升。

SKILL.md

Gradle Standards

Standards for Gradle configuration in Java projects, including version catalogs, dependency bundles, and multi-module setup.

When to use this skill

  • Setting up a new Gradle project
  • Adding or updating dependencies
  • Configuring multi-module builds
  • Troubleshooting dependency conflicts
  • Migrating to version catalogs
  • Cleaning up unused dependencies
  • Optimizing build performance
  • When asked for "gradle dependencies cleanup"

Skill Contents

Sections

Available Resources

📚 references/ - Detailed documentation


Quick Start

1. Version Centralization (Required)

All versions MUST be centralized in gradle/libs.versions.toml:

[versions]
spring-boot = "3.5.9"
grpc = "1.78.0"

[libraries]
spring-boot-starter-web = { module = "org.springframework.boot:spring-boot-starter-web", version.ref = "spring-boot" }
spring-boot-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "spring-boot" }

2. Use in build.gradle

dependencies {
    // ✅ CORRECT: Use version catalog with explicit dependencies
    implementation libs.spring.boot.starter.web
    implementation libs.spring.boot.starter.actuator

    // ❌ NEVER: Hardcode versions
    // implementation "org.springframework.boot:spring-boot-starter-web:3.5.9"
}

Key Principles

PrincipleDescription
Centralize VersionsAll versions in libs.versions.toml, never inline
Explicit DependenciesDeclare each dependency explicitly for clarity
Use Native LockingUse Gradle's native dependency locking (Gradle 9+ recommended)
Never DowngradeDon't replace existing versions with older ones
Use platform() for BOMsImport BOMs via platform(), never enforcedPlatform() or mavenBom directives
Catalog FirstAll versions should come from the version catalog; use resolutionStrategy.force only as a last resort for security
Lock DependenciesGenerate gradle.lockfile for ALL submodules (use custom resolveAndLockAll task with --write-locks; see native-dependency-locking.md for task definition)

Version Conflicts

All projects should preferably use the versions defined in the version catalog. When the resolved version doesn't match the catalog for some reason, prefer fixing the root cause:

  1. First: Define the correct version in the version catalog and declare the dependency explicitly
  2. Second: Use platform() to import a BOM that manages the version (e.g., Spring Boot dependencies)
  3. Last resort: Use resolutionStrategy.force only for security-critical overrides where the above approaches don't work
// AVOID unless absolutely necessary for security
configurations.configureEach {
    resolutionStrategy {
        // Only for security-critical overrides as a last resort
        force libs.commons.compress  // CVE fix not yet in BOM
    }
}

References

ReferenceDescription
references/version-catalogs.mdComplete version catalog guide
references/multi-module.mdMulti-module project setup
references/native-dependency-locking.mdGradle native locking (Gradle 9+ recommended)
references/cleanup-workflow.mdDependency cleanup process
references/unused-detection.mdFinding unused dependencies
references/optimization.mdBuild optimization techniques
references/troubleshooting.mdCommon issues and solutions

Related Rules

Dependency Resolution Stack

┌─────────────────────────────────────────────────────────────────────┐
│  1. VERSION CATALOG (libs.versions.toml)                            │
│     Single source of truth for declared versions                    │
├─────────────────────────────────────────────────────────────────────┤
│  2. RESOLUTION STRATEGY (build.gradle)                              │
│     Use Gradle's native resolutionStrategy for:                     │
│     - force() for security fixes                                    │
│     - eachDependency for group alignment                            │
│     - dependencySubstitution for module replacement                 │
├─────────────────────────────────────────────────────────────────────┤
│  3. LOCK FILE (gradle.lockfile)                                     │
│     Native Gradle locking (Gradle 9+ recommended)                   │
│     Captures EXACT resolved versions                                │
│                                                                     │
│  ⚠️  CRITICAL: Multi-module projects need lockfiles for ALL modules │
│     Use: ./gradlew resolveAndLockAll --write-locks                  │
│     NOT: ./gradlew dependencies --write-locks (root only!)          │
└─────────────────────────────────────────────────────────────────────┘

Lock File:

Multi-Module Lockfile Generation:

# ✅ CORRECT: Generates lockfiles for ALL submodules
./gradlew resolveAndLockAll --write-locks --refresh-dependencies --no-daemon --no-scan

# ❌ WRONG: Only generates for ROOT project
./gradlew dependencies --write-locks

# Verify coverage (lockfiles should ≈ build.gradle files)
find . -name "gradle.lockfile" | wc -l
find . -name "build.gradle" | wc -l

Related Skills

SkillPurpose
dependency-managementVersion catalogs and BOMs
dependabot-securitySecurity vulnerability fixes
java-coverageJaCoCo configuration in Gradle
java-testingTest configuration with Spock

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.85%
按下载量换算44

Antigravity

25.12%
按下载量换算36

windsurf

17.32%
按下载量换算25

OpenCode

13.74%
按下载量换算20

Gemini CLI

7.41%
按下载量换算11

Codex

3.3%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills