code-translation

Translate code snippets between programming languages while preserving behavior and idioms.

1|2|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill code-translation-santosomar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-translation
Source: https://github.com/santosomar/general-secure-coding-agent-skills/tree/main/skills/code-analysis/code-translation
Command: npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill code-translation-santosomar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the conversion of code snippets between different programming languages, ensuring that the translated code is idiomatic and preserves the original behavior.

Core Features & Use Cases

  • Language Translation: Converts single functions or small code units from one language to another.
  • Idiomatic Code Generation: Aims to produce code that follows the conventions and best practices of the target language, not just a literal translation.
  • Behavior Preservation: Focuses on ensuring that the translated code produces the same inputs and outputs as the original.
  • Use Case: You have a Python function that you need to use in a Go project. This Skill can translate the Python function into equivalent, idiomatic Go code.

Quick Start

Translate the following Python code snippet into Java.

Frequently Asked Questions about code-translation

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

FAQPage Schema
How do I translate Python code to Java while preserving behavior?

To translate Python code to Java, this Skill converts single functions or small code units by mapping syntax, semantics, and idioms to generate equivalent target language code. It focuses on preserving observable behavior and inputs while ensuring the output follows Java conventions.

What is the best way to convert C++ code to idiomatic Rust?

The best way to convert C++ code to idiomatic Rust is using a code translation process that maps language semantics and idioms rather than performing a literal translation. This ensures the generated Rust code follows target language conventions and preserves the original behavior.

Can I translate JavaScript to TypeScript without changing the runtime behavior?

Yes, you can translate JavaScript to TypeScript while preserving observable behavior. The translation mechanism validates the converted code against semantic minefields and idiom mapping patterns to ensure the inputs and outputs remain identical to the original snippet.

Does code translation support converting entire projects or just single functions?

Code translation supports converting single functions or small code units, not entire projects. It is designed to handle specific code snippets between common language pairs, ensuring the translated unit produces the same inputs and outputs as the original.

Why does my translated code fail semantic validation during code conversion?

Translated code fails semantic validation during code conversion when the translation hits semantic minefields between the source and target languages. The translation process validates against these specific patterns to ensure behavior preservation and correct idiom mapping.

How do I refactor code to follow the conventions of a different programming language?

To refactor code for a different programming language, this Skill generates idiomatic code that follows the target language's best practices and conventions. It maps the original semantics and idioms to ensure the translated snippet is natural and behavior-preserving.