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.zipInstalls 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.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
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:
| Library | Path | Purpose |
|---|---|---|
arch | src/libs/arch/ | Arch abstractions. |
config | src/libs/config/ | Config constants. |
error | src/libs/error/ | Error types. |
sys | src/libs/sys/ | System types. |
syscall | src/libs/syscall/ | Syscall interface. |
sysapi | src/libs/sysapi/ | System API. |
sysalloc | src/libs/sysalloc/ | Guest allocator. |
syslog | src/libs/syslog/ | Guest logging. |
syslog-macros | src/libs/syslog-macros/ | Log macros. |
nvx | src/libs/nvx/ | High-level API. |
posix | src/libs/posix/ | POSIX layer. |
proc | src/libs/proc/ | Process types. |
type-safe | src/libs/type-safe/ | Type-safe values. |
Utility Libraries (Guest — #![no_std])
| Library | Path | Purpose |
|---|---|---|
bitmap | src/libs/bitmap/ | Bitmap. |
slab | src/libs/slab/ | Slab allocator. |
raw-array | src/libs/raw-array/ | Fixed arrays. |
static_assert | src/libs/static_assert/ | Compile checks. |
elf | src/libs/elf/ | ELF parser. |
libc_stdlib | src/libs/libc_stdlib/ | C stdlib. |
libc_string | src/libs/libc_string/ | C strings. |
no_fail | src/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):
| Library | Path | Purpose |
|---|---|---|
nanvix | src/libs/nanvix/ | Host API. |
nanvix-http | src/libs/nanvix-http/ | HTTP. |
nanvix-terminal | src/libs/nanvix-terminal/ | Terminal. |
hwloc | src/libs/hwloc/ | HW topology. |
profiler | src/libs/profiler/ | Profiling. |
syscomm | src/libs/syscomm/ | Sockets. |
user-vm-api | src/libs/user-vm-api/ | User VM API. |
Build Utilities
| Library | Path | Purpose |
|---|---|---|
build-utils | src/libs/build-utils/ | Build helpers. |
Creating a New Library
-
Create the directory under
src/libs/<name>/. -
Add a
Cargo.tomlwith 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 = [] -
Add the crate to the workspace
memberslist in the rootCargo.toml. -
Add the crate to the workspace
[workspace.dependencies]section. -
Add the library name to the appropriate list in the
Makefile:- Guest:
ALL_GUEST_RUST_LIBS(and optionallyALL_GUEST_RUST_LIBS_TEST_LIST). - Host:
ALL_HOST_RUST_LIBS.
- Guest:
-
Add the copyright header to all source files.
-
Create
src/lib.rswith 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 optionalstdfeature gate. - Use
default-features = falsein 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# Errorssections as applicable. - Unit tests go in
#[cfg(test)]modules;expect()is preferred overunwrap().
When not to use it
- →General Rust development
Prerequisites
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| library-development (this skill) | 0 | 3mo | Review | Advanced |
| deepwiki-rs | 25 | 9mo | Review | Intermediate |
| arm-cortex-expert | 29 | 4mo | No flags | Advanced |
| port-c-module | 2 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by nanvix
View all by nanvix →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.
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.
port-c-module
RediSearch
Guide for porting a C module to Rust
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.
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 设计, 中间件, 路由
rust-symbol-analyzer
actionbook
Analyze Rust project structure using LSP symbols. Triggers on: /symbols, project structure, list structs, list traits, list functions, 符号分析, 项目结构, 列出所有, 有哪些struct