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-analyzer

SKILL.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):

  • goto statements
  • union types
  • void* 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/calloc usage

Pattern Detection

C PatternRust EquivalentDifficulty
ptr + len pairs&[T] slicesMedium
Error code returnsResult<T, E>Easy
NULL checksOption<T>Easy
malloc/freeVec<T>, Box<T>Medium
char* strings&str, StringMedium
Manual iteration with pointers.iter(), .enumerate()Medium
goto cleanupDrop trait, ? operatorHard
Global mutable stateFunction parameters, OnceLockHard
Bit manipulationSame ops with explicit typesMedium
unionenum with variantsHard
Function pointers / callbacksEnum dispatch (preferred) or Fn traitsHard
Linked lists (next/prev)Vec<T> (flatten)Medium
Type tag + union (tagged union)enum with data variantsMedium-Hard
Recursive data structuresenum + Box<T>Medium
Coroutine via switch/caseExplicit state machine (match loop)Hard
Printf format stringsformat!() / println!() macrosEasy-Medium
strdup/strcpy.to_string(), .clone()Easy

Size-Based Strategy

LOC RangeStrategyChunkingRepair Iters
<800Single-pass translationNoFull (5)
800-2000Chunked (400 LOC target)Structural (data model first)Full (8 for chunked)
2000+Chunked (500 LOC target)StructuralReduced (2)
4000+Consider per-module splitsplit_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 -E expansion 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/juanmarchetto/agent-skills/c-cpp-analyzer/badge)](https://verified-skill.com/skills/juanmarchetto/agent-skills/c-cpp-analyzer)

Something wrong with this skill or its page? Tell us.