Jetpack compose audit

From oxyroid/M3UAndroid · View interactive version

Jetpack compose audit is an AI agent skill from the GitHub repository oxyroid/M3UAndroid. Audit Android Jetpack Compose repositories for performance, state management, side effects, and composable API quality. Scans source code, scores each category from 0-10, writes a strict markdown report, and summarizes the most important fixes. Use when reviewing a Compose codebase, rating repositor

How to use this skill

Skill file

Jetpack Compose Audit

This skill audits Android Jetpack Compose repositories with a strict, evidence-based report.

Rubric version: v1 — current as of 2026-04-13. Compose track: Kotlin 2.0.20+ / Compose Compiler 1.5.4+ (Strong Skipping Mode default).

It is intentionally focused on four categories:

This skill does not score design or Material 3 compliance in v1. If the audit surfaces likely design-system problems, recommend a follow-up audit with the material-3 skill (reference implementation: <https://github.com/hamen/material-3-skill>).

Out Of Scope In v1

Owned and deliberate scope choices — call out the limitation in the report rather than silently producing thin coverage:

If the user explicitly asks for any of these, narrow the scope and state it in the report.

When To Use

Use this skill when the user asks to:

Typical trigger phrases:

Expected Output

Produce both:

Audit Principles

Process

1. Confirm Scope

Identify the target path:

Before mapping modules, confirm Compose is actually present (fast-fail):

If neither shows up, stop and report that the target is out of scope. Do not run a full module map first.

If Compose is present only in samples/, demos/, or test sources (no production usage), narrow the scope to those directories, set confidence to Low, and state in the report that the audit is over sample code rather than production paths. Do not score production-quality categories against demo code.

2. Map The Repository

Before scoring, identify:

3. Build A Compose Surface Map

Look for:

If the repo is large, audit by category or by module. If subagents are available, parallelize category scans by spawning Explore-type subagents (no write tools) and merge the findings.

4. Generate Compose Compiler Reports (Automatic)

Do not ask the user to edit build.gradle or run commands themselves. The skill runs the build with a bundled Gradle init script that injects reportsDestination / metricsDestination into every Compose module without modifying any file in the target repo. Before scoring, attempt this:

  1. Locate the init script shipped with the skill: scripts/compose-reports.init.gradle. The absolute path is the skill's install location — in most installs that's ~/.claude/skills/jetpack-compose-audit/scripts/compose-reports.init.gradle. If you cannot resolve the path, fall back to writing the script to <target>/.compose-audit-reports.init.gradle and delete it after the run.
  1. Check for a Gradle wrapper in the target: test -x <target>/gradlew. If missing, skip to the fallback in step 6.
  1. Pick a compile target. Prefer the cheapest task that still triggers Kotlin compilation for a Compose module:
  1. Run the build. Inform the user the build is starting (it may take several minutes).

```bash

cd <target> && ./gradlew <task> \

--init-script <path-to>/compose-reports.init.gradle \

--no-daemon --quiet

```

Use a 600-second timeout. If the task fails, try the next fallback task in step 3 once. Do not loop indefinitely.

  1. Collect the reports.

```bash

find <target> -path '/build/compose_audit/' \

\( -name '-classes.txt' -o -name '-composables.txt' -o -name '-composables.csv' -o -name '-module.json' \)

```

From these files, extract:

  1. Fallback if the build fails or Gradle is unavailable. Proceed with source-inferred stability findings, but:

Stability deductions from step 5 are measured evidence and should be weighted normally. Fallback deductions from step 6 are inferred and must be flagged as such in the report.

5. Audit The Four Categories

Use the scoring rubric in references/scoring.md and the heuristics in references/search-playbook.md.

Performance

Focus on:

State Management

Focus on:

Side Effects

Focus on:

Composable API Quality

Focus on reusable internal components, not every leaf screen.

Check:

6. Verify Findings

Before deducting points:

7. Score

Assign each category a 0-10 score and a status:

Use the weights in references/scoring.md to compute the overall score.

Measured ceilings are mandatory, not suggestive. When Step 4 produced compiler reports, the Performance rubric in references/scoring.md defines a ceiling based on skippable% and unstable-param count. After arriving at a qualitative Performance score, you MUST apply the ceiling and lower the score if it exceeds the cap. Show the math in the report:

Performance ceiling check:
  skippable% = 186/273 = 68.1% → falls in 50-70% band → cap at 4
  qualitative score: 7
  applied score: 4 (ceiling lowered from 7)

Do not round skippable% up into a higher band. 68.1% is not ≥70%. If a qualitative score lands at or below the ceiling, no adjustment is needed — but the check itself must appear in the report so the reader can audit it.

If a category genuinely has too little auditable surface area, mark it N/A, explain why, and renormalize the remaining weights.

8. Write The Report

Use references/report-template.md.

The report must include:

Write the report to:

If COMPOSE-AUDIT-REPORT.md already exists at that path, do not overwrite it silently. Either confirm overwrite with the user, or write to COMPOSE-AUDIT-REPORT-<YYYY-MM-DD>.md alongside it.

9. Return A Short Summary

In chat, produce a summary that mirrors the report's Prioritized Fixes section — not a generic recap. The developer should be able to act on the summary alone without opening the report file.

Include:

The top-three fixes in the chat summary MUST be the same items as the report's Prioritized Fixes list (same file paths, same doc links). Do not add generic advice in chat that isn't in the written report.

Evidence Rules

Large Repo Strategy

For medium or large repositories:

  1. Map modules first.
  2. Pick representative files per module.
  3. Parallelize category scans when possible.
  4. Merge repeated findings into systemic issues instead of listing the same smell twenty times.

What To Avoid

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.