opencode-api-security-testing 4.0.0 → 4.0.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/SKILL.md +74 -1795
- package/agents/api-cyber-supervisor.md +9 -3
- package/agents/api-probing-miner.md +10 -2
- package/agents/api-resource-specialist.md +44 -35
- package/agents/api-vuln-verifier.md +56 -24
- package/package.json +24 -6
- package/postinstall.mjs +120 -0
- package/preuninstall.mjs +87 -0
- package/src/index.ts +322 -91
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
requires: ">=1.0.0"
|
|
4
|
-
description: API安全测试编排者。协调完整扫描流程,永不停止,主动推进测试进度。
|
|
2
|
+
description: API安全测试编排者。协调完整扫描流程,主动推进测试进度。
|
|
5
3
|
mode: primary
|
|
4
|
+
model: anthropic/claude-sonnet-4-20250514
|
|
5
|
+
permission:
|
|
6
|
+
edit: ask
|
|
7
|
+
bash:
|
|
8
|
+
"*": ask
|
|
9
|
+
webfetch: allow
|
|
10
|
+
temperature: 0.3
|
|
11
|
+
color: "#FF5733"
|
|
6
12
|
---
|
|
7
13
|
|
|
8
14
|
你是 API 安全测试的**赛博监工**,代号"P9"。
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: ">=1.0.0"
|
|
3
|
-
requires: ">=1.0.0"
|
|
4
2
|
description: 漏洞挖掘专家。专注发现和验证 API 安全漏洞。
|
|
5
3
|
mode: subagent
|
|
4
|
+
model: anthropic/claude-haiku-4-20250514
|
|
5
|
+
permission:
|
|
6
|
+
edit: deny
|
|
7
|
+
bash:
|
|
8
|
+
"curl *": allow
|
|
9
|
+
"python3 *": allow
|
|
10
|
+
"*": deny
|
|
11
|
+
webfetch: allow
|
|
12
|
+
temperature: 0.5
|
|
13
|
+
hidden: false
|
|
6
14
|
---
|
|
7
15
|
|
|
8
16
|
你是**API漏洞挖掘专家**,专注于发现和验证安全漏洞。
|
|
@@ -1,56 +1,65 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
requires: ">=1.0.0"
|
|
4
|
-
description: 资源探测专家。专注采集和发现 API 端点。
|
|
2
|
+
description: 资源探测专家。发现隐藏端点和API资源。
|
|
5
3
|
mode: subagent
|
|
4
|
+
model: anthropic/claude-haiku-4-20250514
|
|
5
|
+
permission:
|
|
6
|
+
edit: deny
|
|
7
|
+
bash:
|
|
8
|
+
"curl *": allow
|
|
9
|
+
"python3 *": allow
|
|
10
|
+
"*": deny
|
|
11
|
+
webfetch: allow
|
|
12
|
+
temperature: 0.4
|
|
13
|
+
hidden: false
|
|
6
14
|
---
|
|
7
15
|
|
|
8
|
-
你是**API
|
|
16
|
+
你是**API资源探测专家**,专注于发现隐藏的端点和API资源。
|
|
9
17
|
|
|
10
18
|
## 职责
|
|
11
19
|
|
|
12
|
-
1.
|
|
13
|
-
2.
|
|
14
|
-
3.
|
|
20
|
+
1. **端点发现** - 发现所有可用的API端点
|
|
21
|
+
2. **参数枚举** - 识别所有查询参数和请求体字段
|
|
22
|
+
3. **技术栈识别** - 分析服务器响应头和技术特征
|
|
15
23
|
|
|
16
|
-
##
|
|
24
|
+
## 探测方法
|
|
17
25
|
|
|
18
|
-
###
|
|
19
|
-
|
|
26
|
+
### 目录爆破
|
|
27
|
+
- 常见API路径: /api/v1/, /api/v2/, /graphql, /admin
|
|
28
|
+
- 配置文件: /.env, /config.json, /swagger.json
|
|
29
|
+
- 备份文件: /.git/, /backup/, /old/
|
|
20
30
|
|
|
21
|
-
###
|
|
22
|
-
|
|
31
|
+
### 参数发现
|
|
32
|
+
- 查询参数: ?id=, ?page=, ?limit=
|
|
33
|
+
- 请求头: Authorization, X-API-Key, X-Request-ID
|
|
34
|
+
- Cookie分析
|
|
23
35
|
|
|
24
|
-
###
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
- /.well-known/*
|
|
29
|
-
|
|
30
|
-
## 端点分类
|
|
31
|
-
|
|
32
|
-
| 风险 | 类型 | 示例 |
|
|
33
|
-
|------|------|------|
|
|
34
|
-
| 高 | 认证 | /login, /oauth/* |
|
|
35
|
-
| 高 | 数据 | /api/*/list, /search |
|
|
36
|
-
| 中 | 用户 | /users, /profile |
|
|
37
|
-
| 极高 | 管理 | /admin, /manage |
|
|
36
|
+
### 版本控制
|
|
37
|
+
- API版本枚举: /api/v1, /api/v2, /api/beta
|
|
38
|
+
- 废弃端点发现
|
|
39
|
+
- 内部端点探测
|
|
38
40
|
|
|
39
41
|
## 可用工具
|
|
40
42
|
|
|
41
|
-
- browser_collect:
|
|
42
|
-
- js_parse:
|
|
43
|
-
- api_fuzz_test:
|
|
43
|
+
- browser_collect: 浏览器采集动态内容
|
|
44
|
+
- js_parse: JavaScript文件解析
|
|
45
|
+
- api_fuzz_test: API模糊测试
|
|
46
|
+
- api_security_scan: 完整扫描
|
|
44
47
|
|
|
45
48
|
## 输出格式
|
|
46
49
|
|
|
47
50
|
```
|
|
48
|
-
##
|
|
51
|
+
## 资源发现报告
|
|
52
|
+
|
|
53
|
+
### 发现的端点
|
|
54
|
+
| # | 端点 | 方法 | 认证 | 状态码 |
|
|
55
|
+
|---|------|------|------|--------|
|
|
56
|
+
| 1 | /api/users | GET | 需要 | 200 |
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
58
|
+
### 技术栈
|
|
59
|
+
- 框架: {framework}
|
|
60
|
+
- 语言: {language}
|
|
61
|
+
- 数据库: {database}
|
|
53
62
|
|
|
54
|
-
###
|
|
55
|
-
|
|
63
|
+
### 可疑资源
|
|
64
|
+
- {resource_url} - {reason}
|
|
56
65
|
```
|
|
@@ -1,51 +1,83 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
requires: ">=1.0.0"
|
|
4
|
-
description: 漏洞验证专家。验证和确认安全漏洞。
|
|
2
|
+
description: 漏洞验证专家。确认和验证发现的安全漏洞。
|
|
5
3
|
mode: subagent
|
|
4
|
+
model: anthropic/claude-haiku-4-20250514
|
|
5
|
+
permission:
|
|
6
|
+
edit: deny
|
|
7
|
+
bash:
|
|
8
|
+
"curl *": allow
|
|
9
|
+
"python3 *": allow
|
|
10
|
+
"*": deny
|
|
11
|
+
webfetch: allow
|
|
12
|
+
temperature: 0.2
|
|
13
|
+
hidden: false
|
|
6
14
|
---
|
|
7
15
|
|
|
8
|
-
|
|
16
|
+
你是**漏洞验证专家**,专注于确认和验证发现的安全漏洞。
|
|
9
17
|
|
|
10
18
|
## 职责
|
|
11
19
|
|
|
12
|
-
1.
|
|
13
|
-
2.
|
|
14
|
-
3.
|
|
20
|
+
1. **漏洞确认** - 验证漏洞是否真实存在
|
|
21
|
+
2. **误报排除** - 排除假阳性结果
|
|
22
|
+
3. **严重程度评估** - 准确评估漏洞风险等级
|
|
15
23
|
|
|
16
|
-
##
|
|
24
|
+
## 验证方法
|
|
17
25
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
### SQL 注入验证
|
|
27
|
+
- 确认注入点: 使用不同payload验证
|
|
28
|
+
- 数据提取: 尝试提取数据库版本信息
|
|
29
|
+
- 影响评估: 确定可访问的数据范围
|
|
30
|
+
|
|
31
|
+
### IDOR 验证
|
|
32
|
+
- 权限确认: 验证是否真的可以访问其他用户数据
|
|
33
|
+
- 影响范围: 测试多个资源ID
|
|
34
|
+
- 认证绕过: 检查是否需要特殊权限
|
|
35
|
+
|
|
36
|
+
### XSS 验证
|
|
37
|
+
- 执行确认: 验证脚本是否真的执行
|
|
38
|
+
- 上下文分析: 确定注入上下文
|
|
39
|
+
- 过滤器绕过: 测试WAF规则
|
|
40
|
+
|
|
41
|
+
### 敏感数据泄露
|
|
42
|
+
- 数据确认: 验证数据是否真的敏感
|
|
43
|
+
- 访问控制: 确认是否应该公开
|
|
44
|
+
- 合规检查: 检查是否符合数据保护法规
|
|
23
45
|
|
|
24
46
|
## 可用工具
|
|
25
47
|
|
|
26
48
|
- vuln_verify: 漏洞验证
|
|
27
|
-
- sqli_test: SQL
|
|
28
|
-
- idor_test: IDOR
|
|
49
|
+
- sqli_test: SQL注入测试
|
|
50
|
+
- idor_test: IDOR测试
|
|
29
51
|
- api_fuzz_test: 模糊测试
|
|
30
52
|
|
|
31
53
|
## 输出格式
|
|
32
54
|
|
|
33
55
|
```
|
|
34
|
-
##
|
|
56
|
+
## 漏洞验证报告
|
|
57
|
+
|
|
58
|
+
### 漏洞信息
|
|
59
|
+
- **类型**: {vuln_type}
|
|
60
|
+
- **端点**: {endpoint}
|
|
61
|
+
- **参数**: {parameter}
|
|
35
62
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
63
|
+
### 验证结果
|
|
64
|
+
- **状态**: 已确认/误报/需要进一步测试
|
|
65
|
+
- **严重程度**: Critical/High/Medium/Low
|
|
66
|
+
- **CVSS评分**: {score}
|
|
40
67
|
|
|
41
|
-
###
|
|
42
|
-
1. {
|
|
68
|
+
### 验证步骤
|
|
69
|
+
1. {step_1}
|
|
70
|
+
2. {step_2}
|
|
71
|
+
3. {step_3}
|
|
43
72
|
|
|
44
73
|
### PoC
|
|
45
74
|
```bash
|
|
46
|
-
{
|
|
75
|
+
curl -X POST "{endpoint}" \
|
|
76
|
+
-H "Content-Type: application/json" \
|
|
77
|
+
-d '{"payload": "..."}'
|
|
47
78
|
```
|
|
48
79
|
|
|
49
80
|
### 修复建议
|
|
50
|
-
{
|
|
81
|
+
- {recommendation_1}
|
|
82
|
+
- {recommendation_2}
|
|
51
83
|
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-api-security-testing",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"description": "API Security Testing Plugin for OpenCode -
|
|
3
|
+
"version": "4.0.1",
|
|
4
|
+
"description": "API Security Testing Plugin for OpenCode - Automated vulnerability scanning and penetration testing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"files": [
|
|
@@ -9,21 +9,39 @@
|
|
|
9
9
|
"agents/",
|
|
10
10
|
"core/",
|
|
11
11
|
"references/",
|
|
12
|
-
"SKILL.md"
|
|
12
|
+
"SKILL.md",
|
|
13
|
+
"postinstall.mjs",
|
|
14
|
+
"preuninstall.mjs"
|
|
13
15
|
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"postinstall": "node postinstall.mjs",
|
|
18
|
+
"preuninstall": "node preuninstall.mjs"
|
|
19
|
+
},
|
|
14
20
|
"keywords": [
|
|
15
21
|
"opencode",
|
|
16
22
|
"opencode-plugin",
|
|
17
23
|
"security",
|
|
18
|
-
"api-security"
|
|
24
|
+
"api-security",
|
|
25
|
+
"pentest",
|
|
26
|
+
"vulnerability-scanning"
|
|
19
27
|
],
|
|
20
28
|
"author": "steveopen1",
|
|
21
29
|
"license": "MIT",
|
|
22
30
|
"repository": {
|
|
23
31
|
"type": "git",
|
|
24
|
-
"url": "
|
|
32
|
+
"url": "https://github.com/steveopen1/skill-play"
|
|
25
33
|
},
|
|
34
|
+
"homepage": "https://github.com/steveopen1/skill-play/tree/main/agent-plugins/OPENCODE/api-security-testing",
|
|
26
35
|
"peerDependencies": {
|
|
27
|
-
"@opencode-ai/plugin": "^1.1.19"
|
|
36
|
+
"@opencode-ai/plugin": "^1.1.19",
|
|
37
|
+
"@opencode-ai/sdk": "^1.1.19"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@opencode-ai/plugin": "^1.1.19",
|
|
41
|
+
"@opencode-ai/sdk": "^1.1.19"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^25.5.2",
|
|
45
|
+
"typescript": "^6.0.2"
|
|
28
46
|
}
|
|
29
47
|
}
|
package/postinstall.mjs
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* postinstall.mjs - API Security Testing Plugin
|
|
5
|
+
*
|
|
6
|
+
* Installs:
|
|
7
|
+
* 1. agents to ~/.config/opencode/agents/
|
|
8
|
+
* 2. SKILL.md and references to ~/.config/opencode/skills/api-security-testing/
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { copyFileSync, existsSync, mkdirSync, readdirSync } from "node:fs";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = join(__filename, "..");
|
|
17
|
+
|
|
18
|
+
function getOpencodeBaseDir() {
|
|
19
|
+
const home = process.env.HOME || process.env.USERPROFILE || "/root";
|
|
20
|
+
return join(home, ".config", "opencode");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function main() {
|
|
24
|
+
const packageRoot = __dirname;
|
|
25
|
+
const agentsSourceDir = join(packageRoot, "agents");
|
|
26
|
+
const agentsTargetDir = join(getOpencodeBaseDir(), "agents");
|
|
27
|
+
const skillTargetDir = join(getOpencodeBaseDir(), "skills", "api-security-testing");
|
|
28
|
+
|
|
29
|
+
console.log("[api-security-testing] Installing...");
|
|
30
|
+
console.log(` Package root: ${packageRoot}`);
|
|
31
|
+
|
|
32
|
+
let totalInstalled = 0;
|
|
33
|
+
let totalFailed = 0;
|
|
34
|
+
|
|
35
|
+
// 1. Install agents
|
|
36
|
+
console.log("\n[1/3] Installing agents...");
|
|
37
|
+
if (existsSync(agentsSourceDir)) {
|
|
38
|
+
if (!existsSync(agentsTargetDir)) {
|
|
39
|
+
mkdirSync(agentsTargetDir, { recursive: true });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const files = readdirSync(agentsSourceDir).filter(f => f.endsWith(".md"));
|
|
43
|
+
for (const file of files) {
|
|
44
|
+
try {
|
|
45
|
+
copyFileSync(join(agentsSourceDir, file), join(agentsTargetDir, file));
|
|
46
|
+
console.log(` ✓ ${file}`);
|
|
47
|
+
totalInstalled++;
|
|
48
|
+
} catch (err) {
|
|
49
|
+
console.error(` ✗ ${file}: ${err.message}`);
|
|
50
|
+
totalFailed++;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 2. Install SKILL.md
|
|
56
|
+
console.log("\n[2/3] Installing SKILL.md...");
|
|
57
|
+
const skillSource = join(packageRoot, "SKILL.md");
|
|
58
|
+
if (existsSync(skillSource)) {
|
|
59
|
+
if (!existsSync(skillTargetDir)) {
|
|
60
|
+
mkdirSync(skillTargetDir, { recursive: true });
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
copyFileSync(skillSource, join(skillTargetDir, "SKILL.md"));
|
|
64
|
+
console.log(" ✓ SKILL.md");
|
|
65
|
+
totalInstalled++;
|
|
66
|
+
} catch (err) {
|
|
67
|
+
console.error(` ✗ SKILL.md: ${err.message}`);
|
|
68
|
+
totalFailed++;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 3. Install references
|
|
73
|
+
console.log("\n[3/3] Installing references...");
|
|
74
|
+
const refsSourceDir = join(packageRoot, "references");
|
|
75
|
+
const refsTargetDir = join(skillTargetDir, "references");
|
|
76
|
+
if (existsSync(refsSourceDir)) {
|
|
77
|
+
if (!existsSync(refsTargetDir)) {
|
|
78
|
+
mkdirSync(refsTargetDir, { recursive: true });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function copyDir(src, dest) {
|
|
82
|
+
const items = readdirSync(src);
|
|
83
|
+
for (const item of items) {
|
|
84
|
+
const srcPath = join(src, item);
|
|
85
|
+
const destPath = join(dest, item);
|
|
86
|
+
try {
|
|
87
|
+
copyFileSync(srcPath, destPath);
|
|
88
|
+
totalInstalled++;
|
|
89
|
+
} catch {
|
|
90
|
+
if (existsSync(srcPath) && !srcPath.endsWith(".md")) {
|
|
91
|
+
mkdirSync(destPath, { recursive: true });
|
|
92
|
+
copyDir(srcPath, destPath);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
try {
|
|
99
|
+
copyDir(refsSourceDir, refsTargetDir);
|
|
100
|
+
console.log(" ✓ references/");
|
|
101
|
+
totalInstalled++;
|
|
102
|
+
} catch (err) {
|
|
103
|
+
console.error(` ✗ references/: ${err.message}`);
|
|
104
|
+
totalFailed++;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
console.log(`\n========================================`);
|
|
109
|
+
if (totalFailed === 0) {
|
|
110
|
+
console.log(`✓ Installed ${totalInstalled} file(s)`);
|
|
111
|
+
console.log(`\nAgents: ${agentsTargetDir}`);
|
|
112
|
+
console.log(`Skill: ${skillTargetDir}`);
|
|
113
|
+
console.log(`\n⚠️ IMPORTANT: Restart OpenCode to discover new agents`);
|
|
114
|
+
} else {
|
|
115
|
+
console.log(`⚠ Installed ${totalInstalled}, failed ${totalFailed}`);
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
main();
|
package/preuninstall.mjs
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* preuninstall.mjs - API Security Testing Plugin
|
|
5
|
+
*
|
|
6
|
+
* Removes:
|
|
7
|
+
* 1. agents from ~/.config/opencode/agents/
|
|
8
|
+
* 2. SKILL.md and references from ~/.config/opencode/skills/api-security-testing/
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { unlinkSync, existsSync, readdirSync, rmdirSync } from "node:fs";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = join(__filename, "..");
|
|
17
|
+
|
|
18
|
+
function getOpencodeBaseDir() {
|
|
19
|
+
const home = process.env.HOME || process.env.USERPROFILE || "/root";
|
|
20
|
+
return join(home, ".config", "opencode");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function main() {
|
|
24
|
+
const agentsTargetDir = join(getOpencodeBaseDir(), "agents");
|
|
25
|
+
const skillTargetDir = join(getOpencodeBaseDir(), "skills", "api-security-testing");
|
|
26
|
+
|
|
27
|
+
console.log("[api-security-testing] Uninstalling...");
|
|
28
|
+
|
|
29
|
+
let totalRemoved = 0;
|
|
30
|
+
let totalFailed = 0;
|
|
31
|
+
|
|
32
|
+
// 1. Remove agents
|
|
33
|
+
console.log("\n[1/2] Removing agents...");
|
|
34
|
+
if (existsSync(agentsTargetDir)) {
|
|
35
|
+
const agentFiles = ["api-cyber-supervisor.md", "api-probing-miner.md", "api-resource-specialist.md", "api-vuln-verifier.md"];
|
|
36
|
+
for (const file of agentFiles) {
|
|
37
|
+
const filePath = join(agentsTargetDir, file);
|
|
38
|
+
try {
|
|
39
|
+
if (existsSync(filePath)) {
|
|
40
|
+
unlinkSync(filePath);
|
|
41
|
+
console.log(` ✓ Removed ${file}`);
|
|
42
|
+
totalRemoved++;
|
|
43
|
+
}
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error(` ✗ Failed to remove ${file}: ${err.message}`);
|
|
46
|
+
totalFailed++;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 2. Remove SKILL.md and references
|
|
52
|
+
console.log("\n[2/2] Removing SKILL.md and references...");
|
|
53
|
+
if (existsSync(skillTargetDir)) {
|
|
54
|
+
try {
|
|
55
|
+
function removeDir(dir) {
|
|
56
|
+
const items = readdirSync(dir);
|
|
57
|
+
for (const item of items) {
|
|
58
|
+
const itemPath = join(dir, item);
|
|
59
|
+
try {
|
|
60
|
+
unlinkSync(itemPath);
|
|
61
|
+
totalRemoved++;
|
|
62
|
+
} catch {
|
|
63
|
+
if (existsSync(itemPath)) {
|
|
64
|
+
removeDir(itemPath);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
rmdirSync(dir);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
removeDir(skillTargetDir);
|
|
72
|
+
console.log(" ✓ Removed skill directory");
|
|
73
|
+
} catch (err) {
|
|
74
|
+
console.error(` ✗ Failed to remove skill directory: ${err.message}`);
|
|
75
|
+
totalFailed++;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log(`\n========================================`);
|
|
80
|
+
if (totalFailed === 0) {
|
|
81
|
+
console.log(`✓ Removed ${totalRemoved} file(s)`);
|
|
82
|
+
} else {
|
|
83
|
+
console.log(`⚠ Removed ${totalRemoved}, failed ${totalFailed}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
main();
|