9talk/ts-interface-miner/SKILL.md
一个专门用于分析 TypeScript (.ts/.tsx) 文件的智能助手。它能够根据用户提供的关键词(功能描述、函数名、API 路径),精准定位相关接口定义。该技能深度解析代码结构与注释(JSDoc/单行注释),提取请求方法、路径、参数细节、响应结构及状态码,最终生成结构清晰、信息完整的 Markdown 表格文档。
npx skillsauth add openclaw/skills ts-interface-minerInstall 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.
名称: ts-api-miner
描述: 一个专门用于分析 TypeScript (.ts/.tsx) 文件的智能助手。它能够根据用户提供的关键词(功能描述、函数名、API路径),精准定位相关接口定义。该技能深度解析代码结构与注释(JSDoc/单行注释),提取请求方法、路径、参数细节、响应结构及状态码,最终生成结构清晰、信息完整的Markdown 表格文档。
核心特点:
@param, @returns, @description) 和行内注释作为字段说明;若注释与类型定义冲突,以注释为准并标记警告。当用户输入满足以下任一场景时,激活此技能:
"登录", getUserInfo, /api/order),要求寻找相关接口详情。'/api/v1/user')。fetchUserInfo)。// 获取用户详细信息)。基础信息: 提取 Method (GET/POST...), Path, Source Location。
请求参数提取:
LoginReq),深入其定义提取字段列表。注释融合策略 (关键):
/** ... */。@param name - description。// ...。optional (?) 但注释注明“必填”,则在输出中标记为 ✅ (注释强调) 并添加警告图标 ⚠️。响应信息提取:
Promise<ApiResponse<T>>)。@returns 或 @throws 中的状态码和错误描述。所有输出必须严格遵循以下 Markdown 结构。每个匹配的接口生成一个独立板块。
### 🔍 接口分析:[接口功能简述]
| 属性分类 | 详细信息 |
| :--- | :--- |
| **🏷️ 接口名称** | `[函数名/标识符]` |
| **📝 功能描述** | [来自 JSDoc @description 或首行注释] |
| **🔗 请求路径** | `[完整路径,动态参数用 :id 表示]` |
| **⚡ 请求方法** | `[GET/POST/PUT/DELETE/PATCH]` |
| **📂 源文件位置** | `[文件名]:[行号]` (若已知) |
#### 📥 请求参数 (Request)
| 参数位置 | 字段名 | 类型 | 必填 | 默认值 | 说明 (来自注释) |
| :--- | :--- | :--- | :---: | :---: | :--- |
| [Body/Query/Header/Path] | `[key]` | `[type]` | [✅/❌] | `[value]` | [详细描述,若无则填"暂无说明"] |
| ... | ... | ... | ... | ... | ... |
#### 📤 响应信息 (Response)
| 状态码 | 含义 | 响应体结构摘要 | 说明 (来自注释) |
| :---: | :--- | :--- | :--- |
| **[Code]** | [Text] | `{ key: type, ... }` | [成功/失败的具体描述] |
| ... | ... | ... | ... |
#### 💡 关键代码片段
// [相关代码片段,包含函数定义及关键调用]
string 但注释说是 "ISO8601 时间格式",说明列必须写明 "ISO8601 时间格式"。data: CreateUserDTO 而不解释内容。必须展开 CreateUserDTO 的内部字段到表格中。List<Item>),需简要说明 Item 的核心结构。(推断)。⚪ 暂无文档说明。?)与注释描述(如“此项必填”)不一致时,在“必填”列显示 ⚠️ 冲突,并在说明列解释差异。文件内容:
/** * 更新用户个人资料 * @param userId - 用户唯一标识,必填 * @param bio - 个人简介,可选,最大 200 字 */ export async function updateUserProfile(userId: string, bio?: string) { return api.put(`/users/${userId}`, { bio }); }
指令: 分析
updateUserProfile接口。
| 属性分类 | 详细信息 |
|:-------------|:--------------------|
| 🏷️ 接口名称 | updateUserProfile |
| 📝 功能描述 | 更新用户个人资料 |
| 🔗 请求路径 | /users/:userId |
| ⚡ 请求方法 | PUT |
| 📂 源文件位置 | 当前文件 |
| 参数位置 | 字段名 | 类型 | 必填 | 默认值 | 说明 (来自注释) |
|:---------|:---------|:---------|:--:|:-----------:|:-----------------|
| Path | userId | string | ✅ | - | 用户唯一标识,必填 |
| Body | bio | string | ❌ | undefined | 个人简介,可选,最大 200 字 |
| 状态码 | 含义 | 响应体结构摘要 | 说明 (来自注释) |
|:-------:|:----------|:-----------------------|:-----------|
| 200 | OK | { success: boolean } | 更新成功 (推断) |
| 404 | Not Found | - | 用户不存在 (推断) |
/**
* 更新用户个人资料
* @param userId - 用户唯一标识,必填
* @param bio - 个人简介,可选,最大 200 字
*/
export async function updateUserProfile(userId: string, bio?: string) {
return api.put(`/users/${userId}`, {bio});
}
[TypeName] 引用自外部文件,无法展开详细结构。仅显示基础类型信息。”tools
Use when the user wants to connect to, test, or use the McDonalds service at mcp.mcd.cn, including checking authentication, probing MCP endpoints, listing tools, or calling McDonalds MCP tools through a reusable local CLI.
development
Web scraping platform — Twitter/X data, Vinted marketplace, and general web scraping API
development
SlowMist AI Agent Security Review — comprehensive security framework for skills, repositories, URLs, on-chain addresses, and products (Claude Code version)
data-ai
去除中文文本中的 AI 写作痕迹,使其读起来自然。基于维基百科 AI 写作特征指南,检测 24 种 AI 模式。触发词:humanizer-cn、去除 AI 痕迹、去除 AI 写作痕迹、中文文本人性化。