gen-rust
Syncs Rust code and tests with Python changes, excluding UI and login logic.
Install
mkdir -p .claude/skills/gen-rust && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5884" && unzip -o skill.zip -d .claude/skills/gen-rust && rm skill.zipInstalls to .claude/skills/gen-rust
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Sync Rust implementation with Python changes (exclude UI/login) by reviewing recent changes, mapping modules, porting logic, and updating tests.Key capabilities
- →Identifies business logic divergence between Python and Rust
- →Maps internal tool output strings
- →Synchronizes integration test assertions
- →Ports utility modules between environments
- →Updates `kagent` specific console outputs
How it works
Reviews recent git changes in Python, maps them to corresponding Rust file analogs, and applies porting patterns while preserving binary command naming.
Inputs & outputs
When to use gen-rust
- →Propagate business logic changes from Python to Rust
- →Sync internal tool output messages
- →Update Rust integration tests after Python logic updates
About this skill
gen-rust
Use this skill when the user wants Rust (kagent/kosong/kaos) to stay logically identical to Python (kimi_cli/kosong/kaos), excluding UI and login/auth. This includes code and tests: Rust behavior and tests must be fully synchronized with Python changes.
Note: The Rust binary is named kagent. User-facing CLI/output text in Rust must use kagent
instead of kimi to match the Rust command name.
Quick workflow
- Build a complete change inventory
Review recent changes to understand what needs syncing:
# Check staged changes
git diff --cached --name-only
git diff --cached -- src packages
# Check recent commits
git log --oneline -20 -- src packages
git diff HEAD~20..HEAD -- src packages
# Review CHANGELOG.md for context
head -50 CHANGELOG.md
- Classify changes
- Exclude UI and login/auth changes (Shell/Print/ACP UI, login/logout commands).
- Everything else must be mirrored in Rust.
- Keep a small checklist: file -> change summary -> Rust target -> status.
- Map Python -> Rust
Common mappings:
src/kimi_cli/llm.py->rust/kagent/src/llm.rssrc/kimi_cli/soul/*->rust/kagent/src/soul/*src/kimi_cli/tools/*->rust/kagent/src/tools/*src/kimi_cli/utils/*->rust/kagent/src/utils/*src/kimi_cli/wire/*->rust/kagent/src/wire/*packages/kosong/*->rust/kosong/*packages/kaos/*->rust/kaos/*
- Port logic carefully
- Match error messages and tool output text exactly (tests often assert strings).
- Preserve output types (text vs parts) and ordering.
- For media/tool outputs, verify ContentPart wrapping and serialization.
- If Python adds new helper modules, mirror minimal Rust utilities.
- Use
rgto find existing analogs and references.
- Update tests
- Update Rust tests that assert content/strings/parts.
- Mirror Python unit and integration tests when they exist; add missing Rust tests so coverage matches intent.
- Ensure E2E parity: use the existing Python E2E suite against the Rust binary by setting
KIMI_E2E_WIRE_CMD(do not rewrite E2E in Rust). All E2E cases must pass or the gap must be documented. - Prefer targeted tests first (
cargo test -p kagent --test <name>), then full suite if asked.
- Verification is mandatory
- Run the full Rust test suite and ensure all Rust tests pass.
- Run E2E tests with the wire command swapped to Rust (set
KIMI_E2E_WIRE_CMD), and ensure they pass.
- Final report
- List synced files and logic.
- Call out intentionally skipped UI/login changes.
- List tests run and results (must include full Rust tests and Rust E2E with wire command override).
Pitfalls to avoid
- Skipping
llm.py: it often changes model capability logic. - Using commit message filtering instead of full diff.
- Forgetting to update Rust tests when output text/parts change.
- Mixing UI/login changes into core sync.
- Leaving test parity ambiguous; always state unit/integration/E2E status.
Minimal diff checklist (template)
- Recent changes reviewed (staged, commits, changelog)
- Python diffs inspected for core logic
- Rust mappings applied
- Tests updated
- Targeted tests run
- Full Rust test suite passed
- Rust E2E passed with
KIMI_E2E_WIRE_CMD
When not to use it
- →UI, login, or authentication logic sync
- →Non-paired codebase environments
Prerequisites
Limitations
- →Manual mapping sometimes required for complex logic
- →Requires maintaining synchronized test suites
How it compares
It enforces strict cross-language logical parity specifically for internal tooling binaries.
Compared to similar skills
gen-rust side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| gen-rust (this skill) | 1 | 6mo | Review | Advanced |
| ci-pr-helper | 0 | 6mo | Review | Beginner |
| evolve | 0 | 3mo | No flags | Advanced |
| release-skills | 2 | 3mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by MoonshotAI
View all by MoonshotAI →You might also like
ci-pr-helper
lance-format
Run local test/style checks and open GitHub PRs for lance-context. Use when asked to run CI-equivalent checks (uv pytest, ruff/pyright, cargo fmt/clippy/test) and then create a PR with a proper title/body.
evolve
yologdev
Safely modify your own source code, test changes, and manage your evolution
release-skills
JimLiu
Universal release workflow. Auto-detects version files and changelogs. Supports Node.js, Python, Rust, Claude Plugin, and generic projects. Use when user says "release", "发布", "new version", "bump version", "push", "推送".
rfx-bootstrap-install
quantbagel
Bootstrap the rfx monorepo for local development. Use when asked to install dependencies, enable hooks, or prepare this repo for an agent to work safely.
test
FalkorDB
Run FalkorDB's test suites - Rust unit tests, Python e2e/function/MVCC/concurrency tests, openCypher TCK compliance tests, and flow tests. Use when asked to run, narrow down, or debug a failing test, or to decide which suite covers a change.
implementing-cards
bcollazo
Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.