zai-vision-analysis-skill

zai-vision-analysis-skill is a skill for OpenCode from darellchua2/opencode-config-template. It costs 55 tokens per session (1,564 once invoked), scanned A, original, Apache-2.0.

A fallback recipe for analysing images, screenshots, and PDFs through Z.AI’s vision service. It gives a text-only coding agent a description of visual content when built-in image understanding is unavailable.

In plain words
What is it for?
Use it to describe screenshots, inspect images, or extract visual information for an agent that can work with text and shell commands.
Why use it?
It provides a way to inspect visual files when the agent’s normal image support or connected vision tools cannot be used.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions subagents; positional $N argument; mentions OpenCode.

Good fit Use it to describe screenshots, inspect images, or extract visual information for an agent that can work with text and shell commands.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/darellchua2/opencode-config-template/zai-vision-analysis-skill
Install

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.

Any agent
npx skills add darellchua2/opencode-config-template --skill zai-vision-analysis-skill
Clone the repo
git clone --depth 1 https://github.com/darellchua2/opencode-config-template

Made for: OpenCode.

Wrote 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.

agentmods badge for zai-vision-analysis-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/zai-vision-analysis-skill.svg)](https://agentmods.dev/skills/darellchua2/opencode-config-template/zai-vision-analysis-skill)
Your own site
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/zai-vision-analysis-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/zai-vision-analysis-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,564 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to medium

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 →

  • medium Data Exfiltration · line 38
    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 39
    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 68
    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 70
    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.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.01564
Opus 5 $0.00028 $0.00782
Sonnet 5 $0.00011 $0.00313
Haiku 4.5 $0.00006 $0.00156

Measured 4d ago against content hash 9f08ab0f05c5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

zai-vision-analysis-skill scanned grade A with 2 findings 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.

## Recipe (one command — pure stdlib, no curl/ARG_MAX issues)

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

mime = subprocess.check_output(["file","-b","--mime-type",src]).decode().strip() or "image/png"
opencode_app/.opencode/skills/zai-vision-analysis-skill/SKILL.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

What I do

I give an agent a single ready-to-run command that calls the Z.AI vision API directly with glm-5v-turbo (a different model from the native glm-5.3-flash multimodal path), returning the model's text description of an image. This is the API fallback for when native multimodal perception is unavailable — e.g. the image-analyzer-subagent runtime reports "model does not support image input", the vision MCP server isn't connected, or a text-model agent needs image content.

The calling agent (typically a text model) runs the command with bash, then reasons over the returned description.

Why a direct API call

OpenCode's native multimodal agents run on provider-catalog vision models (now zai-coding-plan/glm-5.3-flash), but that path can fail at runtime (provider mis-route, MCP server not connected, text-only session). A direct Z.AI API call works regardless of the OpenCode model layer, so it is a reliable fallback. It also serves any text-model agent that has bash but no image perception.

Prerequisite — key + endpoint

The recipe auto-resolves both, preferring the coding-plan tier:

Source Endpoint
auth.jsonzai-coding-plan.key (preferred) https://api.z.ai/api/coding/paas/v4/chat/completions
auth.jsonzai.key, else $ZAI_API_KEY https://api.z.ai/api/paas/v4/chat/completions

If neither key is found, the command exits with an error telling the caller to authenticate (opencode auth login for Z.AI, or export ZAI_API_KEY).

Recipe (one command — pure stdlib, no curl/ARG_MAX issues)

$IMG = local file path or a remote https:// URL. $PROMPT = analysis instruction. Large local images are auto-downscaled to 1280px max edge (JPEG q85) when Pillow is installed; without Pillow the raw file is sent (may hit size limits on very large images).

IMG="/abs/path/to/image.png"
PROMPT="Describe this image in detail — text, UI elements, errors, layout, colors, anything actionable."

python3 - "$IMG" "$PROMPT" <<'PY'
import sys, os, json, base64, subprocess, urllib.request, urllib.error
src, prompt = sys.argv[1], (sys.argv[2] or "Describe this image in detail.")

def load_auth():
    try:
        return json.load(open(os.path.expanduser("~/.local/share/opencode/auth.json")))
    except Exception:
        return {}
auth = load_auth()
cp = (auth.get("zai-coding-plan") or {}).get("key")
zai = (auth.get("zai") or {}).get("key") or os.environ.get("ZAI_API_KEY", "")
MODEL = "glm-5v-turbo"
if cp:
    ENDPOINT, APIKEY = "https://api.z.ai/api/coding/paas/v4/chat/completions", cp
elif zai:
    ENDPOINT, APIKEY = "https://api.z.ai/api/paas/v4/chat/completions", zai
else:
    sys.exit("ERROR: no Z.AI key — run `opencode auth login` (Z.AI) or export ZAI_API_KEY")

def img_url(src):
    if src.startswith("http"):
        return src
    try:
        from PIL import Image; import io
        im = Image.open(src).convert("RGB"); w, h = im.size
        if max(w, h) > 1280:
            im = im.resize((int(w*1280/max(w,h)), int(h*1280/max(w,h))), Image.LANCZOS)
        buf = io.BytesIO(); im.save(buf, "JPEG", quality=85)
        return "data:image/jpeg;base64,%s" % base64.b64encode(buf.getvalue()).decode()
    except ImportError:
        mime = subprocess.check_output(["file","-b","--mime-type",src]).decode().strip() or "image/png"
        with open(src,"rb") as f: return "data:%s;base64,%s" % (mime, base64.b64encode(f.read()).decode())

payload = json.dumps({"model": MODEL, "messages": [{"role": "user", "content": [
    {"type": "text", "text": prompt},
    {"type": "image_url", "image_url": {"url": img_url(src)}}]}]}).encode()
req = urllib.request.Request(ENDPOINT, data=payload, headers={
    "Authorization": "Bearer " + APIKEY, "Content-Type": "application/json"})
try:
    with urllib.request.urlopen(req, timeout=120) as r:
        print(json.loads(r.read())["choices"][0]["message"]["content"])
except urllib.error.HTTPError as e:
    sys.exit("HTTP %d: %s" % (e.code, e.read().decode()[:500]))
PY

Read the full file on GitHub · 124 lines

Changes

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.

  1. 4d ago First seen · 124 lines · 55 tokens per session scan A 9f08ab0f05c5

Subscribe to this mod's changes

zai-vision-analysis-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 55 tokens to every session and 1,564 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

webgl-holographic-foil

A self-contained WebGL2 hero: thin-film interference over a crushed-foil surface whose palette shifts with the viewing angle; move the cursor to tilt the film.

nexu-io/open-design · 41 tokens

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated…

heygen-com/hyperframes · 92 tokens

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

html-ppt-taste-brutalist

16:9 HTML deck in tactical-telemetry / CRT-terminal taste. Deactivated-CRT charcoal slides, white-phosphor monospace, hazard-red accent, scanline overlay, ASCII syntax, density over decoration. Distilled from Leonxlnx/taste-skill brutalist-skill (Tactical Telemetry mode).

nexu-io/open-design · 78 tokens

diagnostic-stem-delivery

Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow.

HKUDS/OpenSpace · 23 tokens

chengfeng-check-updates

An environment manager for a video-editing system. It checks whether its skills and runtime—the software needed to run them—are installed and compatible.

Agentchengfeng/chengfeng-videocut-skills · 120 tokens