api-docs

Generate MDX API documentation from TypeScript/JavaScript source code using decorators and comments.

333|92|Updated Jun 9, 2025
One-click install
npx skills add https://github.com/shenjingnan/xiaozhi-client --skill api-docs-shenjingnan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-docs
Source: https://github.com/shenjingnan/xiaozhi-client/tree/main/.claude/skills/api-docs
Command: npx skills add https://github.com/shenjingnan/xiaozhi-client --skill api-docs-shenjingnan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

该技能从 Xiaozhi-client 项目的 TypeScript/JavaScript 源代码中自动提取 API 信息、类型定义与注释,生成符合 Next.js/Nextra 标准的 MDX 文档,显著减少手动编写文档的工作量。

Core Features & Use Cases

  • 自动化 API 抽取:从源代码中提取类、方法、接口、类型以及注释,形成可导航的文档结构。
  • MDX 文档输出:生成可直接在文档站点中使用的 MDX 文档,包含参数、返回值和示例。
  • 使用场景:为大型客户端库自动生成 API 参考、类型文档和使用示例,提升开发者体验。

Quick Start

在项目根目录执行命令 api-docs generate 以生成 MDX 文档,然后在 docs/content/api/reference 目录查看产出;如需持续同步,可使用 api-docs generate --watch。

Frequently Asked Questions about api-docs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate API documentation generation from TypeScript source code?

You can automate API documentation generation from TypeScript source code by running static code analysis using decorators like @Tool and @Param. This process parses comments and outputs structured MDX templates, eliminating manual drafting efforts.

How does static code analysis extract types and usage details for API documentation?

Static code analysis extracts types and usage details by parsing decorators like @Tool and @Param alongside code comments. This mechanism captures API definitions and type structures, forming a navigable documentation hierarchy without executing the code.

Can I generate MDX documents compatible with Next.js and Nextra from JavaScript projects?

Yes, you can generate MDX documents compatible with Next.js and Nextra from JavaScript projects. The tool targets TypeScript and JavaScript codebases, producing MDX files that integrate directly into your documentation site alongside navigation metadata.

What is the best way to keep API reference docs synced with source code continuously?

The best way to keep API reference docs synced continuously is using the watch mode command. By executing generation with the watch flag, the tool monitors source code changes and automatically regenerates the MDX documentation outputs in your directory.

Does this API documentation generator work for large client libraries?

Yes, this API documentation generator works for large client libraries by automating the extraction of extensive classes, methods, and types. It handles large codebases by producing structured MDX templates and type documentation, significantly reducing manual workload.