Translation
doxygen/doxygen
Keeps all Doxygen and Doxywizard translations up to date across three mechanisms: translator C++ classes (src/translatorxx.h), Qt .ts locale files for the Doxywizard GUI (addon/doxywizard/i18n/)…
Translate C or C++ programs into equivalent Lean4 code, preserving program semantics and ensuring the generated code is well-typed, executable, and can run successfully.
$ npx skills add ArabelaTso/Skills-4-SE --skill c-cpp-to-lean4-translator -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ArabelaTso/Skills-4-SE c-cpp-to-lean4-translator --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/c-cpp-to-lean4-translator .claude/skills/c-cpp-to-lean4-translator && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "c-cpp-to-lean4-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/c-cpp-to-lean4-translator into .claude/skills/c-cpp-to-lean4-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c-cpp-to-lean4-translator", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/c-cpp-to-lean4-translatorType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ArabelaTso/Skills-4-SE --skill c-cpp-to-lean4-translator -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ArabelaTso/Skills-4-SE c-cpp-to-lean4-translator --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/c-cpp-to-lean4-translator .agents/skills/c-cpp-to-lean4-translator && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "c-cpp-to-lean4-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/c-cpp-to-lean4-translator into .agents/skills/c-cpp-to-lean4-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c-cpp-to-lean4-translator", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill c-cpp-to-lean4-translator -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ArabelaTso/Skills-4-SE c-cpp-to-lean4-translator --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/c-cpp-to-lean4-translator .cursor/skills/c-cpp-to-lean4-translator && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "c-cpp-to-lean4-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/c-cpp-to-lean4-translator into .cursor/skills/c-cpp-to-lean4-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c-cpp-to-lean4-translator", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ArabelaTso/Skills-4-SE.git --path skills/c-cpp-to-lean4-translator--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ArabelaTso/Skills-4-SE --skill c-cpp-to-lean4-translator -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ArabelaTso/Skills-4-SE c-cpp-to-lean4-translator --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/c-cpp-to-lean4-translator .gemini/skills/c-cpp-to-lean4-translator && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "c-cpp-to-lean4-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/c-cpp-to-lean4-translator into .gemini/skills/c-cpp-to-lean4-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c-cpp-to-lean4-translator", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ArabelaTso/Skills-4-SE c-cpp-to-lean4-translatorInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ArabelaTso/Skills-4-SE --skill c-cpp-to-lean4-translator -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/c-cpp-to-lean4-translator .github/skills/c-cpp-to-lean4-translator && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "c-cpp-to-lean4-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/c-cpp-to-lean4-translator into .github/skills/c-cpp-to-lean4-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c-cpp-to-lean4-translator", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill c-cpp-to-lean4-translator -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ArabelaTso/Skills-4-SE c-cpp-to-lean4-translator --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/c-cpp-to-lean4-translator .opencode/skills/c-cpp-to-lean4-translator && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "c-cpp-to-lean4-translator" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/c-cpp-to-lean4-translator into .opencode/skills/c-cpp-to-lean4-translator/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "c-cpp-to-lean4-translator", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
c-cpp-to-lean4-translatorTranslate C or C++ programs into equivalent Lean4 code, preserving program semantics and ensuring the generated code is well-typed, executable, and can run successfully.
C Cpp To Lean4 Translator is an agent skill from ArabelaTso/Skills-4-SE. Translate C or C++ programs into equivalent Lean4 code, preserving program semantics and ensuring the generated code is well-typed, executable, and can run successfully. Use when the user asks to convert C/C++ code to Lean4, port C/C++ programs to Lean4, translate imperative code to functional Lean4, or create Lean4 versions of C/C++ algorithms.
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/translation_patterns.md`).
It sits in Writing & Content, covering Translation. It works with C++. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are lean, c, bash and cpp).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
lean-lang.orggithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
C Cpp To Lean4 Translator loads about 2.5k tokens when it runs, and up to ~4.4k if it reads all its reference files. Until then it costs about 93 tokens; SKILL.md has 747 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 747 words, ~2,478 tokens.
.claude/skills/c-cpp-to-lean4-translator/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Transform C or C++ programs into equivalent Lean4 code that preserves the original semantics while leveraging Lean4's functional programming paradigm, strong type system, and proof capabilities.
Understand the C/C++ program structure and semantics:
Identify program components:
Understand semantics:
Note translation challenges:
Plan the Lean4 equivalent before writing code:
Choose appropriate types:
Int for signed integersNat for unsigned integers and array indicesFloat for floating-point numbersArray for dynamic arraysList for linked listsstructure types for structs/classesDetermine purity:
IO monadIO.Ref or ST monadPlan control flow translation:
Handle memory:
Follow these translation principles:
Pattern: Pure function
// C/C++
int add(int a, int b) {
return a + b;
}-- Lean4
def add (a b : Int) : Int :=
a + bPattern: Function with side effects
// C/C++
void printSum(int a, int b) {
printf("%d\n", a + b);
}-- Lean4
def printSum (a b : Int) : IO Unit :=
IO.println (a + b)Pattern: If-else
// C/C++
int max(int a, int b) {
if (a > b) return a;
else return b;
}-- Lean4
def max (a b : Int) : Int :=
if a > b then a else bPattern: For loop → Tail recursion
// C/C++
int sum(int n) {
int result = 0;
for (int i = 0; i < n; i++) {
result += i;
}
return result;
}-- Lean4
def sum (n : Nat) : Nat :=
let rec loop (i acc : Nat) : Nat :=
if i >= n then acc
else loop (i + 1) (acc + i)
loop 0 0Pattern: While loop → Recursion
// C/C++
int factorial(int n) {
int result = 1;
while (n > 1) {
result *= n;
n--;
}
return result;
}-- Lean4
def factorial (n : Nat) : Nat :=
let rec loop (n acc : Nat) : Nat :=
if n <= 1 then acc
else loop (n - 1) (acc * n)
loop n 1Pattern: Struct
// C/C++
struct Point {
int x;
int y;
};-- Lean4
structure Point where
x : Int
y : Int
deriving ReprPattern: Array
// C/C++
int arr[5] = {1, 2, 3, 4, 5};-- Lean4
def arr : Array Int := #[1, 2, 3, 4, 5]Key principle: Lean4 doesn't have raw pointers. Translate based on usage:
IO.Ref or return new values// C/C++ - Output parameter
void swap(int* a, int* b) {
int temp = *a;
*a = *b;
*b = temp;
}-- Lean4 - Return tuple
def swap (a b : Int) : Int × Int :=
(b, a)Lean4's type system is strict. Address common type issues:
Integer types:
Nat for non-negative values (array indices, counts)Int for potentially negative valuesn.toNat, n.toIntArray bounds:
arr.get?, arr[i]?arr[i]! with runtime checkDivision:
n / m (rounds down)Int.divType annotations:
: Type for clarityEnsure the translated code works correctly:
Compile check:
lake buildCreate test cases:
#eval add 2 3 -- Should output 5
#eval factorial 5 -- Should output 120Compare outputs:
Handle edge cases:
Improve the translated code:
Use Lean4 idioms:
List.foldl, Array.foldlAdd documentation:
/-- Calculate the sum of first n natural numbers -/
def sum (n : Nat) : Nat :=
n * (n + 1) / 2Consider performance:
Array over List for random access@[inline] for small functionsFor detailed patterns, see translation_patterns.md.
| C/C++ | Lean4 |
|---|---|
int x | def x : Int |
unsigned int x | def x : Nat |
float x | def x : Float |
bool x | def x : Bool |
char* str | def str : String |
int arr[] | def arr : Array Int |
struct S | structure S where |
for (...) | let rec loop ... |
while (...) | let rec loop ... |
if (...) {...} | if ... then ... else ... |
switch (...) | match ... with |
return x | x (last expression) |
void f() | def f : IO Unit |
printf(...) | IO.println ... |
C/C++ Input:
int gcd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}Lean4 Output:
def gcd (a b : Nat) : Nat :=
if b = 0 then a
else gcd b (a % b)C/C++ Input:
int findMax(int arr[], int size) {
int max = arr[0];
for (int i = 1; i < size; i++) {
if (arr[i] > max) {
max = arr[i];
}
}
return max;
}Lean4 Output:
def findMax (arr : Array Int) : Option Int :=
if arr.isEmpty then
none
else
some (arr.foldl max arr[0]!)C/C++ Input:
struct Rectangle {
int width;
int height;
int area() {
return width * height;
}
int perimeter() {
return 2 * (width + height);
}
};Lean4 Output:
structure Rectangle where
width : Nat
height : Nat
deriving Repr
def Rectangle.area (r : Rectangle) : Nat :=
r.width * r.height
def Rectangle.perimeter (r : Rectangle) : Nat :=
2 * (r.width + r.height)C/C++ Input:
#include <stdio.h>
int main() {
int n;
printf("Enter a number: ");
scanf("%d", &n);
printf("Factorial: %d\n", factorial(n));
return 0;
}Lean4 Output:
def factorial (n : Nat) : Nat :=
if n <= 1 then 1
else n * factorial (n - 1)
def main : IO Unit := do
IO.print "Enter a number: "
let input ← IO.getStdIn >>= (·.getLine)
match input.trim.toNat? with
| some n =>
IO.println s!"Factorial: {factorial n}"
| none =>
IO.println "Invalid input"Option or Except for error cases© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in skills/c-cpp-to-lean4-translator of ArabelaTso/Skills-4-SE.
Open the folder on GitHubat commit 4f38503
C Cpp To Lean4 Translator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| C Cpp To Lean4 Translator this skillArabelaTso/Skills-4-SE | 253 | — | ~2.5k | Automated safety check: Pass | Apache-2.0 | |
| Translationdoxygen/doxygen | 6.6k | — | ~5.2k | Automated safety check: Pass | GPL-2.0 | |
| Smooth Translationopenforecast-org/smooth | 107 | — | ~2.2k | Automated safety check: Pass | LGPL-2.1 | |
| Msvc Clmohitmishra786/low-level-dev-skills | 253 | — | ~1.3k | Automated safety check: Pass | MIT | |
| D2mcpp Authoringmcpp-community/d2mcpp | 1.8k | — | ~2.7k | Automated safety check: Pass | Custom licence | |
| Mcpp Docs Stylemcpp-community/mcpp | 156 | — | ~3.7k | Automated safety check: Pass | Apache-2.0 |
doxygen/doxygen
Keeps all Doxygen and Doxywizard translations up to date across three mechanisms: translator C++ classes (src/translatorxx.h), Qt .ts locale files for the Doxywizard GUI (addon/doxywizard/i18n/)…
openforecast-org/smooth
Port a feature from the R smooth package to the Python port, or check how an R name maps to Python.
mohitmishra786/low-level-dev-skills
MSVC cl.exe and clang-cl skill for Windows C/C++ projects. An agent skill from mohitmishra786/low-level-dev-skills.
mcpp-community/d2mcpp
Authoring conventions, design principles, and file formats for the d2mcpp (D2X) Modern C++ tutorial project.
mcpp-community/mcpp
A skill your agent uses when writing or editing anything under docs/ (English or 简体中文), docs/specs/, README files, or the design records under .agents/docs/ — states which tree a document belongs…
Devolutions/UniGetUI
Compares UniGetUI JSON locale files against English, identifies untranslated or source-changed keys, and generates patch, reference, and handoff files for a target language.
ArabelaTso/Skills-4-SE
Generate prioritized CVE watchlists and actionable security recommendations for repositories.
ArabelaTso/Skills-4-SE
Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).
ArabelaTso/Skills-4-SE
Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.
ArabelaTso/Skills-4-SE
Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.
ArabelaTso/Skills-4-SE
Automatically migrate Spring MVC applications to Spring Boot.
ArabelaTso/Skills-4-SE
Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.
Works with
Categories
Translate C or C++ programs into equivalent Lean4 code, preserving program semantics and ensuring the generated code is well-typed, executable, and can run successfully. C Cpp To Lean4 Translator is an agent skill from ArabelaTso/Skills-4-SE. Translate C or C++ programs into equivalent Lean4 code, preserving program semantics and ensuring the generated code is well-typed, executable, and can run successfully.
C Cpp To Lean4 Translator fits situations like: the user asks to convert C/C++ code to Lean4; port C/C++ programs to Lean4; translate imperative code to functional Lean4; create Lean4 versions of C/C++ algorithms.
Run `npx skills add ArabelaTso/Skills-4-SE --skill c-cpp-to-lean4-translator -a claude-code`. Or copy the skill folder (skills/c-cpp-to-lean4-translator in ArabelaTso/Skills-4-SE) into .claude/skills/c-cpp-to-lean4-translator in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ArabelaTso/Skills-4-SE --skill c-cpp-to-lean4-translator -a codex`. Or copy the skill folder (skills/c-cpp-to-lean4-translator in ArabelaTso/Skills-4-SE) into .agents/skills/c-cpp-to-lean4-translator in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill c-cpp-to-lean4-translator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/c-cpp-to-lean4-translator, .gemini/skills/c-cpp-to-lean4-translator, .github/skills/c-cpp-to-lean4-translator and .opencode/skills/c-cpp-to-lean4-translator in your project.
SKILL.md names no scripts, command-line tools or credentials: C Cpp To Lean4 Translator is instructions for the agent only.
SKILL.md names 2 domains. As links in the text: lean-lang.org and github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
C Cpp To Lean4 Translator is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with C Cpp To Lean4 Translator: Translation (doxygen/doxygen, 6.6k stars), Smooth Translation (openforecast-org/smooth, 107 stars), Msvc Cl (mohitmishra786/low-level-dev-skills, 253 stars) and D2mcpp Authoring (mcpp-community/d2mcpp, 1.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on August 21, 2026.
Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.