Geoffrey Huntley published a four-loop Ralph workflow for porting codebases by turning tests and source into cited specs before implementation. Try it when you need AI help translating a mature codebase across languages without losing behavioral coverage.

src/* and tests/* into /specs/*.md as citations, effectively converting the old codebase into a high-level PRD with traceability back to behavior and implementation citation method.Huntley’s new post lays out a concrete four-step recipe for language-porting with Ralph loops. In the condensed version repeated in the thread, the order is: “ralph from tests/* to specs,” then “ralph from src/* to specs,” then “ralph TODO/todo.md,” and finally “implementing the target language” four steps.
The longer writeup describes those loops as separate passes with different goals. One pass creates a TODO file, another studies the entire product by having subagents inspect files under src/*, and another compresses tests into markdown specs under /specs/*.md with citations back to the original material workflow details. The framing is that the hard part is not syntax conversion but extracting a faithful, cited specification of behavior before generating the new implementation.
The technical idea is to decouple the port from the source language by turning code and tests into cited specifications first. Huntley’s summary says those citations “reference source code during the translation process,” which makes the codebase behave more like a PRD than a pile of source files citation method. For engineering teams, that is the important shift: the workflow is optimized for preserving behavior and intent, not just reproducing structure.
A reply from dexhorthy added the caveat “porting well-tested software,” and Huntley answered with a laughing salute rather than disputing it well-tested caveat Huntley reply. That caveat fits the method. If the first Ralph loop converts tests into specs, then weak or missing tests leave the process with less behavioral ground truth. The workflow is most credible where tests/* already captures the contract the new code must satisfy.
“porting software has been trivial for a while now. here’s how you do it” (link below)