본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)22k · #10353

migrate-to-rust

하는 일

이 스킬은 오래된 코드베이스를 더 안전하고 빠른 언어인 Rust로 옮기도록 돕습니다. 기존 프로그램의 동작을 유지하면서 현대화하려는 엔지니어링 팀을 위한 스킬입니다.

사용하는 경우

  • ✓레거시 C++, Fortran, Java, Python, C 또는 셸 코드베이스를 Rust로 옮기고 싶을 때.
  • ✓원래 동작과 비교해 테스트로 검증된 Rust 포트가 필요할 때.
  • ✓성능 측정이 포함된 마이그레이션 보고서가 필요할 때.

스킬 링크

https://github.com/google/skills/blob/main/skills/developers/migrate-to-rust/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google/skills/blob/main/skills/developers/migrate-to-rust/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 폴더의 이 레거시 C++ 프로젝트를 안전한 Rust로 옮기고, 테스트가 계속 통과하는지 확인한 다음 속도 변화를 보고해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

원래 코드에서 기준선을 얻고, 아키텍처 계획을 작성한 다음, Rust 버전을 빌드하고 테스트합니다. 작업 중 원격 측정 데이터를 기록하고, 대화형 요약이 포함된 보고서를 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Migrate Legacy Codebases to Safe Rust

Act as a Systems Architect, Performance Engineer, and Rust Specialist. Your goal is to migrate legacy codebases into 100% Safe, PGO-tuned Rust while recording measured telemetry and a first-person engineering narrative via scripts/telemetry.py.

Execution Contract & Portability

When migrating a repository or local directory ({github_url} or {codebase_path}), follow these execution rules across agentic harnesses:

  1. Stage 0 External Code Confirmation Gate: After cloning an external repository and inspecting its build files, present the resolved legacy build command, run command, and target directory to the user and obtain confirmation before compiling or executing cloned code. (For local code that the user explicitly instructed you to run, or once Stage 0 confirmation is granted, proceed directly.)
  2. Continuous Stage 1 -> Stage 2 Progression: Once Stage 0 baseline capture is complete, proceed directly from writing the Architectural Blueprint (Stage 1) into implementing and verifying the Rust workspace (Stage 2) without pausing between milestones, where the host environment permits autonomous tool execution.
  3. Bounded Automated Self-Healing (Max 5 Iterations): When tests, clippy lints, or A/B parity checks fail, log the failure via scripts/telemetry.py, diagnose and fix the root cause, and re-test automatically up to a budget of 5 self-healing iterations (or 15 minutes per phase). If any test or seed still diverges after the budget is exhausted, record the partial state in migration_telemetry.json and document the remaining gap in the final report rather than looping indefinitely.
  4. Verification Targets & Definition of Done:
    • #![forbid(unsafe_code)] Rust crate compiles with a target of 0 cargo clippy warnings (any unavoidable exception must be documented).
    • Unit, integration, doc, and property-based (proptest) tests pass with a target of >= 95% branch coverage (any unavoidable exception must be documented), with every run logged in migration_telemetry.json.
    • A/B differential output parity is verified across N deterministic seeds within a documented numerical epsilon (--max-abs-error), with any floating-point/FMA/PRNG divergence root-caused and logged.
    • All 4 benchmark stages (legacy_baseline, safe_rust, soa_simd, pgo_lto) are measured and logged (or omitted cleanly if a tool such as llvm-profdata is unavailable).
    • The interactive HTML infographic (migration_infographic.html) is rendered via scripts/telemetry.py render-infographic.

End-to-End Workflow Checklist

Copy this checklist to track progress across the three stages (detailed command recipes and architectural specifications are in references/pgo_and_telemetry_guide.md):

- [ ] Stage 0: Acquire repo, initialize `migration_telemetry.json` (`discovery` bucket), scan legacy codebase, confirm resolved build/run commands, and benchmark baseline
- [ ] Stage 1: Audit legacy code (`blueprint` bucket), log opportunities & latent legacy bugs, and generate 6-section Architectural Blueprint
- [ ] Stage 2.1: Scaffold `#![forbid(unsafe_code)]` Rust workspace & deterministic PRNG parity layer (`rewrite` bucket)
- [ ] Stage 2.2: Implement core domain types & SoA/SIMD kernels (<= 400 LOC/file target, full rustdoc) & benchmark `safe_rust` + `soa_simd`
- [ ] Stage 2.3: Run Verification Crucible (`test_heal` bucket, max 5 iterations) — log initial test failure % and each self-healing fix
- [ ] Stage 2.4: Run A/B differential parity harness (`parity` bucket, max 5 iterations) across N seeds within documented epsilon tolerance
- [ ] Stage 2.5: Run LLVM Profile-Guided Optimization (`pgo_bench` bucket), scan final Rust codebase, and render `migration_infographic.html`

Stage 0: Repository Acquisition, Telemetry Init & Legacy Baseline

Resolve context parameters from the repository or directory:

Parameter Placeholder Resolution Strategy
Source Input
자주 묻는 질문

외부 저장소의 코드를 묻지 않고 컴파일하나요?

아닙니다. 외부 저장소의 빌드와 실행 명령을 보여 주고, 먼저 확인을 기다립니다.

Rust 코드에 unsafe 블록을 쓰나요?

100퍼센트 안전한 Rust를 목표로 합니다.

보고서에는 무엇이 들어가나요?

측정된 원격 측정 데이터, 테스트 결과, 마이그레이션에 대한 1인칭 설명입니다.

상세 정보

작성자의 원본 설명

Clones, analyzes, plans, and migrates legacy codebases (C++, Fortran, Java, Python, C, Shell) from a GitHub URL or local directory to a modern, high-performance, deterministic, 100% Safe Rust architecture, tracking live telemetry across every task bucket, test failure/fix cycle, and Profile-Guided Optimization (PGO) stage, and producing a first-person AI storytelling report and interactive HTML infographic. Use when migrating a GitHub repository or local codebase to Rust, porting legacy C++, Fortran, Python, or Java workloads to memory-safe Rust, designing Struct-of-Arrays (SoA) or SIMD Rust a

repo: google/skills

인기도

GitHub 스타
22k
순위
#10353
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬