universal-code-converter

Design, review, or implement source-to-source code translation pipelines that convert or port code between programming languages. Use when building or evaluating a transpiler, code-porting or migration scaffold, tree-sitter-based parser pipeline, intermediate representation (IR), lowering rules, semantic-gap handling, or validation strategy for multi-language code conversion.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "universal-code-converter" with this command: npx skills add syuaibsyuaib/universal-code-converter

Universal Code Converter

Build or refine the converter as a staged translation pipeline. Optimize for semantic fidelity, diagnostics, and incremental delivery instead of "convert everything" claims.

Run This Workflow

  1. Clarify the scope.

    • Capture the source language, target language, runtime constraints, supported constructs, and quality bar.
    • Ask for or extract at least 3 representative snippets before designing the pipeline.
    • Define what "done" means: compilable output, behavior-preserving output, migration scaffold, or partial assisted conversion.
  2. Verify the parser frontend.

    • Confirm the required Tree-sitter grammars exist and are actively usable.
    • Prefer official prebuilt bindings or grammar packages for the first frontend probe. Compile grammars manually only when official artifacts are missing or the task needs grammar changes.
    • Inspect actual node types and field names before hardcoding visitors.
    • Capture one reusable parser-probe artifact from real fixtures: root node type, critical field names, and one query/capture example. Keep it in tests or fixtures so later work does not repeat manual spelunking.
    • If Tree-sitter is part of the plan, run one incremental reparse check with old_tree to prove the grammar is usable as an editing frontend. Treat this as a capability check, not a brittle microbenchmark.
    • Treat Tree-sitter as a concrete syntax tree frontend with incremental parsing, not as a full semantic compiler.
  3. Separate the pipeline into explicit passes.

    • Use this default flow:
parse -> normalize -> semantic enrichment -> IR -> lowering -> emit -> validate
  • Keep normalization separate from semantic analysis.
  • Keep shared IR logic separate from pair-specific lowering rules.
  • Keep code formatting separate from translation logic.
  1. Design the IR around semantics, not surface syntax.

    • Model declarations, scopes, bindings, literals, calls, control flow, imports, types, and diagnostics.
    • Represent lossy or unsupported constructs explicitly with diagnostic nodes or status flags.
    • Remove syntax sugar early when it simplifies downstream lowering.
  2. Implement a narrow vertical slice first.

    • Start with one source-target pair.
    • Start with modules, functions, parameters, literals, identifiers, returns, calls, and simple conditionals.
    • Add tests for each slice before adding more syntax.
  3. Handle semantic gaps intentionally.

    • Classify every feature as one of: direct mapping, desugaring, runtime helper, manual rewrite required, or unsupported.
    • Emit warnings for behavior changes or lossy rewrites.
    • Never silently drop exceptions, mutability rules, async semantics, or type expectations.
  4. Generate target code from a structured model.

    • Prefer a typed target-language model or emitter API over raw string replacement.
    • Centralize naming, escaping, and indentation in the emitter layer.
    • Preserve comments or source maps only when the task explicitly requires them.
  5. Validate the output at multiple levels.

    • Validate frontend assumptions separately from lowering assumptions.
    • Reparse representative source fixtures and assert the parser-probe contract stays stable.
    • Reparse the generated code.
    • Compile or type-check the generated code when tooling is available.
    • Run fixture-based execution tests for behavior-preserving conversions.
    • Include at least one explicit failure-path fixture that must emit diagnostics.
    • Snapshot IR and emitted output for regression coverage.
  6. Deliver a bounded result.

    • Return the supported feature matrix, known gaps, assumptions, warnings, and next steps.
    • Say clearly when the result is a scaffold, partial converter, or production-ready slice.

Produce These Deliverables

  • For architecture requests, return: scope, pipeline, IR outline, feature mapping taxonomy, validation plan, and risk list.
  • For implementation requests, code the smallest working slice first, add executable tests with it, and record the exact frontend dependency/version used for the parser probe.
  • For review requests, prioritize semantic drift, unsupported constructs, parser-shape assumptions, and missing validation.

Read Additional References Only When Needed

  • Read references/architecture-blueprint.md for module layout, feature mapping taxonomy, and IR design prompts.
  • Read references/validation-checklist.md for test strategy, regression gates, and release criteria.

Apply These Guardrails

  • Do not call the converter "universal" unless a supported-language and supported-feature matrix exists.
  • Do not equate CST shape with program meaning.
  • Do not put all translation rules in one transformer file.
  • Do not promise idiomatic target code before correctness and diagnostics exist.
  • Do not add a new language pair without representative fixtures and validation.

Start With This Repo Shape

src/
  frontends/
  normalization/
  semantic/
  ir/
  lowering/
  emitters/
  diagnostics/
tests/
  fixtures/
  golden/

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Gitai - Git Commit Automation

Boost developer productivity with Gitai: An AI-powered Git automation tool that analyzes code changes and generates semantic Conventional Commits instantly. Supports Node.js, Python, Java, Go, PHP, and more. Compatible with OpenAI, Anthropic, and Groq.

Registry SourceRecently Updated
3.2K1Profile unavailable
Coding

ClawHub - YouTube Downloader & Clipper

Clip and download specific time ranges or full YouTube videos in various qualities, including audio-only MP3 extraction, using precise timestamps.

Registry SourceRecently Updated
2.3K0Profile unavailable
Coding

Cobra Claw - Strike First. Strike Hard

Your AI's dojo discipline — Kreese style. Strike First. Strike Hard. No Mercy. Read the markdown files and apply the doctrine. The model develops its own agg...

Registry SourceRecently Updated
1.7K0Profile unavailable
Coding

CodeConductor.ai

AI-powered platform for rapid full-stack app development, autonomous agents, workflow automation, and scalable product creation with low-code and AI integrat...

Registry SourceRecently Updated
3.3K0Profile unavailable