claude-code/vue3/skills/api-extractor/SKILL.md
将指定文件或目录下的 .vue 文件中的内联 API 调用提取出来。支持批量重构整个目录。
npx skillsauth add linzb93/ai-coding-docs api-extractorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
此 Skill 帮助你将嵌入在 .vue 组件(或指定目录下的所有组件)中的 API 调用重构到统一的 shared/api.js 文件中,并在 types/index.ts 中生成相应的类型定义。
你是一位代码重构和 API 管理专家。你的目标是通过集中管理 API 逻辑来保持代码库的整洁。支持单文件处理,也支持处理“提取 xx 目录下的 api 调用”这类批量指令。
分析输入与上下文:
.vue 文件。views/<Module>/ 的子目录(如 children, components 等)下,根目录为 views/<Module>/。views/<Module>/ 下,根目录为 views/<Module>/。src/views/<Module>/shared/api.js。src/views/<Module>/types/index.ts。types 目录不存在,请创建它。绝对禁止在 shared 目录下创建 type.ts 或 types.ts。提取信息(针对每个文件):
await post('/url', { ... }))。post, get 等。/review/list。pageIndex/pageSize,响应是否包含 list/totalCount/totalPages。生成代码:
/review/list -> getReviewList)。types/index.ts):
@/types/index 导入 PaginationParms。Request 接口应 extends PaginationParms。@/types/index 导入 PaginationResponse。Response 接口应 extends PaginationResponse<ItemType>。Request 接口(例如:ReviewListRequest)。Response 接口(例如:ReviewListResponse)。shared/api.js):
@/utils/request 导入 post/get。../types 导入类型(注意路径是 ../types 而不是 ./type)。@file(如果已知 YApi 链接)、@param、@returns。应用变更:
types/index.ts 添加新接口(追加模式)。shared/api.js 添加新函数(追加模式)。.vue 文件:
shared/api.js 相对于当前 .vue 文件的路径(例如:在 components 目录下需使用 ../../shared/api)。src/views/<Module>/shared/api.jssrc/views/<Module>/types/index.tssrc/views/<Module>/shared/type.ts。src/types/index.ts。import { PaginationParms, PaginationResponse } from '@/types/index';/**
* 接口描述
* @file YApi_链接 (如果提供)
* @param {import('../types').RequestType} params
* @returns {Promise<import('../types').ResponseType>}
*/
普通接口:
export interface RequestType {
// 属性定义
}
分页接口:
import { PaginationParms, PaginationResponse } from '@/types/index';
export interface ListRequest extends PaginationParms {
otherParam: string;
}
export interface ListItem {
id: number;
name: string;
}
export interface ListResponse extends PaginationResponse<ListItem> {}
用户指令: "提取 src/views/demo 目录下的 API"
执行过程:
src/views/demo/components/Filter.vue。post('/demo/filter', { ... })。src/views/demo/。src/views/demo/types/index.ts 和 src/views/demo/shared/api.js。.vue 文件:
import { getDemoFilter } from '../../shared/api'; // 注意相对路径
// ...
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.