AgentSkillsCN

build

执行构建、解决错误、运行Lint检查,并优化Gradle配置。

SKILL.md
--- frontmatter
name: build
description: Execute builds, resolve errors, run Lint checks, and optimize Gradle configuration.
argument-hint: "[debug|release|lint|clean|check]"
allowed-tools:
  - Read
  - Write
  - Edit
  - Glob
  - Grep
  - Bash
  - Task

Build & Troubleshoot

Execute project builds, resolve errors, and optimize Gradle configuration.

Commands

Execute based on the argument:

ArgumentAction
debug / (none)./gradlew assembleDebug
release./gradlew assembleRelease
lint./gradlew lint for static analysis
clean./gradlew clean assembleDebug
check./gradlew check (tests + Lint combined)

Build Error Resolution Flow

Step 1: Classify the Error

Read the error message and classify it:

Dependency Errors

  • Version conflicts → Unify in libs.versions.toml
  • Unresolved dependencies → Check Maven repositories
  • BOM version mismatches

Compilation Errors

  • Type mismatches, unresolved references
  • API changes in alpha/beta libraries
  • Kotlin version and Compose Compiler compatibility

Resource Errors

  • Undefined string/drawable resources
  • AndroidManifest configuration mistakes

Gradle Configuration Errors

  • Plugin version mismatches
  • compileSdk / minSdk / targetSdk settings
  • Java/Kotlin version mismatches

Step 2: Fix

  • Apply minimum changes to resolve
  • Manage dependency versions through libs.versions.toml
  • Rebuild to verify after fixing

Step 3: Address Lint Results

Address Lint warnings by severity:

  1. Error: Must fix
  2. Warning: Fix when possible
  3. Info: Address as needed

Gradle Best Practices Check

Also verify the following during builds:

  • All versions are centrally managed in libs.versions.toml
  • No hardcoded versions in build.gradle.kts
  • No unused dependencies
  • compileSdk, minSdk, targetSdk are appropriate
  • ProGuard/R8 configuration is correct (for release builds)

Target

$ARGUMENTS