zephyr-netbuf

zephyr-netbuf is a skill for Claude Code, Codex from ksachdeva/zephyr-rtos-ai. It costs 76 tokens per session (1,183 once invoked), scanned A, original, Apache-2.0.

Embedded-system guidance for Zephyr network buffers, the memory blocks used to hold and pass network, Bluetooth, or USB data. It covers simple buffers, reference-counted buffers, pools, and fragmented packets.

In plain words
What is it for?
Use it to define buffer pools, allocate and release buffers, add or remove data, reserve space around packets, and pass fragmented data between components.
Why use it?
It helps prevent buffer-lifecycle, sizing, fragmentation, and memory-management errors while data moves through protocol code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to define buffer pools, allocate and release buffers, add or remove data, reserve space around packets, and pass fragmented data between components.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ksachdeva/zephyr-rtos-ai/zephyr-netbuf
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ksachdeva/zephyr-rtos-ai --skill zephyr-netbuf
Clone the repo
git clone --depth 1 https://github.com/ksachdeva/zephyr-rtos-ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for zephyr-netbuf

README.md
[![agentmods](https://agentmods.dev/badge/skills/ksachdeva/zephyr-rtos-ai/zephyr-netbuf/github.svg)](https://agentmods.dev/skills/ksachdeva/zephyr-rtos-ai/zephyr-netbuf)
Your own site
<a href="https://agentmods.dev/skills/ksachdeva/zephyr-rtos-ai/zephyr-netbuf"><img src="https://agentmods.dev/badge/skills/ksachdeva/zephyr-rtos-ai/zephyr-netbuf/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for zephyr-netbuf

Your own site · 80×15
<a href="https://agentmods.dev/skills/ksachdeva/zephyr-rtos-ai/zephyr-netbuf"><img src="https://agentmods.dev/badge/skills/ksachdeva/zephyr-rtos-ai/zephyr-netbuf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,183 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00076 $0.01183
Opus 5 $0.00038 $0.00592
Sonnet 5 $0.00015 $0.00237
Haiku 4.5 $0.00008 $0.00118

Measured 9d ago against content hash f315fcd3394a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

zephyr-netbuf scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/zephyr-netbuf/SKILL.md · 133 lines

How it starts

The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Zephyr Network Buffers (net_buf)

Overview

This skill provides expert knowledge on Zephyr's net_buf subsystem — a core memory management library used by networking, Bluetooth, and USB stacks. It covers pool creation, buffer lifecycle, data manipulation, and fragmentation patterns.

Key Concepts

Two Buffer Types:

  • net_buf_simple — Lightweight, no reference counting, stack-allocatable. Use for constrained scenarios.
  • net_buf — Full-featured with reference counting, fragmentation, user data. Use for passing through kernel objects (FIFOs).

Buffer Layout:

[__buf start] <-- headroom --> [data] <-- len --> [tailroom] <-- [__buf end]
                                  ^
                               data pointer

Workflow

1. Choose Buffer Type

Scenario Use
Temporary parsing, stack allocation net_buf_simple + NET_BUF_SIMPLE_DEFINE
Pool-based allocation, ref counting net_buf + NET_BUF_POOL_DEFINE
Large/fragmented packets net_buf with fragment chains

2. Pool Definition

For net_buf, define a pool at file scope:

#include <zephyr/net_buf.h>

/* Fixed-size buffers (most common) */
NET_BUF_POOL_DEFINE(my_pool,
    10,    /* count: number of buffers */
    128,   /* size: max data per buffer */
    4,     /* user_data_size: metadata per buffer */
    NULL); /* destroy callback (optional) */

Pool variants: See references/api.md for NET_BUF_POOL_VAR_DEFINE (variable size) and NET_BUF_POOL_HEAP_DEFINE (heap-backed).

3. Allocation & Lifecycle

/* Allocate (blocks until available or timeout) */
struct net_buf *buf = net_buf_alloc(&my_pool, K_FOREVER);

/* Reserve headroom for protocol headers */
net_buf_reserve(buf, HEADER_SIZE);

/* ... use buffer ... */

/* Release (returns to pool when refcount hits 0) */
net_buf_unref(buf);

Reference counting:

  • net_buf_alloc() → refcount = 1
  • net_buf_ref(buf) → increments refcount
  • net_buf_unref(buf) → decrements; frees when 0

Read the full file on GitHub · 133 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 133 lines · 76 tokens per session scan A f315fcd3394a

Subscribe to this mod's changes

zephyr-netbuf is a skill published in the GitHub repository ksachdeva/zephyr-rtos-ai (23 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 76 tokens to every session and 1,183 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

zcfg

Integrate zcfg (Zero Dependency Configuration Utility) into Java applications. Use when adding configuration loading, reading properties files, setting up application configuration, or integrating zcfg into a Java project. Triggers on "zcfg", "add configuration", "load properties", "application configuration with…

AdamBien/airails · 75 tokens

microprofile-server

Architecture and coding rules for long-running Java MicroProfile / Jakarta EE server applications — BCE layering, business components (BC), JAX-RS resources, CDI, JSON-P, testing (unit/integration/system), and Maven project structure. Use when creating, generating, scaffolding, writing, or reviewing code, resources…

AdamBien/airails · 87 tokens

bce

Generic, composable architecture rules for the Boundary-Control-Entity (BCE/ECB) pattern — business components, layer responsibilities, package structure, and cross-component relationships. Technology-neutral; meant to be composed with language- or framework-specific skills (e.g. microprofile-server, web-components…

AdamBien/airails · 151 tokens

data-structures

Implements custom JavaScript data structures: queues, deques, stacks, linked lists, cons lists, circular buffers, unrolled lists, tries, heaps, graphs, LRU caches, CRDTs, pools, structs. Use when building or choosing non-native collections, optimizing enqueue/dequeue, designing persistent lists, or when the user asks…

metarhia/metaskills · 84 tokens

developing-genkit-tooling

Best practices for authoring Genkit tooling, including CLI commands and MCP server tools. Covers naming conventions, architectural patterns, and consistency guidelines.

genkit-ai/genkit · 35 tokens

sandbox-next

Build or maintain Cloudflare Sandbox apps on @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-migrate-to-next when porting a stable app.

cloudflare/skills · 39 tokens