legacy-code-translator

legacy-code-translator is a skill for Claude Code, Codex from roedyrustam/vibes-plug. It costs 42 tokens per session (938 once invoked), scanned A, original, MIT.

A step-by-step guide for understanding, translating, and modernising large old codebases. It focuses on preserving business rules while moving from older PHP, Python, or React code to newer technologies.

In plain words
What is it for?
Use it to plan legacy-code migrations, separate business logic from old frameworks, translate code between languages, and refactor outdated React components.
Why use it?
It reduces the risk of losing important behaviour or creating new bugs during a major code migration.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/roedyrustam/vibes-plug/legacy-code-translator
Any agent
npx skills add roedyrustam/vibes-plug --skill legacy-code-translator
Clone the repo
git clone --depth 1 https://github.com/roedyrustam/vibes-plug

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for legacy-code-translator

README.md
[![agentmods](https://agentmods.dev/badge/skills/roedyrustam/vibes-plug/legacy-code-translator.svg)](https://agentmods.dev/skills/roedyrustam/vibes-plug/legacy-code-translator)
Your own site
<a href="https://agentmods.dev/skills/roedyrustam/vibes-plug/legacy-code-translator"><img src="https://agentmods.dev/badge/skills/roedyrustam/vibes-plug/legacy-code-translator.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 938 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.00938
Opus 5 $0.00021 $0.00469
Sonnet 5 $0.00008 $0.00188
Haiku 4.5 $0.00004 $0.00094

Measured 3d ago against content hash 1b706d11fe19, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

legacy-code-translator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/legacy-code-translator/SKILL.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Legacy Code Translator (Refactoring Engine)

English | Bahasa Indonesia


English

Orchestration & Integration

Connects and orchestrates with relevant domain skills like brainstorming, zero-to-prod-orchestrator, and project-context-mapper to ensure cohesive execution.

Description

A rigid methodology for the AI agent to reverse-engineer and translate legacy codebases into modern architectures without losing business logic. This gives the agent the "superpower" to handle massive enterprise migrations safely, avoiding the common hallucination trap of rewriting everything at once.

Trigger Conditions

Activate this skill when the user says:

  • "Migrate this old PHP codebase to Next.js."
  • "Translate this Python script to Rust."
  • "Refactor this giant React class component into hooks."

Core Concepts

1. The 4-Step Migration Protocol

The agent MUST follow this exact sequence:

  1. Understand (AST Map): Map out the legacy code's inputs, outputs, and side effects. Document this in an artifact (migration_plan.md).
  2. Isolate Logic: Separate the core business rules from the legacy framework bindings (e.g., separate the tax calculation logic from the WordPress hook).
  3. Translate: Write the modernized code in the new language/framework.
  4. Verify (Shadow Testing): Compare the output of the new code against the old code using identical inputs.
2. Agent Constraints
  • NEVER overwrite the legacy file directly. Always create the new file side-by-side (e.g., User.legacy.php and user.service.ts).
  • NEVER attempt to translate a 2000-line file in one shot. Break it down by functions or modules to prevent context window exhaustion and token truncation.
  • Preserve quirks: Sometimes legacy bugs are actually relied-upon business logic. Document suspicious logic before fixing it.

Integration with Other Skills (MANDATORY)

  • prd-architect — To document the extracted business rules before writing modern code.
  • project-context-mapper — To understand how the legacy files intertwine before pulling them apart.
  • autonomous-tdd-debugger — To write tests against the old code, ensuring the new code passes the exact same tests.

Read the full file on GitHub · 72 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 72 lines · 42 tokens per session scan A 1b706d11fe19

Subscribe to this mod's changes

legacy-code-translator is a skill published in the GitHub repository roedyrustam/vibes-plug (49 stars, last pushed 2d ago), licensed MIT. It adds 42 tokens to every session and 938 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

code-review-and-quality

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch.

addyosmani/agent-skills · 51 tokens

doubt-driven-development

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production, security-sensitive logic, irreversible operations), or any time a confident output would be cheaper to verify now…

addyosmani/agent-skills · 67 tokens

code-simplification

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

addyosmani/agent-skills · 51 tokens

resolve-pr-comments

Evaluate, fix, answer, and reply to GitHub pull request review comments and conversation comments. Handles both change requests (fix or skip) and reviewer questions (explain using reasoning recalled from past Claude Code transcripts). Use when the user asks to "resolve PR comments", "fix review comments", "address PR…

tobihagemann/turbo · 95 tokens

review-code

Review code for bugs, security vulnerabilities, API misuse, consistency issues, simplicity problems, or test coverage gaps by running internal reviews and a peer review in parallel and returning combined findings. Single-concern with a type argument, or full review with no argument. Use when the user asks to "review…

tobihagemann/turbo · 144 tokens

assess-technical-debt

Assess project-wide structural technical debt: complexity hotspots, deprecated API usage, duplication clusters, and architecture rot. Ranks findings by impact and refactor effort into a report at .turbo/technical-debt.md. Use when the user asks to "assess technical debt", "find technical debt", "review technical…

tobihagemann/turbo · 108 tokens