Compose foundation skills for Python-to-Rust or legacy-to-Rust rewrite loops. Use when planning, slicing, dependency-aligning, bootstrapping, implementing, reviewing, promoting, or coordinating gradual replacement work that needs behavior parity first, reversible ownership, DAG execution, and rollback.
Scanned 9/10/2026
Install to Claude Code
npx -y skills add AntheaLaffy/py2rs-loop-lab --skill py2rs --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Py2rs?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/anthealaffy-py2rs)More formats (shields.io, HTML) on the badges page.
---
name: py2rs
description: Compose foundation skills for Python-to-Rust or legacy-to-Rust rewrite loops. Use when planning, slicing, dependency-aligning, bootstrapping, implementing, reviewing, promoting, or coordinating gradual replacement work that needs behavior parity first, reversible ownership, DAG execution, and rollback.
---
# py2rs
Use this composition for gradual Python-to-Rust or legacy-to-Rust replacement.
The reusable mechanisms live in foundation skills; py2rs only binds them into a
rewrite policy.
## Default Policy
```yaml
rewrite_strategy: behavior_parity_first
default_first_gate: behavior_parity
dependency_alignment: enabled_by_default_when_capabilities_or_crates_change
env_bootstrap: required_when_the_old_new_boundary_is_unproven
dag_mode: dry_run_first
unit_model: minimum_independently_verifiable_work_unit
owner_model: legacy_owner_to_target_owner
```
## Foundation Routing
- Use `work-unit-slicing` to define units, current owner, target owner,
verification, rollback, artifacts, and review needs.
- Use `crate-recon` and `dependency-alignment` before implementation when a unit
depends on crates, adapters, source expansion, or handwritten capability
choices.
- Use `env-bootstrap` to prove the old/new seam before business migration.
- Use `phase-dag-execution` to compile `(unit, phase)` nodes, artifact edges,
locks, capacity, stale evidence, and integration waves.
- Use `review-gate` with `behavior_parity` as the mandatory first gate; add
`rust_style`, `error_diagnostics`, `io_concurrency`, `data_algorithm`,
`architecture`, or `product_ergonomics` by risk.
## Rewrite Unit Additions
In addition to the generic unit record, py2rs units need:
```yaml
current_owner: legacy
target_owner: rust
public_interface_policy: "Preserve existing public behavior unless explicitly changed."
behavior_parity:
seam: ""
observations: []
comparison: exact
tolerances: []
promotion: "How target owner becomes default."
rollback: "How to route back to legacy owner."
```
Exact comparison is the default. Numeric/model tolerances require an existing
contract or explicit pre-implementation approval.
## Workflow
1. Read project truth: mission, architecture, resources, notes, manifest, records,
tests, and accepted seam.
2. Slice or recut units around independently comparable public behavior.
3. Align dependencies when capability ownership is uncertain.
4. Bootstrap the seam if it is not already proven.
5. Compile the DAG in dry-run mode and admit only ready nodes.
6. Implement one unit or scheduled node; run writer verification.
7. Run `behavior_parity` first against the exact candidate snapshot.
8. Run selected risk gates.
9. Promote only reviewed snapshots with rollback still clear.
10. Record state changes and stale propagation.
## Non-Negotiables
- Public legacy behavior is the oracle until a unit explicitly changes it.
- Compile-only or Rust-only evidence cannot replace behavior parity.
- A writer does not review their own candidate.
- Control-plane or adapter code does not contain business logic.
- Parallel mutation requires isolated worktrees and a coordinator-owned graph,
integration path, shared dependencies, and build queue.
- Practice skills bind project paths and daily commands; this composition stays
generic.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!