AgentSkillsCN

gradle-plugins

自定义 Gradle 约定插件及其所使用的模块。在创建新模块、修改 build.gradle.kts 文件,或为模块的层级和平台选择合适的插件时使用。

SKILL.md
--- frontmatter
name: gradle-plugins
description: Custom Gradle convention plugins and which modules use them. Use when creating new modules, modifying build.gradle.kts files, or choosing the right plugin for a module's layer and platform.
user-invocable: false
allowed-tools: Read, Glob, Grep

Gradle Convention Plugins

Read docs/gradle_plugins.md for full plugin details, dependencies each plugin adds, and the complete module-to-plugin mapping.

Module path → plugin

When creating a new module at feat/<feature>/<path>, use this mapping:

code
feat/<feature>/
├── business/                → snagMultiplatformModule
├── fe/
    ├── model/               → snagFrontendMultiplatformModule
│   ├── ports/               → snagFrontendMultiplatformModule
│   ├── app/
│   │   ├── api/             → snagFrontendMultiplatformModule
│   │   ├── impl/            → snagFrontendMultiplatformModule
│   │   └── test/            → snagFrontendMultiplatformModule
│   ├── driving/
│   │   ├── api/             → snagDrivingFrontendMultiplatformModule
│   │   └── impl/            → snagDrivingFrontendMultiplatformModule
│   └── driven/
│       ├── impl/            → snagDrivenFrontendMultiplatformModule
│       └── test/            → snagDrivenFrontendMultiplatformModule
└── be/
    ├── model/               → snagBackendModule
    ├── ports/               → snagBackendModule
    ├── app/
    │   ├── api/             → snagBackendModule
    │   ├── impl/            → snagBackendModule
    │   └── test/            → snagBackendModule
    ├── driving/
    │   ├── contract/        → snagContractDrivingBackendMultiplatformModule
    │   └── impl/            → snagImplDrivingBackendModule
    └── driven/
        ├── impl/            → snagDrivenBackendModule
        └── test/            → snagBackendModule

Applied in build.gradle.kts as: alias(libs.plugins.<alias>)

Plugin inheritance chain

code
snagMultiplatformModule
├── snagFrontendMultiplatformModule
│   ├── snagDrivingFrontendMultiplatformModule    (+ Compose)
│   └── snagNetworkFrontendMultiplatformModule    (+ Ktor client)
│       └── snagDrivenFrontendMultiplatformModule (+ Serialization, DB)
└── snagContractDrivingBackendMultiplatformModule (+ Serialization)

snagBackendModule
├── snagDrivenBackendModule                        (+ Exposed, DB)
└── snagImplDrivingBackendModule                  (+ Ktor server)

Applied in build.gradle.kts as: alias(libs.plugins.<alias>)

Plugin sources: build-logic/src/main/kotlin/cz/adamec/timotej/snag/buildsrc/plugins/ Configuration sources: build-logic/src/main/kotlin/cz/adamec/timotej/snag/buildsrc/configuration/