rewrite-in-rust

rewrite-in-rust is a skill for Claude Code, Codex from Firstp1ck/pi-coding-agent-forge. It costs 152 tokens per session (10,687 once invoked), scanned A, original, MIT.

A guided workflow for moving existing software, such as a library or application, to Rust, a programming language. It can assess whether the move is practical, plan it, carry it out within scope, and check the result.

In plain words
What is it for?
Use it to assess, plan, perform, or resume a migration from another language to Rust. It helps preserve documented contracts and observable behavior while verifying the migrated code.
Why use it?
It reduces the risk of losing existing behavior or making an impractical full rewrite. It also supports replacing parts gradually while the rest of the software continues to work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to assess, plan, perform, or resume a migration from another language to Rust. It helps preserve documented contracts and observable behavior while verifying the migrated code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/firstp1ck/pi-coding-agent-forge/rewrite-in-rust
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Firstp1ck/pi-coding-agent-forge --skill rewrite-in-rust
Clone the repo
git clone --depth 1 https://github.com/Firstp1ck/pi-coding-agent-forge

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rewrite-in-rust

README.md
[![agentmods](https://agentmods.dev/badge/skills/firstp1ck/pi-coding-agent-forge/rewrite-in-rust/github.svg)](https://agentmods.dev/skills/firstp1ck/pi-coding-agent-forge/rewrite-in-rust)
Your own site
<a href="https://agentmods.dev/skills/firstp1ck/pi-coding-agent-forge/rewrite-in-rust"><img src="https://agentmods.dev/badge/skills/firstp1ck/pi-coding-agent-forge/rewrite-in-rust/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rewrite-in-rust

Your own site · 80×15
<a href="https://agentmods.dev/skills/firstp1ck/pi-coding-agent-forge/rewrite-in-rust"><img src="https://agentmods.dev/badge/skills/firstp1ck/pi-coding-agent-forge/rewrite-in-rust.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,687 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00152 $0.10687
Opus 5.5 $0.00061 $0.04275
Sonnet 5.5 $0.00030 $0.02137
Haiku 4.5 $0.00015 $0.01069

Measured today against content hash 66c2b05ea99c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rewrite-in-rust scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

pi-skill-rust-rewrite/skills/rewrite-in-rust/SKILL.md · 532 lines

How it starts

The opening of the file, as written. The whole thing — 532 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rewrite in Rust

Carry the requested migration through to verified results within the authorized scope. Treat the original implementation, documented contracts, and observable behavior as evidence. Do not promise that every codebase has a practical complete Rust replacement.

When to use

Use this skill for requests to rewrite, port, migrate, or oxidize an existing codebase, library, module, application, or subsystem in Rust, including RIIR requests; for feasibility assessments of such a port; for incremental replacement of one component while the rest keeps working; and for resuming a migration that already has records under migration/. Do not use it for new Rust code with no original to preserve, for Rust-to-Rust refactors, or for adding a single Rust dependency to a project.

Operating rules

  • Follow the user's scope and repository instructions. An assessment request authorizes assessment; an implementation request authorizes the necessary scoped work. Do not turn internal phase gates into repeated permission questions. Ask only when missing information changes correctness or scope, or an action needs authorization that has not been given.
  • A fixed set of decisions belongs to the user. Collect them once after the assessment from references/DECISIONS.md, each with a recommended answer. Do not decide them silently, do not ask what the code already answers, and do not re-ask a recorded decision per unit.
  • Keep one repository-specific migration contract as the source of truth. Separate compatibility requirements from intentional changes. Default to preserving observable behavior and module boundaries; do not combine migration with unsolicited redesign, dependency replacement, or feature development.
  • Write idiomatic Rust, not a transliteration. Preserving structure means keeping behavior, interfaces, and module responsibilities; it does not mean copying sentinel return codes, out-parameters, index loops, manual cleanup, null pointers, or inheritance mechanics into Rust. See Idiomatic Rust target.
  • Preserve defined behavior and required compatibility. Never recreate undefined behavior, memory corruption, or unsound Rust to imitate the source. Record a safe, specified replacement for those cases. Keep fixes to defined source defects separate and explicit unless the user requested them as part of the migration.
  • Default to safe Rust. When a direct translation would need unsafe, rethink that unit's design instead of transcribing it. Use unsafe only at an unavoidable FFI boundary or in a small block where measured performance is the deciding requirement. See Unsafe policy.
  • Inspect the repository before choosing tools, crate boundaries, or ownership types. Do not import another project's choices, such as a runtime ban, byte strings everywhere, or one crate per source directory, without evidence from this repository.
  • The rulebook is read-only inside a batch. Queue amendments and apply them between batches under the authority the user chose (D-PROC-01). A failure seen three times is a rule defect, not three instances.
  • This skill ships reference documents, not tooling. Read a reference when its section applies. Reuse existing project tooling first; write small repository-specific helpers only when needed, inspect and verify them, and keep them in the target project or a scoped temporary workspace. Never assume a helper, runtime, connector, or agent facility exists.
  • Write migration records only when the request authorizes file changes. For an assessment-only request, return the assessment in the reply.
  • Prefer the smallest useful workflow. A small module may need only a short contract, a patch, and direct verification. Use the large-scale path when the signals in Scale say so.
  • Treat compilation, behavioral compatibility, Rust soundness, performance, and release readiness as separate claims. Attach evidence to each claim.

Read the full file on GitHub · 532 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 532 lines · 152 tokens per session scan A 66c2b05ea99c

Subscribe to this mod's changes

rewrite-in-rust is a skill published in the GitHub repository Firstp1ck/pi-coding-agent-forge (90 stars, last pushed yesterday), licensed MIT. It adds 152 tokens to every session and 10,687 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-16.

Related

Other skills, from other repositories

rust-crate-ci

Load before editing any Rust crate in this repo (currently runners/swarm-sandbox-runner). Covers the mandatory local validation gate, common rustfmt/clippy pitfalls, and Windows-specific Rust correctness patterns that CI enforces but are hard to catch locally without a Windows toolchain.

ZaxbyHub/opencode-swarm · 60 tokens

bxc-rust-ffi

This skill should be used when working on rust-bridge/, FFI between Bun and Rust (cdylib, nomangle extern "C", lolhtml, V8, x-client, x-algorithm), rusqlite workspace constraints, tokio async blocks for FFI, cross-platform cdylib (.so/.dylib/.dll), bxcx symbols, Cargo workspace for rust-bridge crates, or porting Rust…

aphrody-code/bxc · 108 tokens

rust-async-concurrency

Use when writing async Rust — spawning tasks, sharing state across tasks/threads, choosing channels vs mutexes, or hitting Send-bound errors with async traits. Not for HTTP service structure (rust-web-backend) or sync-only ownership (rust-core-language).

fusengine/codex · 57 tokens

rust-core-language

Use when writing or reviewing idiomatic Rust — edition 2024 ownership/borrowing design, or fixing LLM pitfalls (clone tax, unwrap infestation, indexed loops). Not for error-type design (rust-error-handling) or SOLID layout (solid-rust).

fusengine/codex · 58 tokens

rust-ecosystem-crates

Use when choosing crates for a Rust project — serialization, CLI, async runtime, web, database, HTTP client, error handling, observability. Not for API usage details of an already-chosen crate.

fusengine/codex · 48 tokens

rust-testing-quality

Use when writing, organizing, or running Rust tests — unit, integration, doc-tests, proptest, criterion benchmarks, or cargo-mutants. Not for CI pipeline wiring (rust-tooling-cicd).

fusengine/codex · 46 tokens