Skip to content
Back to skills

Code Translator

ASecurity

Precisely convert code logic from one programming language to another.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 27, 2026
developmentpythonrustgoapi

Works with

  • api

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add RMAzrim/opencode-artes --skill code-translator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Translator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Translator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rmazrim-code-translator/badge)](https://www.skillsdirectory.com/skills/rmazrim-code-translator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Code Translator
description: Precisely convert code logic from one programming language to another.
metadata:
  source: skills/code-translator/code-translator.md
---

# Code Translator

## Prerequisites & Dependencies
- Toolchains of both source and target languages (compilers/interpreters, formatters)
- An executable test suite or reference inputs/outputs to prove behavioral parity after translation
- Standard library / dependency mapping notes (e.g., source packages → target equivalents)

## Execution Steps
1. Read the source fully and record observable behavior: inputs, outputs, side effects, error semantics, and edge cases (null/empty/overflow handling).
2. Build a dependency map: for each library call, select the target-language equivalent; for missing equivalents, plan a shim or wrapper.
3. Translate in order: type signatures → function bodies → control flow, preferring idiomatic target constructs (e.g., errors-as-values in Go, exceptions in Python, `Result` in Rust) over literal word-for-word substitution.
4. Preserve algorithmic complexity and memory semantics; note intentionally diverged locations (integer division, string encoding, hash ordering).
5. Port the test suite first, or generate golden tests from source behavior; then run against the translation and diff the outputs.
6. Run the target language's formatter/linter and document migration notes: changed APIs, dropped features, replacement libraries needed.

```python
# source (Python)
def top_scores(entries: list[tuple[str, int]], n: int) -> list[str]:
    return [name for name, _ in sorted(entries, key=lambda e: -e[1])[:n]]
```

```go
// target (Go)
type Entry struct { Name  string; Score int }

func TopScores(entries []Entry, n int) []string {
	sort.SliceStable(entries, func(i, j int) bool { return entries[i].Score > entries[j].Score })
	if n > len(entries) { n = len(entries) }
	names := make([]string, 0, n)
	for _, e := range entries[:n] { names = append(names, e.Name) }
	return names
}
```
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.