juanmarchetto/agent-skills/c-cpp-analyzer
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Analyze C/C++ code for Rust migration planning. Classifies functions by migration difficulty (easy/medium/hard), identifies unsafe patterns, pointer complexity, and macro usage. Use when: analyze C code, migration planning, C to Rust, assess migration difficulty, code complexity analysis.
Install
npx vskill@latest install juanmarchetto/agent-skills/c-cpp-analyzerSKILL.md
C/C++ Analysis for Migration
Difficulty Classification
Uses tree-sitter AST analysis with regex fallback:
- Easy: Pure functions, simple arithmetic, no pointers, <30 lines
- Medium: Pointer parameters, simple structs, bounded arrays, malloc with clear ownership
- Hard: void*, function pointers, unions, goto, complex lifetimes, macro-heavy, coroutines
Hard signals (any 1 → Hard):
gotostatementsuniontypesvoid*pointers- Function pointer callbacks
- Coroutine patterns (Duff's device,
switch-based state machines) - setjmp/longjmp
Medium signals (1+ with >30 lines → Medium):
- Pointer declarations
- Cast expressions
malloc/callocusage
Pattern Detection
| C Pattern | Rust Equivalent | Difficulty | |
|---|---|---|---|
ptr + len pairs | &[T] slices | Medium | |
| Error code returns | Result<T, E> | Easy | |
| NULL checks | Option<T> | Easy | |
malloc/free | Vec<T>, Box<T> | Medium | |
char* strings | &str, String | Medium | |
| Manual iteration with pointers | .iter(), .enumerate() | Medium | |
goto cleanup | Drop trait, ? operator | Hard | |
| Global mutable state | Function parameters, OnceLock | Hard | |
| Bit manipulation | Same ops with explicit types | Medium | |
union | enum with variants | Hard | |
| Function pointers / callbacks | Enum dispatch (preferred) or Fn traits | Hard | |
| Linked lists (next/prev) | Vec<T> (flatten) | Medium | |
| Type tag + union (tagged union) | enum with data variants | Medium-Hard | |
| Recursive data structures | enum + Box<T> | Medium | |
| Coroutine via switch/case | Explicit state machine (match loop) | Hard | |
| Printf format strings | format!() / println!() macros | Easy-Medium | |
strdup/strcpy | .to_string(), .clone() | Easy |
Size-Based Strategy
| LOC Range | Strategy | Chunking | Repair Iters | |
|---|---|---|---|---|
| <800 | Single-pass translation | No | Full (5) | |
| 800-2000 | Chunked (400 LOC target) | Structural (data model first) | Full (8 for chunked) | |
| 2000+ | Chunked (500 LOC target) | Structural | Reduced (2) | |
| 4000+ | Consider per-module split | split_into_modules() | Reduced (2) |
Risk Flags
- Platform-specific code (
#ifdef _WIN32, inline assembly) - Undefined behavior (signed overflow, use-after-free patterns)
- Macro-heavy code (requires
cc -Eexpansion before analysis) - Variadic functions (
...parameters) - setjmp/longjmp (no safe Rust equivalent)
- Thread-unsafe global state
- Bit-exact algorithms (compression, crypto) — very hard to get semantically correct
- Files >4000 LOC — may exceed API token limits even with chunking
Migration Ceiling (learned from miniz)
Some patterns have NO safe Rust equivalent and require full algorithm redesign:
- Coroutine via switch/case (Duff's device) → explicit state machine
- Large structs with internal pointers (~300KB) → redesign needed
- Bit-level DEFLATE/INFLATE → requires exact semantic preservation
- These files need "best-effort" mode: output highest-quality version for developer to finish
Powered by Noricum — autonomous C/C++ to Rust migration agent
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/c-cpp-analyzer/SKILL.md
Popularity
- Repository stars
- 5
- Repository forks
- 1
- 7-day trend score
- 9
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/juanmarchetto/agent-skills/c-cpp-analyzer)