zspace-coder

A skill that turns a captured browser network request, written as a curl command, into zspace NAS API code, a command-line command, and an MCP tool. It also maps response fields and tests the result in a specified folder.

In plain words
What is it for?
Adding zspace file, storage, system, user, backup, and recovery operations from curl requests, then checking them with the development CLI and MCP tools.
Why use it?
It avoids manually translating low-level HTTP requests into several matching interfaces and reduces the risk of using the wrong paths or field names.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/philipxiaoxi/z-cli/zspace-coder
Any agent
npx skills add philipxiaoxi/z-cli --skill zspace-coder
Clone the repo
git clone --depth 1 https://github.com/philipxiaoxi/z-cli

Made for: Claude Code, Codex.

Per session 196 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,887 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00196 $0.01887
Opus 5 $0.00098 $0.00944
Sonnet 5 $0.00039 $0.00377
Haiku 4.5 $0.00020 $0.00189

Measured yesterday against content hash a00020da5011, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

zspace-coder 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 yesterday.

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.

将抓包的 curl 请求自动转换为 zspace CLI 命令和 MCP 工具的完整功能。
.claude/skills/zspace-coder/SKILL.md · 230 lines

How it starts

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

项目信息

  • 项目根目录:/Users/philip/Documents/code/zspace-cli
  • 开发运行:./dev <command> <args>(热更新,改代码直接生效)
  • API 模块:src/zspace/api/
  • CLI 模块:src/zspace/commands/
  • MCP 模块:src/zspace/mcp/tools/

工作流程

收到 curl 命令后,按以下步骤执行:

第一步:解析 curl

从 curl 命令中提取关键信息:

  1. URL 路径 — 去掉协议/域名/端口,只保留路径部分。 例如 http://127.0.0.1:13579/v2/file/newdir/v2/file/newdir 去掉 URL 中 rndwebagent 等反缓存查询参数。

  2. HTTP 方法 — 从 -X 参数获取。如果没有 -X 但有 --data-raw,默认为 POST。

  3. 请求体参数 — 从 --data-raw 中解析。urllib.parse.urlencode(data) 会自动处理编码, 所以在代码中直接传原始字符串(不要手动 URL 编码)。

  4. Referer 路径 — 从 -H 'Referer: ...' 中提取 path= 查询参数的值, 用于 build_headers() 的 path 参数。

  5. 响应字段 — 如果响应包含缩写字段(如 ndismt 等),需要创建字段映射。

第二步:确认无重复

检查以下目录现有文件,确认没有重复实现:

  • src/zspace/api/ — API 函数
  • src/zspace/commands/ — CLI 命令
  • src/zspace/mcp/tools/ — MCP 工具

新增代码前看一两个现有实现,确保风格一致。

第三步:实现 API 函数

根据 curl 在 src/zspace/api/ 下创建或修改 API 函数。

模板:

"""模块描述。"""

import urllib.parse

import httpx

from ..auth import build_headers, get_base_url
from . import _resp_or_json


def your_function(param1: str, param2: str = "default", raw: bool = False) -> str | httpx.Response:
    """函数描述。"""
    data = {
        "param1": param1,
        "param2": param2,
    }
    resp = httpx.request(
        "POST",
        f"{get_base_url()}/api/path",
        headers=build_headers(),
        content=urllib.parse.urlencode(data),
    )
    return _resp_or_json(resp, raw)

规则:

  • 必须通过 _resp_or_json() 返回结果
  • build_headers() 的 path 参数:有文件路径参数时传入该值,否则传空字符串
  • 请求体用 urllib.parse.urlencode(data) 编码
  • 跳过 URL 中的 rndwebagent 等反缓存参数
  • 参数名使用可读英文命名
  • 需要 raw 参数支持原始响应
关于字段映射

如果 API 返回列表数据(数组)且包含缩写字段名,在 src/zspace/api/fields.py 中添加映射, 并在 API 函数中格式化。

from .fields import YOUR_API_FIELDS

def _format_your_api(data: list) -> str:
    out = []
    for item in data:
        readable = {}
        for short, val in item.items():
            long_name = YOUR_API_FIELDS.get(short, short)
            if long_name in ("modified_at", "created_at") and isinstance(val, (int, float)) and val:
                readable[long_name] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(val))
            else:
                readable[long_name] = val
        out.append(readable)
    return json.dumps(out, indent=2, ensure_ascii=False)

Read the full file on GitHub · 230 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 230 lines · 196 tokens per session scan A a00020da5011

Subscribe to this mod's changes

zspace-coder is a skill published in the GitHub repository philipxiaoxi/z-cli (0 stars, last pushed 1mo ago), licensed MIT. It adds 196 tokens to every session and 1,887 once invoked, about $0.0010 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-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens