From axoniq-migration
Internal helper, invoked ONLY by other skills (e.g. axon4to5-migrate-code). Scopes Maven/Gradle compile+test to ONE target class plus all classes required for it to compile, via per-target profile or source-set. Do NOT auto-trigger from user prompts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/axoniq-migration:axon4to5-isolatedtest <TargetName> [build-file=<path>] [cleanup=true|false]<TargetName> [build-file=<path>] [cleanup=true|false]haikuThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Add (or extend) ONE self-contained build-scope unit per target so:
Add (or extend) ONE self-contained build-scope unit per target so:
A target is a single class identified by its simple name (e.g., ResourcesPool, PaymentId). The scope id grammar:
isolated-<TargetName> # Maven profile id (used verbatim — TargetName stays PascalCase)
isolated<TargetName> # Gradle source-set name (camelCase already; <TargetName> is PascalCase)
<TargetName> = simple class name only. Java identifier chars only.
| Input | Required | Default | Description |
|---|---|---|---|
target-name | yes | — | Simple class name, PascalCase. Drives the scope id. |
build-file | no | deduced | Absolute path to pom.xml or build.gradle(.kts). Deduce from the project. |
main-sources | no | deduced | Repo-relative paths under src/main/{java,kotlin} for files to compile in scope. Deduce from the target's imports and the project layout. |
test-sources | no | deduced | Repo-relative paths under src/test/{java,kotlin} for tests to run in scope. Deduce from the project — usually <TargetName>Test and its siblings. |
extra-deps | no | [] | Extra dependency coordinates to add only to this scope. Rare — most projects rely on inherited deps. |
cleanup | no | false | If true, remove the isolated-<TargetName> scope from the build file after a green test run (compile + tests both pass). If false, leave the scope in place so the user can iterate or re-run. On non-green runs the scope is always kept regardless. |
Detect build tool from build-file extension/name:
| Build file | Path | Reference |
|---|---|---|
pom.xml | Maven profile | references/maven.md |
build.gradle.kts / build.gradle | Gradle source-set + Test task | references/gradle.md |
Each reference file is self-contained: it owns the install steps, the verify commands, and the cleanup steps for its build tool.
One scope per <TargetName>, never a shared scope across targets:
git bisect across commits that add or remove scopes sees stable siblings.Do NOT collapse multiple targets into one shared isolated-* scope — you lose all three properties.
isolated-<TargetName> scope.isolated-* scopes.isolated-* scopes in one command to verify several targets together; see references for the exact syntax.isolated-<TargetName> (Maven) / isolated<TargetName> (Gradle) already exist in build-file?main-sources ∪ test-sources → skip install, jump to verify.Use Grep to detect existing scopes:
# Maven
grep -E "<id>isolated-<TargetName></id>" <build-file>
# Gradle (Kotlin DSL)
grep -E "isolated<TargetName>" <build-file>
Run in this order — fail fast on the cheaper check:
isolated-<TargetName> scope.<excludes> (Maven) or source-set exclude(...) (Gradle) to silence compile errors — defeats the purpose. If the include list is too broad, narrow it.isolated-* scope to "borrow" its files. Each target owns exactly one scope.isolated-* scopes in CI by default — these are working scaffolds, not production scope.isolated-* scopes in the build file once the surrounding module compiles and tests pass cleanly without them — see the Cleanup section in maven.md / gradle.md.-Dmaven.compiler.includes=… or -Dmaven.compiler.testIncludes=… from the command line — those properties are silently ignored by maven-compiler-plugin. The scope MUST live in the POM (inside the profile).ALWAYS use this exact template. The user reads this summary to know what was verified, how to re-run it manually, and whether the build file still contains scaffolding.
## axon4to5-isolatedtest: <TargetName>
**Build file**: <absolute path>
**Build tool**: maven | gradle
**Scope id**: isolated-<TargetName> | isolated<TargetName>
### Files in scope
- Main: <count> file(s)
- <relpath 1>
- <relpath 2>
- Test: <count> file(s)
- <relpath 1>
### Compile result
✅ passed | ❌ failed — `<compile-only command, copy-pasteable>`
### Test result
✅ N passed, 0 failed | ❌ N passed, M failed (or 0 executed when no `@Test` methods exist)
- `<FQTestClass1>` — <tests run> passed
- `<FQTestClass2>` — <tests run> passed, <failures> failed
- <failure name>: <one-line reason>
Re-run manually:
```
<scoped test command, copy-pasteable, including the -Dtest=... filter or :testIsolated<Target> task>
```
### Scaffolding status
- `cleanup` input: true | false
- Scope in build file: **kept** | **removed**
- If kept: delete it later with `git checkout <build-file>` or by hand. See the **Cleanup** section in references/<maven|gradle>.md.
- If removed: the build file is back to its pre-skill state; the verification commands above will no longer work — re-invoke the skill if you need to re-verify.
### Notes
<optional — e.g. "Augmented existing scope with 2 new files", "Compile failed naming `Foo.java` outside the include list — add it and re-run", "`cleanup=true` requested but skipped because tests failed">
Tests run: N, Failures: M for surefire; the JUnit XML report's tests= / failures= attrs for Gradle). Don't summarize as "passed" if zero tests executed — say 0 executed and flag that the target test class may have no @Test methods.kept means the user's repo has uncommitted edits to the build file; removed means the file is restored. Never claim removed if any part of the scope (configurations block, source set, task, profile) is still in the file.javac and kotlinc pull in classes referenced from kept files even if those classes are NOT in the include list. If Kept.java imports Broken.java, you must either add Broken.java to includes or fix Broken.java. The compiler error names the file to add. See references/transitive-references.md.
If your project pins a JUnit Platform version that doesn't publish a working junit-platform-console-launcher, use scripts/RunTests.java — a minimal launcher that takes FQ test class names and exits 0/1. Usage instructions are in the file's header comment.
npx claudepluginhub axoniq/agent-skills --plugin axoniq-migrationCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.