Agent skill

Add Compiler Option

by ZacSweers in ZacSweers/metro

“Adds a new compiler option to Metro.”

— description from SKILL.md by ZacSweers
Apache-2.0Auto-check passedMobile

Install Add Compiler Option

skills CLI
$ npx skills add ZacSweers/metro --skill add-compiler-option -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ZacSweers/metro add-compiler-option --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ZacSweers/metro.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/add-metro-option .claude/skills/add-compiler-option && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-compiler-option
GitHub stars
1.4k
Token cost
~1.1k tokens
SKILL.md length
278 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

  • Works in 5 steps: metro-common/src/main/kotlin/dev/zacsweer… → gradle-plugin/src/main/kotlin/dev/zacswee… → gradle-plugin/src/main/kotlin/dev/zacswee… → …
  • SKILL.md covers Files to Update, Option Types, Naming Conventions and Annotations
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

About this skill

Add Compiler Option is a skill in ZacSweers/metro (1.4k stars). Its SKILL.md is about 1.1k tokens. Licence: Apache-2.0.

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. metro-common/src/main/kotlin/dev/zacsweers/metro/compiler/MetroOptions.kt
  2. gradle-plugin/src/main/kotlin/dev/zacsweers/metro/gradle/MetroPluginExtension.kt
  3. gradle-plugin/src/main/kotlin/dev/zacsweers/metro/gradle/MetroGradleSubplugin.kt
  4. compiler/src/test/kotlin/dev/zacsweers/metro/compiler/MetroCompilerTest.kt
  5. (Optional) compiler-tests/src/test/kotlin/dev/zacsweers/metro/compiler/MetroDirectives.kt

What it can do on your machine

Read from SKILL.md and the folder at commit ba2f45f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Compiler Option loads about 1.1k tokens when it runs. Until then it costs about 14 tokens; SKILL.md has 278 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~14
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ZacSweers/metro at commit ba2f45f, republished under its Apache-2.0 licence (© ZacSweers). 278 words, ~1,130 tokens.

Download SKILL.mdSave it as .claude/skills/add-compiler-option/SKILL.md (or your agent's skills folder).
name
add-compiler-option
description
Adds a new compiler option to Metro.

Files to Update

When adding a new option, you need to update these files in order:

1. metro-common/src/main/kotlin/dev/zacsweers/metro/compiler/MetroOptions.kt

Add the option in five places. These shared definitions serve both the compiler and the IDE plugin:

a. Add enum entry in MetroOption
kotlin
MY_NEW_OPTION(
  RawMetroOption.boolean(  // or RawMetroOption() for non-boolean types
    name = "my-new-option",  // kebab-case name used in CLI
    defaultValue = false,
    valueDescription = "<true | false>",
    description = "Description of what this option does.",
    required = false,
    allowMultipleOccurrences = false,
  )
),

For non-boolean options, use the full RawMetroOption constructor with a valueMapper:

kotlin
MY_INT_OPTION(
  RawMetroOption(
    name = "my-int-option",
    defaultValue = 10,
    valueDescription = "<count>",
    description = "Description here",
    required = false,
    allowMultipleOccurrences = false,
    valueMapper = { it.toInt() },
  )
),
b. Add property in the MetroOptions constructor
kotlin
public val myNewOption: Boolean = MetroOption.MY_NEW_OPTION.raw.defaultValue.expectAs(),
c. Add property in MetroOptions.Builder
kotlin
public var myNewOption: Boolean = base.myNewOption
d. Add to Builder.build() function
kotlin
myNewOption = myNewOption,
e. Add to MetroOptions.Builder.applyOptionValue()
kotlin
MetroOption.MY_NEW_OPTION -> myNewOption = value.expectAs()

value has already been converted by RawMetroOption.valueMapper. Use value.expectAs<T>() for its mapped type and apply any additional conversion needed by the builder property.

Compiler loading in compiler/src/main/kotlin/dev/zacsweers/metro/compiler/MetroCompilerOptions.kt and IDE loading through MetroOptions.Builder.applyRawOptions() both delegate to this shared mapping. Do not add a second per-option loading switch to either caller.

2. gradle-plugin/src/main/kotlin/dev/zacsweers/metro/gradle/MetroPluginExtension.kt

Add a Gradle DSL property:

kotlin
/**
 * KDoc description of what this option does.
 *
 * Disabled by default.
 */
public val myNewOption: Property<Boolean> =
  objects.booleanProperty("metro.myNewOption", false)

For options that should support Gradle properties:

kotlin
objects.booleanProperty("metro.propertyName", defaultValue)

For options without Gradle property support:

kotlin
objects.property(Boolean::class.java).convention(false)
3. gradle-plugin/src/main/kotlin/dev/zacsweers/metro/gradle/MetroGradleSubplugin.kt

In applyToCompilation, add to the options list:

kotlin
add(lazyOption("my-new-option", extension.myNewOption))

Note: The option name here must match the name in RawMetroOption.

4. compiler/src/test/kotlin/dev/zacsweers/metro/compiler/MetroCompilerTest.kt

In toPluginOptions(), add handling for the new option:

kotlin
MetroOption.MY_NEW_OPTION -> {
  processor.option(entry.raw.cliOption, myNewOption)
}
5. (Optional) compiler-tests/src/test/kotlin/dev/zacsweers/metro/compiler/MetroDirectives.kt

Only needed if the option should be controllable from test directives:

kotlin
val MY_NEW_OPTION by
  valueDirective("Description of the directive.") { it.toBoolean() }

Or for simple on/off directives:

kotlin
val MY_NEW_OPTION by directive("Description of the directive.")

Wire the directive into MetroOptions.buildOptions in compiler-tests/src/test/kotlin/dev/zacsweers/metro/compiler/MetroExtensionRegistrarConfigurator.kt so it affects the test configuration. Preserve the option's default when the directive is absent.

Option Types

  • Boolean: Use RawMetroOption.boolean() helper
  • Int: Use RawMetroOption() with valueMapper = { it.toInt() }
  • String: Use RawMetroOption() with valueMapper = { it }
  • Enum: Use RawMetroOption() with valueMapper = { it } and parse in Builder.applyOptionValue()
  • Set<ClassId>: Use RawMetroOption() with valueMapper = { it.splitToSequence(':').mapToSet { ClassId.fromString(it, false) } }

Naming Conventions

  • Enum entry: SCREAMING_SNAKE_CASE
  • CLI option name: kebab-case
  • Kotlin property: camelCase
  • Gradle property: metro.camelCase

Annotations

  • Use @DelicateMetroGradleApi for experimental options
  • Use @Deprecated for options that will be removed

© ZacSweers, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/add-metro-option of ZacSweers/metro.

Open the folder on GitHubat commit ba2f45f

Compare with similar skills

Add Compiler Option next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Compiler Option compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Compiler Option this skillZacSweers/metro1.4k—~1.1kAutomated safety check: PassApache-2.0
Android Developmentdpconde/claude-android-skill336—~1.7kAutomated safety check: PassMIT
Diagnosing Compose StabilityrosuH/EasyWatermark1.9k1 repos~3.3kAutomated safety check: PassApache-2.0
Claude Android NinjaDrjacky/claude-android-ninja124—~5.2kAutomated safety check: PassApache-2.0
Expo Brownfield Integrationmweinbach/agent-coworker1562 repos~900Automated safety check: NotesCustom licence
Jugg Android Dev Loopniki914/zafiro241—~2kAutomated safety check: PassMIT

Similar skills

  • Android Development

    dpconde/claude-android-skill

    Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices.

    336 GitHub stars~1.7k tokensUpdated 10 mo ago
    MobileAuto-check passed
  • Diagnosing Compose Stability

    rosuH/EasyWatermark

    A skill your agent uses to diagnose Jetpack Compose stability problems by enabling and reading the Compose Compiler Reports (classes.txt, composables.txt, composables.csv, module.json).

    1.9k GitHub starsUsed in 1 repo~3.3k tokens
    MobileAuto-check passed
  • Claude Android Ninja

    Drjacky/claude-android-ninja

    Build and migrate Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), Navigation3, and multi-module Gradle.

    124 GitHub stars~5.2k tokensUpdated 11 days ago
    MobileAuto-check passed
  • Expo Brownfield Integration

    mweinbach/agent-coworker

    Helps add Expo and React Native to an existing native iOS or Android app, and choose between a prebuilt AAR or XCFramework and a fully integrated build.

    156 GitHub starsUsed in 2 repos~900 tokens
    MobileAuto-check: notes
  • Jugg Android Dev Loop

    niki914/zafiro

    A skill your agent uses when editing source files (Java/Kotlin/XML/layout/AndroidManifest/Gradle) in a Android project, or when user asks to build/deploy/verify an Android app.

    241 GitHub stars~2k tokensUpdated today
    MobileAuto-check passed
  • Build Foreman

    nekomangaorg/Neko

    Optimizes Gradle build scripts, compilation times, and Android Studio sync performance.

    2.8k GitHub stars~807 tokensUpdated yesterday
    MobileAuto-check passed

More from ZacSweers/metro

  • Analyze Perfetto Trace

    ZacSweers/metro

    Query and analyze Metro's perfetto compiler traces to find real hot spots and untraced time.

    1.4k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Test Metro Ide Locally

    ZacSweers/metro

    Run Metro's IDE plugin from source in a sandboxed local IDE against a consumer project.

    1.4k GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Test Metro Locally

    ZacSweers/metro

    Publish the current Metro checkout to Maven Local and verify it in an external consumer or reproducer.

    1.4k GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Add Compiler Option

How do I install Add Compiler Option in Claude Code?

Run `npx skills add ZacSweers/metro --skill add-compiler-option -a claude-code`. Or copy the skill folder (.agents/skills/add-metro-option in ZacSweers/metro) into .claude/skills/add-compiler-option in your project. Claude Code loads it when a task matches its description.

How do I install Add Compiler Option in Codex?

Run `npx skills add ZacSweers/metro --skill add-compiler-option -a codex`. Or copy the skill folder (.agents/skills/add-metro-option in ZacSweers/metro) into .agents/skills/add-compiler-option in your project. Codex loads it when a task matches its description.

Can I use Add Compiler Option in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ZacSweers/metro --skill add-compiler-option -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-compiler-option, .gemini/skills/add-compiler-option, .github/skills/add-compiler-option and .opencode/skills/add-compiler-option in your project.

What does Add Compiler Option need to run?

SKILL.md names no scripts, command-line tools or credentials: Add Compiler Option is instructions for the agent only.

Does Add Compiler Option access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Add Compiler Option safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Compiler Option use?

Add Compiler Option is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Compiler Option use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add Compiler Option?

Skills that share tags, products or a category with Add Compiler Option: Android Development (dpconde/claude-android-skill, 336 stars), Diagnosing Compose Stability (rosuH/EasyWatermark, 1.9k stars), Claude Android Ninja (Drjacky/claude-android-ninja, 124 stars) and Expo Brownfield Integration (mweinbach/agent-coworker, 156 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Compiler Option?

ZacSweers (a GitHub user) maintains it in ZacSweers/metro, which has 1,408 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 11, 2026.

Source: ZacSweers/metro on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.