Token导航 LogoToken导航

Agent Skill · 研究检索

kotlin-tooling-agp9-migration(kotlin 工具 agp9 迁移)

kotlin-tooling-agp9-migration 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

kotlin-tooling-agp9-migration 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 16,689。

总安装 7,033周安装 296GitHub Stars 408下载 2,463核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/kotlin/kotlin-agent-skills --skill kotlin-tooling-agp9-migration

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

kotlin-tooling-agp9-migration 用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。可用于支持技术调研、文档查找或问题排查任务。安装前建议确认权限范围和维护状态,避免触发不必要的联网操作。

可结合原始 README 进一步核验具体功能和使用限制。

来源仓库内路径:skills/kotlin-tooling-agp9-migration

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

kotlin-tooling-agp9-migration 怎么安装?

在终端执行 npx skills add https://github.com/kotlin/kotlin-agent-skills --skill kotlin-tooling-agp9-m…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

kotlin-tooling-agp9-migration 支持哪些 AI 工具?

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

kotlin-tooling-agp9-migration 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

kotlin-tooling-agp9-migration 是免费的吗?

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

kotlin-tooling-agp9-migration 用的人多吗?

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

kotlin-tooling-agp9-migration 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

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

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
kotlin-tooling-agp9-migration

kotlin 工具 agp9 迁移 · 本页

7,033408操作浏览器未明确通过

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

SKILL.md 原文

KMP AGP 9.0 Migration

Android Gradle Plugin 9.0 makes the Android application and library plugins incompatible with the Kotlin Multiplatform plugin in the same module. This skill guides you through the migration.

Step 0: Analyze the Project

Before making any changes, understand the project structure:

  1. Read settings.gradle.kts (or .gradle) to find all modules
  2. For each module, read its build.gradle.kts to identify which plugins are applied
  3. Check if the project uses a Gradle version catalog (gradle/libs.versions.toml). If it exists, read it for current AGP/Gradle/Kotlin versions. If not, find versions directly in build.gradle.kts files (typically in the root buildscript {} or plugins {} block). Adapt all examples in this guide accordingly — version catalog examples use alias(libs.plugins.xxx) while direct usage uses id("plugin.id") version "x.y.z"
  4. Read gradle/wrapper/gradle-wrapper.properties for the Gradle version
  5. Check gradle.properties for any existing workarounds (android.enableLegacyVariantApi)
  6. Check for org.jetbrains.kotlin.android plugin usage — AGP 9.0 has built-in Kotlin and this plugin must be removed
  7. Check for org.jetbrains.kotlin.kapt plugin usage — incompatible with built-in Kotlin, must migrate to KSP or com.android.legacy-kapt
  8. Check for third-party plugins that may be incompatible with AGP 9.0 (see "Plugin Compatibility" section below)

If Bash is available, run scripts/analyze-project.sh from this skill's directory to get a structured summary.

Classify Each Module

For each module, determine its type:

Current pluginsMigration path
kotlin.multiplatform + com.android.libraryPath A — Library plugin swap
kotlin.multiplatform + com.android.applicationPath B — Mandatory Android split
kotlin.multiplatform with multiple platform entry points in one modulePath C — Full restructure (recommended)
com.android.application or com.android.library (no KMP)See "Pure Android Tips" below

Determine Scope

  • Path B is mandatory for any module combining KMP + Android application plugin
  • Path C is recommended when the project has a monolithic composeApp (or similar) module containing entry points for multiple platforms (Android, Desktop, Web). This aligns with the new JetBrains default project structure where each platform gets its own app module.
  • Ask the user whether they want Path B only (minimum required) or Path C (recommended full restructure)

Path A: Library Module Migration

Use this when a module applies kotlin.multiplatform + com.android.library.

See references/MIGRATION-LIBRARY.md for full before/after code.

Summary:

  1. Replace plugin: com.android.library → com.android.kotlin.multiplatform.library
  2. Remove org.jetbrains.kotlin.android plugin if present (AGP 9.0 has built-in Kotlin support)
  3. Migrate DSL: Move config from top-level android {} block into kotlin {android {}}: kotlin {android {namespace = "com.example.lib" compileSdk = 35 minSdk = 24}}
  4. Rename source directories (only if the module uses classic Android layout instead of KMP layout):

- src/main → src/androidMain - src/test → src/androidHostTest - src/androidTest → src/androidDeviceTest - If the module already uses src/androidMain/, no directory renames are needed

  1. Move dependencies from top-level dependencies {} into sourceSets: kotlin {sourceSets {androidMain.dependencies {implementation("androidx.appcompat:appcompat:1.7.0")}}}
  2. Enable resources explicitly if the module uses Android or Compose Multiplatform resources: kotlin {android {androidResources {enable = true}}}
  3. Enable Java compilation if module has .java source files: kotlin {android {withJava()}}
  4. Enable tests explicitly if the module has unit or instrumented tests: kotlin {android {withHostTest {isIncludeAndroidResources = true} withDeviceTest {instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"}}}
  5. Update Compose tooling dependency: // Old: debugImplementation(libs.androidx.compose.ui.tooling) // New: androidRuntimeClasspath(libs.androidx.compose.ui.tooling)
  6. Publish consumer ProGuard rules explicitly if applicable: kotlin {android {consumerProguardFiles.add(file("consumer-rules.pro"))}}
  7. Resolve Sub-dependency Variants (Product Flavors / Build Types): Because the new KMP Android library plugin enforces a single-variant architecture, it does not natively understand how to resolve dependencies that publish multiple variants (like debug/release build types, or product flavors like free/paid). Configure fallback behaviors using localDependencySelection: kotlin {android {localDependencySelection {// Determine which build type to consume from Android library dependencies, in order of preference selectBuildTypeFrom.set(listOf("debug", "release")) // If the dependency has a 'tier' dimension, select the 'free' flavor productFlavorDimension("tier") {selectFrom.set(listOf("free"))}}}}

Path B: Android App + Shared Module Split

Use this when a module applies kotlin.multiplatform + com.android.application. This is mandatory for AGP 9.0 compatibility.

See references/MIGRATION-APP-SPLIT.md for full guide.

Summary:

  1. Create androidApp module with its own build.gradle.kts: plugins {alias(libs.plugins.androidApplication) // Do NOT apply kotlin-android — AGP 9.0 includes Kotlin support alias(libs.plugins.composeMultiplatform) // if using Compose alias(libs.plugins.composeCompiler) // if using Compose} android {namespace = "com.example.app" compileSdk = 35 defaultConfig {applicationId = "com.example.app" minSdk = 24 targetSdk = 35 versionCode = 1 versionName = "1.0"} buildFeatures {compose = true}} dependencies {implementation(projects.shared) // or whatever the shared module is named implementation(libs.androidx.activity.compose)}
  2. Move Android entry point code from src/androidMain/ to androidApp/src/main/:

- MainActivity.kt (and any other Activities/Fragments) - AndroidManifest.xml (app-level manifest with <application> and launcher <activity>) — verify android:name on <activity> uses the fully qualified class name in its new location - Android Application class if present - App-level resources (launcher icons, theme, etc.)

  1. Add to settings.gradle.kts: include(":androidApp")
  2. Add to root build.gradle.kts: plugin declarations with apply false
  3. Convert original module from application to library using Path A steps
  4. Ensure different namespaces: app module and library module must have distinct namespaces
  5. Remove from shared module: applicationId, targetSdk, versionCode, versionName
  6. Update IDE run configurations: change the module from the old module to androidApp

Path C: Full Restructure (Recommended)

Use this when the project has a monolithic module (typically composeApp) containing entry points for multiple platforms. This is optional but aligns with the new JetBrains default.

See references/MIGRATION-FULL-RESTRUCTURE.md for full guide.

Target Structure

project/
├── shared/              ← KMP library (was composeApp), pure shared code
├── androidApp/          ← Android entry point only
├── desktopApp/          ← Desktop entry point only (if desktop target exists)
├── webApp/              ← Wasm/JS entry point only (if web target exists)
├── iosApp/              ← iOS Xcode project (usually already separate)
└── ...

Steps

  1. Apply Path B first — extract androidApp (mandatory for AGP 9.0)
  2. Extract desktopApp (if desktop target exists):

- Create module with org.jetbrains.compose and application {} plugin - Move main() function from desktopMain to desktopApp/src/main/kotlin/ - Move compose.desktop {application {...}} config to desktopApp/build.gradle.kts - Add dependency on shared module

  1. Extract webApp (if wasmJs/js target exists):

- Create module with appropriate Kotlin/JS or Kotlin/Wasm configuration - Move web entry point from wasmJsMain/jsMain to webApp/src/wasmJsMain/kotlin/ - Move browser/distribution config to webApp/build.gradle.kts - Add dependency on shared module

  1. iOS — typically already in a separate iosApp directory. Verify:

- Framework export config (binaries.framework) stays in shared module - Xcode project references the correct framework path

  1. Rename module from composeApp to shared:

- Rename directory - Update settings.gradle.kts include - Update all dependency references across modules

  1. Clean up shared module: remove all platform entry point code and app-specific config that was moved to the platform app modules

Variant: Native UI

If some platforms use native UI (e.g., SwiftUI for iOS), split shared into:

  • sharedLogic — business logic consumed by ALL platforms
  • sharedUI — Compose Multiplatform UI consumed only by platforms using shared UI

Variant: Server

If the project includes a server target:

  • Add server module at the root
  • Move all client modules under an app/ directory
  • Add core module for code shared between server and client (models, validation)

Version Updates

These are required regardless of migration path:

  1. Gradle wrapper — update to 9.1.0+: # gradle/wrapper/gradle-wrapper.properties distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
  2. AGP version — update to 9.0.0+ and add the KMP library plugin. With version catalog (gradle/libs.versions.toml): [versions] agp = "9.0.1" [plugins] android-kotlin-multiplatform-library = {id = "com.android.kotlin.multiplatform.library", version.ref = "agp"} Without version catalog — update com.android.* plugin versions and add in root build.gradle.kts: plugins {id("com.android.application") version "9.0.1" apply false id("com.android.kotlin.multiplatform.library") version "9.0.1" apply false}
  3. JDK — ensure JDK 17+ is used (required by AGP 9.0)
  4. SDK Build Tools — update to 36.0.0: Install via SDK Manager or configure in android {buildToolsVersion = "36.0.0"}
  5. Review gradle.properties — remove error-causing properties and review changed defaults (see "Gradle Properties Default Changes" section)

Built-in Kotlin Migration

AGP 9.0 enables built-in Kotlin support by default for all com.android.application and com.android.library modules. The org.jetbrains.kotlin.android plugin is no longer needed and will conflict if applied.

Important: Built-in Kotlin does NOT replace KMP support. KMP library modules still need org.jetbrains.kotlin.multiplatform + com.android.kotlin.multiplatform.library.

Step 1: Remove kotlin-android Plugin

Remove from all module-level and root-level build files:

// Remove from module build.gradle.kts
plugins {
    // REMOVE: alias(libs.plugins.kotlin.android)
    // REMOVE: id("org.jetbrains.kotlin.android")
}

// Remove from root build.gradle.kts
plugins {
    // REMOVE: alias(libs.plugins.kotlin.android) apply false
}

Remove from version catalog (gradle/libs.versions.toml):

[plugins]
# REMOVE: kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

Step 2: Migrate kapt to KSP or legacy-kapt

The org.jetbrains.kotlin.kapt plugin is incompatible with built-in Kotlin.

Preferred: Migrate to KSP — see the KSP migration guide for each annotation processor.

Fallback: Use com.android.legacy-kapt (same version as AGP):

# gradle/libs.versions.toml
[plugins]
legacy-kapt = { id = "com.android.legacy-kapt", version.ref = "agp" }
// Module build.gradle.kts — replace kotlin-kapt with legacy-kapt
plugins {
    // REMOVE: alias(libs.plugins.kotlin.kapt)
    alias(libs.plugins.legacy.kapt)
}

Step 3: Migrate kotlinOptions to compilerOptions

For pure Android modules (non-KMP), migrate android.kotlinOptions {} to the top-level kotlin.compilerOptions {}:

// Old
android {
    kotlinOptions {
        jvmTarget = "11"
        languageVersion = "2.0"
        freeCompilerArgs += listOf("-Xopt-in=kotlin.RequiresOptIn")
    }
}

// New
kotlin {
    compilerOptions {
        jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
        languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
        optIn.add("kotlin.RequiresOptIn")
    }
}

Note: With built-in Kotlin, jvmTarget defaults to android.compileOptions.targetCompatibility, so it may be optional if you already set compileOptions.

Step 4: Migrate kotlin.sourceSets to android.sourceSets

With built-in Kotlin, only android.sourceSets {} with the kotlin set is supported:

// NOT SUPPORTED with built-in Kotlin:
kotlin.sourceSets.named("main") {
    kotlin.srcDir("additionalSourceDirectory/kotlin")
}

// Correct:
android.sourceSets.named("main") {
    kotlin.directories += "additionalSourceDirectory/kotlin"
}

For generated sources, use the Variant API:

androidComponents.onVariants { variant ->
    variant.sources.kotlin!!.addStaticSourceDirectory("additionalSourceDirectory/kotlin")
}

Per-Module Migration Strategy

For large projects, migrate module-by-module:

  1. Disable globally: android.builtInKotlin=false in gradle.properties
  2. Enable per migrated module by applying the opt-in plugin: plugins {id("com.android.built-in-kotlin") version "AGP_VERSION"}
  3. Follow Steps 1-4 for that module
  4. Once all modules are migrated, remove android.builtInKotlin=false and all com.android.built-in-kotlin plugins

Optional: Disable Kotlin for Non-Kotlin Modules

For modules that contain no Kotlin sources, disable built-in Kotlin to save build time:

android {
    enableKotlin = false
}

Opt-Out (Temporary)

If blocked by plugin incompatibilities, opt out temporarily:

# gradle.properties
android.builtInKotlin=false
android.newDsl=false  # also required if using new DSL opt-out

Warning: Ask the user if they want to opt out, and if so, remind them this is a temporary measure.

Plugin Compatibility

See references/PLUGIN-COMPATIBILITY.md for the full compatibility table with known compatible versions, opt-out flag workarounds, and broken plugins.

Before migrating, inventory all plugins in the project and check each against that table. If any plugin is broken without workaround, inform the user. If plugins need opt-out flags, add them togradle.properties and note them as temporary workarounds.

Gradle Properties Default Changes

AGP 9.0 changes the defaults for many Gradle properties. Check gradle.properties for any explicitly set values that may now conflict. Key changes:

PropertyOld DefaultNew DefaultAction
android.uniquePackageNamesfalsetrueEnsure each library has a unique namespace
android.enableAppCompileTimeRClassfalsetrueRefactor switch on R fields to if/else
android.defaults.buildfeatures.resvaluestruefalseEnable resValues = true where needed
android.defaults.buildfeatures.shaderstruefalseEnable shaders where needed
android.r8.optimizedResourceShrinkingfalsetrueReview R8 keep rules
android.r8.strictFullModeForKeepRulesfalsetrueUpdate keep rules to be explicit
android.proguard.failOnMissingFilesfalsetrueRemove invalid ProGuard file references
android.r8.proguardAndroidTxt.disallowedfalsetrueUse proguard-android-optimize.txt only
android.r8.globalOptionsInConsumerRules.disallowedfalsetrueRemove global options from library consumer rules
android.sourceset.disallowProviderfalsetrueUse Sources API on androidComponents
android.sdk.defaultTargetSdkToCompileSdkIfUnsetfalsetrueSpecify targetSdk explicitly
android.onlyEnableUnitTestForTheTestedBuildTypefalsetrueOnly if testing non-default build types

Check for and remove properties that now cause errors:

  • android.r8.integratedResourceShrinking — removed, always on
  • android.enableNewResourceShrinker.preciseShrinking — removed, always on

Pure Android Tips

For non-KMP Android modules upgrading to AGP 9.0, follow the "Built-in Kotlin Migration" steps above, then review the "Gradle Properties Default Changes" table. Additional changes:

  • Review new DSL interfaces — BaseExtension is removed; use CommonExtension or specific extension types
  • Java default changed from Java 8 to Java 11 — ensure compileOptions reflects this

Verification

After migration, verify with the checklist. Key checks:

  1. ./gradlew build succeeds with no errors
  2. All platform targets build successfully (Android, iOS via xcodebuild, Desktop, JS/Wasm)
  3. ./gradlew:shared:allTests and Android unit tests pass
  4. No com.android.library or com.android.application in KMP modules
  5. No org.jetbrains.kotlin.android in AGP 9.0 modules
  6. Source sets use correct names (androidMain, androidHostTest, androidDeviceTest)
  7. No deprecation warnings about variant API or DSL

Common Issues

See references/KNOWN-ISSUES.md for details. Key gotchas:

KMP Library Plugin Issues

  • BuildConfig unavailable in library modules — use DI/AppConfiguration interface, or use BuildKonfig or gradle-buildconfig-plugin for compile-time constants
  • No build variants — single variant architecture; compile-time constants can use BuildKonfig/gradle-buildconfig-plugin flavors, but variant-specific dependencies/resources/signing must move to app module
  • NDK/JNI unsupported in new plugin — extract to separate com.android.library module
  • Compose resources crash without androidResources {enable = true}
  • Consumer ProGuard rules silently dropped if not migrated to consumerProguardFiles.add(file(...)) in new DSL
  • KSP requires version 2.3.1+ for AGP 9.0 compatibility

AGP 9.0 General Issues

  • BaseExtension removed — convention plugins using old DSL types need rewriting to use CommonExtension
  • Variant APIs removed — applicationVariants, libraryVariants, variantFilter replaced by androidComponents
  • Convention plugins need refactoring — old android {} extension helpers are obsolete

Reference Files

平台分布

Codex

34.58%
按下载量换算852

Claude

27.63%
按下载量换算681

Cursor

19.15%
按下载量换算472

Gemini CLI

9.55%
按下载量换算235

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

继续浏览同类 Skills