mcp-probe-kit 1.7.0 → 1.8.1
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 +44 -2
- package/build/index.js +112 -83
- package/build/tools/code_review.js +33 -0
- package/build/tools/convert.js +9 -0
- package/build/tools/debug.js +41 -0
- package/build/tools/design2code.js +9 -0
- package/build/tools/estimate.js +41 -9
- package/build/tools/explain.js +8 -0
- package/build/tools/fix_bug.js +44 -0
- package/build/tools/gen_skill.d.ts +16 -0
- package/build/tools/gen_skill.js +543 -0
- package/build/tools/genapi.js +10 -1
- package/build/tools/genchangelog.js +9 -1
- package/build/tools/gendoc.js +9 -0
- package/build/tools/genpr.js +8 -0
- package/build/tools/gentest.js +9 -0
- package/build/tools/genui.js +9 -0
- package/build/tools/index.d.ts +1 -0
- package/build/tools/index.js +1 -0
- package/build/tools/perf.js +37 -0
- package/build/tools/refactor.js +9 -0
- package/build/tools/security_scan.js +35 -9
- package/build/tools/split.js +9 -0
- package/docs/BEST_PRACTICES.md +9 -0
- package/docs/HOW_TO_TRIGGER.html +68 -69
- package/docs/HOW_TO_TRIGGER.md +41 -2
- package/package.json +2 -2
- package/docs/specs/add-feature/design.md +0 -608
- package/docs/specs/add-feature/requirements.md +0 -175
- package/docs/specs/add-feature/tasks.md +0 -111
- package/docs/specs/design2code/README.md +0 -0
- package/docs/specs/design2code/requirements.md +0 -0
- package/docs/specs/estimate/design.md +0 -209
- package/docs/specs/estimate/requirements.md +0 -140
- package/docs/specs/estimate/tasks.md +0 -66
- package/docs/specs/fix-bug/design.md +0 -259
- package/docs/specs/fix-bug/requirements.md +0 -132
- package/docs/specs/fix-bug/tasks.md +0 -66
- package/docs/specs/gen-mock/design.md +0 -241
- package/docs/specs/gen-mock/requirements.md +0 -137
- package/docs/specs/gen-mock/tasks.md +0 -66
- package/docs/specs/init-project-context/design.md +0 -515
- package/docs/specs/init-project-context/requirements.md +0 -144
- package/docs/specs/init-project-context/tasks.md +0 -93
- package/docs/specs/security-scan/design.md +0 -152
- package/docs/specs/security-scan/requirements.md +0 -150
- package/docs/specs/security-scan/tasks.md +0 -67
- package/docs/specs/start-bugfix/design.md +0 -42
- package/docs/specs/start-bugfix/requirements.md +0 -70
- package/docs/specs/start-bugfix/tasks.md +0 -21
- package/docs/specs/start-feature/design.md +0 -41
- package/docs/specs/start-feature/requirements.md +0 -90
- package/docs/specs/start-feature/tasks.md +0 -21
- package/docs/specs/start-review/requirements.md +0 -0
|
@@ -113,6 +113,39 @@ ${code || "请提供需要审查的代码"}
|
|
|
113
113
|
|
|
114
114
|
---
|
|
115
115
|
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 📤 输出格式要求
|
|
119
|
+
|
|
120
|
+
请严格按以下 JSON 格式输出审查结果:
|
|
121
|
+
|
|
122
|
+
\`\`\`json
|
|
123
|
+
{
|
|
124
|
+
"summary": "代码整体评价(一句话)",
|
|
125
|
+
"score": 85,
|
|
126
|
+
"issues": [
|
|
127
|
+
{
|
|
128
|
+
"severity": "critical|high|medium|low",
|
|
129
|
+
"category": "quality|security|performance|style",
|
|
130
|
+
"file": "文件路径(如有)",
|
|
131
|
+
"line": 10,
|
|
132
|
+
"code": "问题代码片段",
|
|
133
|
+
"message": "问题描述",
|
|
134
|
+
"suggestion": "修复建议",
|
|
135
|
+
"fix_example": "修复示例代码"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"highlights": ["做得好的地方1", "做得好的地方2"]
|
|
139
|
+
}
|
|
140
|
+
\`\`\`
|
|
141
|
+
|
|
142
|
+
## ⚠️ 边界约束
|
|
143
|
+
|
|
144
|
+
- ❌ 仅分析,不自动修改源代码
|
|
145
|
+
- ❌ 不执行代码或 shell 命令
|
|
146
|
+
- ❌ 不做业务逻辑正确性判断(只关注代码质量)
|
|
147
|
+
- ✅ 输出结构化问题清单和改进建议
|
|
148
|
+
|
|
116
149
|
现在请开始代码审查,生成详细的审查报告。`;
|
|
117
150
|
return {
|
|
118
151
|
content: [
|
package/build/tools/convert.js
CHANGED
package/build/tools/debug.js
CHANGED
|
@@ -53,6 +53,47 @@ ${context || "请提供相关代码或场景描述"}
|
|
|
53
53
|
- TimeoutError → 检查异步操作和网络请求
|
|
54
54
|
- MemoryError → 检查内存泄漏和资源释放
|
|
55
55
|
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 📤 输出格式要求
|
|
59
|
+
|
|
60
|
+
请严格按以下 JSON 格式输出分析结果:
|
|
61
|
+
|
|
62
|
+
\`\`\`json
|
|
63
|
+
{
|
|
64
|
+
"error_analysis": {
|
|
65
|
+
"type": "错误类型(SyntaxError/TypeError/LogicError等)",
|
|
66
|
+
"severity": "critical|high|medium|low",
|
|
67
|
+
"root_cause": "根本原因分析"
|
|
68
|
+
},
|
|
69
|
+
"possible_causes": [
|
|
70
|
+
{
|
|
71
|
+
"probability": "high|medium|low",
|
|
72
|
+
"description": "可能原因描述",
|
|
73
|
+
"evidence": "支持证据"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"debug_strategy": [
|
|
77
|
+
{
|
|
78
|
+
"step": 1,
|
|
79
|
+
"action": "调试步骤描述",
|
|
80
|
+
"expected_result": "预期结果"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"solutions": {
|
|
84
|
+
"quick_fix": "临时解决方案",
|
|
85
|
+
"root_fix": "根本解决方案",
|
|
86
|
+
"prevention": "预防措施"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
\`\`\`
|
|
90
|
+
|
|
91
|
+
## ⚠️ 边界约束
|
|
92
|
+
|
|
93
|
+
- ❌ 仅分析和建议,不自动修改代码
|
|
94
|
+
- ❌ 不执行代码或命令
|
|
95
|
+
- ✅ 输出结构化调试策略和解决方案
|
|
96
|
+
|
|
56
97
|
现在请按照上述步骤分析错误并提供具体的调试方案。`;
|
|
57
98
|
return {
|
|
58
99
|
content: [
|
|
@@ -231,6 +231,15 @@ src/components/
|
|
|
231
231
|
|
|
232
232
|
---
|
|
233
233
|
|
|
234
|
+
## ⚠️ 边界约束
|
|
235
|
+
|
|
236
|
+
- ❌ 仅输出组件代码,不自动创建文件
|
|
237
|
+
- ❌ 不执行代码或命令
|
|
238
|
+
- ✅ 默认输出与项目一致的框架与样式方案
|
|
239
|
+
- ✅ 1:1 还原设计稿布局和样式
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
234
243
|
*工具: MCP Probe Kit - design2code*
|
|
235
244
|
`;
|
|
236
245
|
export async function design2code(args) {
|
package/build/tools/estimate.js
CHANGED
|
@@ -171,15 +171,47 @@ const PROMPT_TEMPLATE = `# 工作量估算指南
|
|
|
171
171
|
|
|
172
172
|
---
|
|
173
173
|
|
|
174
|
-
##
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
174
|
+
## 📤 输出格式要求
|
|
175
|
+
|
|
176
|
+
请严格按以下 JSON 格式输出估算结果:
|
|
177
|
+
|
|
178
|
+
\`\`\`json
|
|
179
|
+
{
|
|
180
|
+
"summary": "任务估算总结(一句话)",
|
|
181
|
+
"estimate": {
|
|
182
|
+
"story_points": 5,
|
|
183
|
+
"hours": { "optimistic": 4, "expected": 8, "pessimistic": 16 },
|
|
184
|
+
"confidence": "high|medium|low"
|
|
185
|
+
},
|
|
186
|
+
"complexity": {
|
|
187
|
+
"code_volume": { "score": 3, "reason": "中等代码量" },
|
|
188
|
+
"technical_difficulty": { "score": 4, "reason": "涉及新技术" },
|
|
189
|
+
"dependency": { "score": 2, "reason": "依赖较少" },
|
|
190
|
+
"testing": { "score": 3, "reason": "需要集成测试" }
|
|
191
|
+
},
|
|
192
|
+
"breakdown": [
|
|
193
|
+
{ "activity": "需求理解", "hours": 1 },
|
|
194
|
+
{ "activity": "设计", "hours": 2 },
|
|
195
|
+
{ "activity": "编码", "hours": 4 },
|
|
196
|
+
{ "activity": "测试", "hours": 2 }
|
|
197
|
+
],
|
|
198
|
+
"risks": [
|
|
199
|
+
{
|
|
200
|
+
"type": "technical|dependency|requirement",
|
|
201
|
+
"description": "风险描述",
|
|
202
|
+
"impact": "high|medium|low",
|
|
203
|
+
"mitigation": "缓解措施"
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
"split_suggestion": ["子任务1", "子任务2"]
|
|
207
|
+
}
|
|
208
|
+
\`\`\`
|
|
209
|
+
|
|
210
|
+
## ⚠️ 边界约束
|
|
211
|
+
|
|
212
|
+
- ❌ 仅估算,不执行任何开发工作
|
|
213
|
+
- ❌ 估算基于静态分析,实际可能有偏差
|
|
214
|
+
- ✅ 输出结构化估算结果和风险分析
|
|
183
215
|
|
|
184
216
|
---
|
|
185
217
|
|
package/build/tools/explain.js
CHANGED
package/build/tools/fix_bug.js
CHANGED
|
@@ -247,6 +247,50 @@ describe('[功能描述]', () => {
|
|
|
247
247
|
|
|
248
248
|
---
|
|
249
249
|
|
|
250
|
+
## 📤 输出格式要求
|
|
251
|
+
|
|
252
|
+
请严格按以下 JSON 格式输出修复指南:
|
|
253
|
+
|
|
254
|
+
\`\`\`json
|
|
255
|
+
{
|
|
256
|
+
"bug_summary": "Bug 简述(一句话)",
|
|
257
|
+
"analysis": {
|
|
258
|
+
"error_type": "错误类型",
|
|
259
|
+
"direct_cause": "直接原因",
|
|
260
|
+
"root_cause": "根本原因",
|
|
261
|
+
"affected_scope": "影响范围"
|
|
262
|
+
},
|
|
263
|
+
"location": {
|
|
264
|
+
"file": "问题文件路径",
|
|
265
|
+
"line": 42,
|
|
266
|
+
"function": "问题函数名",
|
|
267
|
+
"code_snippet": "问题代码片段"
|
|
268
|
+
},
|
|
269
|
+
"fix_plan": {
|
|
270
|
+
"chosen_solution": "选择的修复方案",
|
|
271
|
+
"reason": "选择理由",
|
|
272
|
+
"steps": [
|
|
273
|
+
{ "step": 1, "action": "修复步骤", "file": "文件", "change": "变更内容" }
|
|
274
|
+
],
|
|
275
|
+
"code_before": "修改前代码",
|
|
276
|
+
"code_after": "修改后代码"
|
|
277
|
+
},
|
|
278
|
+
"verification": {
|
|
279
|
+
"test_cases": ["测试用例1", "测试用例2"],
|
|
280
|
+
"manual_checks": ["手动验证项1", "手动验证项2"]
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
\`\`\`
|
|
284
|
+
|
|
285
|
+
## ⚠️ 边界约束
|
|
286
|
+
|
|
287
|
+
- ❌ 仅提供修复指南,不保证自动修改代码
|
|
288
|
+
- ❌ 不执行代码或命令
|
|
289
|
+
- ✅ 输出结构化修复方案和验证步骤
|
|
290
|
+
- 💡 如需自动修复,可配合 fix 工具应用 patch
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
250
294
|
*指南版本: 1.0.0*
|
|
251
295
|
*工具: MCP Probe Kit - fix_bug*
|
|
252
296
|
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gen_skill - 生成 Agent Skills 文档
|
|
3
|
+
*/
|
|
4
|
+
export declare function genSkill(args: any): Promise<{
|
|
5
|
+
content: {
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}[];
|
|
9
|
+
isError?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
content: {
|
|
12
|
+
type: string;
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
15
|
+
isError: boolean;
|
|
16
|
+
}>;
|