rustport
/rustport
Port games, apps and CLIs to Rust, or build a compatible Rust runtime for an existing program's content, backed by evidence from the original (ledger, golden tests, screenshots) and a GitHub Pages site. Use for Rust ports, reverse engineering of shipped binaries/apps into Rust, engine reimplementations, continuing an existing port. Also triggers on "портировать на Rust", "реверс-инжиниринг", "переписать на Rust". Not for new Rust apps with no original to match.
- Author
- LakoMoor ↗
- Repository
- portcode ↗
- Licence
- MIT
- Last repository change
- 09.11.2026
Assessment and security
- Files in this package
- 59
- Scripts
- 22
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 09.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 22 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: assets/wgpu_template/src/main.rs, examples/binary-name-slice/port/src/lib.rs, examples/binary-name-slice/port/src/main.rs, examples/binary-name-slice/port/tests/static_inference.rs, examples/codex-cli-port/port/src/main.rs, examples/codex-cli-port/tests/check.py, install.py, install.sh
What it does and when to use it
Port games, apps and CLIs to Rust, or build a compatible Rust runtime for an existing program's content, backed by evidence from the original (ledger, golden tests, screenshots) and a GitHub Pages site. Use for Rust ports, reverse engineering of shipped binaries/apps into Rust, engine reimplementations, continuing an existing port. Also triggers on "портировать на Rust", "реверс-инжиниринг", "переписать на Rust". Not for new Rust apps with no original to match.
Triggers from the description
Original author description
Port games, apps and CLIs to Rust, or build a compatible Rust runtime for an existing program's content, backed by evidence from the original (ledger, golden tests, screenshots) and a GitHub Pages site. Use for Rust ports, reverse engineering of shipped binaries/apps into Rust, engine reimplementations, continuing an existing port. Also triggers on "портировать на Rust", "реверс-инжиниринг", "переписать на Rust". Not for new Rust apps with no original to match.
How it works
- Hard rules (read twice)
- Phases — do not start phase N+1 until phase N's "Done when" is true
- Failure handling
- Working style (important for small and open-weight models)
- References (load only when the phase needs them)
- Final report
SKILL.md preview
--- name: rustport license: Apache-2.0 description: Port games, apps and CLIs to Rust, or build a compatible Rust runtime for an existing program's content, backed by evidence from the original (ledger, golden tests, screenshots) and a GitHub Pages site. Use for Rust ports, reverse engineering of shipped binaries/apps into Rust, engine reimplementations, continuing an existing port. Also triggers on "портировать на Rust", "реверс-инжиниринг", "переписать на Rust". Not for new Rust apps with no original to match. --- # rustport — port to Rust, prove it with evidence You are a **porting engineer**. Deliver a Rust program that behaves like the original, **measured against recordings of the original**, with a docs site and screenshots for every ported feature. Reply in the user's language; keep code, paths and identifiers in English. ## Hard rules (read twice) 1. **The original is the spec.** If your reading of code and the original's behaviour disagree, run the original. 2. **Every claim has an evidence id.** Record facts with `evidence_add` as `observation` (you saw it), `inference` (you derived it) or `unknown` (a gap). Decompiler output and static reading are `inference`, never `observation`. 3. **Oracle before code.** Capture golden outputs from the original *before* writing Rust. 4. **One slice at a time, always green.** After each slice: `cargo check`, then its golden test. Do not start a new slice while the last one is red. 5. **Never say "identical" without a `parity` PASS.** Say exactly what was measured. 6. **Safe Rust, no panics on input.** No `unsafe`, no `unwrap()`/`expect()`/indexing on input-derived values in non-test code. See [architecture](references/architecture.md). 7. **Stay in scope.** Only inspect what the user owns or is authorised to study. If unclear, ask once and stop. See [clean-room](references/clean-room.md). 8. **Finish 1:1.** One todo per behaviour of the original (each option, output, exit code, error). Do not stop or ask "continue?" until every todo is done and `parity` PASSES on the final code. Stop early only for a decision the user alone can make (PortCode: `blocked`). ## Phases — do not start phase N+1 until phase N's "Done when" is true Tools below are PortCode tool names. In other agents use the scripts in `scripts/` and `references/workbench.md`. **0 Intake** — ask ≤4 bundled questions only for real forks: fidelity (bit-exact / tolerance / feature parity), platforms, scope cuts, licence. Mode: *clean-room* (observe only; default) or *deep* (look inside). Record assumptions if non-interactive. Done when: mode, fidelity, targets and licence status are written in `docs/PORT.md`. **1 Pin + survey** — `pin` the exact original (hash, version). `survey` the tree. Source available → build and run it. Only a binary/app → [rea](references/rea.md) and [reverse-methods](references/reverse-methods.md); run it isolated and bounded. Done when: pin is recorded (E-id), survey read, entry point and main loop traced, and an `unknown` is recorded for every gap. **2 Plan** — `scaffold` (skip if a workspace exists), then fill `docs/PORT.md`: module map (leaves first: math, parsers, rules → main loop → rendering last), dependency map ([mappings](assets/mappings.md)), hard problems, milestones. Per module: **rewrite** (default) · **bind** (wrap a stable C lib) · **drop** (log why). Done when: each module has a strategy and an owner slice, ≤200 LOC per slice. **3 Golden harness (M0)** — deterministic scenarios on the *original*: fixed seed, fixed timestep, no wall clock, scripted input. Save to `tests/golden/<case>/`. Use `screenshot` for CLI output; for GUI apps save a PNG to `docs/screenshots/` and attach it with `evidence_add`. Done when: ≥3 golden cases exist, each with an evidence id; what is *not* covered is listed. **4 Port core (M1)** — per slice: read the source module fully → note implicit behaviour (int widths, overflow, float order, iteration order, sort stability, RNG stream) → write Rust (keep recognisable names, `// src: path:line` on non-obvious logic) → unit test from goldens → `cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test` → `parity`. Diverged? **Bisect to the first differing field, fix the cause. Do not widen tolerance to pass.** Done when: headless goldens PASS and the slice is ticked in `docs/PORT.md`. **5 Platform / rendering (M2–M3, GUI only)** — window/input/audio behind thin traits; wgpu from `assets/wgpu_template`; zero validation errors; offscreen render + PNG compare. wgpu is not a reflex: CLI/server/logic-only → no GPU dependency. Done when: rendered frames match golden screenshots within the stated tolerance. **6 Prove it (M4)** — run the port yourself and look. Build `--release`, compare speed with the original. Run `screenshot` for **every ported feature** (original side and port side) so each feature has an attached image. Then `site_build` and open `docs/site/index.html`. See [site-and-screenshots](references/site-and-screenshots.md). Done when: every feature in `docs/PORT.md` links an evidence id with a screenshot, `parity` PASS, site builds. ## Failure handling - Same failure 3 times → stop, write what you know to `docs/PORT.md`, change approach or ask. No mass rewrites. - Borrow-checker fight → ids/arenas/split borrows/`std::mem::take`; not `Rc<RefCell>` everywhere, never `unsafe`. - Visual mismatch → check in order: sRGB/gamma, Y flip, NDC depth range, winding, blend/premultiplied alpha, uniform padding, filtering/wrap, mips. - Build error in a third-party crate → read its changelog at the pinned version; look APIs up (`cargo doc`, `~/.cargo/registry/src/*`), do not recall them. - Tool says "not read first" / "changed on disk" → `read` the file again, then edit. ## Working style (important for small and open-weight models) - One tool call per step unless reads are independent. Do not describe a tool call in text — make it. - Read errors fully; fix the first error first. Edit with `edit`, not by rewriting whole files. - Keep tool outputs small: use `offset/limit`, `grep`, `head`/`tail`. Prefer names over long paths in prose. - End every turn with: **done / next step / blocked-on**. More: [local-llm](references/local-llm.md). ## References (load only when the phase needs them) [evidence](references/evidence.md) · [clean-room](references/clean-room.md) · [deep-engines](references/deep-engines.md) · [architecture](references/architecture.md) · [site-and-screenshots](references/site-and-screenshots.md) · [pitfalls](references/pitfalls.md) · [local-llm](references/local-llm.md) · [workbench](references/workbench.md) · [compatible-runtime](references/compatible-runtime.md) · [native-lab](references/native-lab.md) · [agent-roles](references/agent-roles.md) · [scenarios](references/scenarios.md) · [agents](references/agents.md) ## Final report Modules done/total · golden cases passing/total · deviations with cause · what is *not* covered · perf vs original · how to build/run · site path. Real output, including failures. Never claim more than the evidence covers.
Files in this package (59)
- LICENSE 11 KB
- NOTICE 1 KB
- README.md 1 KB
- SKILL.md 7 KB
- install.py 6 KB
- install.sh 1 KB
- assets/PORT_TEMPLATE.md 1 KB
- assets/mappings.md 6 KB
- assets/wgpu_template/Cargo.toml 1 KB
- assets/wgpu_template/src/main.rs 6 KB
- assets/wgpu_template/src/shader.wgsl 1 KB
- examples/binary-name-slice/.gitignore 1 KB
- examples/binary-name-slice/README.md 2 KB
- examples/binary-name-slice/proposed-changes.md 2 KB
- examples/binary-name-slice/evidence/ORIGINAL-LICENSE 1 KB
- examples/binary-name-slice/evidence/safe-name-assembly.txt 11 KB
- examples/binary-name-slice/port/Cargo.toml 1 KB
- examples/binary-name-slice/port/README.md 1 KB
- examples/binary-name-slice/port/src/lib.rs 1 KB
- examples/binary-name-slice/port/src/main.rs 1 KB
- examples/binary-name-slice/port/tests/static_inference.rs 1 KB
- examples/codex-cli-port/.gitignore 1 KB
- examples/codex-cli-port/PORT.md 3 KB
- examples/codex-cli-port/original/main.c 1 KB
- examples/codex-cli-port/port/Cargo.toml 1 KB
- examples/codex-cli-port/port/src/main.rs 5 KB
- examples/codex-cli-port/tests/check.py 4 KB
- examples/codex-cli-port/tests/golden/original.json 5 KB
- references/agent-roles.md 2 KB
- references/agents.md 4 KB
- references/architecture.md 2 KB
- references/clean-room.md 2 KB
- references/compatible-runtime.md 7 KB
- references/deep-engines.md 2 KB
- references/evidence.md 2 KB
- references/local-llm.md 3 KB
- references/native-lab.md 10 KB
- references/pitfalls.md 2 KB
- references/rea.md 6 KB
- references/reverse-methods.md 3 KB
- references/scenarios.md 1 KB
- references/site-and-screenshots.md 1 KB
- references/workbench.md 5 KB
- scripts/differential_fuzz.py 7 KB
- scripts/native_lab.py 21 KB
- scripts/oracle_runner.py 6 KB
- scripts/parity.sh 3 KB
- scripts/renderdiff.py 3 KB
- scripts/scaffold.sh 2 KB
- scripts/survey.sh 3 KB
- scripts/workbench.py 26 KB
- scripts/ghidra/RustportExport.java 6 KB
- tests/test_differential_fuzz.py 3 KB
- tests/test_install.py 7 KB
- tests/test_native_lab.py 7 KB
- tests/test_oracle_runner.py 2 KB
- tests/test_workbench.py 6 KB
- tests/results/codex-engine-binary.md 3 KB
- tests/results/codex-smoke.md 2 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · LakoMoor/portcode | 100 | MIT |
| LakoMoor/rustport-skill | 95 | Apache-2.0 |
Database snapshot: 13.11.2026 · package version eb014492a22d (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 96rust-port
Use when porting code to Rust from another language, or rewriting a module in Rust. - 90write-rust-tests
Write Rust tests to verify correctness of Rust code. Use this when you want to write Rust tests. - 100rust-port
Port code from C, C++, Python, Go, JavaScript, or TypeScript into idiomatic Rust that keeps the original behavior: ownership instead of manual memory, Result instead of error codes and exceptions, enums instead of flag ints and magic strings, and tests that prove the port… - 100run-rust-tests
Run Rust tests after making changes to verify correctness. Use this when you want to verify your changes to Rust code. - 90rust-applications
Index for building Rust applications (binaries, CLIs, TUIs, desktop apps). Use when starting or reshaping a Rust app and you need to pick the right focused skill for architecture, async, config/CLI, observability, persistence, testing, UI, or release builds. Library publishing,… - 95rust-testing
Design Rust tests that catch real regressions — unit, integration, doc, property, snapshot, and golden tests, and differential tests that prove a port matches its source. Use when writing or reviewing Rust tests, when a change lands without tests, when deciding what form a test…