zephyr-json

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

A guide to Zephyr's descriptor-based JSON library for converting C structures to JSON text and reading JSON text back into C structures.

In plain words
What is it for?
Use it for sensor data, MQTT, HTTP, or CoAP messages, and for JSON payloads in embedded REST APIs.
Why use it?
It provides a defined mapping between C fields and JSON keys without requiring dynamic memory allocation, which suits embedded devices.

Skill for Claude CodeCodex

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

Good fit Use it for sensor data, MQTT, HTTP, or CoAP messages, and for JSON payloads in embedded REST APIs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ksachdeva/zephyr-rtos-ai/zephyr-json
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-json
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-json

README.md
[![agentmods](https://agentmods.dev/badge/skills/ksachdeva/zephyr-rtos-ai/zephyr-json/github.svg)](https://agentmods.dev/skills/ksachdeva/zephyr-rtos-ai/zephyr-json)
Your own site
<a href="https://agentmods.dev/skills/ksachdeva/zephyr-rtos-ai/zephyr-json"><img src="https://agentmods.dev/badge/skills/ksachdeva/zephyr-rtos-ai/zephyr-json/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-json

Your own site · 80×15
<a href="https://agentmods.dev/skills/ksachdeva/zephyr-rtos-ai/zephyr-json"><img src="https://agentmods.dev/badge/skills/ksachdeva/zephyr-rtos-ai/zephyr-json.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,535 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.00068 $0.01535
Opus 5.5 $0.00027 $0.00614
Sonnet 5.5 $0.00014 $0.00307
Haiku 4.5 $0.00007 $0.00153

Measured 1mo ago against content hash c66f48e13555, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

zephyr-json 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 1mo 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-json/SKILL.md · 182 lines

How it starts

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

Zephyr JSON

Zephyr's JSON library provides compile-time descriptor-based serialization without dynamic memory allocation. It maps C struct fields to JSON keys using static descriptors.

Quick Start

#include <zephyr/data/json.h>

// 1. Define your data structure
struct sensor_data {
    const char *device_id;
    int32_t temperature;
    bool active;
};

// 2. Create descriptors mapping struct fields to JSON keys
static const struct json_obj_descr sensor_descr[] = {
    JSON_OBJ_DESCR_PRIM(struct sensor_data, device_id, JSON_TOK_STRING),
    JSON_OBJ_DESCR_PRIM(struct sensor_data, temperature, JSON_TOK_NUMBER),
    JSON_OBJ_DESCR_PRIM(struct sensor_data, active, JSON_TOK_TRUE),
};

// 3. Encode to JSON
struct sensor_data data = {.device_id = "sensor-01", .temperature = 25, .active = true};
char buffer[128];
int ret = json_obj_encode_buf(sensor_descr, ARRAY_SIZE(sensor_descr), &data, buffer, sizeof(buffer));
// buffer: {"device_id":"sensor-01","temperature":25,"active":true}

// 4. Decode from JSON
char json[] = "{\"device_id\":\"sensor-02\",\"temperature\":30,\"active\":false}";
struct sensor_data parsed;
int64_t result = json_obj_parse(json, strlen(json), sensor_descr, ARRAY_SIZE(sensor_descr), &parsed);

Kconfig

# Required
CONFIG_JSON_LIBRARY=y

# Optional: Enable float/double support (requires full libc)
CONFIG_JSON_LIBRARY_FP_SUPPORT=y

Token Types Quick Reference

Token Type C Type JSON Type
JSON_TOK_STRING const char * "string"
JSON_TOK_STRING_BUF char[] "string" (copies to buffer)
JSON_TOK_NUMBER int32_t 42
JSON_TOK_INT int8_t, int16_t -128
JSON_TOK_UINT uint8_t, uint16_t, uint32_t 255
JSON_TOK_INT64 int64_t 9223372036854775807
JSON_TOK_UINT64 uint64_t 18446744073709551615
JSON_TOK_TRUE / JSON_TOK_FALSE bool true/false
JSON_TOK_FLOAT_FP float 3.14 (requires FP_SUPPORT)
JSON_TOK_DOUBLE_FP double 3.14159 (requires FP_SUPPORT)
JSON_TOK_OBJECT_START nested struct {...}
JSON_TOK_ARRAY_START array [...]

Read the full file on GitHub · 182 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. 1mo ago First seen · 182 lines · 68 tokens per session scan A c66f48e13555

Subscribe to this mod's changes

zephyr-json is a skill published in the GitHub repository ksachdeva/zephyr-rtos-ai (23 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 68 tokens to every session and 1,535 once invoked, about $0.0003 per session on Opus 5.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

loom-cpp

C++ language expertise for idiomatic, production-quality code.

cosmix/loom · 16 tokens

loom-c

C language expertise (C11/C17/C23) for memory-safe, portable, production-quality systems code.

cosmix/loom · 25 tokens

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

zcl

Add colored terminal output to Java applications using zcl (Zero-dependency Colour Logger). Use when adding colored console output, terminal logging with colors, ANSI color support, or integrating zcl into a Java project. Triggers on "zcl", "colored output", "colored logging", "terminal colors", "ANSI colors"…

AdamBien/airails · 85 tokens

zjson

Use JSON in zero-dependency Java by copying the org.json source (JSONObject, JSONArray, JSONTokener) directly into the project instead of adding a Maven/Gradle dependency. Use when adding JSON parsing or generation to a Java CLI script, zb project, or any project that must stay dependency-free. Triggers on "JSON in…

AdamBien/airails · 109 tokens

java-cli-app

Create and maintain multi-file Java 25 CLI applications packaged as executable JARs with zb (Zero Dependencies Builder). Use when asked to create a Java CLI application, a CLI project with multiple source files, or an executable JAR. Triggers on "Java CLI app", "CLI application", "multi-file Java", "executable JAR"…

AdamBien/airails · 106 tokens