Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add darellchua2/opencode-config-template --skill zai-ocr-skillgit clone --depth 1 https://github.com/darellchua2/opencode-config-templateWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/darellchua2/opencode-config-template/zai-ocr-skill)<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/zai-ocr-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/zai-ocr-skill.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 6 findings, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Supply Chain · line 46 Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.Fix: Avoid downloading and executing remote scripts. Use trusted packages from PyPI/npm. If remote fetch is required, verify checksums and use HTTPS.
- high Supply Chain · line 75 Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.Fix: Avoid downloading and executing remote scripts. Use trusted packages from PyPI/npm. If remote fetch is required, verify checksums and use HTTPS.
- medium Data Exfiltration · line 46 Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
- medium Data Exfiltration · line 75 Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
- medium Data Exfiltration · line 44 Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
- medium Data Exfiltration · line 72 Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.01398 |
| Opus 5 | $0.00026 | $0.00699 |
| Sonnet 5 | $0.00010 | $0.00280 |
| Haiku 4.5 | $0.00005 | $0.00140 |
Grade A, and why
zai-ocr-skill scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
RESP=$(curl -sS --max-time 180 -X POST "$BASE/layout_parsing" \ How it starts
The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.
What I do
I provide the exact recipe for an agent to extract text with layout structure
from an image or PDF via the Z.AI GLM-OCR layout_parsing API. Unlike a
vision-chat description, the dedicated endpoint returns the document's text
organized by detected layout (blocks, reading order, tables).
Why a skill (not vision chat)
POST /layout_parsingis a dedicated document-extraction endpoint — richer and more faithful for dense/structured documents than asking a chat model to describe an image.- Input is an http(s) URL. Base64 is documented in the API schema but every
base64 form is rejected server-side with code
1214(verified 2026-08-30: png/jpeg/pdf × raw/data-URI/padded/unpadded) — local files use the vision fallback in Path B.
Prerequisite — API key resolution
KEY="${ZAI_API_KEY:-$(jq -r '.["zai"].key // .["zai-coding-plan"].key // empty' \
~/.local/share/opencode/auth.json 2>/dev/null)}"
[ -z "$KEY" ] && { echo "ZAI_API_KEY not found — set it (export ZAI_API_KEY) or run \`opencode auth login\` (Z.AI)."; exit 1; }
If neither source has the key, stop and report — do not proceed.
Recipe
Path A — file already has a public URL (full layout result)
FILE_URL="https://example.com/document.png" # REQUIRED — public http(s) URL, png/jpg/pdf
BASE="${ZAI_MEDIA_ENDPOINT:-https://api.z.ai/api/paas/v4}" # pay-as-you-go ONLY
RESP=$(curl -sS --max-time 180 -X POST "$BASE/layout_parsing" \
-H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
-d "{\"model\":\"glm-ocr\",\"file\":\"$FILE_URL\"}")
printf '%s' "$RESP" | python3 -c '
import sys, json
d = json.load(sys.stdin)
if d.get("error"):
sys.stderr.write("API error: " + json.dumps(d["error"]) + "\n"); sys.exit(1)
print(d.get("md_results") or "(empty md_results)")
for page in d.get("layout_details", []):
for el in page:
print("[" + str(el.get("label", "")) + "] " + str(el.get("content", "")))'
Output: md_results (markdown of the whole document) plus one
[label] content line per layout element (text/table/formula/image) on stdout.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 117 lines · 52 tokens per session scan A 193810735cb6
zai-ocr-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 52 tokens to every session and 1,398 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
pydicom
Use pydicom to read, inspect, write, transform, and safely preflight local DICOM datasets and pixel data. Applies to DICOM metadata, transfer syntaxes, compression plugins, frames, private elements, JSON, and bounded de-identification review.
foundry-hosted-agent-validation
Step-by-step process for validating a Python Foundry hosted agent sample (under python/samples/04-hosting/foundry-hosted-agents/) end to end — running it locally (native runtime and azd ai agent run) and after deploying it to an Azure AI Foundry project with azd. Use this when asked to validate a hosted agent sample.
skill-doc-delivery
Convert markdown to DOCX, PPTX, XLSX, PDF office documents — use when you need exportable deliverables.
pdf-extract-create-workflow
Complete PDF lifecycle: download, extract, and generate structured documents with reportlab.
document-direct-python
Use direct Python execution for reliable document creation including spreadsheets, PDFs, and structured reports.
pdf-text-extraction-fallback-85d5ca
Fallback workflow for extracting text from PDFs when readfile returns binary data.