Agent skill

Compose Modifier

by r0adkll in r0adkll/Campfire

Enforce the Compose guideline that every @Composable function must declare modifier: Modifier = Modifier as its first optional parameter and apply it to the root layout.

GPL-3.0Auto-check passedMobile

Install Compose Modifier

skills CLI
$ npx skills add r0adkll/Campfire --skill compose-modifier -a claude-code

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

GitHub CLI
$ gh skill install r0adkll/Campfire compose-modifier --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/r0adkll/Campfire.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/compose-modifier .claude/skills/compose-modifier && 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
compose-modifier
GitHub stars
139
Token cost
~1.2k tokens
SKILL.md length
424 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
GPL-3.0

At a glance

Enforce the Compose guideline that every @Composable function must declare modifier: Modifier = Modifier as its first optional parameter and apply it to the root layout.

  • Reviewing any @Composable function — including private / internal helpers extracted from a UI file
  • SKILL.md covers Rule, Why, Position and Apply to root, caller-first, plus 4 more sections
  • Calls rg

What it does

Compose Modifier is an agent skill from r0adkll/Campfire. Enforce the Compose guideline that every @Composable function must declare modifier: Modifier = Modifier as its first optional parameter and apply it to the root layout. Trigger when authoring or reviewing any @Composable function — including private / internal helpers extracted from a UI file.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile. It works with Jetpack Compose. The repository describes itself as: A KMP Compose app for Audiobookshelf. The licence is GPL-3.0.

When your agent uses it

  • Reviewing any @Composable function — including private / internal helpers extracted from a UI file

Example prompts

  • “/compose-modifier”

What it can do on your machine

Read from SKILL.md and the folder at commit e52e0de. 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

    Shell commands in SKILL.md call:

    • rg

    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

Compose Modifier loads about 1.2k tokens when it runs. Until then it costs about 81 tokens; SKILL.md has 424 words of instructions outside code blocks.

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

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 r0adkll/Campfire at commit e52e0de, republished under its GPL-3.0 licence (© r0adkll). 424 words, ~1,230 tokens.

Download SKILL.mdSave it as .claude/skills/compose-modifier/SKILL.md (or your agent's skills folder).
name
compose-modifier
description
Enforce the Compose guideline that every `@Composable` function must declare `modifier: Modifier = Modifier` as its first optional parameter and apply it to the root layout. Trigger when authoring or reviewing any `@Composable` function — including `private` / `internal` helpers extracted from a UI file.

Rule

Every @Composable function (public, internal, OR private) MUST declare a modifier: Modifier = Modifier parameter and pipe it into the outermost layout element.

Why

  • Lets callers customise sizing, padding, click behavior, alignment, semantics, and test tags without forking the composable.
  • Matches the official AndroidX Compose API guidelines so this codebase reads consistently with the rest of the ecosystem.
  • Removes a footgun where you decompose a *Ui.kt into helpers and the helpers silently swallow caller intent.

Position

modifier is the first optional parameter: it follows all required ones and precedes the rest of the defaults.

kotlin
@Composable
internal fun PodcastRow(
  podcast: PodcastSearchResult,             // required
  onClick: () -> Unit,                       // required
  modifier: Modifier = Modifier,             // ← first default
  shape: Shape = MaterialTheme.shapes.medium,
)

Apply to root, caller-first

Pipe modifier into the outermost layout. Chain local modifiers onto it (caller's modifications run first), don't .then(modifier) after locals.

kotlin
@Composable
internal fun Section(
  text: String,
  modifier: Modifier = Modifier,
) {
  Surface(
    modifier = modifier.fillMaxWidth(),       // caller first, ours after
    shape = MaterialTheme.shapes.medium,
  ) { Text(text) }
}

Anti-patterns

  • No modifier parameter at all. Most common offender — internal helpers like row composables, section headers, dialog bodies extracted from a screen UI.

    kotlin
    // ❌ DON'T
    @Composable
    private fun ExplicitRow(enabled: Boolean, onToggle: (Boolean) -> Unit) { ... }
  • Modifier not first among the defaults. Pushes future API additions to insert other defaults before it and breaks call-site stability.

    kotlin
    // ❌ DON'T
    @Composable
    internal fun Row(
      text: String,
      shape: Shape = MaterialTheme.shapes.medium,
      modifier: Modifier = Modifier,
    )
  • Local-first then .then(modifier). Caller's intent is overridden by the composable's hardcoded modifiers.

    kotlin
    // ❌ DON'T
    Surface(modifier = Modifier.fillMaxWidth().then(modifier)) { ... }
  • Swallowed modifier. Param accepted but never applied — usually leftover from a refactor.

    kotlin
    // ❌ DON'T
    @Composable
    internal fun Row(text: String, modifier: Modifier = Modifier) {
      Surface(modifier = Modifier.fillMaxWidth()) { Text(text) }   // <-- ignored modifier
    }

Not subject to this rule

  • LazyListScope / LazyGridScope / BoxScope extension functions (e.g. LazyListScope.episodesSection(...), BoxScope.CenteredMessage(...)) — these aren't standalone composables; they emit items into an existing scope and have no single root layout to attach a modifier to. If you need per-item modification, plumb it explicitly through the children.
  • Slot / content lambdas typed @Composable () -> Unit — those are caller-supplied content, not functions you declare.
  • @Preview composables — they don't take parameters from external callers, so a modifier param adds no value. (They should still be private or internal.)
Show full SKILL.md (157 more words)Show less

When to apply

  • Authoring any new @Composable function — drop in modifier: Modifier = Modifier from the start.
  • Reviewing a PR that introduces a Compose file or adds a new private helper composable inside one.
  • Extracting a private composable out of a screen UI file. Tempting to skip the modifier param because "no one calls it except the file it came from" — don't. Tomorrow someone moves the file, or the screen needs to position the helper differently, or someone wants Modifier.testTag(...) on it. Future-you spends 30 seconds adding the parameter back; future-you will not remember why.
  • Touching an existing helper that doesn't comply: opportunistically add modifier: Modifier = Modifier and apply it. Don't propagate the legacy shape when copy-pasting.

Auditing the codebase

Find non-conforming composables:

bash
# Composables with no parameter list mentioning Modifier
rg -P --multiline-dotall \
  '@Composable\s*\n(?:internal |private )?fun [A-Z]\w+\s*\([^)]*\)' \
  --type kt \
  -g '!*/build/*' \
  -g '!*Preview*' \
  | rg -v 'modifier:\s*Modifier'

The add/composables/ and builder/composables/ directories under features/podcasts/ui/ carry the most violations as of the recent screen extractions — many helper rows, dialog bodies, and section composables were extracted without modifier params. Migrate as you touch them.

© r0adkll, GPL-3.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 .claude/skills/compose-modifier of r0adkll/Campfire.

Open the folder on GitHubat commit e52e0de

Compare with similar skills

Compose Modifier 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.

Compose Modifier compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Compose Modifier this skillr0adkll/Campfire139—~1.2kAutomated safety check: PassGPL-3.0
Compose Multiplatform Patternsmonta-app/ocpp-emulator1795 repos~2kAutomated safety check: PassApache-2.0
Stylesarindamxd/camerax-android1324 repos~2.3kAutomated safety check: PassApache-2.0
Compose UIMoustachauve/WLED-Android1693 repos~676Automated safety check: PassApache-2.0
Compose Animationschrisbanes/skills1.1k—~1.1kAutomated safety check: PassApache-2.0
Edge To Edgearindamxd/camerax-android1325 repos~3.6kAutomated safety check: PassApache-2.0

Similar skills

  • Compose Multiplatform Patterns

    monta-app/ocpp-emulator

    Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.

    179 GitHub starsUsed in 5 repos~2k tokens
    MobileAuto-check passed
  • Styles

    arindamxd/camerax-android

    A skill your agent uses to integrate the Jetpack Compose Styles API into an Android project.

    132 GitHub starsUsed in 4 repos~2.3k tokens
    MobileAuto-check passed
  • Compose UI

    Moustachauve/WLED-Android

    Best practices for building UI with Jetpack Compose, focusing on state hoisting, detailed performance optimizations, and theming.

    169 GitHub starsUsed in 3 repos~676 tokens
    MobileAuto-check passed
  • Compose Animations

    chrisbanes/skills

    A skill your agent uses when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one…

    1.1k GitHub stars~1.1k tokensUpdated 3 days ago
    MobileAuto-check passed
  • Edge To Edge

    arindamxd/camerax-android

    A skill your agent uses to migrate your Jetpack Compose app to add adaptive edge-to-edge support and troubleshoot common issues.

    132 GitHub starsUsed in 5 repos~3.6k tokens
    MobileAuto-check passed
  • A skill your agent uses when writing or reviewing Jetpack Compose UI tests, screenshot tests or baseline-recording evidence, previews, semantics assertions, fake image loading, keyboard input, focus…

    1.1k GitHub stars~1.8k tokensUpdated 3 days ago
    MobileAuto-check passed

More from r0adkll/Campfire

All 9 skills in this repo
  • PR Stack

    r0adkll/Campfire

    Open, describe, and maintain pull requests in Campfire, especially stacks of dependent PRs (each branch built on the one before).

    139 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Fdroid Reproducible Foss

    r0adkll/Campfire

    Rules and reliable local tests for keeping Campfire's foss flavor F-Droid-compatible — a clean source scan (using scandelete, never scanignore) and a byte-for-byte reproducible build.

    139 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed
  • I18n Compose

    r0adkll/Campfire

    Extract hardcoded user-facing string literals from a Jetpack Compose / Compose Multiplatform file into the owning module's composeResources/values/<modulestrings.xml, then replace each call site…

    139 GitHub stars~3.2k tokensUpdated yesterday
    Auto-check passed
  • Iconbutton A11y

    r0adkll/Campfire

    Enforce the Campfire IconButton accessibility convention — every IconButton (and its derivatives) must be wrapped with IconButtonTooltip and given a localized action label.

    139 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Socket Event Listener

    r0adkll/Campfire

    Enforce the Campfire pattern for feature modules to react to Audiobookshelf socket events.

    139 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Compose UI

    r0adkll/Campfire

    Campfire Compose UI conventions. An agent skill from r0adkll/Campfire.

    139 GitHub stars~886 tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Compose Modifier

What does Compose Modifier do?

Enforce the Compose guideline that every @Composable function must declare modifier: Modifier = Modifier as its first optional parameter and apply it to the root layout. Compose Modifier is an agent skill from r0adkll/Campfire. Enforce the Compose guideline that every @Composable function must declare modifier: Modifier = Modifier as its first optional parameter and apply it to the root layout.

When should I use Compose Modifier?

Compose Modifier fits situations like: reviewing any @Composable function — including private / internal helpers extracted from a UI file.

How do I install Compose Modifier in Claude Code?

Run `npx skills add r0adkll/Campfire --skill compose-modifier -a claude-code`. Or copy the skill folder (.claude/skills/compose-modifier in r0adkll/Campfire) into .claude/skills/compose-modifier in your project. Claude Code loads it when a task matches its description.

How do I install Compose Modifier in Codex?

Run `npx skills add r0adkll/Campfire --skill compose-modifier -a codex`. Or copy the skill folder (.claude/skills/compose-modifier in r0adkll/Campfire) into .agents/skills/compose-modifier in your project. Codex loads it when a task matches its description.

Can I use Compose Modifier 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 r0adkll/Campfire --skill compose-modifier -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/compose-modifier, .gemini/skills/compose-modifier, .github/skills/compose-modifier and .opencode/skills/compose-modifier in your project.

What does Compose Modifier need to run?

Going by SKILL.md and its folder, Compose Modifier needs the command-line tools its instructions call (rg).

Does Compose Modifier 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 Compose Modifier 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 Compose Modifier use?

Compose Modifier is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Compose Modifier use?

About 1.2k tokens (SKILL.md is roughly 4.9k 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 Compose Modifier?

Skills that share tags, products or a category with Compose Modifier: Compose Multiplatform Patterns (monta-app/ocpp-emulator, 179 stars), Styles (arindamxd/camerax-android, 132 stars), Compose UI (Moustachauve/WLED-Android, 169 stars) and Compose Animations (chrisbanes/skills, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Compose Modifier?

r0adkll (a GitHub user) maintains it in r0adkll/Campfire, which has 139 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 6, 2026.

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