api-docs

api-docs is a skill for Claude Code, Codex from shenjingnan/xiaozhi-client. It costs 8 tokens per session (3,495 once invoked), scanned A, original, MIT.

An API documentation generator that reads TypeScript and JavaScript source code and creates MDX pages for Nextra, a documentation site built with Next.js.

In plain words
What is it for?
Use it to document classes, functions, types, parameters, and JSDoc comments from the xiaozhi-client project.
Why use it?
It reduces the manual work of finding API details and keeping reference pages in sync with code.

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/shenjingnan/xiaozhi-client/api-docs
Any agent
npx skills add shenjingnan/xiaozhi-client --skill api-docs
Clone the repo
git clone --depth 1 https://github.com/shenjingnan/xiaozhi-client

Made for: Claude Code, Codex.

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 api-docs

README.md
[![agentmods](https://agentmods.dev/badge/skills/shenjingnan/xiaozhi-client/api-docs.svg)](https://agentmods.dev/skills/shenjingnan/xiaozhi-client/api-docs)
Your own site
<a href="https://agentmods.dev/skills/shenjingnan/xiaozhi-client/api-docs"><img src="https://agentmods.dev/badge/skills/shenjingnan/xiaozhi-client/api-docs.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,495 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00008 $0.03495
Opus 5 $0.00004 $0.01747
Sonnet 5 $0.00002 $0.00699
Haiku 4.5 $0.00001 $0.00349

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

Security

Grade A, and why

api-docs scanned grade A with 0 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/api-docs/SKILL.md · 545 lines

How it starts

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

我是 API 文档自动生成技能,专门从 xiaozhi-client 项目的源代码中提取 API 信息,生成符合 Nextra (Next.js) 标准的 MDX 文档,同时遵循务实开发理念。

技能使用原则

  • 保持文档质量,但避免过度复杂:生成清晰有用的文档,但不追求完美的文档结构
  • 实用功能优先,理论完美次之:解决实际的文档需求比完美的文档设计更重要
  • 简单解决方案优于复杂方案:优先选择直接有效的文档生成方式
  • 务实开发指导:评估文档的必要性,避免为了文档而文档

技能能力

1. 源代码分析

深度解析 TypeScript/JavaScript 源代码,提取 API 相关信息:

支持的代码元素
  • 类和方法:使用 @Tool 装饰器的方法
  • 函数接口:纯函数和工具方法
  • 类型定义:接口、类型别名、枚举
  • 参数信息:使用 @Param 装饰器的参数定义
  • 注释文档:JSDoc 格式的代码注释
解析能力
// 示例源代码
@Tool("控制灯光设备 - 支持通过名称控制灯光设备的开关、亮度和色温")
public async LightControl(
  @Param(z.string().describe("灯光设备名称"))
  name: string,
  @Param(z.enum(["turn_on", "turn_off"]).describe("控制动作"))
  action: "turn_on" | "turn_off",
  @Param(z.number().min(1).max(100).optional().describe("亮度百分比"))
  brightnessPct?: number
) {
  // 实现逻辑...
}

// 提取的信息
{
  name: "LightControl",
  description: "控制灯光设备 - 支持通过名称控制灯光设备的开关、亮度和色温",
  parameters: [
    {
      name: "name",
      type: "string",
      description: "灯光设备名称",
      required: true
    },
    {
      name: "action",
      type: "turn_on | turn_off",
      description: "控制动作",
      required: true
    },
    {
      name: "brightnessPct",
      type: "number",
      description: "亮度百分比",
      required: false,
      constraints: { min: 1, max: 100 }
    }
  ]
}

2. MDX 文档生成

基于提取的信息生成符合 xiaozhi-client 项目标准的 Nextra MDX 文档。

文档结构模板
# {ToolName}

## 工具介绍

{工具描述}

## 参数定义

| 参数 | 类型 | 范围 | 说明 |
|------|------|------|------|
{参数表格}

## 使用示例

### 基础用法
{基础示例代码}

### 高级功能
{高级示例代码}

## 错误信息

| 错误类型 | 错误信息 | 处理建议 |
|----------|----------|----------|
{错误表格}

## 返回值格式

### 成功响应
{成功响应示例}

### 错误响应
{错误响应示例}

3. 类型信息集成

从类型定义文件中提取相关类型信息,增强文档的完整性。

类型文档化
// 源类型定义
export interface LightControlParams {
  entity_id: string;
  action: LightActionType;
  brightness?: number;
  transition?: number;
}

export type LightActionType = "turn_on" | "turn_off" | "toggle";

// 生成的类型文档
### LightControlParams
灯光控制参数接口

| 属性 | 类型 | 必需 | 说明 |
|------|------|------|------|
| entity_id | string | 是 | 灯光设备实体ID |
| action | LightActionType | 是 | 控制动作类型 |
| brightness | number | 否 | 亮度百分比 (1-100) |
| transition | number | 否 | 渐变时间(秒) |

### LightActionType
灯光控制动作类型

**可选值:**
- `"turn_on"` - 开灯
- `"turn_off"` - 关灯
- `"toggle"` - 切换开关状态

Read the full file on GitHub · 545 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 · 545 lines · 8 tokens per session scan A 37d319d21c6d

Subscribe to this mod's changes

api-docs is a skill published in the GitHub repository shenjingnan/xiaozhi-client (337 stars, last pushed yesterday), licensed MIT. It adds 8 tokens to every session and 3,495 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

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