Module Level Code Translator logo

Module Level Code Translator

Community
ArabelaTso
module-level-code-translator

Translate source code between programming languages at function, class, and module levels while preserving behavior and generating verification tests. Use when translating code from one language to another (e.g., "translate this Python module to JavaScript", "convert this Java class to C#", "port this code to Go and generate tests"), migrating codebases between languages, or creating equivalent implementations across different technology stacks. Handles idiom adaptation, standard library mappings, and test generation.

Overview

PublisherArabelaTso
RepositorySkills-4-SE
Skill namemodule-level-code-translator
Stars
258
Forks
25
Bundled files
7
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ArabelaTso on GitHub. Read the source before you install it.

Installation

Install the Module Level Code Translator AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/module-level-code-translator
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git /tmp/Skills-4-SE
mkdir -p .claude/skills
cp -r /tmp/Skills-4-SE/skills/module-level-code-translator .claude/skills/module-level-code-translator
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Module Level Code Translator in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Module Level Code Translator on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Module Level Code Translator is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Module-Level Code Translator

Translate source code between programming languages while preserving behavior, adapting idioms, and generating verification tests.

Translation Workflow

Follow this sequential process for code translation:

1. Analyze Source Code

Before translating, thoroughly understand the source code:

  • Identify scope: Determine if translating functions, classes, or entire modules
  • Map dependencies: List all imports, external libraries, and dependencies
  • Understand behavior: Identify core logic, algorithms, and expected behavior
  • Note language-specific features: Identify features that require special handling (decorators, generators, async/await, etc.)
  • Extract test cases: If existing tests are available, analyze them to understand expected behavior

2. Plan Translation Strategy

Create a translation plan before writing code:

  • Map standard libraries: Identify equivalent libraries in target language (see references/stdlib_mappings.md)
  • Adapt idioms: Plan how to translate language-specific patterns (see references/language_mappings.md)
  • Handle type systems: Plan type annotations/declarations if moving between typed/untyped languages
  • Identify testing framework: Choose appropriate testing framework for target language (see references/testing_frameworks.md)
  • List transformations: Document major transformations needed (e.g., class → struct, decorator → annotation)

3. Translate Code

Implement the translation following target language conventions:

Core principles:

  • Preserve original behavior exactly
  • Follow target language idioms and conventions
  • Maintain code structure when possible (functions → functions, classes → classes)
  • Adapt patterns that don't translate directly (e.g., Python decorators → Java annotations)
  • Add appropriate error handling for target language
  • Include necessary imports and dependencies

Common transformations:

Python → JavaScript:

  • Classes: Keep class structure, adapt __init__ to constructor
  • List comprehensions: Convert to .map(), .filter(), .reduce()
  • Decorators: Convert to higher-order functions or use libraries
  • Type hints: Convert to TypeScript or JSDoc comments

Python → Java:

  • Functions: Convert to static methods or instance methods in classes
  • Dynamic typing: Add explicit type declarations
  • Duck typing: Use interfaces or abstract classes
  • List/dict operations: Use Collections framework

Python → Go:

  • Classes: Convert to structs with methods
  • Exceptions: Convert to error return values
  • Dynamic features: Use interfaces for polymorphism
  • List comprehensions: Use explicit loops

Java → C#:

  • Naming: Convert PascalCase for methods
  • Properties: Use C# property syntax instead of getters/setters
  • Collections: Map to .NET collections
  • Annotations: Convert to C# attributes

4. Generate Tests

Create comprehensive tests to verify translation correctness:

Test generation approach:

  1. Use appropriate test template from assets/ directory
  2. Port existing tests if available in source code
  3. Create new tests covering:
    • Basic functionality for each function/method
    • Edge cases (empty inputs, null values, boundary conditions)
    • Error handling and exceptions
    • Integration between components

Test equivalence:

  • Ensure tests verify the same behavior as original code
  • Use equivalent assertions (see references/testing_frameworks.md)
  • Maintain test structure and organization
  • Add setup/teardown as needed for target framework

5. Create Translation Summary

Document the translation with a summary including:

Mappings:

  • List of source → target function/class/module mappings
  • Standard library equivalences used
  • External dependencies and their target equivalents

Transformations:

  • Major structural changes (e.g., decorator → annotation)
  • Idiom adaptations (e.g., list comprehension → map/filter)
  • Type system changes (dynamic → static typing)

Verification notes:

  • Test coverage summary
  • Known limitations or differences
  • Manual verification steps if needed

Output Format

Provide the translation in this structure:

## Translated Code

[Target language code with appropriate file structure]

## Tests

[Test code using target language testing framework]

## Translation Summary

### Mappings
- SourceClass → TargetClass
- source_function() → targetFunction()
- source_module → target.package

### Standard Library Equivalences
- source.lib.function → target.lib.function

### Transformations
- [Description of major transformations]

### Verification
- [Test coverage and verification notes]

Language-Specific Considerations

Python → JavaScript/TypeScript

  • Convert snake_case to camelCase
  • Handle async/await (similar syntax)
  • Map list/dict operations to array/object methods
  • Consider using TypeScript for type safety

Python → Java

  • Add explicit type declarations throughout
  • Convert modules to packages with proper structure
  • Use appropriate Java collections (ArrayList, HashMap, etc.)
  • Handle checked exceptions

Python → Go

  • Convert classes to structs with receiver methods
  • Replace exceptions with error return values
  • Use goroutines for concurrency (if applicable)
  • Follow Go naming conventions (exported vs unexported)

Java → C#

  • Convert naming conventions (PascalCase methods)
  • Use C# properties instead of getters/setters
  • Map Java collections to .NET equivalents
  • Convert annotations to attributes

JavaScript → Python

  • Convert camelCase to snake_case
  • Handle promises/async with Python async/await
  • Map array methods to list comprehensions or loops
  • Add type hints if using modern Python

Resources

references/

  • language_mappings.md: Common idiom mappings between languages
  • stdlib_mappings.md: Standard library equivalences across languages
  • testing_frameworks.md: Testing framework mappings and patterns

assets/

Test templates for common target languages:

  • test_template_python.py: pytest template
  • test_template_javascript.js: Jest template
  • test_template_java.java: JUnit 5 template
  • test_template_go.go: Go testing template

Use these templates as starting points for generated tests.

Best Practices

  1. Preserve behavior first: Correctness is more important than idiomatic code
  2. Follow target conventions: Use target language's naming, structure, and patterns
  3. Test thoroughly: Generate comprehensive tests to verify equivalence
  4. Document differences: Note any behavioral differences or limitations
  5. Handle edge cases: Ensure edge cases are properly translated
  6. Consider performance: Be aware of performance implications of translations
  7. Use appropriate types: Leverage target language's type system effectively
  8. Maintain readability: Keep code readable and maintainable in target language

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Module Level Code Translator AI skill do?

Translate source code between programming languages at function, class, and module levels while preserving behavior and generating verification tests. Use when translating code from one language to another (e.g., "translate this Python module to JavaScript", "convert this Java class to C#", "port this code to Go and generate tests"), migrating codebases between languages, or creating equivalent implementations across different technology stacks. Handles idiom adaptation, standard library mappings, and test generation.

Why use Module Level Code Translator on TypingMind?

Because you install it once and use it with any model. Module Level Code Translator is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Module Level Code Translator in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/module-level-code-translator. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Module Level Code Translator?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Module Level Code Translator?

As many as you like. As long as a model supports skills, you can use Module Level Code Translator with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Module Level Code Translator AI skill free?

Yes. It is published on GitHub by ArabelaTso under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇