/codeguard-security:memory-safe-migrationfrom codeguard-security
Guides migration from memory-unsafe languages (C, C++, Assembly) to memory-safe languages (Rust, Go, Java, C#, Swift) with priority assessment, test-first workflow, and FFI boundary rules.
Ships in codeguard-security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Before writing any new code, ask:
If the project is predominantly C/C++, write the new module in an MSL and integrate via FFI. See references/ffi-security.md for boundary rules.
Follow these steps for every migration task:
Run the assessment script to evaluate migration priority and feasibility:
python scripts/assess-migration.py --file <source_file>
Or manually evaluate using the checklist in references/assessment-checklist.md.
Priority order for migration:
Never migrate a component without test coverage. If no tests exist, write them against the C/C++ implementation before touching anything. These tests become the correctness oracle for the new implementation.
One function or module at a time. Never rewrite an entire codebase in one pass. Follow the Android model: new code in MSL, existing stable code stays in place, proportion of unsafe code decreases over time.
For common migration patterns (buffers, strings, concurrency, error handling), see references/migration-patterns.md.
Every interface between safe and unsafe code is a security boundary. Follow all rules in references/ffi-security.md. Key rules:
unsafe blocks — wrap only the minimum necessary operationunsafe block with a // SAFETY: commentstd::panic::catch_unwind at FFI entry pointsAfter every migration unit, verify:
unsafe surface without documented safety invariantsclippy for Rust, go vet for Go)rustfmt, gofmt)unsafe without annotation, dependency audit)Never do these during migration:
unsafe to replicate C-style patterns in Rust — if extensive unsafe
is needed, the approach should be redesigned or the code should remain in CResult,
Go uses multiple returns. Every error path must be explicitly mappeddefer, try-with-resources,
using, or with patternsFor detailed guidance on specific topics:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
memory-safety, c-cpp-migration, secure-rewrite, ffi-security
3 skills in this plugin
/codeguardGuides secure implementation, vulnerability remediation, and security review. Use when creating or reviewing code, remediating vulnerabilities, or performing security review, or when code or configuration handles untrusted or external data, dynamic execution, authentication, sessions, authorization, privilege, credentials, secrets, cryptography, files or parsers, native or unsafe memory operations, network listeners or destinations, external service integrations, security logs or externally visible errors, dependencies, builds, deployment, or concurrent access to protected state./security-reviewComprehensive security code review workflow for a target repository, producing a markdown report with findings and recommendations.npx claudepluginhub cosai-oasis/project-codeguard --plugin codeguard-securityOther plugins' skills for the same job