Skip to content

Repository files navigation

JAIPilot

JAIPilot

Ship better Java with your coding agent.

JAIPilot helps Codex and Claude Code clean, test, review, modernize, and optimize real Java repositories without drifting into unnecessary code or unproved changes.

By default, your agent runs Java builds, tests, analysis, profiling, and benchmarks on a ready remote Java machine whenever the task does not require laptop-only access or state.

JAIPilot does not replace your coding agent or add another AI. It gives your agent focused Java workflows, remote compute, and one rule: show evidence, not confidence.

Install and run

Codex

codex plugin marketplace add JAIPilot/jaipilot
codex plugin add jaipilot@jaipilot

Claude Code

/plugin marketplace add JAIPilot/jaipilot
/plugin install jaipilot@jaipilot

Open a Java repository and ask:

Make my current Java changes production-ready without changing their behavior. Add missing tests,
remove unnecessary code, improve only performance you can measure, and run the full verification.
Use JAIPilot Remote for substantial Java commands unless this work needs my laptop.

The Java skills work locally as soon as the plugin is installed. When remote execution is useful, your agent asks before uploading the current tracked and unignored Git files. Approve the upload and sign in when prompted; the agent handles packaging, integrity checking, upload, execution, logs, and workspace deletion. You do not create an archive, configure a VM, provide an API key, or copy files manually. .git, ignored files, and remote edits are never transferred back automatically.

If packaging or upload cannot be verified, JAIPilot does not create the workspace. Your agent must show the failing step instead of silently uploading a different source tree.

12.2–80.3% faster61.3–62.5% faster87.5–92.4% faster8 → 2 SQL statements
OTel lookup mediansMicrometer mergesCalcite JMH mediansN+1 removed

JAIPilot vs no JAIPilot

The original Petclinic PR already had a green build. JAIPilot reviewed that exact head and produced this companion change:

MetricWithout JAIPilotWith JAIPilotOutcome
Tests7585+10 tests (+13.3%)
Changed-method line coverage0/12 (0%)11/11 (100%)+100 percentage points
Changed-method branch coverage0/8 (0%)8/8 (100%)+100 percentage points
Owner class line coverage22/53 (41.5%)33/51 (64.7%)+23.2 points with less code
Production changeUnused helper remained+2/-9 lines7 net lines removed
Owner methods16151 unused method removed
Owner complexity25244% lower
Clean Maven verification75/75 passed85/85 passedBoth stayed green

The important result is not simply “more tests.” Without JAIPilot, the build passed while the new behavior had zero coverage and unused code remained. With JAIPilot, the same behavior stayed green, the edge cases became executable tests, and production code became smaller.

The comparison uses the original PR head and JAIPilot's direct child commit, clean worktrees, the same ./mvnw -q clean verify command, and fresh JaCoCo 0.8.14 reports.

Measured performance: Apache Calcite

On skrcode/calcite at exact commit d3a5d8d, JAIPilot profiled Calcite's existing DefaultDirectedGraphBenchmark.removeAllVertices{10,50,90}Benchmark. The 50% workload attributed 31.1% of runnable samples to Collection.removeIf: the implementation scanned the complete global edge set once for every removed vertex.

The candidate changed two files (+28/-5), removed the repeated scans, and added behavior tests for the majority-removal and self-loop paths. Lower JMH scores are better:

Removed verticesBaseline median (µs/op)JAIPilot median (µs/op)ImprovementBaseline p95 (µs/op)JAIPilot p95 (µs/op)Improvement
10%26.7102.02992.4%27.1422.43991.0%
50%74.6199.14087.8%87.24514.99382.8%
90%77.4239.67787.5%89.51410.05288.8%

Baseline and candidate ran on the same 4 CPU/8 GiB remote workspace with the same Temurin JDK 17, built JMH jar, command, and workload. Each row contains 21 measured observations: seven forks with three measured iterations per fork after warm-up. The identical focused command passed 15/15 tests before and after the production edit. A fresh exact-SHA :core:clean :core:check then completed 16,644 tests with 0 failures and 155 skips, and the tested remote diff matched the local candidate digest.

This is a controlled result for Calcite's existing graph-removal workloads, not a claim that every Java workload becomes faster.

Measured performance: OpenTelemetry Java

On skrcode/opentelemetry-java at exact commit 35636ae, JAIPilot found that immutable attribute sets were sorted by key name during construction but still used a full linear scan for every lookup. This matters at the default span limit of 128 attributes.

The three-file draft change preserves the small-set and first-four-entry fast path, then uses binary search for the rest. It also adds a large-set behavior test and a repository-native JMH benchmark. Lower values are better:

LookupBaseline median (ns/op)JAIPilot median (ns/op)ImprovementBaseline p95JAIPilot p95Improvement
First2.4832.17912.2%2.6372.27213.8%
Middle169.12485.90549.2%178.25088.53750.3%
Last346.19587.32374.8%358.32190.08474.9%
Missing141.56069.55250.9%150.32174.26150.6%
Last as Value368.62972.68480.3%387.46778.08779.8%

Baseline and candidate ran in the same 4 CPU/8 GiB remote workspace with Temurin JDK 21, the same JMH jar, command, warm-up, and workload. Each row has 21 observations. The new focused behavior test passed before and after the production edit; a clean :api:all:check passed all 147 tasks including Animal Sniffer, Checkstyle, Spotless, tests, and japicmp. The tested remote Git delta matched the local candidate digest. The Value workload still allocates about 16 B/op; JAIPilot reports the lookup-time win without claiming that allocation disappeared.

Measured performance: Micrometer

On skrcode/micrometer at exact commit 22207bf, JAIPilot found that adding or replacing one Tag or KeyValue went through temporary varargs and iterable merge machinery even though the backing arrays were already sorted.

The six-file draft change adds a bounded binary-search merge for the single-value overloads, behavior tests, and four workloads in Micrometer's existing JMH module:

Replacement workloadBaseline median (ns/op)JAIPilot median (ns/op)ImprovementBaseline p95JAIPilot p95ImprovementAllocation
KeyValues.and57.94122.44961.3%63.55423.48763.0%136 → 104 B/op
Tags.and58.96822.10162.5%63.38824.42561.5%136 → 104 B/op

Single-value insertion reduced median allocation by 17.6% and p95 allocation by 46.2%. Its median latency improved by only 6.7–8.9%, below JAIPilot's 10% shared-hardware threshold, so it is not presented as a speed win. The same-workspace experiment used 21 observations per workload; 92 focused tests and the final clean scoped build passed, with 1,132 tests, zero failures, and the remote production diff matching the local digest.

Measured database work: Petclinic

On the current Petclinic JDBC vet listing, JAIPilot found a real N+1 query path: six vets required eight SQL statements (2 + N). It kept the ordered vet query and replaced the per-vet specialty lookups with one joined association query.

EvidenceBaselineJAIPilot candidate
SQL statements, six vets82
Growth with vet count2 + Nconstant 2
Focused JDBC tests11/1115/15
Clean repository build75/7579/79

The new tests lock vet ordering, specialty ordering, vets without specialties, duplicate links, shared specialty identity, empty data, and the exact two-statement ceiling. The final clean Maven build and JaCoCo report passed on a 4 CPU/8 GiB remote workspace, and the local and remote binary diff digests matched. This is deterministic query-count evidence; JAIPilot does not turn it into an invented latency claim.

Why teams use JAIPilot

  • Less agent drift — changes stay bounded, lean, and aligned with the repository.
  • Better Java code — remove proven waste, reduce complexity, improve tests, review risky diffs, modernize safely, and optimize measured bottlenecks.
  • Real verification — use the repository's Maven or Gradle build, tests, coverage, architecture rules, and performance measurements.
  • Remote-first execution — use disposable hardware with JDK 17, 21, and 25, Maven, and Gradle ready unless private networks, local services, secrets, hardware, or state require the laptop.
  • Remote performance lab — profile and compare a bounded optimization on one 4 CPU/8 GiB workspace, with matching patch identity, raw observations, median, p95, and correctness evidence.
  • Works on your current change — staged, unstaged, and untracked files can be tested without committing or pushing first.
  • Your agent stays in control — Codex or Claude Code chooses every edit and command and reports exactly what JAIPilot achieved.

More proven results

Additional acceptance runs used repository-native verification:

Use caseResult
Optimize Apache Calcite graph removalExisting JMH workload medians improved by 87.5–92.4% across 10%, 50%, and 90% removal cases; matching behavior tests and a 16,644-test clean check passed.
Optimize OpenTelemetry attribute lookupFive 128-attribute lookup workloads improved by 12.2–80.3% at median and 13.8–79.8% at p95; clean API compatibility and verification passed.
Optimize Micrometer single-value mergesReplacement merges improved by 61.3–62.5% at median and allocated 23.5% less; sub-threshold insertion latency was not marketed as a speed win.
Cover previously untested behavior7 focused tests added with no production or dependency change; target coverage moved from 0% to 100% for lines and branches; 82/82 tests passed independently on Java 17 and 21.
Run the current change remotelyAn uncommitted file reached the workspace; ./mvnw clean test passed 75/75 tests in 44.6 seconds; job recovery, cancellation, and workspace deletion were verified.
Remove a JDBC N+1 queryVet listing SQL statements fell from 8 to 2 on the six-vet fixture; 15/15 focused and 79/79 clean-build tests passed, with identical local/remote diff digests.

These are reproducible acceptance results, not claims that every repository will see the same coverage, code reduction, or speed.

MCP Registry

Clients that consume the official MCP Registry can discover the hosted remote tools as io.github.JAIPilot/jaipilot. This installs remote execution only; install the Codex or Claude Code plugin above for the six Java engineering skills as well.

Included skills

SkillOutcome
jaipilot-optimize-javaMake one bounded Java change leaner, safer, and faster.
jaipilot-generate-testsAdd meaningful tests and fresh coverage evidence.
jaipilot-clean-javaRemove waste, enforce architecture, and simplify code.
jaipilot-review-diffFind regressions, unnecessary code, and missing proof.
jaipilot-fast-executionRun substantial Java verification efficiently.
jaipilot-remote-javaDefault applicable Java execution to remote hardware.

JAIPilot can work with repository-configured tools such as JaCoCo, PIT, ArchUnit, OpenRewrite, Checkstyle, PMD, SpotBugs, SonarQube, JMH, and JFR. It never weakens a quality gate merely to get a green result.

Remote build beta

The beta permits one active remote workspace. Remote work is disposable and never commits, pushes, or publishes code. JAIPilot defaults applicable Java execution to remote hardware; it stays local when a corporate VPN, private artifact service, internal database, unavailable secret, machine-specific state, or another laptop-only resource is required.

See Security, Privacy, Support, Terms, and the Changelog.

Licensed under the MIT License.