Agent skill

Cgo Bindings

by Goldziher in Goldziher/ai-rulez

cgo conventions for linking Go to a C or Rust static library: import "C" directives, type/string conversion, CString memory management, thread safety, and Go pointer pinning.

MITAuto-check passedAgent Workflows

Install Cgo Bindings

skills CLI
$ npx skills add Goldziher/ai-rulez --skill cgo-bindings -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Goldziher/ai-rulez cgo-bindings --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Goldziher/ai-rulez.git skills-src && mkdir -p .claude/skills && cp -r skills-src/internal/builtins/bindings/cgo/skills/cgo-bindings .claude/skills/cgo-bindings && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cgo-bindings
GitHub stars
159
Token cost
~371 tokens
SKILL.md length
156 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

cgo conventions for linking Go to a C or Rust static library: import "C" directives, type/string conversion, CString memory management, thread safety, and Go pointer pinning.

  • Agent Workflows work in your project
  • Calls go

What it does

Cgo Bindings is an agent skill from Goldziher/ai-rulez. cgo conventions for linking Go to a C or Rust static library: import "C" directives, type/string conversion, CString memory management, thread safety, and Go pointer pinning. Load when generating or reviewing cgo bindings that call a C or Rust core from Go.

Its SKILL.md is about 370 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows. It works with Rust. The repository describes itself as: One source of truth for AI assistant configs: 14 built-in presets (Claude, Cursor, Copilot, Codex, Gemini, Xum, …), full-parity custom presets, and distributable plugin bundles… The licence is MIT.

When your agent uses it

  • Agent Workflows work in your project

Example prompts

  • “/cgo-bindings”

What it can do on your machine

Read from SKILL.md and the folder at commit 1192ada. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cgo Bindings loads about 371 tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 156 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~371

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Goldziher/ai-rulez at commit 1192ada, republished under its MIT licence (© Goldziher). 156 words, ~371 tokens.

Download SKILL.mdSave it as .claude/skills/cgo-bindings/SKILL.md (or your agent's skills folder).
name
cgo-bindings
description
cgo conventions for linking Go to a C or Rust static library: import "C" directives, type/string conversion, CString memory management, thread safety, and Go pointer pinning. Load when generating or reviewing cgo bindings that call a C or Rust core from Go.
  • Use import "C" with // #cgo LDFLAGS: and // #cgo CFLAGS: directives for linking.
  • Declare C header functions in comment block immediately above import "C" — no blank line between.
  • Type mapping: C.int, C.long, C.char. Use C.CString() and C.GoString() for string conversion.
  • Memory: C.CString() allocates — always defer C.free(unsafe.Pointer(cStr)) immediately after creation.
  • Error handling: return error codes from C functions, convert to Go error values. Check all return values.
  • Link Rust static libraries: // #cgo LDFLAGS: -L./target/release -lmylib. Build Rust with crate-type = ["staticlib"].
  • Thread safety: C functions called from Go may run on any OS thread. Use runtime.LockOSThread() when needed.
  • Go pointer passing: use runtime.Pinner (Go 1.21+) to pin Go memory passed to C. Never pass Go pointers without pinning.
  • Test with go test (requires CGO_ENABLED=1). Mock C layer for unit tests, use integration tests for real FFI.
  • Build: CGO_ENABLED=1 go build. Cross-compilation requires appropriate C toolchain.
  • Anti-patterns: leaking C.CString memory, passing unpinned Go pointers to C, ignoring C return codes.

© Goldziher, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in internal/builtins/bindings/cgo/skills/cgo-bindings of Goldziher/ai-rulez.

Open the folder on GitHubat commit 1192ada

Compare with similar skills

Cgo Bindings next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cgo Bindings compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cgo Bindings this skillGoldziher/ai-rulez159—~371Automated safety check: PassMIT
Lean Ctx Reviewyvgude/lean-ctx3.9k—~1.6kAutomated safety check: PassApache-2.0
Bd To Br MigrationDicklesworthstone/beads_rust1.1k—~2.2kAutomated safety check: PassCustom licence
Manage Skills Hubqufei1993/skills-hub1.7k—~3.2kAutomated safety check: PassMIT
Ourmemourmem/omem1741 repos~3.4kAutomated safety check: PassCustom licence
Foremergenaw103/foremerge538—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • Lean Ctx Review

    yvgude/lean-ctx

    Review how the lean-ctx ctx MCP tools performed in the current session and file upstream issues for confirmed problems.

    3.9k GitHub stars~1.6k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Bd To Br Migration

    Dicklesworthstone/beads_rust

    Migrate docs from bd (beads) to br (beadsrust). An agent skill from Dicklesworthstone/beads_rust.

    1.1k GitHub stars~2.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Manage Skills Hub

    qufei1993/skills-hub

    A skill your agent uses whenever an Agent needs to query, find, install, deploy, update, tag, adopt, diagnose, or safely remove Skills Hub content, including natural-language requests to manage…

    1.7k GitHub stars~3.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Ourmem

    ourmem/omem

    Shared memory that never forgets. An agent skill from ourmem/omem.

    174 GitHub starsUsed in 1 repo~3.4k tokens
    Agent WorkflowsAuto-check passed
  • Foremerge

    naw103/foremerge

    Coordinate parallel coding agents with Foremerge's local Git-compatible CLI and MCP server.

    538 GitHub stars~2.4k tokensUpdated 5 days ago
    Agent WorkflowsAuto-check passed
  • Base Help

    ChristopherKahler/base

    Coach mode for the base CLI: teaches what to do and why, rather than just answering.

    292 GitHub stars~2.6k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed

More from Goldziher/ai-rulez

All 10 skills in this repo
  • AI Rulez

    Goldziher/ai-rulez

    Standards-compliant lifecycle tool for agent knowledge and capabilities: author in .ai-rulez/, generate for 52 harnesses (Claude Code, Cursor, Codex, Copilot, Gemini CLI, OpenCode, Devin, and more)…

    159 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Code Quality Standards

    Goldziher/ai-rulez

    Concrete code-quality thresholds and anti-patterns: 120-char lines, max 20 cyclomatic complexity, max 4 nesting levels, max 50 lines per function, no magic numbers, no global state, composition over…

    159 GitHub stars~486 tokensUpdated today
    Auto-check passed
  • Rust Conventions

    Goldziher/ai-rulez

    Rust code conventions covering edition 2024, cargo fmt/clippy, Result-based error handling, unsafe discipline, async with tokio, API-guideline naming, trait implementations, benchmarking, and…

    159 GitHub stars~746 tokensUpdated today
    Auto-check passed
  • Testing Conventions

    Goldziher/ai-rulez

    How to write a good test: behaviour-describing names (shouldreturnerrorwheninputisempty, givenwhenthen), exact-value assertions over truthiness, snapshot and property-based testing…

    159 GitHub stars~473 tokensUpdated today
    Auto-check passed
  • Vite Plus Conventions

    Goldziher/ai-rulez

    vite+ unified TypeScript toolchain conventions: the vp CLI for package/node management, oxlint/oxfmt, type-aware linting, vitest, rolldown/tsdown bundling, task caching, and migration.

    159 GitHub stars~567 tokensUpdated today
    Auto-check passed
  • Bindings

    Goldziher/ai-rulez

    Cross-language binding architecture rules: bindings as minimal glue, canonical API surface ordering (core, ABI, language), per-language test suites in CI, generated-code discipline, and error/async…

    159 GitHub stars~265 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Cgo Bindings

What does Cgo Bindings do?

cgo conventions for linking Go to a C or Rust static library: import "C" directives, type/string conversion, CString memory management, thread safety, and Go pointer pinning. Cgo Bindings is an agent skill from Goldziher/ai-rulez. cgo conventions for linking Go to a C or Rust static library: import "C" directives, type/string conversion, CString memory management, thread safety, and Go pointer pinning.

When should I use Cgo Bindings?

Cgo Bindings fits situations like: agent Workflows work in your project.

How do I install Cgo Bindings in Claude Code?

Run `npx skills add Goldziher/ai-rulez --skill cgo-bindings -a claude-code`. Or copy the skill folder (internal/builtins/bindings/cgo/skills/cgo-bindings in Goldziher/ai-rulez) into .claude/skills/cgo-bindings in your project. Claude Code loads it when a task matches its description.

How do I install Cgo Bindings in Codex?

Run `npx skills add Goldziher/ai-rulez --skill cgo-bindings -a codex`. Or copy the skill folder (internal/builtins/bindings/cgo/skills/cgo-bindings in Goldziher/ai-rulez) into .agents/skills/cgo-bindings in your project. Codex loads it when a task matches its description.

Can I use Cgo Bindings in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Goldziher/ai-rulez --skill cgo-bindings -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cgo-bindings, .gemini/skills/cgo-bindings, .github/skills/cgo-bindings and .opencode/skills/cgo-bindings in your project.

What does Cgo Bindings need to run?

Going by SKILL.md and its folder, Cgo Bindings needs the command-line tools its instructions call (go).

Does Cgo Bindings access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cgo Bindings safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cgo Bindings use?

Cgo Bindings is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cgo Bindings use?

About 371 tokens (SKILL.md is roughly 1.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cgo Bindings?

Skills that share tags, products or a category with Cgo Bindings: Lean Ctx Review (yvgude/lean-ctx, 3.9k stars), Bd To Br Migration (Dicklesworthstone/beads_rust, 1.1k stars), Manage Skills Hub (qufei1993/skills-hub, 1.7k stars) and Ourmem (ourmem/omem, 174 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cgo Bindings?

Goldziher (a GitHub user) maintains it in Goldziher/ai-rulez, which has 159 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 10, 2026.

Source: Goldziher/ai-rulez on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.