360 Secure SkillHub
360 安全技能中心

json-report

该 Skill 面向 JSON 到 Markdown 的转换:可处理粘贴的 JSON、API/日志输出或批量记录,按数组、对象或键值结构生成表格,并输出 Markdown 文本或 .md 文件。它提供本地 Python 辅助脚本处理转义和多表输入,强调保留字段名、数字和日期;不负责数据抓取或深度业务分析。

dwzhjt
dwzhjt
热度 8.60
最近更新 2026-08-16 23:27:17
分类:效率依赖:代码执行 / 读写文件应用场景:数据处理 / 报告撰写 / 文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add json-report
Metadata
name
json-report
description
Convert JSON data into clean Markdown tables and reports. Use for pasted JSON, API or log output, or any batch of JSON records.
version
1.0.0
slug
json-report
homepage
https://clawhub.ai/example/json-report
changelog
Initial release of the JSON-to-Markdown report skill.
user-invocable
true
metadata
{"clawdbot":{"emoji":"📊","os":["linux","darwin","win32"]},"openclaw":{"requires":{"anyBins":["python3","python"]}}}

When to Use

Use when the main artifact is a readable Markdown report derived from JSON data, for example:

  • The user pastes JSON and asks for a table, summary, or readable report.
  • API responses, logs, or exports need to be turned into documentation.
  • A batch of JSON records should become a single .md document.

Core Rules

1. Prefer the helper script over hand-built tables

  • Run {baseDir}/scripts/json_to_md.py with the exec tool instead of writing tables by hand.
  • The script handles escaping, column detection, and multi-table inputs.
  • Fall back to manual conversion only when Python is unavailable or the input needs special handling the script does not cover.

2. Preserve data fidelity

  • Never round or truncate numbers, dates, or strings when converting.
  • Escape | characters in cell content so tables do not break.
  • Keep field names exactly as they appear in the source JSON.

3. Choose the right output shape

  • A top-level array of flat objects becomes one Markdown table.
  • A top-level object whose values are arrays becomes one table per key.
  • A single object becomes a two-column key/value table.

Usage

python {baseDir}/scripts/json_to_md.py input.json --title "My Report" --out report.md

Common Traps

  • Multi-line cell values silently break table rows; the script converts newlines to <br>.
  • JSON with mixed record shapes can produce sparse tables; confirm the columns before delivery.
  • Large inputs may produce very wide tables; prefer key/value layout for deeply nested objects.

Output Format

Output is Markdown: an optional # Title heading followed by one or more GitHub-style tables. Always deliver the result as a .md file or markdown text block.