ruby-bindings-patterns

Define Ruby bindings for Rust cores using Magnus, RBS, Steep, RSpec, and Rubocop.

836|66|Updated Feb 3, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill ruby-bindings-patterns-kreuzberg-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ruby-bindings-patterns
Source: https://github.com/kreuzberg-dev/html-to-markdown/tree/main/.codex/skills/ruby-bindings-patterns
Command: npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill ruby-bindings-patterns-kreuzberg-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidelines and standards for developing Ruby bindings that interface with a Rust core, ensuring maintainability and adherence to best practices.

Core Features & Use Cases

  • Rust Core Integration: Focuses on the Magnus bridge and Ruby gem packaging for Rust libraries.
  • Development Standards: Outlines requirements for type checking (RBS/Steep), testing (RSpec), linting (Rubocop), and code quality.
  • Use Case: A developer needs to integrate a high-performance Rust library into a Ruby application and requires a clear set of rules for building the Ruby interface.

Quick Start

Follow the Ruby 3.2+ standards for developing bindings, including using RBS files and Steep for type checking.

Frequently Asked Questions about ruby-bindings-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create Ruby bindings for a Rust core library?

To create Ruby bindings for a Rust core, use the Magnus FFI bridge to integrate the libraries, package the extension as a gem, and adhere to Ruby 3.2+ conventions for maintainable integration.

What is the best way to type check Ruby bindings for Rust?

The best way to type check Ruby bindings for Rust is using RBS files alongside Steep, ensuring type safety and code quality across the Magnus FFI bridge integration.

Does Magnus support standard Ruby gem packaging and testing workflows?

Yes, Magnus supports standard Ruby gem packaging workflows by allowing you to wrap Rust libraries in gems, test them using RSpec, and lint the Ruby code with Rubocop.

Can I use RSpec and Rubocop when integrating Rust with Ruby?

Yes, you can use RSpec for testing and Rubocop for linting your Ruby code when integrating a Rust core, ensuring the bindings maintain standard Ruby 3.2+ development quality.

Why do I need Steep and RBS when building Ruby bindings for a Rust core?

You need Steep and RBS when building Ruby bindings to enforce static type checking, ensuring the Ruby interface correctly matches the underlying Rust core types and maintains code quality.