gen-rust

Ports Python code changes to Rust implementations while synchronizing tests and E2E verification.

6|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/Wyl-cmd/kxns-cli --skill gen-rust-wyl-cmd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gen-rust
Source: https://github.com/Wyl-cmd/kxns-cli/tree/main/.agents/skills/gen-rust
Command: npx skills add https://github.com/Wyl-cmd/kxns-cli --skill gen-rust-wyl-cmd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping a Rust codebase logically identical to a parallel Python codebase is error-prone: changes get missed, error messages drift, and tests fall out of sync. This Skill provides a disciplined workflow for reviewing Python changes and mirroring them into Rust (kagent/kosong/kaos) with full test parity. ## Core Features & Use Cases - Change Inventory: Builds a complete list of staged changes, recent commits, and changelog entries before porting anything. - Module Mapping: Provides explicit Python-to-Rust path mappings (e.g., src/kimi_cli/llm.py to rust/kagent/src/llm.rs) while excluding UI and login/auth changes. - Test Parity Enforcement: Requires updating Rust unit/integration tests and running the Python E2E suite against the Rust binary via KIMI_E2E_WIRE_CMD. - Use Case: After merging a Python PR that changes tool output formatting, use this Skill to port the logic to Rust, update string-asserting tests, and verify with the full Rust test suite and E2E run. ## Quick Start Sync the recent Python changes in src and packages into the Rust kagent codebase, excluding UI and login changes, and run the full Rust tests plus E2E with the wire command override.

Frequently Asked Questions about gen-rust

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep a Rust implementation in sync with Python code?

Review staged changes, recent commits, and the changelog to build a complete change inventory, then map each Python module to its Rust counterpart and port the logic. Finish by updating Rust tests and running the full test suite plus E2E verification.

How to run Python E2E tests against a Rust binary?

Set the KIMI_E2E_WIRE_CMD environment variable to point at the Rust binary instead of rewriting the E2E suite in Rust. All existing E2E cases must pass, or any gap must be explicitly documented.

Which Python changes should not be ported to Rust?

UI and login/auth changes are explicitly excluded, including Shell/Print/ACP UI and login/logout commands. Everything else, including core logic in llm.py, tools, wire, and utility modules, must be mirrored in Rust.

Why do Rust tests fail after porting Python output changes?

Rust tests often assert exact error messages and output strings, so any Python change to output text or ContentPart wrapping breaks them. Update the affected Rust tests whenever output text, parts, or serialization ordering changes.

What are common mistakes when syncing Python to Rust code?

Common pitfalls include skipping llm.py capability changes, filtering by commit messages instead of reading full diffs, forgetting test updates, and mixing UI/login changes into the core sync. Always state unit, integration, and E2E status explicitly.