Agent skill

Meojson

by MaaEnd in MaaEnd/MaaEnd

Guide for using the meojson C++ JSON library in MaaEnd cpp-algo.

AGPL-3.0Auto-check passedMobile

Install Meojson

skills CLI
$ npx skills add MaaEnd/MaaEnd --skill meojson -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install MaaEnd/MaaEnd meojson --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/MaaEnd/MaaEnd.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/meojson .claude/skills/meojson && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
meojson
GitHub stars
4k
Token cost
~2.1k tokens
SKILL.md length
310 words
Files
2
Skills in repo
14
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Guide for using the meojson C++ JSON library in MaaEnd cpp-algo.

  • Works in 7 steps: json::parse returns std::optional —… → as_*() / as() throws on type mismatch —… → 禁止 .value_or(...).as() — 静默吞错误 +… → …
  • Writing code that involves JSON parsing
  • SKILL.md covers Core Types, Parsing, Constructing Values and Reading Values, plus 7 more sections
  • Needs MEO_KEY

What it does

Meojson is an agent skill from MaaEnd/MaaEnd. Guide for using the meojson C++ JSON library in MaaEnd cpp-algo. Use when writing code that involves JSON parsing, serialization, struct jsonization (MEOJSONIZATION), json::value manipulation, ext::jsonization custom type support, or custom recognition param parsing in agent/cpp-algo/.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `reference.md`).

It sits in Mobile. It works with C++. The repository describes itself as: MaaEnd 终末地小助手:基于视觉 AI 的「明日方舟:终末地」自动化工具. The licence is AGPL-3.0.

When your agent uses it

  • Writing code that involves JSON parsing
  • Struct jsonization (MEOJSONIZATION)
  • Json::value manipulation
  • Ext::jsonization custom type support

Example prompts

  • “/meojson”

Requirements

  • A credential in MEO_KEY

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. json::parse returns std::optional — always check before use,失败路径必须 LogError + 早期 return
  2. as_*() / as() throws on type mismatch — 用 find() 或 is_*() 前置检查;对 struct 用 from_json() 检查返回值
  3. 禁止 .value_or(...).as() — 静默吞错误 + 可能抛异常,应拆开检查(见上方推荐模式)
  4. char is deleted — use std::string or int
  5. ext::jsonization lives in json::ext namespace
  6. MEO_OPT applies to the next field only — each optional field needs its own MEO_OPT
  7. MEO_KEY goes after MEO_OPT — order is MEO_OPT MEO_KEY("key") field

What it can do on your machine

Read from SKILL.md and the folder at commit f47207b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are cpp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • MEO_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Meojson loads about 2.1k tokens when it runs. Until then it costs about 74 tokens; SKILL.md has 310 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~74
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from MaaEnd/MaaEnd at commit f47207b, republished under its AGPL-3.0 licence (© MaaEnd). 310 words, ~2,145 tokens.

Download SKILL.mdSave it as .claude/skills/meojson/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
meojson
description
Guide for using the meojson C++ JSON library in MaaEnd cpp-algo. Use when writing code that involves JSON parsing, serialization, struct jsonization (MEO_JSONIZATION), json::value manipulation, ext::jsonization custom type support, or custom recognition param parsing in agent/cpp-algo/.

meojson in MaaEnd cpp-algo

meojson is a header-only C++ JSON library, provided via MaaFramework deps. Include via <meojson/json.hpp>.

Core Types

TypeDescription
json::valueUniversal JSON value (null/bool/number/string/array/object)
json::arrayJSON array, wraps std::vector<json::value>
json::objectJSON object, wraps std::map<std::string, json::value>

Parsing

cpp
#include <meojson/json.hpp>

// From string — returns std::optional<json::value>
auto opt = json::parse(str);
if (!opt) { /* parse failed */ }

// From file
auto opt = json::open("/path/to/file.json");

// JSONC (with comments)
auto opt = json::parsec(str);

// JSONC file: check UTF-8 BOM and allow comments
auto opt = json::open("/path/to/file.json", true, true);

json::open(path, check_bom, with_comments) 的两个布尔参数分别控制 UTF-8 BOM 检查和注释解析;默认调用 json::open(path) 是严格 JSON,既不检查 BOM,也不接受注释。

在 MaaEnd cpp-algo 中读取仓库维护、允许注释的 JSON/JSONC 文件时,优先复用公共能力:

cpp
#include "Common/JsoncFile.h"

auto opt = common::OpenJsoncFile(path);

运行时接口参数(如 custom_recognition_param)、识别结果 detail 和生成报告仍保持严格 JSON,除非对应契约明确允许 JSONC。不要为解决仓库配置文件的注释问题而放宽运行时输入边界。

cpp-algo 推荐模式 — 安全解析自定义识别参数:

cpp
template <typename T>
T ParseCustomRecognitionParam(const char* custom_recognition_param)
{
    if (!custom_recognition_param || std::strlen(custom_recognition_param) == 0) {
        return T {};
    }
    auto opt = json::parse(custom_recognition_param);
    if (!opt) {
        LogError << "failed to parse custom_recognition_param" << VAR(custom_recognition_param);
        return T {};
    }
    T result {};
    if (!result.from_json(*opt)) {
        LogError << "failed to deserialize param" << VAR(custom_recognition_param);
        return T {};
    }
    return result;
}

反模式:json::parse(str).value_or(json::object {}).as<T>() —— value_or 静默吞掉 parse 失败;空 object 调 as<T>() 当 T 有 required 字段时会抛异常。

Constructing Values

cpp
json::value v1 = 42;
json::value v2 = "hello";
json::value v3 = true;
json::value v4 = nullptr;    // null

json::array arr { 1, 2, "three" };
json::object obj {
    { "key1", "value1" },
    { "key2", 42 },
};

// From STL containers (implicit conversion)
std::vector<int> vec = {1, 2, 3};
json::value v5 = vec;                              // → JSON array

std::map<std::string, int> m = {{"a", 1}};
json::value v6 = m;                                // → JSON object

Reading Values

Type Checking
cpp
v.is_null() / v.is_boolean() / v.is_number() / v.is_string()
v.is_array() / v.is_object()
v.is<int>()     // check if convertible to type
Direct Access (throws on type mismatch)
cpp
v.as_string()       // → std::string
v.as_string_view()  // → std::string_view (no copy)
v.as_integer() / v.as_double() / v.as_boolean()
v.as_array()        // → const json::array&
v.as_object()       // → const json::object&
v.as<T>()           // → T (explicit conversion)
Safe Access
cpp
// find() returns std::optional<T>
auto opt = v.find<std::string>("key");
if (opt) { std::string s = *opt; }

// get() with default value — supports chained keys
std::string s = v.get("key", "default_value");
int n = v.get("a", "b", 0);  // v["a"]["b"], default 0

// exists() / contains()
if (v.exists("key")) { ... }
Subscript & Iteration
cpp
const json::value& v2 = v["key"];      // object access
v["key"] = "new_value";                // mutable (creates key if missing)

for (const auto& item : v.as_array()) { ... }
for (const auto& [key, val] : v.as_object()) { ... }

Serialization

cpp
v.dumps()               // compact string
v.dumps(4)              // pretty print with indent=4
v.format()              // same as dumps(4)

cpp-algo 常见模式 — 写回 JSON detail:

cpp
template <typename T>
void WriteJsonDetail(MaaStringBuffer* out_detail, const T& payload)
{
    if (out_detail == nullptr) return;
    const std::string json_text = json::value(payload).dumps();
    MaaStringBufferSet(out_detail, json_text.c_str());
}

Object Merge Operator

cpp
json::value merged = obj1 | obj2;   // right side wins on conflict
obj1 |= obj2;                       // in-place merge

MEO_JSONIZATION — Struct ↔ JSON

MEO_JSONIZATION(fields...) generates to_json(), check_json(), from_json() member functions.

Basic Usage
cpp
struct LocateOutput {
    int status = 0;
    std::string message;
    std::string mapName;
    int x = 0;
    int y = 0;

    MEO_JSONIZATION(status, message, MEO_OPT mapName, MEO_OPT x, MEO_OPT y)
};

// Serialize
json::value j = data;               // implicit via to_json()

// Deserialize — 安全方式:用 from_json() 检查返回值
MyData data {};
if (!data.from_json(j)) {
    LogError << "failed to deserialize" << VAR(j);
}

// as<T>() 在类型不匹配 / required 字段缺失时会抛异常,仅在确定数据合法时使用
MyData data2 = j.as<MyData>();
MEO_OPT — Optional Fields

By default all fields are required in from_json(). Prefix with MEO_OPT to make optional (keeps default if missing):

cpp
struct LocateOptions {
    double loc_threshold = 0.55;
    double yolo_threshold = 0.70;
    bool force_global_search = false;

    MEO_JSONIZATION(
        MEO_OPT loc_threshold,
        MEO_OPT yolo_threshold,
        MEO_OPT force_global_search)
};
MEO_KEY — Override JSON Key Name
cpp
struct JTemplateMatch {
    std::vector<std::string> template_;   // "template" is C++ keyword
    MEO_TOJSON(MEO_KEY("template") template_);
};

// Combine with MEO_OPT:
MEO_JSONIZATION(MEO_OPT MEO_KEY("default") default_);
Sub-Macros
MacroGenerates
MEO_TOJSON(...)to_json() only
MEO_FROMJSON(...)from_json() only
MEO_CHECKJSON(...)check_json() only
MEO_JSONIZATION(...)All three
Supported Field Types
  • Primitives: int, double, bool, std::string
  • STL containers: std::vector<T>, std::map<std::string, T>, std::array<T,N>
  • Nullable: std::optional<T>, std::shared_ptr<T>
  • Tuple-like: std::pair<A,B>, std::tuple<...>
  • Variant: std::variant<Ts...>
  • Nested structs with MEO_JSONIZATION / to_json()
  • json::value, json::object, json::array directly

ext::jsonization — Custom Type Support

For types you don't own, specialize json::ext::jsonization<T>:

cpp
namespace json::ext {
template <>
class jsonization<cv::Rect> {
public:
    json::value to_json(const cv::Rect& rect) const {
        return json::array { rect.x, rect.y, rect.width, rect.height };
    }
    bool check_json(const json::value& json) const {
        return json.is<std::vector<int>>() && json.as_array().size() == 4;
    }
    bool from_json(const json::value& json, cv::Rect& rect) const {
        auto arr = json.as<std::vector<int>>();
        rect = cv::Rect(arr[0], arr[1], arr[2], arr[3]);
        return true;
    }
};
}

MaaUtils 已提供的特化(通过 <MaaUtils/JsonExt.hpp> 间接可用):

  • cv::Point ↔ [x, y]、cv::Rect ↔ [x, y, w, h]、cv::Size ↔ [w, h]
  • std::filesystem::path ↔ UTF-8 string
  • std::chrono::milliseconds → "123ms" (to_json only)
  • Fallback: any type with operator<< → string (to_json only)

Enum Reflection

cpp
enum class MyEnum {
    A, B, C,
    MEOJSON_ENUM_RANGE(A, C)
};

json::value j = MyEnum::B;    // → "B"
MyEnum e = j.as<MyEnum>();    // → MyEnum::B

Common Pitfalls

  1. json::parse returns std::optional — always check before use,失败路径必须 LogError + 早期 return
  2. as_*() / as<T>() throws on type mismatch — 用 find() 或 is_*() 前置检查;对 struct 用 from_json() 检查返回值
  3. 禁止 .value_or(...).as<T>() — 静默吞错误 + 可能抛异常,应拆开检查(见上方推荐模式)
  4. char is deleted — use std::string or int
  5. ext::jsonization lives in json::ext namespace
  6. MEO_OPT applies to the next field only — each optional field needs its own MEO_OPT
  7. MEO_KEY goes after MEO_OPT — order is MEO_OPT MEO_KEY("key") field

Quick Reference

For detailed API signatures, see reference.md.

© MaaEnd, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/meojson of MaaEnd/MaaEnd.

  • SKILL.md
  • reference.md

Open the folder on GitHubat commit f47207b

Compare with similar skills

Meojson next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Meojson compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Meojson this skillMaaEnd/MaaEnd4k—~2.1kAutomated safety check: PassAGPL-3.0
Cppsickn33/agentic-awesome-skills47k1 repos~1.6kAutomated safety check: PassMIT
Fory Version Bumpapache/fory4.6k—~1.1kAutomated safety check: PassApache-2.0
Fory Performance Optimizationapache/fory4.6k—~2.2kAutomated safety check: PassApache-2.0
Crossbindcrossbind/crossbind148—~1.1kAutomated safety check: PassMIT
Audit Xcode Security Settingssuperagents-lab/xcode27-skills338—~4.6kAutomated safety check: PassNone

Similar skills

  • Cpp

    sickn33/agentic-awesome-skills

    Language-specific super-code guidelines for cpp. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 1 repo~1.6k tokens
    MobileAuto-check passed
  • Bump Apache Fory release or post-release development versions across Java, Kotlin, Scala, Python, Rust, Go, C++, C, Dart, JavaScript, Swift, integration tests, examples, and source docs.

    4.6k GitHub stars~1.1k tokensUpdated yesterday
    MobileAuto-check passed
  • Run profile-driven bottleneck optimization across Apache Fory implementations (Java, C++, Python/Cython, Go, Rust, Swift, C, JavaScript/TypeScript, Dart, Kotlin, Scala).

    4.6k GitHub stars~2.2k tokensUpdated yesterday
    MobileAuto-check passed
  • Crossbind

    crossbind/crossbind

    A skill your agent uses when a user wants to call C++ or Rust from JavaScript or TypeScript; add a native library such as GDAL, SQLite, OpenSSL, GEOS or PROJ to a browser, Node.js, Cloudflare Worker…

    148 GitHub stars~1.1k tokensUpdated today
    MobileAuto-check passed
  • Audit Xcode Security Settings

    superagents-lab/xcode27-skills

    Audit and enable security-oriented Xcode build settings. An agent skill from superagents-lab/xcode27-skills.

    338 GitHub stars~4.6k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • Build Nitro Modules

    margelo/react-native-skills

    Builds and designs React Native Nitro Modules with Nitrogen, HybridObject TypeScript specs, Nitro View components, generated native implementations, zero-copy and native-state APIs, Swift/Kotlin/C++…

    175 GitHub stars~9.9k tokensUpdated 1 mo ago
    MobileAuto-check passed

More from MaaEnd/MaaEnd

All 14 skills in this repo
  • Maa Logging

    MaaEnd/MaaEnd

    MaaFramework 日志宏用法指南,适用于 MaaEnd cpp-algo。Use when writing logging code, using LogInfo/LogError/LogWarn/LogDebug/LogTrace, outputting containers or custom types to logs, or when the user asks about…

    4k GitHub stars~807 tokensUpdated yesterday
    Auto-check passed
  • Maaend Test Image

    MaaEnd/MaaEnd

    为 MaaEnd 添加、导入或补充节点识别测试截图,并按仓库约定脱敏图片、放入 tests/MaaEndTestset、维护 tests//test.json 和运行 pnpm check/pnpm test 验证。用户提到“添加测试图片/截图”“把截图加入 ADB 或 Win32 测试集”“给节点补正例或反例”“更新 hits/box”“UID…

    4k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • 新增或改写 MaaEnd 的 AutoCollect 自动采集路线说明。默认包含路线文件创建、AutoCollect 主入口接线、任务选项注册和多语言文案补充。适用于“参考现有 AutoCollect 路线新建一条采集线”“给定传送点与路径点位生成 AutoCollectRouteX.json 并注册到任务中”“用户已经写好路线文件,只需要补注册接口”等场景。注意:本 skill 仅适用于参考…

    4k GitHub stars~3.2k tokensUpdated yesterday
    Auto-check passed
  • 仅分析 AutoStockStapleMain 的 MaaEnd 日志。用于还原该任务实际购买了什么、购买所对应的证据、逐步剩余账单(券/账单)数值时间线,以及在 pipeline 或 go-service 中应当加日志/埋点的位置。适用于用户询问 AutoStockStapleMain、AutoStockStaple、武陵/四号谷地的稳定需求物资购买,或该任务内账单数值变化原因等场景。

    4k GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed
  • Cpp Algo Style

    MaaEnd/MaaEnd

    MaaEnd cpp-algo C++ 编码风格与工程规范指南。参考 MaaFramework 的优秀实践,规范命名、头文件、公共工具、错误处理、日志、CMake 等方面。在编写、修改或审查 agent/cpp-algo/ 下的 C++ 代码时使用。

    4k GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • 分析 MaaEnd CreditShoppingMain 的日志。用于还原信用购物任务中实际购买了什么商品、每件商品的折扣力度、是否触发过刷新(或刷新次数已用尽)、稳健刷新是否触发、以及信用点的消耗状况。货架槽位必须以日志中的 CreditIcon(TemplateMatcher)为锚,有无 BuyFirstOCR/Priority2OCR…

    4k GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Meojson

What does Meojson do?

Guide for using the meojson C++ JSON library in MaaEnd cpp-algo. Meojson is an agent skill from MaaEnd/MaaEnd. Guide for using the meojson C++ JSON library in MaaEnd cpp-algo.

When should I use Meojson?

Meojson fits situations like: writing code that involves JSON parsing; struct jsonization (MEOJSONIZATION); json::value manipulation; ext::jsonization custom type support.

How do I install Meojson in Claude Code?

Run `npx skills add MaaEnd/MaaEnd --skill meojson -a claude-code`. Or copy the skill folder (.agents/skills/meojson in MaaEnd/MaaEnd) into .claude/skills/meojson in your project. Claude Code loads it when a task matches its description.

How do I install Meojson in Codex?

Run `npx skills add MaaEnd/MaaEnd --skill meojson -a codex`. Or copy the skill folder (.agents/skills/meojson in MaaEnd/MaaEnd) into .agents/skills/meojson in your project. Codex loads it when a task matches its description.

Can I use Meojson in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add MaaEnd/MaaEnd --skill meojson -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/meojson, .gemini/skills/meojson, .github/skills/meojson and .opencode/skills/meojson in your project.

What does Meojson need to run?

Going by SKILL.md and its folder, Meojson needs credentials named MEO_KEY. Our summary lists: A credential in MEO_KEY.

Does Meojson access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Meojson safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Meojson use?

Meojson is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Meojson use?

About 2.1k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Meojson?

Skills that share tags, products or a category with Meojson: Cpp (sickn33/agentic-awesome-skills, 47k stars), Fory Version Bump (apache/fory, 4.6k stars), Fory Performance Optimization (apache/fory, 4.6k stars) and Crossbind (crossbind/crossbind, 148 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Meojson?

MaaEnd (a GitHub organization) maintains it in MaaEnd/MaaEnd, which has 3,991 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 7, 2026.

Source: MaaEnd/MaaEnd on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.