Orquestrador Delphi para Rust com IA
raja-taparia/delphi-to-rust-ai-orchestrator
Migra código Delphi legado para Rust com geração automática de testes
Ver no GitHubPlugin que automatiza a migração de código legado Delphi para Rust idiomático usando Claude da Anthropic, gerando testes Golden Master automaticamente. Reduz o esforço manual de refatoração de sistemas antigos através de orquestração de IA.
Instalação
npx convez-ai raja-taparia/delphi-to-rust-ai-orchestrator1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Modernizar aplicações Delphi legadas para Rust
- Gerar testes de caracterização (Golden Master) durante migração
- Automatizar tradução de lógica de negócio entre linguagens
Veredito

Solução específica e bem-estruturada para um problema niche (migração Delphi→Rust). Funciona como prova de conceito sólida aproveitando Claude para tradução de código legado, mas exige conhecimento técnico profundo tanto de Delphi quanto de Rust para extensão efetiva.
README
A tradução para o português deste README ainda está na fila.
Delphi to Rust AI Orchestrator
A minimal, opinionated orchestrator that demonstrates how to migrate legacy Delphi logic into idiomatic Rust using an LLM (Anthropic Claude) and generate Golden Master tests.
This project is intentionally small and structured to be easy to extend.
🚀 Quick Start
1) Create and activate a Python virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate
2) Install dependencies
pip install -r requirements.txt
3) Install the package in editable mode
pip install -e .
4) Configure your Anthropic API key
cp .env .env.local
# Edit .env.local and set your API key
5) (Optional) Tune behavior via config.yml
config.yml controls:
- which Anthropic model is used
- token limits for translation + test generation
- output directory structure
▶️ Run the orchestrator
python -m delphi_to_rust_ai_orchestrator
CLI options
python -m delphi_to_rust_ai_orchestrator \
--legacy-dir ./legacy_delphi \
--target-dir ./out \
--rust-dir src \
--tests-dir tests \
--config config.yml
Run without writing output:
python -m delphi_to_rust_ai_orchestrator --dry-run
✅ Recommended commands (Makefile)
make install # install dependencies + editable package
make run # run the orchestrator
make test # run unit tests
make clean # clean build artifacts
🗂 Project Structure
src/delphi_to_rust_ai_orchestrator/— main package sourcetests/— unit testslegacy_delphi/— place legacy Delphi source files here for migrationconfig.yml— engine defaults (model, token limits, output paths).env— local secrets (API key)pyproject.toml— packaging metadataMakefile— convenience commands
🧠 How It Works
- The pipeline reads legacy Delphi code (currently mocked).
- It calls Anthropic Claude to translate Delphi → Rust.
- It calls Anthropic Claude to generate Golden Master tests.
- It writes generated outputs to the configured directory.
🧪 Testing
make test
� Example output (dry-run)
--- Starting Delphi to Rust Migration Pipeline ---
⚠️ No legacy Delphi sources found. Falling back to a mocked example.
🚀 Initializing AI-Assisted Extraction for module: mocked_ping_sensor...
🛡️ Generating Golden Master / Characterization Tests...
✅ AI Extraction Complete. Ready for Human Architectural Review.
Preview of generated Rust (Async Tokio implementation):
----------------------------------------
use tokio::net::TcpStream;
use std::net::SocketAddr;
pub async fn execute_ping(ip: &str) -> Result<u32, Error> {... }
🤝 How to contribute / extend
This project is intentionally small, so contributions are welcome.
- Fork the repo and create a feature branch.
- Add or improve the parser in
src/delphi_to_rust_ai_orchestrator/legacy.py. - Update prompts in
src/delphi_to_rust_ai_orchestrator/prompts.pyor improve generation insrc/delphi_to_rust_ai_orchestrator/translator.py. - Add tests under
tests/and runmake test. - Submit a PR with a short description of your change.
�🔧 Next Improvements
- Add real Delphi parsing + discovery
- Improve output formatting and module naming
- Add richer CLI configuration
- Add integration tests and error reporting