A modernization request usually arrives as a technology question: which framework replaces the old one? The safer starting point is to establish what still works, then assemble evidence that both guards that behavior against regressions and shows where change is actually required.

This evidence-first approach was applied to four public applications, ranging from a small Node.js game to a large Java ERP system. Each called for different treatment, yet the loop of gathering evidence, picking the next experiment, and defining proof points stayed repeatable. The procedure can also be encoded as a GitHub Copilot agent skill without taking architectural judgment away from the people who own the system.

What to gather before picking a target

A label like "Java microservices" leaves out too much: which JDK runs in production, where that version is pinned, whether tests actually execute, and which interfaces other systems rely on. Likewise, "legacy monolith" says nothing about whether the business core is sound or whether a single retired platform dependency stops the application from starting.

Build a compact inventory of evidence first, covering:

  • Manifests, lockfiles, entry points, and deployable components
  • Commands verified for install, build, test, package, and run
  • Runtime pins found in containers, CI workflows, deployment files, and developer tooling
  • External contracts: APIs, database behavior, file formats, and user workflows
  • End-of-life frameworks and dependencies, with proof the application still uses them

Label uncertainty as you go: documented, inferred, or unverified. When two files disagree on the Java version, resolve the conflict. If it is unclear whether a CI check blocks merges, record that gap instead of turning a guess into a finding. The resulting inventory is something the application's owners can review before any change is proposed.

A decision order, not a risk ranking

Decisions belong at the component level. One system may contain code worth keeping, dependencies worth swapping, and a single subsystem that truly needs a rewrite.

Ask first whether a capability is still needed. Remove it only once it is confirmed unused or superseded and the owner agrees — removal stands as its own decision and is not automatically the most disruptive one.

Where the capability stays, take the option that changes least:

  1. Keep it. Supported code that still fits needs no modernization story.
  2. Upgrade it. Move to a supported major version and repair the breaking changes.
  3. Swap it. Replace an abandoned dependency while keeping the existing design.
  4. Wrap it. Stabilize a useful interface and replace the internals incrementally.
  5. Rewrite it. Reserved for cases with no responsible upgrade path or an architecture that cannot meet the requirement.

Because this is an order of preference rather than a ranking of effort or risk, choosing something more disruptive demands evidence. Aging code is not sufficient. Escalation can be justified by a known vulnerability with no patched release for the pinned version, a dependency that fails on the required runtime, or a measured reliability target the current design cannot reach.

Testing whether proof is even possible

Ask next whether the component can run well enough to produce evidence, even with a legacy CI pipeline that is not green. Run a time-boxed feasibility check: attempt dependency installation, a build on an available toolchain, startup, and at least one meaningful test. When the box expires, stop — the outcome determines the path.

Capture behavior, then upgrade. Applies when the old application still runs at acceptable cost. Record externally visible behavior, repair the test harness where practical, and use those checks to verify the upgrade.

Build a small modern slice first. Applies when the component cannot run until it has already been changed. Move the thinnest useful workflow onto supported technology, prove it, and expand. Demanding a complete legacy test suite in this case is circular, since restoring that suite is itself part of the modernization.

Safety levels adapted from the doc-and-modernize skill describe the strongest regression protection available:

LevelStrongest honest protection
L0No usable regression net; treat the old code and available documentation as the specification.
L1Small reversible changes, old and new paths in parallel, smoke checks, and domain review.
L2Captured inputs and outputs, snapshots, or other behavioral comparisons.
L3Automated checks cover part of the system, with the remaining gaps named.
L4An automated CI gate combines lint, unit, behavioral, and end-to-end checks for the agreed scope.

Always state what is provable and what risk remains — even an L4 gate cannot show that every possible behavior is correct. APIs, database effects, files, rendered output, and business workflows tend to make durable comparison points, because they can survive a framework or language change.

Case one: PiggyMetrics, where the label was wrong

PiggyMetrics looked worse than it was. It used Java 8, Spring Boot 2.0.3, Spring Cloud Finchley, Zuul, Hystrix, and the old spring-security-oauth2 library — easy to write off and redesign from scratch. The feasibility check disagreed.

Two probes ran against the legacy checkout with JDK 8; these are historical recorded results, not commands expected to reproduce the same failures on the modernized checkout:

CommandRecorded resultWhat it established
mvn -pl config -am compileExit code 0The selected config module and required reactor dependencies compiled.
mvn -pl account-service -am test14 tests ran: five passed and nine erroredSome service logic passed; embedded MongoDB initialization blocked the other tests.

The nine errors all traced through Failed to load ApplicationContext to an embedded MongoDB download returning HTTP 403, compounded by a pinned binary built for i386 that would not run on the Apple Silicon host.

Neither probe proved the whole application ran or that integration behavior was correct. What they produced was a much narrower next step: swap the test dependency and rerun the affected tests before touching the production stack. That spared a tidy but expensive redesign — one broken test dependency did not justify re-architecting, and five passing tests gave behavior to watch for unintended changes.

The modernization plan encoded the evidence as a capture-then-upgrade sequence:

  1. Replace the embedded database dependency with Testcontainers and get a green baseline on the existing stack.
  2. Put that baseline in GitHub Actions before changing the production runtime.
  3. Move from Java 8 to Java 21 and Spring Boot 3.3.
  4. Swap obsolete components behind their existing interfaces: Zuul for Spring Cloud Gateway, Hystrix for Resilience4j, and the retired OAuth stack for Spring Authorization Server plus JSON Web Token (JWT) resource servers.
  5. Carry the baseline forward and add contract checks around behavior that changed.

The first acceptance gate was a passing baseline on the old stack — not merely a replacement dependency installing cleanly. Running checks in CI and enforcing them as merge requirements were likewise planned as separate steps.

According to the result summary, Java and Spring were upgraded while the microservice decomposition the application exists to demonstrate was kept. Eureka and Cloud Config stayed; the two monitoring modules tied to the retired Hystrix and Turbine stack were dropped, taking the in-scope build from nine modules to seven.

Those versions document an experiment, not a recommendation for today's choices — pick targets against current support requirements. The lesson is how repository evidence narrowed the change.

Same method, different answers

Applied to two smaller applications, the process produced different outcomes:

ApplicationWhat stayedWhat changedStrategy
BrowserQuestCanvas renderer, pathfinding, world model, protocol, and game-loop modelNode 0.4.7 to Node 22, two obsolete WebSocket stacks to ws, plus tests and GitHub ActionsUpgrade and swap
DOOMRenderer, 35 Hz simulation model, and WAD game-data formatX11 video and OSS audio replaced with SDL2; platform code adapted for modern 64-bit systemsPreserve the core and replace the platform

One qualification matters here: DOOM's checks froze outputs from the modernized engine itself. They guard against later regressions but do not independently prove parity with a period-correct legacy binary. Naming that limit is part of choosing an honest safety level.

Scaling up: ADempiere

Next came ADempiere, a large Java suite spanning ERP, CRM, manufacturing, supply chain, accounting, and point of sale. Scale changed the controls, not the method: the work established a reproducible build, moved the runtime to JDK 21, preserved SOAP web-service contracts while replacing XFire with CXF and Jakarta, captured legacy web behavior, and opened a modern web path for selected users. The first modern business partner write was compared against a result frozen from the legacy application.

The fixed measurement report covers 30 merged modernization pull requests and 102,587.72 reconstructed Copilot credits through the first accepted portable demo — a credit total, not a dollar cost. Just as important, it states what the result was not: no claim that every ADempiere screen or production deployment had been modernized.

Work stopped once the proof-of-concept question was answered: a build on the selected runtime, old and new paths running side by side, and a real business write checked against the legacy result. Finishing the rest would need a product funding decision rather than another technical proof; stopping at that boundary was itself part of the method.

Encoding the procedure as an agent skill

Rather than leave the checklist and decision rules in personal notes, the method went into the public doc-and-modernize agent skill. Agent skills are folders of instructions, scripts, and resources that Copilot loads when a task is relevant; a project skill can live with a single repository:

.github/skills/doc-and-modernize/
├── SKILL.md
├── references/
└── scripts/

Only SKILL.md is required — the other resource folders shown are optional. It needs YAML frontmatter with a name and a description saying what the skill does and when to use it, followed by the instructions; the creation guide has the full format.

Paraphrasing the commit-pinned skill source, the fork in the decision is simple:

  • If the old component runs at acceptable cost, capture its behavior before upgrading.
  • If it cannot run without changes, build and verify a small modern slice first, then expand.

The full skill adds the feasibility check, the testability milestone, safety levels, phase gates, and evidence requirements.

The distinction that matters is procedure versus policy. A shared skill can demand repository evidence, bounded experiments, explicit safety levels, and runnable exit criteria. Only your organization can supply the rest:

  • Approved runtimes, frameworks, and hosting services
  • Application criticality and acceptable residual risk
  • Security, compliance, and change-control requirements
  • Which legacy or production results count as the expected answer
  • Who approves architecture and declares a production change complete

The skill should surface those decisions, not make them on your behalf.

Scope the first engagement to a single, observable application

Pick an application that has a named owner, measurable business value, and one workflow you can actually watch end to end. Lead with the documentation workflow, and walk the architecture, commands, runtime surfaces, and open questions through with the team that owns the system. Sign off on a single experiment rather than a portfolio-wide rewrite.

Vet the skill before it enters the project

Examine the skill and any supporting files before you add it to a project. The GitHub CLI gh skill commands remain in public preview, so confirm the current installation guidance at the point you plan to use them. The doc-and-modernize agent skill is available for review before adoption.