Token导航 LogoToken导航

Agent Skill · 待分类

gradle-performance-optimization(梯度性能优化)

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

gradle-performance-optimization 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 8,815。

总安装 275周安装 11GitHub Stars 1下载 89核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:gradle-performance-optimization(梯度性能优化)
来源仓库:https://github.com/dawiddutoit/custom-claude
仓库路径:skills/gradle-performance-optimization
安装命令:
npx skills add https://github.com/dawiddutoit/custom-claude --skill gradle-performance-optimization
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dawiddutoit/custom-claude --skill gradle-performance-optimization

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

专注于 Gradle 构建过程的性能分析与深度调优。适合大型单体或微服务项目中构建缓慢的痛点解决。gradle-performance-optimization 属于待分类类 Skill,可作为该场景下的辅助能力补充。支持增量编译、并行化、缓存机制等多维度优化建议。

需具备读取 gradle.properties 及任务执行日志的权限。注意:部分优化可能改变默认行为,需验证兼容性。

来源仓库内路径:skills/gradle-performance-optimization

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dawiddutoit/custom-claude --skill gradle-perfo…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

gradle-performance-optimization 怎么安装?

在终端执行 npx skills add https://github.com/dawiddutoit/custom-claude --skill gradle-performance-opt…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

gradle-performance-optimization 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

gradle-performance-optimization 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

gradle-performance-optimization 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

gradle-performance-optimization 用的人多吗?

公开数据是累计安装 275 次,近一周安装 11 次,下载 89 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

gradle-performance-optimization 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
gradle-performance-optimization

梯度性能优化 · 本页

2751需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Gradle Performance Optimization

Table of Contents

Purpose

Dramatically improve Gradle build speed through intelligent caching, parallel execution, and configuration optimization. Properly configured projects can see 50-80% reduction in build times.

When to Use

Use this skill when you need to:

  • Speed up slow Gradle builds (>2 minutes for medium projects)
  • Optimize CI/CD pipeline build times
  • Configure caching for multi-module projects
  • Enable configuration cache for faster configuration phase
  • Set up parallel execution for independent subprojects
  • Tune JVM memory settings for large projects
  • Generate build scans to identify performance bottlenecks
  • Implement dependency locking for reproducible builds

Quick Start

Add these lines to gradle.properties:

# Enable caching (87% faster with cache hits)
org.gradle.caching=true
org.gradle.configuration-cache=true

# Enable parallel execution
org.gradle.parallel=true

# Configure memory (4GB for most projects)
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# Keep daemon running (enabled by default)
org.gradle.daemon=true

Then run:

./gradlew build --build-cache --parallel

Instructions

Step 1: Enable Build Cache

The build cache stores task outputs and reuses them when inputs haven't changed.

Enable local cache in gradle.properties:

org.gradle.caching=true

Results: 87% faster builds on cache hits (35s down to 4.5s example)

Configure remote cache for CI (optional but recommended for teams):

// settings.gradle.kts
buildCache {
    local {
        isEnabled = true
    }
    remote<HttpBuildCache> {
        url = uri("https://build-cache.company.com/cache/")
        isEnabled = true
        isPush = System.getenv("CI") == "true"  // Only CI pushes
        credentials {
            username = System.getenv("CACHE_USERNAME")
            password = System.getenv("CACHE_PASSWORD")
        }
    }
}

Step 2: Enable Configuration Cache

Configuration cache skips the entire configuration phase when inputs haven't changed. Gradle 8.11+ gives 65% median time reduction.

Enable in gradle.properties:

org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn  # Start with warnings

Verify compatibility:

./gradlew help --configuration-cache

Check configuration cache report:

build/reports/configuration-cache/<hash>/configuration-cache-report.html

Step 3: Enable Parallel Execution

Execute tasks from different projects simultaneously.

Enable in gradle.properties:

org.gradle.parallel=true
org.gradle.workers.max=4  # Adjust based on CPU cores (default: num cores)

Effectiveness: 30-50% faster for multi-module projects

Note: Requires independent subprojects; tasks within same project run sequentially unless using configuration cache.

Step 4: Configure Memory Settings

Proper JVM heap allocation is critical for large projects.

For most projects (up to 30 modules) in gradle.properties:

org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

For large projects (30+ modules):

org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

Memory allocation guidelines:

  • Small projects (1-10 modules): 2-4 GB (-Xmx2g to -Xmx4g)
  • Medium projects (10-30 modules): 4-6 GB (-Xmx4g to -Xmx6g)
  • Large projects (30+ modules): 6-8 GB (-Xmx6g to -Xmx8g)

Step 5: Configure Daemon Settings

Gradle daemon is enabled by default but can be optimized.

In gradle.properties:

org.gradle.daemon=true
org.gradle.daemon.idletimeout=3600000  # 1 hour (default: 3 hours)

Manage daemon:

./gradlew --status              # Show running daemons
./gradlew --stop                # Stop all daemons
./gradlew build --no-daemon     # Run without daemon (for debugging)

Step 6: Dependency Resolution Optimization

Lock dependency versions for reproducible, faster builds.

Generate lock files:

./gradlew dependencies --write-locks

Result: gradle.lockfile and configuration-specific lock files created

Verify against locks:

./gradlew dependencies --verify-locks

Step 7: Enable Build Scans

Visualize build performance and identify bottlenecks.

One-time scan:

./gradlew build --scan

Automatic scanning in builds:

// build.gradle.kts
plugins {
    id("com.gradle.build-scan") version "3.17"
}

buildScan {
    termsOfServiceUrl = "https://gradle.com/terms-of-service"
    termsOfServiceAgree = "yes"
    publishAlways()
}

Step 8: Optimize CI/CD Configuration

Detect CI environment and adjust behavior:

// build.gradle.kts
val isCi = System.getenv("CI") != null

if (isCi) {
    // CI-specific build scan
    buildScan {
        termsOfServiceUrl = "https://gradle.com/terms-of-service"
        termsOfServiceAgree = "yes"
        publishAlways()
        tag("CI")
        tag(System.getenv("CI_COMMIT_REF_NAME") ?: "unknown")
    }
}

Examples

Example 1: Complete Optimized gradle.properties

# Gradle Optimization Configuration

# === CACHING ===
# Build cache - stores task outputs for reuse (87% faster on hits)
org.gradle.caching=true

# Configuration cache - skip configuration phase (65% faster median time)
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn

# === EXECUTION ===
# Parallel execution - run tasks from different projects simultaneously
org.gradle.parallel=true
org.gradle.workers.max=4

# Daemon - long-running JVM process (enabled by default)
org.gradle.daemon=true
org.gradle.daemon.idletimeout=3600000

# === MEMORY ===
# JVM heap for Gradle daemon (adjust for project size)
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# === DEBUGGING ===
# Uncomment if needed
# org.gradle.logging.level=info
# org.gradle.debug=true

Example 2: Enabling Configuration Cache with Warnings

Start with warnings to identify incompatible plugins:

# gradle.properties
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn  # Shows warnings instead of failing

Monitor output:

./gradlew build 2>&1 | grep -i "configuration-cache"

Fix issues, then switch to strict mode:

# Once all issues are fixed
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=fail  # Now strict

Example 3: CI/CD GitHub Actions with Optimization

# .github/workflows/build.yml
name: Optimized Build

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Set up JDK 21
      uses: actions/setup-java@v4
      with:
        java-version: '21'
        distribution: 'temurin'

    - name: Setup Gradle (official action with caching)
      uses: gradle/actions/setup-gradle@v4
      with:
        cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

    - name: Build with Gradle (optimized)
      run: ./gradlew build --parallel --build-cache --configuration-cache --scan
      env:
        CI: true

    - name: Upload build scans
      if: always()
      uses: actions/upload-artifact@v4
      with:
        name: build-scans
        path: build/reports/

Example 4: GitLab CI/CD with Performance Tuning

# .gitlab-ci.yml
image: gradle:8.11-jdk21-alpine

variables:
  GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.caching=true -Dorg.gradle.parallel=true"
  GRADLE_USER_HOME: "$CI_PROJECT_DIR/.gradle"

cache:
  key: "$CI_COMMIT_REF_SLUG"
  paths:
    - .gradle/wrapper
    - .gradle/caches

build:
  stage: build
  script:
    - chmod +x ./gradlew
    - ./gradlew assemble --parallel --build-cache --configuration-cache
  artifacts:
    paths:
      - build/libs/*.jar
    expire_in: 1 day

test:
  stage: test
  script:
    - ./gradlew test --parallel --build-cache --configuration-cache
  artifacts:
    when: always
    reports:
      junit: build/test-results/test/TEST-*.xml

Example 5: Measuring Build Performance Improvement

# Before optimization
time ./gradlew clean build
# Real    2m 30s

# After optimization
time ./gradlew build --parallel --build-cache --configuration-cache
# Real    0m 45s (82% improvement!)

# Generate build scan for detailed analysis
./gradlew build --scan
# Opens scan at https://scans.gradle.com

Example 6: Dependency Locking for Consistency

# Generate lock files
./gradlew dependencies --write-locks

# Verify locks in CI
./gradlew dependencies --verify-locks

# Update lock files (controlled)
./gradlew dependencies --write-locks --refresh-dependencies

Commands Reference

See references/commands-and-troubleshooting.md for complete command reference, troubleshooting guide, and optimization checklist.

See Also

平台分布

Codex

37.75%
按下载量换算34

Claude

29.12%
按下载量换算26

Cursor

19.45%
按下载量换算17

Gemini CLI

9.58%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills