LI

library-development

Provides guidance for developing and modifying libraries within the Nanvix Cargo workspace.

Install

mkdir -p .claude/skills/library-development && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10651" && unzip -o skill.zip -d .claude/skills/library-development && rm skill.zip

Installs to .claude/skills/library-development

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Guide for creating and modifying Nanvix libraries under src/libs, including guest no_std and host std crates. Use this when asked about library architecture or crate changes.
174 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Create guest no_std libraries
  • Develop host std libraries
  • Manage library workspace structure
  • Configure build utilities

How it works

The skill provides structural guidance for developing libraries in the Nanvix workspace, distinguishing between guest no_std and host std crates.

Inputs & outputs

You give it
Library development request
You get back
Scaffolded library structure

When to use library-development

  • Create a new guest library
  • Modify syscall interfaces
  • Refactor system architecture
  • Update crate dependencies

About this skill

Library Development

Use this skill when the user asks about developing, modifying, or adding system libraries in Nanvix. All libraries live under src/libs/ and are part of the Cargo workspace.

Library Categories

Core Libraries (Guest — #![no_std])

These run inside the Nanvix guest (user-space) and are compiled with cargo:

LibraryPathPurpose
archsrc/libs/arch/Arch abstractions.
configsrc/libs/config/Config constants.
errorsrc/libs/error/Error types.
syssrc/libs/sys/System types.
syscallsrc/libs/syscall/Syscall interface.
sysapisrc/libs/sysapi/System API.
sysallocsrc/libs/sysalloc/Guest allocator.
syslogsrc/libs/syslog/Guest logging.
syslog-macrossrc/libs/syslog-macros/Log macros.
nvxsrc/libs/nvx/High-level API.
posixsrc/libs/posix/POSIX layer.
procsrc/libs/proc/Process types.
type-safesrc/libs/type-safe/Type-safe values.

Utility Libraries (Guest — #![no_std])

LibraryPathPurpose
bitmapsrc/libs/bitmap/Bitmap.
slabsrc/libs/slab/Slab allocator.
raw-arraysrc/libs/raw-array/Fixed arrays.
static_assertsrc/libs/static_assert/Compile checks.
elfsrc/libs/elf/ELF parser.
libc_stdlibsrc/libs/libc_stdlib/C stdlib.
libc_stringsrc/libs/libc_string/C strings.
no_failsrc/libs/no_fail/No-fail alloc.

Host Libraries (Host — std available)

These run on the host system and are compiled with the host Rust build command (HOST_CARGO_BUILD_CMD, currently cargo):

LibraryPathPurpose
nanvixsrc/libs/nanvix/Host API.
nanvix-httpsrc/libs/nanvix-http/HTTP.
nanvix-terminalsrc/libs/nanvix-terminal/Terminal.
hwlocsrc/libs/hwloc/HW topology.
profilersrc/libs/profiler/Profiling.
syscommsrc/libs/syscomm/Sockets.
user-vm-apisrc/libs/user-vm-api/User VM API.

Build Utilities

LibraryPathPurpose
build-utilssrc/libs/build-utils/Build helpers.

Creating a New Library

  1. Create the directory under src/libs/<name>/.

  2. Add a Cargo.toml with workspace package metadata:

    [package]
    name = "<name>"
    version.workspace = true
    license-file.workspace = true
    authors.workspace = true
    edition.workspace = true
    
    [dependencies]
    # Add dependencies here.
    
    [features]
    default = []
    std = []
    
  3. Add the crate to the workspace members list in the root Cargo.toml.

  4. Add the crate to the workspace [workspace.dependencies] section.

  5. Add the library name to the appropriate list in the Makefile:

    • Guest: ALL_GUEST_RUST_LIBS (and optionally ALL_GUEST_RUST_LIBS_TEST_LIST).
    • Host: ALL_HOST_RUST_LIBS.
  6. Add the copyright header to all source files.

  7. Create src/lib.rs with proper module organization (see coding standards).

Building Libraries

# Build all guest libraries.
./z build -- all

# Run unit tests for host libraries.
./z build -- run-unit-tests

Guest libraries use GUEST_CARGO_BUILD_CMD (cross-compiled with cargo). Host libraries use HOST_CARGO_BUILD_CMD.

Windows Compilation

On a Windows development host, guest libraries are cross-compiled using a local toolchain, so they work identically to Linux. Host libraries that use std may need conditional compilation (#[cfg(target_os = "...")]) for platform-specific code paths (e.g., KVM, libc).

Note: Windows CI jobs run as part of the main CI pipeline. Platform-independent crates should still be manually verified on a Windows host when making changes that may affect cross-platform compatibility or Windows-specific behavior.

Coding Rules (Library-Specific)

  • Guest libraries must support #![no_std] with optional std feature gate.
  • Use default-features = false in workspace dependency declarations.
  • Use c_size_t, c_ssize_t, c_int, etc. for C interoperability.
  • Keep struct fields private; provide getter/setter methods.
  • All public items must have doc comments with # Description, # Parameters, # Returns, and # Errors sections as applicable.
  • Unit tests go in #[cfg(test)] modules; expect() is preferred over unwrap().

When not to use it

  • General Rust development

Prerequisites

Cargo workspace

Limitations

  • Requires manual verification on Windows
  • Strict coding standards

How it compares

It enforces strict coding rules and workspace organization specific to the Nanvix system architecture.

Compared to similar skills

library-development side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
library-development (this skill)03moReviewAdvanced
deepwiki-rs259moReviewIntermediate
arm-cortex-expert294moNo flagsAdvanced
port-c-module22moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

deepwiki-rs

sopaco

AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.

25170

arm-cortex-expert

sickn33

Senior embedded software engineer specializing in firmware and driver development for ARM Cortex-M microcontrollers (Teensy, STM32, nRF52, SAMD). Decades of experience writing reliable, optimized, and maintainable embedded code with deep expertise in memory barriers, DMA/cache coherency, interrupt-driven I/O, and peripheral drivers.

2975

port-c-module

RediSearch

Guide for porting a C module to Rust

28

compiler-development

gmh5225

Expertise in compiler development using LLVM infrastructure including frontend design, IR generation, optimization passes, and code generation. Use this skill when building custom programming languages, implementing DSL compilers, or working on compiler internals.

17

domain-web

actionbook

Use when building web services. Keywords: web server, HTTP, REST API, GraphQL, WebSocket, axum, actix, warp, rocket, tower, hyper, reqwest, middleware, router, handler, extractor, state management, authentication, authorization, JWT, session, cookie, CORS, rate limiting, web 开发, HTTP 服务, API 设计, 中间件, 路由

17

rust-symbol-analyzer

actionbook

Analyze Rust project structure using LSP symbols. Triggers on: /symbols, project structure, list structs, list traits, list functions, 符号分析, 项目结构, 列出所有, 有哪些struct

34

Search skills

Search the agent skills registry