translate-code

Translate analysis scripts between Python, Stata, and R while preserving logic and output.

1|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/AndreaMentasti/tweet-election --skill translate-code-andreamentasti
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: translate-code
Source: https://github.com/AndreaMentasti/tweet-election/tree/main/.claude/skills/translate-code
Command: npx skills add https://github.com/AndreaMentasti/tweet-election --skill translate-code-andreamentasti

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the translation of analysis scripts between Python, Stata, and R, ensuring that the logic, output, and project conventions are preserved across languages.

Core Features & Use Cases

  • Faithful Translation: Converts code while maintaining identical logic, variable names, filters, transformations, and output structure.
  • Syntax and Boilerplate Handling: Adapts code to the specific syntax, paths, and standard boilerplate of the target language (Python, Stata, or R).
  • Use Case: You have a data analysis script in Python and need to port it to Stata for a colleague who primarily uses that language. This Skill will perform the conversion, ensuring the Stata script produces the same results and adheres to Stata's project conventions.

Quick Start

Use the translate-code skill to convert the file 'analysis.py' to R.

Frequently Asked Questions about translate-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I translate a Python data analysis script to Stata or R?

To translate Python data analysis scripts to Stata or R, the skill converts the code while preserving identical logic, variable names, filters, transformations, and output structure to ensure faithful cross-language conversion.

Can I convert Stata code to Python and keep the same project conventions?

Yes, converting Stata code to Python adapts the syntax to the target language's specific standard boilerplate, path mappings, and project conventions while maintaining output fidelity and deterministic analysis results.

What is the best way to port R scripts to Stata for a colleague?

Porting R scripts to Stata is handled by translating the analysis script directionally, adapting the code to Stata's specific syntax and standard boilerplate while ensuring the resulting script produces identical analysis results.

Does code translation between Python, R, and Stata handle cross-language traps?

Yes, code translation between Python, R, and Stata specifically requires adherence to cross-language trap considerations and boilerplate mappings to accurately perform deterministic tasks and avoid conversion errors.

Why does my translated script produce different output in the target language?

Translated scripts may produce different output if specific boilerplate, path mappings, and cross-language trap considerations are not strictly followed during the conversion process to ensure deterministic task execution.