mintychochip

rosetta

Use when porting source code between Java and Go. Provides a local-first migration control plane that extracts source facts, records project-level decisions, creates dependency-aware work units, coordinates agents, and gates completion with saved eval evidence.

mintychochip 0 Updated 1d ago

Resources

17
GitHub

Install

npx skillscat add mintychochip/rosetta

Install via the SkillsCat registry.

SKILL.md

Rosetta

Use Rosetta to port a codebase systematically between Java and Go. This root skill is a router; use one of the smaller skills in skills/ for detailed work:

  • initialize-port: create queues, ingest source, build graphs, list references, and inspect initial status.
  • using-rosetta: orientation for choosing the right focused skill and understanding the end-to-end workflow.
  • port-subagent-coordination: multi-agent protocol for shared queues, workstreams, claims, releases, phase ownership, and phase advancement.
  • work-port-claim: worker loop for claimed entries: port, eval, fix failures, mark done, and document waivers.

Core Rule

A work unit is not complete just because target code exists. Run and save eval results before marking the unit done:

python <skill-dir>/scripts/main.py eval run .rosetta <work-id> --save
python <skill-dir>/scripts/main.py work done .rosetta <work-id>

Use work done --force "reason" only for an explicitly reviewed waiver. The reason must say why the failed gate is acceptable and what follow-up remains.

CLI Location

The installed skill contains:

  • <skill-dir>/scripts/main.py: canonical Python CLI implementation and compatibility dispatcher.
  • <skill-dir>/rosetta: legacy shell wrapper for Unix-like environments.
  • <skill-dir>/scripts/routers/: language ingestion routers.
  • <skill-dir>/references/: language-specific source and target references.
  • <skill-dir>/skills/: focused agent skills for initialization, subagent coordination, and claimed-entry work.

On Windows, run the Python entry point directly:

python <skill-dir>/scripts/main.py <command>

On Unix-like systems, use the wrapper:

<skill-dir>/rosetta <command>

Quick Workflow

Create and analyze a Rosetta project:

python <skill-dir>/scripts/main.py init \
  --from java \
  --to go \
  --root <source-dir> \
  --target <target-dir> \
  --out .rosetta
python <skill-dir>/scripts/main.py analyze .rosetta
python <skill-dir>/scripts/main.py decisions init .rosetta
python <skill-dir>/scripts/main.py analyzers run .rosetta --stage pre-port

Claim and complete work:

python <skill-dir>/scripts/main.py work ready .rosetta --json
python <skill-dir>/scripts/main.py work claim .rosetta --agent <agent-id> --limit <n>
# port the claimed work unit
python <skill-dir>/scripts/main.py eval run .rosetta <work-id> --save
python <skill-dir>/scripts/main.py work done .rosetta <work-id>

Advance phases after the current phase is complete:

python <skill-dir>/scripts/main.py phase advance .rosetta

Porting Phases

Each work unit moves through three dependency-ordered phases:

Phase Name Requirement
A Faithful Port Use the Phase A unit/result workflow when possible. Preserve contracts, signatures, public APIs, fields, methods, constructors, and behavior. Do not idiomatically rewrite.
B Language Idioms & Tests Rewrite Phase A output into target-language idioms and port source tests. Preserve behavior.
C Wiring & Integration Fix imports, packages, module links, and compilation issues.

For details, use work-port-claim.

Analyzer Model

Rosetta analyzers are deterministic scanners that add facts, markers, decisions, and adapter work units. They do not perform the cross-language rewrite. Agents use analyzer output as context and still perform the semantic migration.

Per-Entry Playbook

When work claim returns a unit:

  1. Check the queue's current phase.
  2. Confirm dependencies are done or skipped in the current phase.
  3. Load only relevant language references with rosetta refs.
  4. Read the source file and existing target file if present.
  5. Port according to the current phase and required decisions.
  6. Run eval run .rosetta <work-id> --save.
  7. Run work done .rosetta <work-id> only after the saved gates pass.

If dependencies are blocked, stop that entry and claim unrelated ready work if available.

If .rosetta/decisions.json has pending choices for framework migrations, adapters, target libraries, or unknown dependencies, ask the human to resolve them before Phase B/C work that depends on those choices.

Reference Loading

Discover language references before porting:

rosetta refs --from java --to go
rosetta refs --from java --to go --topics core,types,errors

Load only the references relevant to the current file. For Java to Go, common starting topics are:

  • Source: references/java/core.md, references/java/types.md, references/java/oop.md.
  • Target: references/go/core.md, references/go/types.md, references/go/interfaces.md, references/go/errors.md.

Guardrails

  • Always use CLI commands to mutate .rosetta artifacts; do not edit them by hand during coordinated work.
  • Keep one shared .rosetta directory for coordinated work.
  • Use work claim for subagents; do not manually divide work units.
  • Treat regex router output as approximate and manually inspect edge cases.
  • Run eval report .rosetta after saving eval results to surface blockers, waivers, parser-trust warnings, and entries without eval data.