Agent Skills › videojs/video.js › write-api-reference

write-api-reference

GitHub

用于生成 Video.js API 参考文档,涵盖组件、钩子及工具函数。通过读取源码和测试规范,利用构建器生成 JSON 并编写 MDX 页面,确保元数据准确且符合框架兼容性要求。

.agents/skills/write-api-reference/SKILL.md videojs/video.js

触发场景

需要为 Video.js 组件或 API 编写参考文档 更新或创建基于 JSDoc 的 API 说明页面

安装

npx skills add videojs/video.js --skill write-api-reference -g -y
更多选项

非标准路径

npx skills add https://github.com/videojs/video.js/tree/main/.agents/skills/write-api-reference -g -y

不安装直接使用

npx skills use videojs/video.js@write-api-reference

指定 Agent (Claude Code)

npx skills add videojs/video.js --skill write-api-reference -a claude-code -g -y

安装 repo 全部 skill

npx skills add videojs/video.js --all -g -y

预览 repo 内 skill

npx skills add videojs/video.js --list

SKILL.md

Frontmatter
{
    "name": "write-api-reference",
    "description": "Write generated Video.js API reference pages. Use for components, hooks, controllers, factories, builder compatibility, demos, or extracted JSDoc."
}

API reference

Treat TypeScript source and the builder E2E test as the specification. Generated JSON is diagnostic output, not an editable source.

Workflow

  1. Identify the export and read its implementation, public export path, tests, and any matching design record.
  2. Read site/scripts/api-docs-builder/src/tests/e2e.test.ts to confirm the builder contract involved in the change.
  3. Load only the needed reference:
    • Component discovery or naming failure: references/builder-conventions.md
    • Hook, controller, mixin, factory, or other utility: references/util-conventions.md
    • New MDX reference page: references/mdx-structure.md
    • New interactive example: references/demo-patterns.md
  4. Run pnpm -F site api-docs and inspect the corresponding file under site/src/content/generated-*-reference/.
  5. Fix missing metadata at the TypeScript/JSDoc source or in the builder. Do not hand-edit generated JSON.
  6. Create or update the page and the matching site/src/docs.config.ts entry when a page is required: site/src/content/docs/reference/components/<slug>.mdx for components, skins, media, extensions, and the icon sets; site/src/content/docs/reference/api/<slug>.mdx for hooks, features, controllers, factories, utilities, and presets (preset-<name>.mdx, in the API tab's Presets group). Keep each page in its sidebar tab's directory, because each tab's llms files are written where its pages share a directory.
  7. Give extra exports a code heading or an ## Exports table row, or list them in apis when neither fits, then run pnpm -F site check:api-stability (see the frontmatter section of site/src/content/docs/writing-style/write-references.mdx).
  8. Verify the page for every supported framework/style combination it targets.

Component pages

  • Derive props, state, data attributes, parts, tag names, and behavior from source.
  • Add prose only for non-obvious behavior, styling contracts, accessibility, or platform constraints.
  • Keep reference prose neutral and descriptive: state facts, let examples illustrate without teaching, and link how-to guides for tasks and concept pages for rationale (see .agents/skills/write-docs/references/diataxis.md).
  • Include basic HTML and React demos when both platforms expose the component; follow existing neighboring demos when the reference guide leaves room for judgment.

Utility pages

  • Confirm the export is reachable from a builder-scanned public entry point.
  • Add @public only when the export intentionally belongs in reference docs and naming-based discovery does not include it.
  • Verify generated overloads, parameters, and return data before authoring prose.

Validation

Run the builder E2E test for builder changes, pnpm -F site api-docs, and the narrowest site check that renders the affected page.

Example

Input: “Add the Menu component API reference.”

Output: Source JSDoc and builder-compatible metadata, verified generated output, MDX examples, navigation config, and site checks.

版本历史

  • 8a0a3d8 当前 2026-10-20 08:03

同 Skill 集合

.agents/skills/change-spf-behavior/SKILL.md
.agents/skills/commit-pr/SKILL.md
.agents/skills/configure-vite-plus/SKILL.md
.agents/skills/create-html-component/SKILL.md
.agents/skills/create-issue/SKILL.md
.agents/skills/create-react-component/SKILL.md
.agents/skills/create-skill/SKILL.md
.agents/skills/create-spf-behavior/SKILL.md
.agents/skills/design-api/SKILL.md
.agents/skills/document-spf-feature/SKILL.md
.agents/skills/document-spf-use-case/SKILL.md
.agents/skills/implement-accessible-ui/SKILL.md
.agents/skills/implement-spf-feature/SKILL.md
.agents/skills/implement-spf-use-case/SKILL.md
.agents/skills/implement-ui-transition/SKILL.md
.agents/skills/investigate-issue/SKILL.md
.agents/skills/maintain-agent-docs/SKILL.md
.agents/skills/maintain-tests/SKILL.md
.agents/skills/maintain-vjsc-skin-gaps/SKILL.md
.agents/skills/review-accessibility/SKILL.md
.agents/skills/review-api/SKILL.md
.agents/skills/review-branch/SKILL.md
.agents/skills/review-docs/SKILL.md
.agents/skills/review-html-component-design/SKILL.md
.agents/skills/review-html-component/SKILL.md
.agents/skills/review-react-component-design/SKILL.md
.agents/skills/review-react-component/SKILL.md
.agents/skills/write-design-doc/SKILL.md
.agents/skills/write-docs/SKILL.md
.agents/skills/write-html-component-design/SKILL.md
.agents/skills/write-locale-translations/SKILL.md
.agents/skills/write-react-component-design/SKILL.md
.agents/skills/write-rfc/SKILL.md
.agents/skills/create-rolldown-plugin/SKILL.md
.agents/skills/create-vite-plugin/SKILL.md
.agents/skills/create-vjsc-component/SKILL.md
.agents/skills/transform-rolldown-code/SKILL.md

元信息

文件数
0
版本
8a0a3d8
Hash
c29256e8
收录时间
2026-10-20 08:03

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 11:51
浙ICP备14020137号-1