agentsclimarketplace

Embedded data parsing libs

Skill easyzoom/aix-skills/skills/embedded-data-parsing-libs

Reusable Agent Skills for embedded systems, MCU debugging, firmware workflows, and AI automation. (嵌入式、MCU 调试、固件流程与 AI 自动化的可复用 Agent Skills 集合)。

Install
npx -y skills add easyzoom/aix-skills --skill embedded-data-parsing-libs

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 22 stars22 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when integrating, porting, configuring, or debugging embedded C data parsers such as cJSON, jsmn, or inih on MCU projects

SKILL.md

2.9 KB, as published. Nobody here has run it

Embedded Data Parsing Libs

Overview

Use this skill for small embedded data parsers where the main risks are memory allocation, input bounds, encoding assumptions, recursion, and callback handling. Cover cJSON, jsmn, and inih without copying their full APIs.

When To Use

Use this skill when:

  • The user wants to parse JSON or INI on an MCU.
  • The task mentions cJSON, jsmn, inih, config files, telemetry JSON, command payloads, or settings parsing.
  • The issue involves parse failure, memory leak, heap exhaustion, malformed input, callback mapping, or stack/recursion limits.

Do not use this skill for binary protocols or large streaming parsers outside these small libraries.

First Questions

Ask for:

  • Parser library: cJSON, jsmn, inih, or another small C parser.
  • Input source and maximum input size.
  • Runtime: bare metal, RTOS, Linux, bootloader, or shell command.
  • Whether dynamic allocation is allowed.
  • Expected schema and how malformed input should behave.
  • Current error, sample input, and memory budget.

Library Checks

cJSON

  • Decide whether heap allocation is acceptable.
  • Provide custom malloc/free hooks if the project uses a custom allocator.
  • Always delete parsed trees after use.
  • Bound input size before parsing.
  • Validate type before reading values.

jsmn

  • Allocate enough tokens for the expected JSON shape.
  • Handle JSMN_ERROR_NOMEM, JSMN_ERROR_INVAL, and JSMN_ERROR_PART.
  • Remember that tokens reference the original input buffer.
  • Validate string lengths and value types manually.

inih

  • Implement the handler callback with strict section/key matching.
  • Decide whether duplicate keys overwrite, error, or merge.
  • Bound line length and input source.
  • Validate converted numeric values and ranges.

Common Failures

  • Heap fragmentation from repeated cJSON_Parse without hooks or cleanup.
  • Token buffer too small for jsmn.
  • Using JSON token pointers after the input buffer is freed.
  • Accepting partial config and booting with unsafe defaults.
  • Silent typo in INI key because handler ignores unknown fields.

Verification

Before claiming parser integration works:

  • State parser, allocation policy, max input size, and schema assumptions.
  • Test valid input, missing fields, wrong types, malformed input, and oversize input.
  • Confirm memory is released or static buffers are bounded.
  • Confirm unknown fields and duplicate keys behavior.

Example

User:

想用 cJSON 解析串口发来的配置。

Agent:

  1. Asks for max payload size, schema, allocator policy, and malformed-input behavior.
  2. Uses custom hooks if needed and validates each field type.
  3. Tests good JSON, missing keys, bad types, and oversized payloads.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.