z-cli: Skill for Claude Code

.claude/skills/zspace-coder/SKILL.md

zspace-coder is a skill for Claude Code from philipxiaoxi/z-cli. It costs 196 tokens per session (1,887 once invoked), scanned A, original, MIT.

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 Code

Written for Claude Code: installed under .claude/.

This is philipxiaoxi/z-cli's own configuration. It tells Claude Code how to work on z-cli itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything z-cli configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/philip/Documents/code/zspace-cli.

Reuse

Borrowing it

Nothing to install: this file belongs to philipxiaoxi/z-cli. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/philipxiaoxi/z-cli/main/.claude/skills/zspace-coder/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/philipxiaoxi/z-cli

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/philipxiaoxi/z-cli/zspace-coder/github.svg)](https://agentmods.dev/skills/philipxiaoxi/z-cli/zspace-coder)
Your own site
<a href="https://agentmods.dev/skills/philipxiaoxi/z-cli/zspace-coder"><img src="https://agentmods.dev/badge/skills/philipxiaoxi/z-cli/zspace-coder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for zspace-coder

Your own site · 80×15
<a href="https://agentmods.dev/skills/philipxiaoxi/z-cli/zspace-coder"><img src="https://agentmods.dev/badge/skills/philipxiaoxi/z-cli/zspace-coder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.00196 $0.01887
Opus 5.5 $0.00078 $0.00755
Sonnet 5.5 $0.00039 $0.00377
Haiku 4.5 $0.00020 $0.00189

Measured 2mo ago against content hash a00020da5011, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.

将抓包的 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 中 rnd 和 webagent 等反缓存查询参数。

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

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

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

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

第二步:确认无重复

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

  • 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 中的 rnd、webagent 等反缓存参数
  • 参数名使用可读英文命名
  • 需要 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. 2mo ago 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 (1 stars, last pushed 3mo ago), licensed MIT. It adds 196 tokens to every session and 1,887 once invoked, about $0.0008 per session on Opus 5.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

zspace-coder compared with skills from other repositories

zspace-coder next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
zspace-coderphilipxiaoxi/z-cliSkill13mo agoMITA196Claude Code
mem0-oss-to-platformmem0ai/mem0Skill68k2d agoApache-2.0A217Claude Code, Codex
azure-mgmt-botservice-dotnetmicrosoft/skillsSkill3.2kyesterdayMITA78Claude Code
fastapi-router-pymicrosoft/skillsSkill3.2kyesterdayMITA46Claude Code
dev-runtimelangwatch/langwatchSkill5.0kyesterdayApache-2.0A172Claude Code
api-designericrisco/rsc-harnessSkill5032d agoMITA105Claude Code, Codex
migrate-segw-to-raparc-mcp/arc-1Skill252yesterdayMITA106Claude Code