nim-c-wrappers

Community

Build safe, idiomatic Nim wrappers over C.

Authorplanetis-m
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps you turn C FFI bindings into ABI-correct, idiomatic Nim APIs without introducing subtle bugs like wrong struct layouts, incorrect calling conventions, or unsafe ownership/lifetime handling.

Core Features & Use Cases

  • Two-layer wrapper design: keep a thin raw FFI layer for ABI-faithful declarations and add an ergonomic Nim layer for safety and convenience.
  • ABI and safety guardrails: preserve field order, avoid reordering, use correct calling conventions, and prevent enum modeling and memory mistakes in the raw layer.
  • Ownership-aware wrappers: model move-only resources with destructor patterns, avoid fake ownership for non-handle APIs, and use exception-based error translation at clear boundaries.
  • Correct C type mapping: apply consistent Nim C-interoperability types (e.g., cint, csize_t, cstring) and patterns for strings, buffers, opaque handles, and callbacks.

Quick Start

Ask the AI to generate your Nim wrapper plan by mapping the required C header elements into a minimal raw layer and a separate ergonomic layer that enforces ownership and error handling rules for your specific library.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: nim-c-wrappers
Download link: https://github.com/planetis-m/skills_experiment/archive/main.zip#nim-c-wrappers

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.