agentleFS
full-stack-skillsfull-stack-skills/kotlin-skills/skills/kotlin-java-migration-testing/SKILL.md

kotlin-java-migration-testing

Skill0 starsChanged 54 days agoApache-2.0View on GitHub

Prove Java-to-Kotlin migration completeness through 100 percent lossless source-test implementation, byte-identical source assets, dedicated whole-project test modules, full Java/Kotlin differential execution, Kotlin-specific risk tests, and auditable evidence. Use after or during kotlin-java-migration; coverage alone never satisfies this skill.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep independent denominators and statuses for:

    line 13
  2. Distinctive:

    Test resources, golden files, schemas, certificates, archives, scripts, and datasets.

    line 17
  3. Distinctive:

    No skipped, ignored, disabled, quarantined, compile-only, or not-run target case may count as complete.

    line 29
  4. Distinctive:

    Keep the Java suite executable.

    line 30
  5. Distinctive:

    Use the bundled audit helper as an inventory starting point:

    line 36
  6. Very specific:

    Create a Gradle module named <project>-test for migration acceptance:

    line 47
  7. Distinctive:

    Add tests for platform-type nulls, Java/Kotlin ABI calls, default arguments and overload bridges, generic variance, data-class …

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Java to Kotlin Migration Testing

This skill defines the acceptance proof. The final objective is identical observable behavior for the same inputs under equivalent environments.

Mandatory evidence dimensions

Keep independent denominators and statuses for:

  1. Java production objects and members.
  2. Java test files, test methods, parameterized/dynamic concrete cases, suites, and disabled tests.
  3. Test resources, golden files, schemas, certificates, archives, scripts, and datasets.
  4. Full Java/Kotlin differential cases.
  5. Kotlin-only obligations such as null/platform-type boundaries, coroutine cancellation, Flow lifecycle, Java ABI, and Gradle/toolchain compatibility.
  6. Coverage, mutation, fuzz/property, load/soak, security, and platform evidence.

Dimensions 1–4 must reach exact completeness; dimensions 5–6 are additive risk evidence.

Source-test parity

  • Inventory every Java test source and every concrete case, including parameter sources, nested/dynamic tests, inherited contract suites, tags, assumptions, disabled cases, fixtures, and external prerequisites.
  • Implement each case losslessly in Kotlin. Preserve input, setup, operation, assertion strength, expected failure category/message when contractual, side effects, order, cleanup, and case identity.
  • A grouped Kotlin parameterized test is acceptable only if the ledger maps every Java case and reports every result separately.
  • No skipped, ignored, disabled, quarantined, compile-only, or not-run target case may count as complete.
  • Keep the Java suite executable; do not replace it with translated tests alone.

Asset parity

Copy source test assets directly whenever licensing and repository policy permit. Preserve bytes, relative paths, encoding, line endings, permissions when relevant, and archive structure. Produce a SHA-256 manifest and fail on missing, extra, or changed required assets. Generated equivalents require explicit approval and reproducibility evidence.

Use the bundled audit helper as an inventory starting point:

python3 scripts/audit_migration_tests.py \
  --java-root /path/to/java-project \
  --target-root /path/to/kotlin-project \
  --target-extension .kt

Dedicated whole-project module

Create a Gradle module named <project>-test for migration acceptance:

project-test/
├── build.gradle.kts
└── src/test/
    ├── kotlin/          # whole-project scenarios and differential harness
    └── resources/       # byte-identical copied source fixtures

This module depends on production modules through their public composition boundary and owns end-to-end scenarios, real adapter/host integration, Java/Kotlin runners, output normalization, and parity reports. Local tests inside production modules continue to test local behavior.

Differential gate

For every source case, execute Java and Kotlin against the same versioned input and compare the complete observable contract:

  • return value and type/category;
  • structured error, causal chain, and contractual message;
  • ordering, state transitions, side effects, call counts, and emitted events;
  • serialized bytes, protocol output, filesystem/database effects, and resource lifecycle where applicable.

Store raw outputs separately. Pin source/target commits, runners, normalizer version, locale, timezone, encoding, dependencies, seed, and platform. Normalization may remove only proven nondeterminism and must never hide unexpected fields.

Final acceptance requires:

java_suite=PASS
kotlin_suite=PASS
differential_cases=100% MATCH
mismatch=0 harness_error=0 skipped=0 ignored=0 not_run=0

Kotlin-specific additions

Add tests for platform-type nulls, Java/Kotlin ABI calls, default arguments and overload bridges, generic variance, data-class equality/copy, coroutine cancellation, Flow backpressure/lifecycle, dispatcher blocking, and Gradle/JDK compatibility. These supplement source parity and cannot replace it.

Coverage position

Measure comparable production scopes after parity. Coverage helps find unexercised Kotlin paths, but equal or high coverage does not prove equal behavior. Never weaken assertions, duplicate trivial tests, or exclude difficult code to satisfy a number.

Completion report

Publish commands, environment, artifact links, per-case ledger, asset hashes, mismatch report, known limitations, and rollback/compatibility results. Say “complete” only when all mandatory gates pass with zero unexplained exceptions.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.