rust-port
Skill3 starsChanged 13 days agoMITView on GitHub
Port existing C, C++, Python, Go, JavaScript, or TypeScript code to Rust while preserving its agreed observable behaviour. Use for requested Rust migrations or rewrites, not conceptual language comparisons or unrelated Rust edits.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- XGENT-ai/skillstheir own version, first seen Nov 8, 2026
- po4yka/rust-skillstheir own version, first seen Nov 8, 2026
- promptctl/cc-candybartheir own version, first seen Nov 8, 2026
- weedmo/skillstheir own version, first seen Nov 8, 2026
- fedemelo/agent-configtheir own version, first seen Nov 1, 2026
- tuan3w/herdr-mobiletheir own version, first seen Nov 1, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- morganlinton/BeautifulRust★ 1.8ksame name
- tuan3w/herdr-mobile★ 29same name
- po4yka/rust-skills★ 5same name
- fedemelo/agent-config★ 4same name
- weedmo/skills★ 1same name
- XGENT-ai/skills★ 1same name
- promptctl/cc-candybar★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- lazarus-modeSkill
- php-best-practicesSkill
- pr-splitterSkill
- rust-best-practicesSkill
- rust-reviewSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Read the source, callers, tests, build configuration, and relevant data formats before editing.
- Distinctive: line 14
Run the original tests when practical and record the source revision and environment.
- Distinctive: line 24
Before translating a language's representations, read only its relevant guide:
- Distinctive: line 30
Keep ordinary ports safe. Where an ABI or demonstrated requirement needs unsafe code, isolate it behind a sound boundary and document the …
- Distinctive: line 42
When the original is executable, compare it with the port on representative and boundary inputs, covering returned values, error …
- Very specific: line 44
Write concise PORTING.md notes, or use the repository's established migration document, with:
- Distinctive: line 50
Check these notes against the final code before returning.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust port
Port the behaviour into idiomatic Rust. Keep the work within the requested module, interfaces, and deployment constraints. This skill is independently usable; an installed Rust writing skill may supplement it but is not required.
Establish compatibility
Read the source, callers, tests, build configuration, and relevant data formats before editing. Identify the public operations, input domain, output bytes and ordering, error/absence semantics, numeric ranges, encoding, resource ownership, concurrency, and external interfaces that callers observe. Distinguish requirements from incidental implementation structure.
Run the original tests when practical and record the source revision and environment. If tests are missing, establish characterisation cases before replacing the implementation. Existing tests are evidence, not a complete definition of the supported contract.
Preserve specified behaviour and understood quirks unless the user authorises a change. Do not silently narrow accepted Unicode, whitespace, numeric ranges, missing values, or input sizes because Rust's defaults differ. Record a proposed difference and obtain agreement before relying on it; writing it in porting notes does not authorise it. If the contract is ambiguous, ask about the material ambiguity while progressing on independent parts. Do not reproduce source undefined behaviour or introduce Rust unsoundness to imitate it; identify the gap and establish defined behaviour.
Translate evidence before implementation
Port the source tests first, keeping a traceable mapping to their Rust coverage. Test grouping can change if every original assertion and behaviour remains accounted for. Add boundary cases for semantic differences the translation could introduce, including empty/invalid inputs, ordering ties, overflow, and cleanup after partial failure.
Design Rust types and signatures from that contract, then implement against the tests. Prefer ownership and RAII, Option for absence, Result for expected failure, and enums for meaningful state distinctions. Preserve error data callers use; do not collapse distinct missing states or failure categories. Public errors in a std-based library implement Display and std::error::Error; explain the compatible alternative for other targets. Use borrowed slices or strings according to the actual data, not merely the source's spelling.
Before translating a language's representations, read only its relevant guide:
- C and C++: bytes, pointers, ABI, buffers, and lifetimes.
- Python: Unicode, integers, ordering, and exceptions.
- Go, JavaScript, and TypeScript: nil/missing states, numbers, iteration, and concurrency.
Keep ordinary ports safe. Where an ABI or demonstrated requirement needs unsafe code, isolate it behind a sound boundary and document the invariants. Do not retain raw pointers simply because the source used them.
Keep the design proportionate
Prefer standard Rust facilities when they satisfy the agreed contract. Use a small compatibility adapter where required, rather than recreating an entire source runtime. Avoid speculative builders, traits, public operations, and dependencies. Keep an existing algorithm unless a concrete requirement justifies a change, and verify any replacement preserves the agreed behaviour.
Investigate disproportionate growth as a design signal; do not enforce arbitrary source-to-Rust line-count ratios. Choose differential tests and fuzzing according to the input surface and risk. Do not dismiss discovered divergences as exotic without checking whether they are supported inputs.
Verify and hand over
Run the project's documented Rust formatting, lint, build, and test checks with the supported edition, MSRV, features, and targets. If none are documented, start with cargo fmt --check, cargo clippy --all-targets, and cargo test; run builds or integration checks for the affected deliverables. Fix failures introduced by the port and distinguish existing failures or unavailable checks. Do not claim a command ran or passed when it did not.
When the original is executable, compare it with the port on representative and boundary inputs, covering returned values, error categories, ordering, and relevant side effects. Passing examples do not prove equivalence over every input. Report any remaining compatibility gaps explicitly.
Write concise PORTING.md notes, or use the repository's established migration document, with:
- API and test mappings, including how each original behaviour is covered.
- Preserved quirks, approved differences, and unresolved compatibility gaps.
- Verification commands and their actual results, including unavailable checks.
Check these notes against the final code before returning. Keep speculative improvements separate from the compatibility claim.
Attribution
Adapted from Morgan Linton's BeautifulRust. See NOTICE.md for provenance and LICENSE for the retained MIT notice.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

