extract-json
GitHub基于gliner2-base-v1的模式驱动JSON提取工具。当用户需要从自由文本中提取特定字段(如联系信息、发票详情等)并生成结构化JSON时使用。需通过heredoc传入原文及单引号定义的字段模式。
触发场景
安装
npx skills add zerogpu/zerogpu-router --skill extract-json -g -y
SKILL.md
Frontmatter
{
"name": "extract-json",
"description": "Schema-driven structured JSON extraction (gliner2-base-v1). Use when the user wants to pull specific named fields out of free text into a JSON object — contact info, invoice details, order data, profile attributes — defined by a per-field type\/description schema.",
"allowed-tools": "Bash(zerogpu extract_json*)",
"argument-hint": "<text> -s '<json schema>'"
}
Run structured JSON extraction:
zerogpu extract_json $ARGUMENTS
Quoting (required, to survive shell parsing of arbitrary user text): format $ARGUMENTS with the source text wrapped via heredoc command substitution, then flags after. Inside the heredoc, paste the user's text verbatim — do not escape:
"$(cat <<'ZGPU_T'
<the source text, verbatim, multi-line and special chars all OK>
ZGPU_T
)" -s '{"contact":["name::str::Full name","email::str::Email address","phone::str::Phone number"]}'
Schema is required, single-quoted JSON. Each field is name::type::description. Output is a JSON object keyed by group, with extracted field values.
Savings note: only if the command output literally contains a line starting with 💰 ZeroGPU savings, append that exact line, unchanged, as the last line of your reply. If no such line is present, say nothing about savings and do not mention or suggest /zerogpu-router:cost-savings — this note is intentionally occasional, not shown every time.
版本历史
- 7b9b503 当前 2026-07-24 11:47


