verify-code-quality
Skill66 starsChanged 7 days agoApache-2.0View on GitHub
Run lint, static analysis, ABI validation and coverage gates for compose-swing-ui. Use when checking code quality, fixing style issues, or before committing.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Run the scoped checks for what changed (below), fixing findings as they surface.
- Distinctive: line 13
Run the full gate once before committing:
- Very specific: line 25
After the gate, read the diff against the design rules under "Code style" in CONTRIBUTING.md.
- Very specific: line 30
Do not add clean or --rerun-tasks: Gradle's up-to-date checks are correct here, and discarding them turns a targeted check into a full …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Verify Code Quality
Order of work
- Run the scoped checks for what changed (below), fixing findings as they surface.
./gradlew :buildSrc:ktlintFormat ktlintFormatto auto-fix formatting, then check again../gradlew updateKotlinAbiif the public API changed, and review the dump diff.- Run the full gate once before committing:
./gradlew :buildSrc:ktlintCheck :buildSrc:detekt :buildSrc:test
./gradlew build --continueTwo commands, because buildSrc is an included build the root-level tasks do not reach. build runs
every module's check — compile, staticAnalysis (ktlint and the type-resolution detekt tasks, not
plain detekt), tests, checkKotlinAbi and the coverage floors — plus assemble. --continue
reports every failure in one run instead of stopping at the first.
After the gate, read the diff against the design rules under "Code style" in CONTRIBUTING.md.
Scoping a run
Work with the narrowest tasks that cover the change; the full gate is what settles it before a commit.
Do not add clean or --rerun-tasks: Gradle's up-to-date checks are correct here, and discarding them
turns a targeted check into a full rebuild. The facade case under "Stale results" is the one exception.
./gradlew :swing-ui-core:ktlintCheck :swing-ui-core:detektMain :swing-ui-core:detektTest
./gradlew :swing-ui-components:ktlintCheck :swing-ui-components:detektMain :swing-ui-components:detektTest
./gradlew :swing-ui-core:checkKotlinAbi :swing-ui-components:checkKotlinAbi
./gradlew :swing-ui-core:jacocoTestCoverageVerification :swing-ui-components:jacocoTestCoverageVerificationjacocoTestCoverageVerification runs the module's tests to produce the report it measures.
Within a module, scope detekt as detektMain/detektTest, never detekt. buildSrc is the
exception: it configures detekt itself, and plain :buildSrc:detekt is its gate. CONTRIBUTING.md
explains what the plain task misses everywhere else.
Stale results
- After changing a rule in
swing-ui-detekt, add--no-daemonto the detekt runs of the modules that consume it. A running Gradle daemon can keep the previous rule jar loaded: a new rule then reports nothing, or the run fails withNoClassDefFoundErroron a rule class. - After adding a file to a
@JvmMultifileClassfacade, or removing one, add--rerun-tasks. The build cache can serve the facade class without one of its parts. The signs areNoClassDefFoundErroron a...Ktclass in unrelated tests, orKey ...Kt is missing in the mapfrom the ABI tasks.
What applies where
A module carries the gates of the convention plugins its build.gradle.kts applies, and an ABI dump
when it commits <module>/api/<module>.api. buildSrc is gated by its own tasks, invoked explicitly.
The animation.core package of swing-ui-animation-core contains the Android Open Source Project's
Jetpack Compose animation-core in upstream's format, with the adaptations its META-INF/NOTICE
lists, so it is exempt from the shared style gates by design. Keep it comparable to that upstream: do
not restyle it, and do not bring it under those gates. AwtVectorConverters.kt there is authored
here and stays under detekt, though ktlint is off for the whole package, as do the animated containers
of swing-ui-animation.
Which modules carry a coverage floor, and each one's line and branch minimums, is set in that
module's own build.gradle.kts - read it there rather than here. CONTRIBUTING.md explains how the
floors are meant to be treated when a change moves one.
Public API
checkKotlinAbi compares the compiled surface against the dumps committed under <module>/api/. When
the public API changes intentionally, regenerate them and review the diff before committing:
./gradlew updateKotlinAbiTwo kinds of declaration are outside the dumps, so the gate cannot answer for them:
- anything annotated
@InternalSwingUiApi, which the validation filters out by configuration; - public inline functions with a reified type parameter, which compile to synthetic methods that
the dump skips. Changing one of their signatures breaks every caller while
checkKotlinAbistays green. Enumerate the current set rather than trusting a fixed list — it grows as the API does:git grep -n 'public inline fun <reified' swing-ui-core/src/main swing-ui-components/src/main swing-ui-test/src/mainSwingNode,MenuNodeandSwingModifier.listenerare examples, not the whole set. Diff whatever the grep finds against its committed form by hand before concluding the surface is unchanged.
Why the build rejects code that compiles in an IDE
allWarningsAsErrors is on, so a warning fails the build. Published binaries target Java 11 and
Kotlin language and API level 2.2, independent of the toolchain the build runs on, so a newer language
feature or standard-library API fails to compile even on a current JDK.
Configuration
- detekt:
config/detekt/detekt.yml, layered on the default config and on the defaults:swing-ui-detektships. The file states the reason for each rule it turns off. - Coverage floors and ABI filters: each module's
build.gradle.kts. - The gates and the code style in prose:
CONTRIBUTING.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

