소스 정보
- 저장소
- dvcrn/openclaw-skills-marketplace
- 최근 소스 활동
- 2026년 3월 15일 09:13
- 감지된 SKILL.md 언어
- 중국어
- 스타
- 29
- 포크
- 10
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/dvcrn/openclaw-skills-marketplace --skill openclaw-cleaner명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | openclaw-cleaner |
| description | OpenClaw清理大师 - 项目目录清理与优化工具。提供快照、Diff、检查点、任务进度等能力,AI 可直接调用自动执行。 |
AI 可直接调用的项目清理与优化工具
本技能提供一系列自动化能力,AI 可在执行任务时直接调用,无需用户确认。
| 能力 | 说明 | 何时调用 |
|---|---|---|
| 快照 | 记录文件状态 | 执行修改前 |
| Diff | 对比变更差异 | 修改完成后展示给用户 |
| Checkpoint | 保存关键状态 | 重要操作前 |
| Task Progress | 追踪长时间任务 | 批量处理时 |
| Health Check | 评估目录健康度 | 用户询问或定期 |
| Skill Match | 推荐相关 Skills | 用户描述任务时 |
| Optimize | 优化文件减少 Token | 空间不足或定期 |
// 1. 先创建快照(自动,也可手动)
const snap = await snapshot.create('before-remove-old-skill');
// 2. 执行删除
await skills.remove('unused-skill');
// 3. 对比变更,展示给用户
const diff = await snapshot.compare(snap.name, 'latest');
console.log(snapshot.generateReport(diff));
// 用户看到: "我删除了 xxx,新增了 yyy"
// 1. 开始任务
const taskInfo = await task.start('process-files', fileList);
// 2. 处理每个文件
for (const file of files) {
try {
await processFile(file);
await task.markCompleted(taskInfo.id, index);
} catch (e) {
await task.markFailed(taskInfo.id, index, e.message);
}
}
// 3. 用户可随时查看进度
const status = await task.getStatus(taskInfo.id);
// snapshot.compare()
{
added: [{ path: string, size: number, content?: string }],
removed: [{ path: string, size: number }],
modified: [{ path: string, oldSize: number, newSize: number, changes: [] }]
}
// health.check()
{
score: number, // 0-100
totalFiles: number,
totalDirs: number,
totalSize: number,
warnings: string[]
}
v2.1.2 - 整合为单文件版本
// ============================================================================
// OpenClaw Cleaner - 完整实现代码 (2.1.2)
// ============================================================================
import fs from 'fs/promises';
import path from 'path';
import crypto from 'crypto';
// 获取工作空间路径
function getWorkspacePath() { return process.cwd(); }
// 静默日志
const silentLogger = { info: () => {}, debug: () => {}, warn: () => {}, error: () => {}, success: () => {}, section: () => {} };
// ============================================================================
// VisualDiffService - 快照和 Diff 服务
// ============================================================================
class VisualDiffService {
constructor(workspacePath, options = {}) {
this.workspacePath = workspacePath;
this.backupDir = options.backupDir || '.cleaner-backups';
this.logger = options.;
}
() { path.(., ., name); }
() {
files = {};
() {
entries = fs.(dir, { : });
( entry entries) {
fullPath = path.(dir, entry.);
relativePath = path.(basePath, fullPath);
(entry.()) {
([, , , ].(entry.)) ;
(fullPath);
} (entry.()) {
{
stat = fs.(fullPath);
content = fs.(fullPath, );
hash = crypto.().(content).();
files[relativePath] = { : relativePath, : stat., : stat..(), hash, content };
} {}
}
}
}
(dirPath);
files;
}
() {
timestamp = ().().(, );
snapshotName = ;
snapshotPath = path.(.(), , snapshotName);
fs.(snapshotPath, { : });
files = .(., .);
fs.(path.(snapshotPath, ), .(files, , ));
fs.(path.(snapshotPath, ), .({ : snapshotName, : ().(), : .(files). }, , ));
{ : snapshotName, : snapshotPath, : .(files). };
}
() {
pathA = snapshotA.() ? snapshotA : path.(.(), , snapshotA);
pathB = snapshotB.() ? snapshotB : path.(.(), , snapshotB);
filesA, filesB;
{ filesA = .( fs.(path.(pathA, ), )); } { (); }
{ filesB = .( fs.(path.(pathB, ), )); } { (); }
diff = { : [], : [], : [], : [] };
pathsA = (.(filesA)), pathsB = (.(filesB));
( filePath pathsB) { (!pathsA.(filePath)) diff..({ : filePath, : filesB[filePath]., : filesB[filePath]. }); }
( filePath pathsA) { (!pathsB.(filePath)) diff..({ : filePath, : filesA[filePath]., : filesA[filePath]. }); }
( filePath pathsA) { (pathsB.(filePath) && filesA[filePath]. !== filesB[filePath].) diff..({ : filePath, : filesA[filePath]., : filesB[filePath]., : filesA[filePath]., : filesB[filePath]. }); }
diff;
}
() {
lines = [];
lines.(.()); lines.(); lines.(.());
lines.();
(diff.. > ) { lines.(); ( f diff.) lines.(); lines.(); }
(diff.. > ) { lines.(); ( f diff.) lines.(); lines.(); }
(diff.. > ) { lines.(); ( f diff.) lines.(); lines.(); }
lines.(.());
lines.();
}
() {
snapshotsPath = path.(.(), );
{
entries = fs.(snapshotsPath, { : });
snapshots = [];
( entry entries) {
(entry.()) {
{ meta = .( fs.(path.(snapshotsPath, entry., ), )); snapshots.({ : entry., : meta., : meta. }); }
{ snapshots.({ : entry., : }); }
}
}
snapshots.( (b. || ) - (a. || ));
} { []; }
}
}
{
() { . = workspacePath; . = options. || ; . = options.; }
() { path.(., .); }
() {
checkpointPath = .();
fs.(checkpointPath, { : });
timestamp = ().().(, );
checkpoint = { name, : , : ().(), data };
fs.(path.(checkpointPath, ), .(checkpoint, , ));
checkpoint;
}
() {
checkpointPath = .();
{
files = fs.(checkpointPath);
checkpoints = files.( f.()).( f.(, )).( !name || f.(name)).().();
(checkpoints. === ) ;
.( fs.(path.(checkpointPath, ), ));
} { ; }
}
() { .( fs.(path.(.(), ), )); }
() {
checkpointPath = .();
{
files = fs.(checkpointPath);
checkpoints = [];
( file files) {
(file.()) {
checkpoint = .( fs.(path.(checkpointPath, file), ));
checkpoints.({ : checkpoint., : checkpoint., : checkpoint. });
}
}
checkpoints.( (b.) - (a.));
} { []; }
}
}
{
() { . = workspacePath; . = options. || ; . = options.; }
() { path.(., .); }
() {
progressPath = .();
fs.(progressPath, { : });
timestamp = ().().(, );
taskId = ;
task = { : taskId, : taskName, : , : ().(), : totalItems., : , : , : totalItems.( ({ index, : item, : , : })), metadata };
fs.(path.(progressPath, ), .(task, , ));
task;
}
() {
task = .( fs.(path.(.(), ), ));
item = task.[itemIndex];
(item) { item. = status; item. = error; }
task. = task..( i. === ).;
task. = task..( i. === ).;
task. = ().();
(task. + task. >= task.) { task. = task. > ? : ; task. = ().(); }
fs.(path.(.(), ), .(task, , ));
task;
}
() { .(taskId, itemIndex, ); }
() { .(taskId, itemIndex, , error); }
() { task = .( fs.(path.(.(), ), )); task..( item. === ); }
() { { .( fs.(path.(.(), ), )); } { ; } }
() {
progressPath = .();
{
files = fs.(progressPath);
tasks = [];
( file files) {
(file.()) {
task = .( fs.(path.(progressPath, file), ));
tasks.({ : task., : task., : task., : , : ((task. + task.) / task. * ).() + });
}
}
tasks.( (b.) - (a.));
} { []; }
}
}
{
() { . = workspacePath; . = options. || ; . = options.; }
() { path.(., ., name); }
() {
timestamp = ().().(, );
backupName = options. || ;
backupPath = .(backupName);
fs.(backupPath, { : });
targets = [, , , , , , , , , ];
results = { : [], : [] };
( target targets) {
{ fs.(path.(., target), path.(backupPath, target), { : }); results..(target); }
(e) { results..({ target, : e. }); }
}
fs.(path.(backupPath, ), .({ : backupName, : ().(), : results }, , ));
{ : backupName, : backupPath, results };
}
() {
basePath = .();
{
entries = fs.(basePath, { : });
backups = [];
( entry entries) {
(entry.()) {
{ meta = .( fs.(path.(basePath, entry., ), )); backups.({ : entry., : meta. }); }
{ backups.({ : entry., : }); }
}
}
backups.( (b. || ) - (a. || ));
} { []; }
}
() {
backupPath = .(name);
.();
targets = [, , , , , ];
( target targets) { { fs.(path.(backupPath, target), path.(., target), { : }); } {} }
{ : name };
}
}
{
() { . = rootPath; . = { : , : , : , : , : [] }; . = []; . = []; . = []; }
() { .(.); .(); .(); ; }
() {
(depth > ) ;
{
entries = fs.(dirPath, { : });
( entry entries) {
(.(entry.)) ;
fullPath = path.(dirPath, entry.);
(entry.()) { ..++; .(fullPath, depth + ); }
{ ..++; size = ( fs.(fullPath)).; .. += size; (size > * ) ...({ : fullPath, size }); }
}
} {}
}
() { [, , , , , , ].(name); }
() {
skillsPath = path.(., );
{ entries = fs.(skillsPath, { : }); . = entries.( e.()).( ({ : e., : path.(skillsPath, e.) })); }
{ . = []; }
}
() {
agentsPath = path.(., );
{
entries = fs.(agentsPath, { : });
. = entries.( e.()).( ({ : e., : path.(agentsPath, e.), : , : , : }));
( agent .) { subDirs = fs.(path.(agentsPath, agent.)); agent. = subDirs.(); agent. = subDirs.(); agent. = subDirs.(); }
} { . = []; }
}
() {
score = ;
(... > ) score -= ;
(.. > * * ) score -= ;
missingWorkspace = ..( !a.).;
missingLogs = ..( !a.).;
score -= missingWorkspace * ; score -= missingLogs * ;
.(, .(, score));
}
}
{
() { . = workspacePath; . = options.; }
() {
keywords = { : [, , , , , , , , ], : [, , , , ], : [, , , , ], : [, , ], : [, , , ] };
bestMatch = , highestScore = ;
lowerQuery = query.();
( [category, words] .(keywords)) { ( word words) { (lowerQuery.(word)) { bestMatch = category; highestScore++; } } }
{ : { : bestMatch, : .(, highestScore / ) }, : [] };
}
}
{ () { . = workspacePath; . = options.; } () { { : , : }; } }
{
() { . = logger; }
() {
soulFiles = [, , , , ];
results = [];
( file soulFiles) {
filePath = path.(workspacePath, file);
{
content = fs.(filePath, );
originalSize = content.;
optimized = .(content);
saved = originalSize - optimized.;
(saved > ) { fs.(filePath, optimized); results.({ file, saved, originalSize, : optimized. }); }
} { results.({ file, : }); }
}
results;
}
() { content.(, ).(, ).(); }
}
snapshot = {
() { ((), { : silentLogger }).(name); },
() { ((), { : silentLogger }).(); },
() { ((), { : silentLogger }).(before, after); },
() { ((), { : silentLogger }).(diff); },
};
checkpoint = {
() { ((), { : silentLogger }).(name, data); },
() { ((), { : silentLogger }).(); },
() { ((), { : silentLogger }).(id); },
() { ((), { : silentLogger }).(); },
};
task = {
() { ((), { : silentLogger }).(name, items); },
() { ((), { : silentLogger }).(taskId, index); },
() { ((), { : silentLogger }).(taskId, index, error); },
() { ((), { : silentLogger }).(taskId); },
() { ((), { : silentLogger }).(taskId); },
() { ((), { : silentLogger }).(); },
};
backup = {
() { ((), { : silentLogger }).(name); },
() { ((), { : silentLogger }).(name); },
() { ((), { : silentLogger }).(); },
};
health = {
() { workspace = (()); workspace.(); { : workspace., : workspace.., : workspace.., : workspace.., : workspace. }; },
};
skills = {
() { { : [], : [] }; },
() { ((), { : silentLogger }).(query); },
() { { : name }; },
};
optimize = {
() { results = (silentLogger).(()); totalSaved = results.( sum + r., ); { results, totalSaved }; },
() { backupResult = ((), { : silentLogger }).(); (silentLogger).(()); { : , : backupResult. }; },
};
audit = { () { ((), { : silentLogger }).(); } };
{ snapshot, checkpoint, task, backup, health, skills, optimize, audit };
node skills/openclaw-cleaner/SKILL.md