Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions .agents/skills/verify-code-quality/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: Run lint, static analysis, ABI validation and coverage gates for co
4. Run the full gate once before committing:

```bash
./gradlew :buildSrc:ktlintCheck :buildSrc:detekt detektMain detektTest detektTestFixtures
./gradlew :buildSrc:ktlintCheck :buildSrc:detekt :buildSrc:test
./gradlew build --continue
```

Expand All @@ -22,11 +22,13 @@ every module's `check` — compile, `staticAnalysis` (ktlint and the type-resolu
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.
turns a targeted check into a full rebuild. The facade case under "Stale results" is the one exception.

```bash
./gradlew :swing-ui:ktlintCheck :swing-ui:detektMain :swing-ui:detektTest
Expand All @@ -40,19 +42,26 @@ turns a targeted check into a full rebuild.
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-daemon`** to 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 with `NoClassDefFoundError` on a rule class.
- **After adding a file to a `@JvmMultifileClass` facade, or removing one, add `--rerun-tasks`.** The
build cache can serve the facade class without one of its parts. The signs are
`NoClassDefFoundError` on a `...Kt` class in unrelated tests, or `Key ...Kt is missing in the map`
from the ABI tasks.

## What applies where

| Module | ktlint / detekt | ABI dump |
|----------------------|---------------------------------------------|----------|
| `buildSrc` | ktlint and detekt only, invoked explicitly | no |
| `swing-ui` | yes | yes |
| `swing-ui-test` | yes | yes |
| `swing-ui-animation` | yes, except `animation.core` | yes |
| `samples/*` | yes | no |

`swing-ui-animation` applies the shared quality convention, but detekt and ktlint exclude the package
`org.jetbrains.compose.swing.animation.core`, which is upstream-derived Compose animation-core. Keep that package
comparable to upstream: do not restyle it, and do not bring it under those gates.
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` 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. The module's hand-written animation APIs and
containers stay under them.

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
Expand Down
24 changes: 7 additions & 17 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
# AI Agent Instructions

Compose Swing UI — a Compose runtime over Swing. `@Composable` wrappers, modifiers and state holders
drive real `javax.swing` components, published as the `swing-ui`, `swing-ui-test` and
`swing-ui-animation` modules. The public API is not frozen: design each API the way it should be
rather than preserving an earlier shape.
Compose Swing UI — a Compose runtime over Swing. `@Composable` wrappers, modifiers and state holders drive real `javax.swing` components, published as separate modules. Design each public API as it should be; do not preserve an earlier shape.

## Quality rules

- **Quality first.** Fix the code — never relax, disable or exclude a ktlint, detekt,
ABI or coverage rule to make a build pass.
- **Suppressions are narrow and explained.** A suppression carries a comment stating the invariant
that makes it safe, not the rule it avoids.
- **No deprecated APIs** unless explicitly requested. Prefer the standard library or existing library
functionality over a custom implementation.
- **Quality first.** Fix the code — never relax, disable or exclude a ktlint, detekt, ABI or coverage rule to make a build pass.
- **Suppressions are narrow and explained.** A suppression carries a comment stating the invariant that makes it safe, not the rule it avoids.
- **No deprecated APIs** unless explicitly requested. Prefer the standard library or existing library functionality over a custom implementation.
- **Verify every change.** Add or update tests for changed behavior, then run the gates.
- **Do not commit until the change has been reviewed.**

The code style itself — explicit API mode, KDoc, the EDT rule — is `CONTRIBUTING.md`'s to state; read
it there rather than here, so the two files never drift apart on the same rule.
The code style itself — explicit API mode, KDoc, the EDT rule — is `CONTRIBUTING.md`'s to state; read it there rather than here, so the two files never drift apart on the same rule.

## Skills

Task procedures live in `.agents/skills/`, each in its own directory as a `SKILL.md`. They are
surfaced to each tool through the `.claude/skills`, `.codex/skills` and `.junie/skills` symlinks.
Task procedures live in `.agents/skills/<name>/SKILL.md`. They are surfaced to each tool through the `.claude/skills`, `.codex/skills` and `.junie/skills` symlinks.

## Reference

- `CONTRIBUTING.md` — prerequisites, the build, the quality gates and the code style.
- `docs/ARCHITECTURE.md` — how the runtime works.
- `docs/CUSTOM-COMPONENTS.md` — the worked guide to writing a component.
- `docs/TESTING-COMPONENTS.md` — the test harness.
- `docs/` — the guides to the runtime, components, API rules and the test harness.
Loading