mcp-probe-kit 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +164 -21
- package/build/index.js +8 -1
- package/build/schemas/index.d.ts +126 -0
- package/build/schemas/index.js +2 -0
- package/build/schemas/interview-tools.d.ts +72 -0
- package/build/schemas/interview-tools.js +64 -0
- package/build/schemas/orchestration-tools.d.ts +58 -0
- package/build/schemas/orchestration-tools.js +59 -0
- package/build/tools/ask_user.d.ts +17 -0
- package/build/tools/ask_user.js +124 -0
- package/build/tools/css_order.js +55 -55
- package/build/tools/index.d.ts +3 -0
- package/build/tools/index.js +4 -0
- package/build/tools/interview.d.ts +18 -0
- package/build/tools/interview.js +418 -0
- package/build/tools/start_ralph.d.ts +16 -0
- package/build/tools/start_ralph.js +779 -0
- package/docs/BEST_PRACTICES.md +200 -6
- package/docs/HOW_TO_TRIGGER.html +14 -2
- package/docs/HOW_TO_TRIGGER.md +125 -64
- package/docs/MCP-Probe-Kit-/344/275/277/347/224/250/346/211/213/345/206/214.html +83 -48
- package/docs/MCP-Probe-Kit-/344/275/277/347/224/250/346/211/213/345/206/214.md +291 -34
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
> 🚀 AI 开发增强工具集 - 让 AI 更懂你的开发流程
|
|
9
9
|
|
|
10
|
-
一个强大的 MCP (Model Context Protocol) 服务器,提供 **
|
|
10
|
+
一个强大的 MCP (Model Context Protocol) 服务器,提供 **43 个实用工具**(34 个基础工具 + 9 个智能编排),覆盖代码质量、开发效率、项目管理全流程。
|
|
11
|
+
|
|
12
|
+
**✨ v1.12.0 新增**: Interview 模式 - 先慢下来,通过访谈把需求想清楚,反而能更快!
|
|
11
13
|
|
|
12
14
|
**支持所有 MCP 客户端**:Cursor、Claude Desktop、Cline、Continue 等
|
|
13
15
|
|
|
@@ -17,10 +19,14 @@
|
|
|
17
19
|
|
|
18
20
|
## ✨ 功能特性
|
|
19
21
|
|
|
22
|
+
### 🎯 访谈工具(2 个工具)🆕
|
|
23
|
+
- **`interview`** - 需求访谈模式:在开发前通过结构化提问澄清需求,避免理解偏差和返工
|
|
24
|
+
- **`ask_user`** - 通用提问工具:AI 可随时向用户提问,澄清不确定的信息
|
|
25
|
+
|
|
20
26
|
### 🔍 代码质量(8 个工具)
|
|
21
27
|
- **`detect_shell`** - AI 模型套壳检测
|
|
22
28
|
- **`code_review`** - 代码审查助手
|
|
23
|
-
- **`security_scan`** - 安全漏洞扫描
|
|
29
|
+
- **`security_scan`** - 安全漏洞扫描
|
|
24
30
|
- **`debug`** - 智能调试助手
|
|
25
31
|
- **`gentest`** - 测试用例生成器
|
|
26
32
|
- **`refactor`** - 重构建议
|
|
@@ -35,17 +41,16 @@
|
|
|
35
41
|
- **`genchangelog`** - Changelog 生成
|
|
36
42
|
- **`gensql`** - SQL 查询生成器
|
|
37
43
|
- **`genui`** - UI 组件生成器(React + Vue)
|
|
38
|
-
- **`gen_mock`** - Mock 数据生成器
|
|
39
|
-
- **`gen_skill`** - Agent Skills 文档生成器
|
|
40
|
-
- **`design2code`** - 设计稿转代码(图片/描述/HTML → Vue/React
|
|
44
|
+
- **`gen_mock`** - Mock 数据生成器
|
|
45
|
+
- **`gen_skill`** - Agent Skills 文档生成器
|
|
46
|
+
- **`design2code`** - 设计稿转代码(图片/描述/HTML → Vue/React)
|
|
41
47
|
- **`explain`** - 代码解释器
|
|
42
48
|
- **`convert`** - 代码转换器
|
|
43
49
|
- **`css_order`** - CSS 属性顺序规范
|
|
44
50
|
- **`genreadme`** - README 生成器
|
|
45
51
|
- **`split`** - 文件拆分工具
|
|
46
|
-
- **`fix_bug`** - Bug 修复流程指南
|
|
47
|
-
- **`estimate`** - 工作量估算
|
|
48
|
-
- **`gen_skill`** - Agent Skills 文档生成器 🆕
|
|
52
|
+
- **`fix_bug`** - Bug 修复流程指南
|
|
53
|
+
- **`estimate`** - 工作量估算
|
|
49
54
|
|
|
50
55
|
### 📦 项目管理(8 个工具)
|
|
51
56
|
- **`init_setting`** - Cursor AI 配置初始化
|
|
@@ -53,22 +58,23 @@
|
|
|
53
58
|
- **`check_deps`** - 依赖健康度检查
|
|
54
59
|
- **`resolve_conflict`** - Git 冲突解决助手
|
|
55
60
|
- **`analyze_project`** - 项目分析工具,帮助AI快速理解老项目
|
|
56
|
-
- **`init_project_context`** - 初始化项目上下文,生成技术栈和架构文档
|
|
57
|
-
- **`add_feature`** - 添加新功能,生成需求/设计/任务文档
|
|
58
|
-
- **`start_onboard`** -
|
|
61
|
+
- **`init_project_context`** - 初始化项目上下文,生成技术栈和架构文档
|
|
62
|
+
- **`add_feature`** - 添加新功能,生成需求/设计/任务文档
|
|
63
|
+
- **`start_onboard`** - 快速上手项目(智能编排)
|
|
59
64
|
|
|
60
|
-
### 🚀 智能编排(
|
|
65
|
+
### 🚀 智能编排(9 个工具)
|
|
61
66
|
|
|
62
67
|
智能编排工具自动组合多个基础工具,一键完成复杂工作流:
|
|
63
68
|
|
|
64
|
-
- **`start_feature`** - 新功能开发:上下文 → 功能规格 → 工作量估算
|
|
65
|
-
- **`start_bugfix`** - Bug 修复:上下文 → 分析修复 → 测试 → 提交
|
|
66
|
-
- **`start_review`** - 代码体检:上下文 → 质量审查 → 安全扫描 → 性能分析
|
|
67
|
-
- **`start_release`** - 发布准备:上下文 → Changelog → PR 描述
|
|
68
|
-
- **`start_refactor`** - 代码重构:上下文 → 审查 → 重构 → 测试
|
|
69
|
-
- **`start_onboard`** - 快速上手:项目分析 → 生成上下文文档
|
|
70
|
-
- **`start_api`** - API 开发:上下文 → API 文档 → Mock 数据 → 测试
|
|
71
|
-
- **`start_doc`** - 文档生成:上下文 → 代码注释 → README → API 文档
|
|
69
|
+
- **`start_feature`** - 新功能开发:上下文 → 功能规格 → 工作量估算
|
|
70
|
+
- **`start_bugfix`** - Bug 修复:上下文 → 分析修复 → 测试 → 提交
|
|
71
|
+
- **`start_review`** - 代码体检:上下文 → 质量审查 → 安全扫描 → 性能分析
|
|
72
|
+
- **`start_release`** - 发布准备:上下文 → Changelog → PR 描述
|
|
73
|
+
- **`start_refactor`** - 代码重构:上下文 → 审查 → 重构 → 测试
|
|
74
|
+
- **`start_onboard`** - 快速上手:项目分析 → 生成上下文文档
|
|
75
|
+
- **`start_api`** - API 开发:上下文 → API 文档 → Mock 数据 → 测试
|
|
76
|
+
- **`start_doc`** - 文档生成:上下文 → 代码注释 → README → API 文档
|
|
77
|
+
- **`start_ralph`** - Ralph Loop 循环开发:生成安全模式脚本 → 多轮迭代 → 自动保护 🆕
|
|
72
78
|
|
|
73
79
|
---
|
|
74
80
|
|
|
@@ -307,6 +313,85 @@ npm install mcp-probe-kit
|
|
|
307
313
|
|
|
308
314
|
## 📖 工具使用指南
|
|
309
315
|
|
|
316
|
+
### 🎯 访谈工具 🆕
|
|
317
|
+
|
|
318
|
+
#### `interview` - 需求访谈模式
|
|
319
|
+
|
|
320
|
+
在开发前通过结构化访谈澄清需求,避免理解偏差和返工。
|
|
321
|
+
|
|
322
|
+
**核心理念**: 先慢下来,把问题想清楚,反而能更快地交付正确的解决方案。
|
|
323
|
+
|
|
324
|
+
**用法**:
|
|
325
|
+
```
|
|
326
|
+
interview "实现用户登录功能"
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**访谈内容**:
|
|
330
|
+
- **阶段 1**: 背景理解(3个问题)- 痛点、用户、业务驱动
|
|
331
|
+
- **阶段 2**: 功能边界(4个问题)- 核心价值、范围、输入输出
|
|
332
|
+
- **阶段 3**: 技术约束(4个问题)- 技术栈、性能、兼容性、安全
|
|
333
|
+
- **阶段 4**: 验收标准(3个问题)- 成功标准、测试场景、效果衡量
|
|
334
|
+
|
|
335
|
+
**工作流程**:
|
|
336
|
+
```
|
|
337
|
+
1. AI: interview "登录功能"
|
|
338
|
+
↓
|
|
339
|
+
2. 生成 12-15 个结构化问题
|
|
340
|
+
↓
|
|
341
|
+
3. 用户回答所有问题
|
|
342
|
+
↓
|
|
343
|
+
4. AI 生成 docs/interviews/user-login-interview.md
|
|
344
|
+
↓
|
|
345
|
+
5. 用户选择:
|
|
346
|
+
- 立即开发: start_feature --from-interview user-login
|
|
347
|
+
- 生成规格: add_feature --from-interview user-login
|
|
348
|
+
- 稍后开发: 访谈记录已保存,随时可用
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**适用场景**:
|
|
352
|
+
- ✅ 需求不明确的新功能
|
|
353
|
+
- ✅ 复杂的业务功能
|
|
354
|
+
- ✅ 涉及多方协作的功能
|
|
355
|
+
- ❌ 简单的 Bug 修复
|
|
356
|
+
- ❌ 需求非常明确的功能
|
|
357
|
+
|
|
358
|
+
**详细文档**: 查看 [Interview 使用指南](docs/INTERVIEW_GUIDE.md)
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
#### `ask_user` - 通用提问工具
|
|
363
|
+
|
|
364
|
+
AI 可在任何时候主动向用户提问,澄清不确定的信息。
|
|
365
|
+
|
|
366
|
+
**用法**:
|
|
367
|
+
```
|
|
368
|
+
ask_user "你希望支持哪些支付方式?"
|
|
369
|
+
ask_user --questions ["问题1", "问题2"] --context "背景信息"
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
**功能特点**:
|
|
373
|
+
- 支持单个或多个问题
|
|
374
|
+
- 可提供选项供用户选择
|
|
375
|
+
- 可标注必答/可选
|
|
376
|
+
- 可在任何工具中使用
|
|
377
|
+
|
|
378
|
+
**使用场景**:
|
|
379
|
+
```
|
|
380
|
+
场景1: 代码审查时
|
|
381
|
+
AI: "发现了性能问题,但不确定优先级"
|
|
382
|
+
调用: ask_user "这个性能问题的优先级如何?是否需要立即优化?"
|
|
383
|
+
|
|
384
|
+
场景2: 技术方案选择
|
|
385
|
+
AI: "可以用两种方案,不确定你的偏好"
|
|
386
|
+
调用: ask_user --options ["方案A: 性能优先", "方案B: 可读性优先"]
|
|
387
|
+
|
|
388
|
+
场景3: Bug 修复时
|
|
389
|
+
AI: "需要确认是否向后兼容"
|
|
390
|
+
调用: ask_user "修复这个 Bug 是否需要保持向后兼容?"
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
310
395
|
### 🔍 代码质量工具
|
|
311
396
|
|
|
312
397
|
#### `detect_shell` - 套壳检测
|
|
@@ -1154,6 +1239,52 @@ design2code <div class="container">...</div>
|
|
|
1154
1239
|
|
|
1155
1240
|
## 🎯 使用场景示例
|
|
1156
1241
|
|
|
1242
|
+
### 🎤 Interview 模式(推荐)🆕
|
|
1243
|
+
|
|
1244
|
+
#### 场景 1: 需求不明确时
|
|
1245
|
+
```
|
|
1246
|
+
用户: "我想做登录功能"
|
|
1247
|
+
↓
|
|
1248
|
+
AI: interview "登录功能"
|
|
1249
|
+
↓
|
|
1250
|
+
生成 12-15 个结构化问题
|
|
1251
|
+
↓
|
|
1252
|
+
用户: 回答所有问题
|
|
1253
|
+
↓
|
|
1254
|
+
AI: 生成 docs/interviews/user-login-interview.md
|
|
1255
|
+
↓
|
|
1256
|
+
用户: "开始开发"
|
|
1257
|
+
↓
|
|
1258
|
+
AI: start_feature --from-interview user-login
|
|
1259
|
+
↓
|
|
1260
|
+
生成完整的功能规格文档 + 工作量估算
|
|
1261
|
+
```
|
|
1262
|
+
|
|
1263
|
+
#### 场景 2: 分步进行
|
|
1264
|
+
```
|
|
1265
|
+
第1天:
|
|
1266
|
+
用户: "我想做登录功能"
|
|
1267
|
+
AI: interview "登录功能"
|
|
1268
|
+
用户: [回答问题]
|
|
1269
|
+
AI: 生成访谈记录
|
|
1270
|
+
|
|
1271
|
+
第3天:
|
|
1272
|
+
用户: "开始做登录功能"
|
|
1273
|
+
AI: start_feature --from-interview user-login
|
|
1274
|
+
AI: 读取之前的访谈,生成规格文档
|
|
1275
|
+
```
|
|
1276
|
+
|
|
1277
|
+
#### 场景 3: AI 主动提问
|
|
1278
|
+
```
|
|
1279
|
+
用户: "优化这段代码"
|
|
1280
|
+
AI: 发现不确定因素
|
|
1281
|
+
AI: ask_user "优化目标是性能还是可读性?"
|
|
1282
|
+
用户: "性能"
|
|
1283
|
+
AI: 继续优化
|
|
1284
|
+
```
|
|
1285
|
+
|
|
1286
|
+
---
|
|
1287
|
+
|
|
1157
1288
|
### 📝 日常开发流程
|
|
1158
1289
|
```
|
|
1159
1290
|
1. code_review @feature.ts # 代码提交前审查
|
|
@@ -1187,7 +1318,19 @@ design2code <div class="container">...</div>
|
|
|
1187
1318
|
5. 开始维护和开发...
|
|
1188
1319
|
```
|
|
1189
1320
|
|
|
1190
|
-
### 🎯
|
|
1321
|
+
### 🎯 添加新功能(两种方式)
|
|
1322
|
+
|
|
1323
|
+
#### 方式 1: Interview 模式(需求不明确时)🆕
|
|
1324
|
+
```
|
|
1325
|
+
1. interview "用户登录认证功能" # 访谈澄清需求
|
|
1326
|
+
2. 回答 12-15 个问题
|
|
1327
|
+
3. start_feature --from-interview user-auth # 基于访谈生成规格
|
|
1328
|
+
4. 根据 tasks.md 逐步实现
|
|
1329
|
+
5. gentest @feature.ts # 生成测试
|
|
1330
|
+
6. gencommit # 提交代码
|
|
1331
|
+
```
|
|
1332
|
+
|
|
1333
|
+
#### 方式 2: 直接开发(需求明确时)
|
|
1191
1334
|
```
|
|
1192
1335
|
1. init_project_context # 确保项目上下文存在
|
|
1193
1336
|
2. add_feature user-auth "用户登录认证功能" # 生成功能规格
|
package/build/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
-
import { detectShell, initSetting, initProject, gencommit, debug, genapi, codeReview, gentest, genpr, checkDeps, gendoc, genchangelog, refactor, perf, fix, gensql, resolveConflict, genui, explain, convert, cssOrder, genreadme, split, analyzeProject, initProjectContext, addFeature, securityScan, fixBug, estimate, genMock, design2code, startFeature, startBugfix, startReview, startRelease, startRefactor, startOnboard, startApi, startDoc, genSkill } from "./tools/index.js";
|
|
5
|
+
import { detectShell, initSetting, initProject, gencommit, debug, genapi, codeReview, gentest, genpr, checkDeps, gendoc, genchangelog, refactor, perf, fix, gensql, resolveConflict, genui, explain, convert, cssOrder, genreadme, split, analyzeProject, initProjectContext, addFeature, securityScan, fixBug, estimate, genMock, design2code, startFeature, startBugfix, startReview, startRelease, startRefactor, startOnboard, startApi, startDoc, genSkill, startRalph, interview, askUser } from "./tools/index.js";
|
|
6
6
|
import { VERSION, NAME } from "./version.js";
|
|
7
7
|
import { allToolSchemas } from "./schemas/index.js";
|
|
8
8
|
import { getToolParamsGuide } from "./resources/index.js";
|
|
@@ -108,6 +108,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
108
108
|
return await startDoc(args);
|
|
109
109
|
case "gen_skill":
|
|
110
110
|
return await genSkill(args);
|
|
111
|
+
case "start_ralph":
|
|
112
|
+
return await startRalph(args);
|
|
113
|
+
// 访谈工具
|
|
114
|
+
case "interview":
|
|
115
|
+
return await interview(args);
|
|
116
|
+
case "ask_user":
|
|
117
|
+
return await askUser(args);
|
|
111
118
|
default:
|
|
112
119
|
throw new Error(`未知工具: ${name}`);
|
|
113
120
|
}
|
package/build/schemas/index.d.ts
CHANGED
|
@@ -764,4 +764,130 @@ export declare const allToolSchemas: ({
|
|
|
764
764
|
readonly required: readonly [];
|
|
765
765
|
readonly additionalProperties: true;
|
|
766
766
|
};
|
|
767
|
+
} | {
|
|
768
|
+
readonly name: "start_ralph";
|
|
769
|
+
readonly description: "当用户需要启动 Ralph Wiggum Loop 循环开发时使用。生成 .ralph/ 目录结构、安全模式脚本和执行指南。默认启用多重安全保护,防止无人值守时费用失控";
|
|
770
|
+
readonly inputSchema: {
|
|
771
|
+
readonly type: "object";
|
|
772
|
+
readonly properties: {
|
|
773
|
+
readonly goal: {
|
|
774
|
+
readonly type: "string";
|
|
775
|
+
readonly description: "本次要完成的目标/需求描述。例如:'实现用户认证功能'、'修复登录 bug'";
|
|
776
|
+
};
|
|
777
|
+
readonly mode: {
|
|
778
|
+
readonly type: "string";
|
|
779
|
+
readonly description: "运行模式:safe(安全模式,默认)、normal(普通模式)。安全模式包含多重保护机制";
|
|
780
|
+
};
|
|
781
|
+
readonly completion_promise: {
|
|
782
|
+
readonly type: "string";
|
|
783
|
+
readonly description: "完成条件描述。默认:'tests passing + requirements met'";
|
|
784
|
+
};
|
|
785
|
+
readonly test_command: {
|
|
786
|
+
readonly type: "string";
|
|
787
|
+
readonly description: "每轮执行的测试命令。默认:'npm test'(会在首轮由 agent 识别正确命令)";
|
|
788
|
+
};
|
|
789
|
+
readonly cli_command: {
|
|
790
|
+
readonly type: "string";
|
|
791
|
+
readonly description: "Claude Code CLI 命令名。默认:'claude-code'(可能需要改为 'claude')";
|
|
792
|
+
};
|
|
793
|
+
readonly max_iterations: {
|
|
794
|
+
readonly type: "number";
|
|
795
|
+
readonly description: "最大迭代轮数。safe 模式默认:8";
|
|
796
|
+
};
|
|
797
|
+
readonly max_minutes: {
|
|
798
|
+
readonly type: "number";
|
|
799
|
+
readonly description: "最大运行分钟数。safe 模式默认:25";
|
|
800
|
+
};
|
|
801
|
+
readonly confirm_every: {
|
|
802
|
+
readonly type: "number";
|
|
803
|
+
readonly description: "每几轮要求人工确认。safe 模式默认:1(每轮都确认)";
|
|
804
|
+
};
|
|
805
|
+
readonly confirm_timeout: {
|
|
806
|
+
readonly type: "number";
|
|
807
|
+
readonly description: "确认等待秒数,超时自动停止。safe 模式默认:20";
|
|
808
|
+
};
|
|
809
|
+
readonly max_same_output: {
|
|
810
|
+
readonly type: "number";
|
|
811
|
+
readonly description: "输出重复多少次停止(防卡死)。safe 模式默认:2";
|
|
812
|
+
};
|
|
813
|
+
readonly max_diff_lines: {
|
|
814
|
+
readonly type: "number";
|
|
815
|
+
readonly description: "git diff 变更行数超过此值停止(防失控)。safe 模式默认:300";
|
|
816
|
+
};
|
|
817
|
+
readonly cooldown_seconds: {
|
|
818
|
+
readonly type: "number";
|
|
819
|
+
readonly description: "每轮后冷却秒数。safe 模式默认:8";
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
readonly required: readonly [];
|
|
823
|
+
readonly additionalProperties: true;
|
|
824
|
+
};
|
|
825
|
+
} | {
|
|
826
|
+
readonly name: "interview";
|
|
827
|
+
readonly description: "当用户需求不明确、需要澄清需求时使用。需求访谈工具,在开发前通过结构化提问澄清需求,避免理解偏差和返工;生成访谈记录文件供后续 start_feature/add_feature 使用;仅支持 feature 类型";
|
|
828
|
+
readonly inputSchema: {
|
|
829
|
+
readonly type: "object";
|
|
830
|
+
readonly properties: {
|
|
831
|
+
readonly description: {
|
|
832
|
+
readonly type: "string";
|
|
833
|
+
readonly description: "功能描述(如'实现用户登录功能'),用于开始访谈。可以是简短的自然语言描述";
|
|
834
|
+
};
|
|
835
|
+
readonly feature_name: {
|
|
836
|
+
readonly type: "string";
|
|
837
|
+
readonly description: "功能名称(kebab-case 格式,如 user-login)。可选,会自动从描述中提取";
|
|
838
|
+
};
|
|
839
|
+
readonly answers: {
|
|
840
|
+
readonly type: "object";
|
|
841
|
+
readonly description: "访谈问题的回答(JSON 对象,key 为问题 ID,value 为回答内容)。用于提交访谈结果";
|
|
842
|
+
};
|
|
843
|
+
};
|
|
844
|
+
readonly required: readonly [];
|
|
845
|
+
readonly additionalProperties: true;
|
|
846
|
+
};
|
|
847
|
+
} | {
|
|
848
|
+
readonly name: "ask_user";
|
|
849
|
+
readonly description: "当 AI 需要更多信息、遇到不确定因素时使用。向用户提问工具,AI 可主动向用户提问;支持单个或多个问题、提供选项、标注重要性;可在任何时候使用";
|
|
850
|
+
readonly inputSchema: {
|
|
851
|
+
readonly type: "object";
|
|
852
|
+
readonly properties: {
|
|
853
|
+
readonly question: {
|
|
854
|
+
readonly type: "string";
|
|
855
|
+
readonly description: "单个问题(如'你希望支持哪些支付方式?')";
|
|
856
|
+
};
|
|
857
|
+
readonly questions: {
|
|
858
|
+
readonly type: "array";
|
|
859
|
+
readonly description: "多个问题列表,每个问题可包含 question、context、options、required 字段";
|
|
860
|
+
readonly items: {
|
|
861
|
+
readonly type: "object";
|
|
862
|
+
readonly properties: {
|
|
863
|
+
readonly question: {
|
|
864
|
+
readonly type: "string";
|
|
865
|
+
};
|
|
866
|
+
readonly context: {
|
|
867
|
+
readonly type: "string";
|
|
868
|
+
};
|
|
869
|
+
readonly options: {
|
|
870
|
+
readonly type: "array";
|
|
871
|
+
readonly items: {
|
|
872
|
+
readonly type: "string";
|
|
873
|
+
};
|
|
874
|
+
};
|
|
875
|
+
readonly required: {
|
|
876
|
+
readonly type: "boolean";
|
|
877
|
+
};
|
|
878
|
+
};
|
|
879
|
+
};
|
|
880
|
+
};
|
|
881
|
+
readonly context: {
|
|
882
|
+
readonly type: "string";
|
|
883
|
+
readonly description: "问题的背景信息或上下文";
|
|
884
|
+
};
|
|
885
|
+
readonly reason: {
|
|
886
|
+
readonly type: "string";
|
|
887
|
+
readonly description: "为什么要问这个问题(提问原因)";
|
|
888
|
+
};
|
|
889
|
+
};
|
|
890
|
+
readonly required: readonly [];
|
|
891
|
+
readonly additionalProperties: true;
|
|
892
|
+
};
|
|
767
893
|
})[];
|
package/build/schemas/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { codeGenToolSchemas } from "./code-gen-tools.js";
|
|
|
8
8
|
import { docUtilToolSchemas } from "./doc-util-tools.js";
|
|
9
9
|
import { projectToolSchemas } from "./project-tools.js";
|
|
10
10
|
import { orchestrationToolSchemas } from "./orchestration-tools.js";
|
|
11
|
+
import { interviewToolSchemas } from "./interview-tools.js";
|
|
11
12
|
// 合并所有工具 schemas
|
|
12
13
|
export const allToolSchemas = [
|
|
13
14
|
...basicToolSchemas,
|
|
@@ -17,4 +18,5 @@ export const allToolSchemas = [
|
|
|
17
18
|
...docUtilToolSchemas,
|
|
18
19
|
...projectToolSchemas,
|
|
19
20
|
...orchestrationToolSchemas,
|
|
21
|
+
...interviewToolSchemas,
|
|
20
22
|
];
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 访谈工具的 Schema 定义
|
|
3
|
+
*/
|
|
4
|
+
export declare const interviewToolSchemas: readonly [{
|
|
5
|
+
readonly name: "interview";
|
|
6
|
+
readonly description: "当用户需求不明确、需要澄清需求时使用。需求访谈工具,在开发前通过结构化提问澄清需求,避免理解偏差和返工;生成访谈记录文件供后续 start_feature/add_feature 使用;仅支持 feature 类型";
|
|
7
|
+
readonly inputSchema: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly description: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "功能描述(如'实现用户登录功能'),用于开始访谈。可以是简短的自然语言描述";
|
|
13
|
+
};
|
|
14
|
+
readonly feature_name: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: "功能名称(kebab-case 格式,如 user-login)。可选,会自动从描述中提取";
|
|
17
|
+
};
|
|
18
|
+
readonly answers: {
|
|
19
|
+
readonly type: "object";
|
|
20
|
+
readonly description: "访谈问题的回答(JSON 对象,key 为问题 ID,value 为回答内容)。用于提交访谈结果";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly required: readonly [];
|
|
24
|
+
readonly additionalProperties: true;
|
|
25
|
+
};
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "ask_user";
|
|
28
|
+
readonly description: "当 AI 需要更多信息、遇到不确定因素时使用。向用户提问工具,AI 可主动向用户提问;支持单个或多个问题、提供选项、标注重要性;可在任何时候使用";
|
|
29
|
+
readonly inputSchema: {
|
|
30
|
+
readonly type: "object";
|
|
31
|
+
readonly properties: {
|
|
32
|
+
readonly question: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "单个问题(如'你希望支持哪些支付方式?')";
|
|
35
|
+
};
|
|
36
|
+
readonly questions: {
|
|
37
|
+
readonly type: "array";
|
|
38
|
+
readonly description: "多个问题列表,每个问题可包含 question、context、options、required 字段";
|
|
39
|
+
readonly items: {
|
|
40
|
+
readonly type: "object";
|
|
41
|
+
readonly properties: {
|
|
42
|
+
readonly question: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
};
|
|
45
|
+
readonly context: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
};
|
|
48
|
+
readonly options: {
|
|
49
|
+
readonly type: "array";
|
|
50
|
+
readonly items: {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
readonly required: {
|
|
55
|
+
readonly type: "boolean";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
readonly context: {
|
|
61
|
+
readonly type: "string";
|
|
62
|
+
readonly description: "问题的背景信息或上下文";
|
|
63
|
+
};
|
|
64
|
+
readonly reason: {
|
|
65
|
+
readonly type: "string";
|
|
66
|
+
readonly description: "为什么要问这个问题(提问原因)";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
readonly required: readonly [];
|
|
70
|
+
readonly additionalProperties: true;
|
|
71
|
+
};
|
|
72
|
+
}];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 访谈工具的 Schema 定义
|
|
3
|
+
*/
|
|
4
|
+
export const interviewToolSchemas = [
|
|
5
|
+
{
|
|
6
|
+
name: "interview",
|
|
7
|
+
description: "当用户需求不明确、需要澄清需求时使用。需求访谈工具,在开发前通过结构化提问澄清需求,避免理解偏差和返工;生成访谈记录文件供后续 start_feature/add_feature 使用;仅支持 feature 类型",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
description: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "功能描述(如'实现用户登录功能'),用于开始访谈。可以是简短的自然语言描述",
|
|
14
|
+
},
|
|
15
|
+
feature_name: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "功能名称(kebab-case 格式,如 user-login)。可选,会自动从描述中提取",
|
|
18
|
+
},
|
|
19
|
+
answers: {
|
|
20
|
+
type: "object",
|
|
21
|
+
description: "访谈问题的回答(JSON 对象,key 为问题 ID,value 为回答内容)。用于提交访谈结果",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
required: [],
|
|
25
|
+
additionalProperties: true,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "ask_user",
|
|
30
|
+
description: "当 AI 需要更多信息、遇到不确定因素时使用。向用户提问工具,AI 可主动向用户提问;支持单个或多个问题、提供选项、标注重要性;可在任何时候使用",
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {
|
|
34
|
+
question: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "单个问题(如'你希望支持哪些支付方式?')",
|
|
37
|
+
},
|
|
38
|
+
questions: {
|
|
39
|
+
type: "array",
|
|
40
|
+
description: "多个问题列表,每个问题可包含 question、context、options、required 字段",
|
|
41
|
+
items: {
|
|
42
|
+
type: "object",
|
|
43
|
+
properties: {
|
|
44
|
+
question: { type: "string" },
|
|
45
|
+
context: { type: "string" },
|
|
46
|
+
options: { type: "array", items: { type: "string" } },
|
|
47
|
+
required: { type: "boolean" },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
context: {
|
|
52
|
+
type: "string",
|
|
53
|
+
description: "问题的背景信息或上下文",
|
|
54
|
+
},
|
|
55
|
+
reason: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "为什么要问这个问题(提问原因)",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
required: [],
|
|
61
|
+
additionalProperties: true,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
];
|
|
@@ -183,4 +183,62 @@ export declare const orchestrationToolSchemas: readonly [{
|
|
|
183
183
|
readonly required: readonly [];
|
|
184
184
|
readonly additionalProperties: true;
|
|
185
185
|
};
|
|
186
|
+
}, {
|
|
187
|
+
readonly name: "start_ralph";
|
|
188
|
+
readonly description: "当用户需要启动 Ralph Wiggum Loop 循环开发时使用。生成 .ralph/ 目录结构、安全模式脚本和执行指南。默认启用多重安全保护,防止无人值守时费用失控";
|
|
189
|
+
readonly inputSchema: {
|
|
190
|
+
readonly type: "object";
|
|
191
|
+
readonly properties: {
|
|
192
|
+
readonly goal: {
|
|
193
|
+
readonly type: "string";
|
|
194
|
+
readonly description: "本次要完成的目标/需求描述。例如:'实现用户认证功能'、'修复登录 bug'";
|
|
195
|
+
};
|
|
196
|
+
readonly mode: {
|
|
197
|
+
readonly type: "string";
|
|
198
|
+
readonly description: "运行模式:safe(安全模式,默认)、normal(普通模式)。安全模式包含多重保护机制";
|
|
199
|
+
};
|
|
200
|
+
readonly completion_promise: {
|
|
201
|
+
readonly type: "string";
|
|
202
|
+
readonly description: "完成条件描述。默认:'tests passing + requirements met'";
|
|
203
|
+
};
|
|
204
|
+
readonly test_command: {
|
|
205
|
+
readonly type: "string";
|
|
206
|
+
readonly description: "每轮执行的测试命令。默认:'npm test'(会在首轮由 agent 识别正确命令)";
|
|
207
|
+
};
|
|
208
|
+
readonly cli_command: {
|
|
209
|
+
readonly type: "string";
|
|
210
|
+
readonly description: "Claude Code CLI 命令名。默认:'claude-code'(可能需要改为 'claude')";
|
|
211
|
+
};
|
|
212
|
+
readonly max_iterations: {
|
|
213
|
+
readonly type: "number";
|
|
214
|
+
readonly description: "最大迭代轮数。safe 模式默认:8";
|
|
215
|
+
};
|
|
216
|
+
readonly max_minutes: {
|
|
217
|
+
readonly type: "number";
|
|
218
|
+
readonly description: "最大运行分钟数。safe 模式默认:25";
|
|
219
|
+
};
|
|
220
|
+
readonly confirm_every: {
|
|
221
|
+
readonly type: "number";
|
|
222
|
+
readonly description: "每几轮要求人工确认。safe 模式默认:1(每轮都确认)";
|
|
223
|
+
};
|
|
224
|
+
readonly confirm_timeout: {
|
|
225
|
+
readonly type: "number";
|
|
226
|
+
readonly description: "确认等待秒数,超时自动停止。safe 模式默认:20";
|
|
227
|
+
};
|
|
228
|
+
readonly max_same_output: {
|
|
229
|
+
readonly type: "number";
|
|
230
|
+
readonly description: "输出重复多少次停止(防卡死)。safe 模式默认:2";
|
|
231
|
+
};
|
|
232
|
+
readonly max_diff_lines: {
|
|
233
|
+
readonly type: "number";
|
|
234
|
+
readonly description: "git diff 变更行数超过此值停止(防失控)。safe 模式默认:300";
|
|
235
|
+
};
|
|
236
|
+
readonly cooldown_seconds: {
|
|
237
|
+
readonly type: "number";
|
|
238
|
+
readonly description: "每轮后冷却秒数。safe 模式默认:8";
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
readonly required: readonly [];
|
|
242
|
+
readonly additionalProperties: true;
|
|
243
|
+
};
|
|
186
244
|
}];
|
|
@@ -193,4 +193,63 @@ export const orchestrationToolSchemas = [
|
|
|
193
193
|
additionalProperties: true,
|
|
194
194
|
},
|
|
195
195
|
},
|
|
196
|
+
{
|
|
197
|
+
name: "start_ralph",
|
|
198
|
+
description: "当用户需要启动 Ralph Wiggum Loop 循环开发时使用。生成 .ralph/ 目录结构、安全模式脚本和执行指南。默认启用多重安全保护,防止无人值守时费用失控",
|
|
199
|
+
inputSchema: {
|
|
200
|
+
type: "object",
|
|
201
|
+
properties: {
|
|
202
|
+
goal: {
|
|
203
|
+
type: "string",
|
|
204
|
+
description: "本次要完成的目标/需求描述。例如:'实现用户认证功能'、'修复登录 bug'",
|
|
205
|
+
},
|
|
206
|
+
mode: {
|
|
207
|
+
type: "string",
|
|
208
|
+
description: "运行模式:safe(安全模式,默认)、normal(普通模式)。安全模式包含多重保护机制",
|
|
209
|
+
},
|
|
210
|
+
completion_promise: {
|
|
211
|
+
type: "string",
|
|
212
|
+
description: "完成条件描述。默认:'tests passing + requirements met'",
|
|
213
|
+
},
|
|
214
|
+
test_command: {
|
|
215
|
+
type: "string",
|
|
216
|
+
description: "每轮执行的测试命令。默认:'npm test'(会在首轮由 agent 识别正确命令)",
|
|
217
|
+
},
|
|
218
|
+
cli_command: {
|
|
219
|
+
type: "string",
|
|
220
|
+
description: "Claude Code CLI 命令名。默认:'claude-code'(可能需要改为 'claude')",
|
|
221
|
+
},
|
|
222
|
+
max_iterations: {
|
|
223
|
+
type: "number",
|
|
224
|
+
description: "最大迭代轮数。safe 模式默认:8",
|
|
225
|
+
},
|
|
226
|
+
max_minutes: {
|
|
227
|
+
type: "number",
|
|
228
|
+
description: "最大运行分钟数。safe 模式默认:25",
|
|
229
|
+
},
|
|
230
|
+
confirm_every: {
|
|
231
|
+
type: "number",
|
|
232
|
+
description: "每几轮要求人工确认。safe 模式默认:1(每轮都确认)",
|
|
233
|
+
},
|
|
234
|
+
confirm_timeout: {
|
|
235
|
+
type: "number",
|
|
236
|
+
description: "确认等待秒数,超时自动停止。safe 模式默认:20",
|
|
237
|
+
},
|
|
238
|
+
max_same_output: {
|
|
239
|
+
type: "number",
|
|
240
|
+
description: "输出重复多少次停止(防卡死)。safe 模式默认:2",
|
|
241
|
+
},
|
|
242
|
+
max_diff_lines: {
|
|
243
|
+
type: "number",
|
|
244
|
+
description: "git diff 变更行数超过此值停止(防失控)。safe 模式默认:300",
|
|
245
|
+
},
|
|
246
|
+
cooldown_seconds: {
|
|
247
|
+
type: "number",
|
|
248
|
+
description: "每轮后冷却秒数。safe 模式默认:8",
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
required: [],
|
|
252
|
+
additionalProperties: true,
|
|
253
|
+
},
|
|
254
|
+
},
|
|
196
255
|
];
|