Agent skill

Maa Logging

by 1204244136 in 1204244136/MDA

MaaFramework C++ 日志宏用法指南。用于写 C++ MaaFramework 扩展、Custom 组件或工具代码时使用 LogInfo/LogError/LogWarn/LogDebug/LogTrace、VAR、容器输出和自定义类型日志。

AGPL-3.0Auto-check passed

Install Maa Logging

skills CLI
$ npx skills add 1204244136/MDA --skill maa-logging -a claude-code

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

GitHub CLI
$ gh skill install 1204244136/MDA maa-logging --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/1204244136/MDA.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/maa-logging .claude/skills/maa-logging && 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
maa-logging
GitHub stars
119
Token cost
~790 tokens
SKILL.md length
124 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
AGPL-3.0

At a glance

MaaFramework C++ 日志宏用法指南。用于写 C++ MaaFramework 扩展、Custom 组件或工具代码时使用 LogInfo/LogError/LogWarn/LogDebug/LogTrace、VAR、容器输出和自定义类型日志。

  • Works in 5 steps: 可构造 json::value → dumps() 输出。 → 可构造 json::array → dumps() 输出。 → 可构造 json::object → dumps() 输出。 → …
  • SKILL.md covers 可用宏, 核心原则:不要手动拼日志字符串, 典型用法 and 多变量输出, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Maa Logging is an agent skill from 1204244136/MDA. MaaFramework C++ 日志宏用法指南。用于写 C++ MaaFramework 扩展、Custom 组件或工具代码时使用 LogInfo/LogError/LogWarn/LogDebug/LogTrace、VAR、容器输出和自定义类型日志。

Its SKILL.md is about 790 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with C++. The repository describes itself as: Nikke小助手 | Assistant For Goddess of Victory: Nikke. The licence is AGPL-3.0.

Example prompts

  • “/maa-logging”

Workflow steps

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

  1. 可构造 json::value → dumps() 输出。
  2. 可构造 json::array → dumps() 输出。
  3. 可构造 json::object → dumps() 输出。
  4. 有 operator<< → 直接流输出。
  5. 以上都不满足 → 编译期报错。

What it can do on your machine

Read from SKILL.md and the folder at commit 9fb9b48. 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 no API keys, tokens, secrets or passwords.

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

Context cost

Maa Logging loads about 790 tokens when it runs. Until then it costs about 35 tokens; SKILL.md has 124 words of instructions outside code blocks.

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

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 1204244136/MDA at commit 9fb9b48, republished under its AGPL-3.0 licence (© 1204244136). 124 words, ~790 tokens.

Download SKILL.mdSave it as .claude/skills/maa-logging/SKILL.md (or your agent's skills folder).
name
maa-logging
description
MaaFramework C++ 日志宏用法指南。用于写 C++ MaaFramework 扩展、Custom 组件或工具代码时使用 LogInfo/LogError/LogWarn/LogDebug/LogTrace、VAR、容器输出和自定义类型日志。

MaaFramework C++ 日志宏用法

头文件:<MaaUtils/Logger.h>

可用宏

宏级别 / 用途
LogFatal致命错误
LogError不可恢复或当前操作失败的错误
LogWarn可恢复异常、环境风险、降级行为
LogInfo关键状态、任务阶段、初始化结果
LogDebug调试信息、中间结果
LogTrace高频或详细数据
LogFunc函数作用域 enter/leave 和耗时
VAR(x)格式化为 [x=value]
VAR_VOIDP(x)将指针转为 void* 后输出

核心原则:不要手动拼日志字符串

使用 << 流式输出,各片段自动分隔:

cpp
LogInfo << "matched" << VAR(zone_id) << VAR(x) << VAR(y) << VAR(score);
LogError << "locator init failed";

避免:

cpp
LogInfo << "position: " + std::to_string(x) + ", " + std::to_string(y);
LogInfo << std::format("position: ({}, {})", x, y);

std::format 可用于一般字符串构建,但日志中优先直接输出字段。

典型用法

cpp
#include <MaaUtils/Logger.h>

MaaBool MyRecognitionRun(MaaContext* context, MaaTaskId task_id, const char* node_name)
{
    LogInfo << VAR(context) << VAR(task_id) << VAR(node_name);

    if (context == nullptr) {
        LogError << "context is null";
        return MAA_FALSE;
    }

    LogDebug << "recognition input prepared" << VAR(task_id);
    return MAA_TRUE;
}

多变量输出

cpp
LogInfo << "phase transition" << VAR(from_phase) << VAR(to_phase) << VAR(reason);
LogDebug << "match result" << VAR(score) << VAR(x) << VAR(y) << VAR(width) << VAR(height);

容器直接输出

vector、set、map<string, T> 等 STL 容器可以直接 <<,会自动序列化为 JSON:

cpp
std::vector<std::string> names = { "a", "b", "c" };
LogInfo << "names" << names;

std::map<std::string, int> config;
LogInfo << "config" << config;

不需要手写循环打印容器内容。

自定义类型输出

给结构体加 MEO_TOJSON(...) 或 MEO_JSONIZATION(...),即可直接输出:

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

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

LogInfo << VAR(output);

容器嵌套也可以工作:

cpp
std::vector<LocateOutput> results;
LogInfo << VAR(results);

日志级别建议

场景级别
初始化成功/失败、关键状态变更LogInfo
任务阶段切换、最终识别结果LogInfo
中间分数、候选数量、调试变量LogDebug
完整矩阵、向量、逐帧详细数据LogTrace
可恢复异常、环境风险LogWarn
当前操作无法继续LogError
进程级不可恢复错误LogFatal

高频日志约束

  • 每帧推理、循环匹配、滚动扫描中的大量数据不要用 LogInfo。
  • 详细数组、完整 softmax、候选列表优先用 LogTrace。
  • 用户需要定位问题的关键结果用 LogInfo 或 LogDebug。

原理简述

LogStream::stream 通常按优先级尝试:

  1. 可构造 json::value → dumps() 输出。
  2. 可构造 json::array → dumps() 输出。
  3. 可构造 json::object → dumps() 输出。
  4. 有 operator<< → 直接流输出。
  5. 以上都不满足 → 编译期报错。

如果遇到 “Unsupported type”,给类型加 MEO_TOJSON、MEO_JSONIZATION,或特化 json::ext::jsonization<T>。

审查清单

  • 日志没有手动拼接多个字段。
  • 关键上下文使用 VAR(x) 输出。
  • 高频详细数据不使用 LogInfo。
  • 错误路径有 LogError 或合理级别日志。
  • 自定义类型日志支持 JSON 化或流输出。

© 1204244136, 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

Just SKILL.md in .claude/skills/maa-logging of 1204244136/MDA.

Open the folder on GitHubat commit 9fb9b48

Compare with similar skills

Maa Logging 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.

Maa Logging compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Maa Logging this skill1204244136/MDA119—~790Automated safety check: PassAGPL-3.0
Paddle BuildPaddlePaddle/Paddle24k—~1kAutomated safety check: PassApache-2.0
Fory Releaseapache/fory4.6k—~2.9kAutomated safety check: PassApache-2.0
ONNX Runtime Shape Inference Safety Auditmicrosoft/onnxruntime22k—~3.3kAutomated safety check: PassMIT
Code Audit3stoneBrother/code-audit8931 repos~2.7kAutomated safety check: PassNone
Qt C++ Code Reviewx-tools-author/x-tools1.1k2 repos~4.3kAutomated safety check: PassBSD-3-Clause

Similar skills

  • Paddle Build

    PaddlePaddle/Paddle

    A skill your agent uses when needing to compile, rebuild, or install Paddle from source after code changes.

    24k GitHub stars~1k tokensUpdated 9 days ago
    AI & LLM EngineeringAuto-check passed
  • Fory Release

    apache/fory

    Prepare an Apache Fory release candidate from a clean release branch, including the version bump, RC tag, JVM staging, ASF source artifacts, SVN upload, and vote email.

    4.6k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Official

    Finds and fixes out-of-range output writes in ONNX Runtime operator shape-inference functions where a getNumOutputs guard admits too few outputs.

    22k GitHub stars~3.3k tokensUpdated yesterday
    SecurityAuto-check passed
  • Code Audit

    3stoneBrother/code-audit

    Professional code security audit skill covering 55+ vulnerability types.

    893 GitHub starsUsed in 1 repo~2.7k tokens
    SecurityAuto-check passed
  • Qt C++ Code Review

    x-tools-author/x-tools

    Read-only review of Qt6 C++ code that combines a deterministic lint script with six parallel analysis agents and reports only high-confidence issues.

    1.1k GitHub starsUsed in 2 repos~4.3k tokens
    DevelopmentAuto-check passed
  • Translation

    doxygen/doxygen

    Keeps all Doxygen and Doxywizard translations up to date across three mechanisms: translator C++ classes (src/translatorxx.h), Qt .ts locale files for the Doxywizard GUI (addon/doxywizard/i18n/)…

    6.6k GitHub stars~5.2k tokensUpdated 8 days ago
    Writing & ContentAuto-check passed

More from 1204244136/MDA

All 9 skills in this repo
  • Generate Pi Task

    1204244136/MDA

    根据 MaaFramework Pipeline 定义生成或更新 Project Interface 任务 JSON。用于创建、编辑或扩展 assets/tasks/ 下的任务文件,将 Pipeline 节点映射为用户可配置选项(switch/select/checkbox/input)并绑定 pipelineoverride。

    119 GitHub stars~1k tokensUpdated 3 days ago
    Auto-check passed
  • Dmp Analysis

    1204244136/MDA

    分析 Windows 崩溃转储文件(.dmp),诊断 MaaFramework / MXU 项目及其依赖项的崩溃。用于 issue 日志包或附件中发现 .dmp 文件,或用户要求分析 DMP / 崩溃转储时。

    119 GitHub stars~1.3k tokensUpdated 3 days ago
    Auto-check passed
  • Go Service Guide

    1204244136/MDA

    MaaFramework Go Agent / go-service 编写指南。用于编写、修改或审查 agent/go-service/ 下的 Go 自定义识别器、动作、EventSink,或了解 MaaFramework Go Agent 的注册、日志、目录组织和参数解析模式。

    119 GitHub stars~1.3k tokensUpdated 3 days ago
    Auto-check passed
  • 分析 MDA 公开 Issue、日志包或本地日志。用于 https://github.com/1204244136/MDA/issues/...、1234、MDA 日志压缩包、识别失败、任务卡死、控制器差异、Pipeline/Agent/MXU 问题。会从…

    119 GitHub stars~1.7k tokensUpdated 3 days ago
    Auto-check passed
  • Mda Project Guide

    1204244136/MDA

    MDA 项目专属开发指南。用于在 MDA 中编写或审查 MaaFramework Pipeline、Project Interface 任务、locale、go-service 组件时补充项目结构、业务域、命名习惯和现有任务选项示例。与通用 pipeline-guide、pipeline-debug、generate-pi-task、go-service-guide 配合使用。

    119 GitHub stars~1.8k tokensUpdated 3 days ago
    Auto-check passed
  • Meojson

    1204244136/MDA

    meojson C++ JSON 库使用指南。用于 MaaFramework C++ 项目中的 JSON 解析、序列化、MEOJSONIZATION、json::value 操作、ext::jsonization 自定义类型支持,以及 Custom 参数解析。

    119 GitHub stars~1.3k tokensUpdated 3 days ago
    Auto-check passed

Works with

Questions about Maa Logging

What does Maa Logging do?

MaaFramework C++ 日志宏用法指南。用于写 C++ MaaFramework 扩展、Custom 组件或工具代码时使用 LogInfo/LogError/LogWarn/LogDebug/LogTrace、VAR、容器输出和自定义类型日志。. Maa Logging is an agent skill from 1204244136/MDA.

How do I install Maa Logging in Claude Code?

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

How do I install Maa Logging in Codex?

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

Can I use Maa Logging 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 1204244136/MDA --skill maa-logging -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/maa-logging, .gemini/skills/maa-logging, .github/skills/maa-logging and .opencode/skills/maa-logging in your project.

What does Maa Logging need to run?

SKILL.md names no scripts, command-line tools or credentials: Maa Logging is instructions for the agent only.

Does Maa Logging 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 Maa Logging 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 Maa Logging use?

Maa Logging 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 Maa Logging use?

About 790 tokens (SKILL.md is roughly 3.2k 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 Maa Logging?

Skills that share tags, products or a category with Maa Logging: Paddle Build (PaddlePaddle/Paddle, 24k stars), Fory Release (apache/fory, 4.6k stars), ONNX Runtime Shape Inference Safety Audit (microsoft/onnxruntime, 22k stars) and Code Audit (3stoneBrother/code-audit, 893 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Maa Logging?

1204244136 (a GitHub user) maintains it in 1204244136/MDA, which has 119 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 5, 2026.

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