AGENT SKILL

JSON 结构与类型推断

jqschema

通过基于 jq 的模式发现(schema discovery)来推断 JSON 的结构和类型。

使用场景开发参考
License 许可
MIT
所属仓库
github/gh-aw
最近更新
2026-11-15
Stars
★ 5.6k
Forks
626

01 前言 Front Matter

name
jqschema
tools
{ "bash": [ "jq *", "./.github/skills/jqschema/jqschema.sh", "git" ] }
description
Infer JSON structure and types with jq-based schema discovery.

02 资源文件 2

03 SKILL.md 正文

jqschema - JSON Schema Discovery

Use ./.github/skills/jqschema/jqschema.sh to generate a compact structural schema (keys + types) from JSON input. Pipe any JSON source through it to discover structure before querying full data.

# Analyze a file or command output
cat data.json | ./.github/skills/jqschema/jqschema.sh
gh api search/repositories?q=language:go | ./.github/skills/jqschema/jqschema.sh

The script replaces object values with type names ("string", "number", "boolean", "null"), reduces arrays to first-element structure, and outputs compact JSON. Use perPage: 1 to fetch minimal data when exploring unknown API shapes.

Example: {"total_count":1000,"items":[{"login":"user1","id":123}]} → {"total_count":"number","items":[{"login":"string","id":"number"}]}

04 同仓库更多 Skills