Claude Cursor Skill

extendr-bindings

extendr conventions for exposing a Rust core to R: extendr macros and module registration, Robj type mapping, NA handling, rextendr builds, R package scaffolding, and CRAN compliance. Load when generating or reviewing extendr R bindings for a Rust library.

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download goldziher-ai-rulez-internal_builtins_bindings_extendr_skills_extendr-bindings-ca967ad.zip · 0 KB
Part of goldziher/ai-rulez — 151 skills

Install

skills CLI npx skills add https://github.com/Goldziher/ai-rulez/tree/main/internal/builtins/bindings/extendr/skills/extendr-bindings
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install goldziher-ai-rulez@llmmart
Git git clone https://github.com/Goldziher/ai-rulez.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole goldziher/ai-rulez collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

  • Use extendr crate for Rust-R interop. #[extendr] macro on functions, extendr_module! for registration.
  • Type mapping: Robj for generic R objects, Doubles, Integers, Strings, List for typed access.
  • Return Result<T, extendr_api::Error> for R error propagation. Use .into() for Rust-to-R conversion.
  • NA handling: use Rfloat::na(), Rint::na() for missing values. Check with .is_na() before operations.
  • Build with rextendr::document() in R for development, cargo build --release for production.
  • Package integration: use usethis::use_extendr() for scaffolding. Maintain src/rust/ in R package.
  • Test R-side with testthat, Rust-side with standard #[test]. Use rextendr::test() for integration.
  • CRAN compliance: R CMD check --as-cran must pass. No compiler warnings. Vendor Rust dependencies.
  • Keep R wrapper functions thin — heavy computation in Rust, R provides user-facing API with roxygen2 docs.
  • Anti-patterns: ignoring NA values, allocating R objects in Rust threads, panics in #[extendr] functions.
Files (ai-rulez)
  • SKILL.md 1.3 KB
    ---
    name: extendr-bindings
    description: "extendr conventions for exposing a Rust core to R: extendr macros and module registration, Robj type mapping, NA handling, rextendr builds, R package scaffolding, and CRAN compliance. Load when generating or reviewing extendr R bindings for a Rust library."
    ---
    
    - Use `extendr` crate for Rust-R interop. `#[extendr]` macro on functions, `extendr_module!` for registration.
    - Type mapping: `Robj` for generic R objects, `Doubles`, `Integers`, `Strings`, `List` for typed access.
    - Return `Result<T, extendr_api::Error>` for R error propagation. Use `.into()` for Rust-to-R conversion.
    - NA handling: use `Rfloat::na()`, `Rint::na()` for missing values. Check with `.is_na()` before operations.
    - Build with `rextendr::document()` in R for development, `cargo build --release` for production.
    - Package integration: use `usethis::use_extendr()` for scaffolding. Maintain `src/rust/` in R package.
    - Test R-side with `testthat`, Rust-side with standard `#[test]`. Use `rextendr::test()` for integration.
    - CRAN compliance: `R CMD check --as-cran` must pass. No compiler warnings. Vendor Rust dependencies.
    - Keep R wrapper functions thin — heavy computation in Rust, R provides user-facing API with roxygen2 docs.
    - Anti-patterns: ignoring NA values, allocating R objects in Rust threads, panics in `#[extendr]` functions.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related