Legacy system modernization with Spec-Driven Development
Upgrade the system your business depends on without stopping operations: automated tests check every step before each version switch. For business and technology leaders.
Two systems migrated from CodeIgniter 2 to 3, with unit-test suites
Quilt Software / PosNation: test suite from 540 to 1,455 in 3 weeks
Claude Code used to reverse-engineer undocumented legacy code
01
Recognize this situation?
The system runs on an unsupported PHP or framework version, and every server update turns into a risk.
There are no tests and no documentation: only one or two people understand the business rules, and they may leave.
A rewrite from scratch looks like the way out, but operations cannot stop or wait for the new version to catch up.
Every deploy is manual and tense, and the team spends more time firefighting than delivering the roadmap.
02
What we deliver
Legacy assessment
Legacy assessment
An inventory of versions, dependencies, integrations and untested areas, with a modernization plan in steps ordered by risk and by business value.
Tests before cutover
Tests before cutover
Unit and integration tests that pin down the current behavior of the system before any change, so every step is validated against what already works.
Incremental language and framework upgrades
Incremental language and framework upgrades
Version-by-version upgrades of PHP, CodeIgniter and Laravel, fixing the incompatibilities at each jump while the system stays in production the whole way.
Documentation recovered by reverse engineering
Documentation recovered by reverse engineering
Specs, business rules and OpenAPI contracts recovered from the code with AI and reviewed by people who know the operation, so the system stops depending on one or two people.
CI/CD and quality gates
CI/CD and quality gates
Deploys stop being manual: a pipeline with automated tests, static analysis and pre-commit hooks, and no change reaches production without passing the same criteria.
Reproducible environment and cutover plan
Reproducible environment and cutover plan
A Docker development environment that is the same for the whole team and a cutover runbook with acceptance and rollback criteria set before the date.
Event-driven architectureEach domain sits isolated behind an API with contracts. Services publish events to a bus with queues and retries, and workers handle integrations and per-tenant data, without coupling one domain to another.
03
Results and experience
Regal Rexnord (NYSE: RRX)
Scope:
PHP legacy modernization
Upgrade of critical applications from PHP 5.6 to 8.4 and migration of two systems from CodeIgniter 2 to 3.
PHP 5.6 → 8.4 (10 versions)
Unit-test suites for zero-downtime cutovers
Claude Code used to reverse-engineer undocumented code
Free first conversation · Reply within 1 business day
04
Who it is for and who it is not
Legacy modernization is upgrading an aging system the business uses every day, in small steps and without stopping operations. Spec-Driven Development is the method: before any change, current behavior is written down and covered by automated tests. Hire it when the version is out of support, every update is feared or the system has stopped evolving.
A good fit for
CTOs with critical systems on old or unsupported versions of PHP, CodeIgniter or Laravel.
Companies whose operations depend on the system every day and cannot stop for a rewrite.
Teams that inherited code with no tests and no documentation and need to evolve the product safely again.
Companies that want to adopt Spec-Driven Development starting from a system already in production.
Not a fit for
Small, rarely used systems, where replacing them with an off-the-shelf SaaS costs less than modernizing.
Anyone who wants a full rewrite on another stack, all at once: that is a custom software project.
Mainframe, COBOL or customization of packaged ERPs: our experience is with web applications, APIs and PHP.
Projects with no business owner available to validate rules and acceptance criteria.
05
How it works and timelines
01
Discovery
Discovery
We read the code and map versions, dependencies, integrations and untested areas. You receive a risk report and the modernization plan in steps, with an estimate for each one.
02
Safety net: specs and tests
Safety net: specs and tests
We recover the business rules by reverse engineering and write the tests that pin down current behavior. You receive the specs, the test suite and a working CI.
03
Pilot on one module
Pilot on one module
We modernize one module end to end, from upgrade to cutover, to validate the method on your system. You receive the module in production and a revised estimate for the rest.
04
Incremental modernization
Incremental modernization
Version-by-version upgrades, with frequent releases and the system live. A step only moves forward with the tests passing. You receive each step in production, with its rollback runbook.
05
Handover and evolution
Handover and evolution
Documentation, pipeline and standards stay with your team, with mentoring to keep the pace. Evolution of the system can continue under a monthly retainer.
Typical ways to engage this service
Scope
Typical timeline
Engagement model
Legacy assessmentInventory of versions, dependencies and risks, a modernization plan in steps and an estimate
1–2 weeks
Fixed-scope project
Modernization pilotOne module with tests, upgrade and cutover in production, to validate the method
2–4 weeks
Fixed-scope project
Incremental modernizationLanguage and framework upgrades, tests, CI/CD and documentation, with the system live
6–12 weeks
Fixed scope per step or time & materials with a cap
Ongoing evolutionFurther upgrades, continuous improvement and team mentoring
Ongoing
Monthly fractional retainer
Timelines are typical ranges. Discovery defines the scope and the estimate of each project; the contract can be in USD or BRL.
Free first conversation · Reply within 1 business day
06
Technical details
How we use AI with governance, the decision comparison and the stack
AI with governance
We use AI coding agents to understand and refactor legacy code faster, under one rule: no AI-generated change goes in without an approved spec, passing tests and human review.
Where AI comes inClaude Code reads undocumented code, maps dependencies and proposes specs and tests that describe current behavior.
Spec firstIn Spec-Driven Development, the expected behavior is written and approved before the agent changes a single line.
What humans reviewThe recovered business rules, the plan for each upgrade and every merge go through senior human review.
Quality gatesAutomated tests, static analysis and pre-commit hooks block any change that breaks current behavior.
Team adoptionPutting AI coding agents into your engineering routine is the subject of the AI software automation service.
Your dataClient data never trains models, and we work under NDA.
Decision comparison
Scroll sideways to see more
Rewrite from scratch, modernize incrementally or keep as is: how to decide
Criterion
Rewrite from scratch
Incremental modernization
Keep as is
When it makes sense
The current architecture blocks the business or the technology has no upgrade path
The system works and holds business rules that must not be lost
The system will be retired soon or has low business impact
Operations during the work
Two systems in parallel until the switch
The system stays in production; each step goes live separately
No change
Return
Shows up only after the full switch
Shows up with every step delivered
None; maintenance cost tends to grow
Main risk
Undocumented business rules are left out of the new version
Requires test discipline and living with old code for a while
Unsupported versions accumulate security flaws and technical debt
Prerequisite
A complete specification of current behavior
Tests that pin down current behavior before each change
A retirement or replacement plan
Stack and integrations
PHP
CodeIgniter
Laravel
MySQL
SQL Server
PostgreSQL
React
Vue.js
TypeScript
PHPUnit
Jest
Playwright
Docker
GitHub Actions
OpenAPI
Claude Code
07
Frequently asked questions about Legacy Modernization
Should we rewrite or incrementally modernize a legacy PHP system?
In most cases, modernize in steps: the system stays in production, the return shows up with every delivery and the accumulated business rules are not lost. A rewrite is justified when the current architecture blocks the business or the technology has no upgrade path. A 1–2 week discovery compares both paths using the data of your system.
How do you upgrade a legacy PHP system without downtime?
With tests that pin down current behavior and upgrades one version at a time, each with a rollback runbook: that is how we took Regal Rexnord's applications from PHP 5.6 to 8.4 without downtime. The step-by-step is in our guide “PHP 5 to PHP 8 Migration Without Downtime”.
How long does a legacy modernization take?
Typical timelines are: discovery in 1–2 weeks, a pilot on one module in 2–4 weeks and each modernization cycle in 6–12 weeks. Large systems are split into cycles, and every cycle ends with something in production. The biggest factors are the size of the codebase, the existing test coverage and the number of integrations.
What if the system has no tests and no documentation?
That is the most common starting point, and the work begins right there: we recover the business rules by reverse engineering and write tests that pin down current behavior before changing anything. At Quilt Software / PosNation, we took the suite from 540 to 1,455 tests in 3 weeks, on a legacy PHP and React/TypeScript platform shared by about 18 engineers.
How is AI used safely on legacy code?
AI reads and proposes; a person decides, with senior review, and nothing reaches production without an approved spec and passing tests. AI coding agents such as Claude Code speed up reverse engineering, test writing and refactoring. At Regal Rexnord, we used Claude Code to understand undocumented legacy code. Client data never trains models, and we work under NDA.
What is Spec-Driven Development, and does it work for legacy code?
Yes. Spec-Driven Development (SDD) means writing and approving the specification, with acceptance criteria, before the code. On legacy code, the first step is turning current behavior into specs and tests; from there, every upgrade has a clear target and an objective check. The full method is in our guide “What Is Spec-Driven Development (SDD)?”.
When is it worth modernizing a legacy system?
It is worth it when the system sustains operations and at least one of these signs shows up: a version without security support, risky deploys, difficulty hiring for the technology or new features that take longer every time. If the system has low impact or will be retired, keeping it as is can be the right call, and we tell you so in the first conversation.
How much does legacy modernization cost?
The cost depends on the size of the codebase, the existing test coverage, the number of version jumps and the integrations. That is why we do not publish a price list. A 1–2 week discovery produces the plan in steps and an estimate for each one. The proposal can be fixed scope per step or time & materials with a cap, in USD or BRL.
ERP, CRM, POS and APIs that follow your process, with tests.
View service
Let's assess your legacy system
In the first conversation we look at the versions, tests and risks of your system and tell you plainly whether the path is to modernize in steps, rewrite or keep it as is.