build-config-kmp

Configure per-environment build values and secrets for Kotlin Multiplatform projects.

Updated Sep 12, 2026
One-click install
npx skills add https://github.com/Vierco/citoVisionApp --skill build-config-kmp-vierco
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: build-config-kmp
Source: https://github.com/Vierco/citoVisionApp/tree/main/.claude/skills/build-config-kmp
Command: npx skills add https://github.com/Vierco/citoVisionApp --skill build-config-kmp-vierco

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing environment-specific configuration (dev/staging/prod base URLs, API keys, compile-time feature flags) in a Kotlin Multiplatform project often leads to duplicated literals, leaked secrets in the repository, and builds that silently mix values from different environments. This Skill defines a consistent way to generate a multiplatform BuildConfig and expose it safely to the app. ## Core Features & Use Cases - Per-environment build configuration: Select dev, staging, or prod values at build time via a Gradle property (-PappEnv=...) using the com.github.gmazzo.buildconfig plugin (6.x line). - Secret management: Read API keys and build tokens from environment variables or a non-versioned local.properties/.env file, never hardcoding them in build.gradle.kts. - Decoupled access layer: Wrap the generated BuildConfig in an AppConfig object in core/config so UseCases, Repositories, and the Ktor HTTP client never depend on the plugin-generated class directly. - Use Case: You need your Ktor client to point at https://dev.api.citovision.com in development and https://api.citovision.com in release builds, while injecting a private API key from CI without committing it to git. ## Quick Start Ask the AI to set up per-environment build configuration with the gmazzo BuildConfig plugin in the shared module, wrapping the generated BuildConfig in an AppConfig object and reading the API key from an environment variable.

Frequently Asked Questions about build-config-kmp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set different API base URLs per environment in Kotlin Multiplatform?▼

Use the com.github.gmazzo.buildconfig plugin in the shared module and select values with a Gradle property like -PappEnv=staging. Group each environment's values in a single map in the build script and expose them through buildConfigField entries.

How do I keep API keys out of a Gradle build script?▼

Read secrets from environment variables or a non-versioned local.properties or .env file listed in .gitignore. Commit a local.properties.example template documenting the expected variables without real values, and fail the build explicitly when a required variable is missing.

Does the gmazzo BuildConfig plugin support Kotlin Multiplatform?▼

Yes, the 6.x line generates a multiplatform BuildConfig using expect/actual for values that differ per platform, but the author marks multiplatform support as experimental. Pin the plugin version and check its changelog before upgrading, since some useKotlinOutput combinations with com.android.library have known bugs.

When should I not use build-time configuration for values?▼

Do not use it for runtime user preferences, which belong in DataStore settings, or for runtime secrets like session tokens obtained after login, which belong in secure storage. BuildConfig is only for values fixed at compile time.

Why wrap the generated BuildConfig in an AppConfig object?▼

Wrapping BuildConfig in an AppConfig class in core/config prevents Domain and Application layers from depending on a plugin-generated class name. This keeps UseCases, Repositories, and ViewModels decoupled from the build tool so it can be replaced later.