dev-machine-cleanup

开发机清理技能 - 异步清理日志和临时文件(不阻塞主会话)

3,891 stars

Best use case

dev-machine-cleanup is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

开发机清理技能 - 异步清理日志和临时文件(不阻塞主会话)

Teams using dev-machine-cleanup should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/dev-machine-cleanup/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/alexmayanjun-collab/dev-machine-cleanup/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/dev-machine-cleanup/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How dev-machine-cleanup Compares

Feature / Agentdev-machine-cleanupStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

开发机清理技能 - 异步清理日志和临时文件(不阻塞主会话)

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 🧹 开发机清理技能(异步版)

清理开发机(datax)上的日志文件和临时文件,**异步执行不阻塞**。

## 🎯 触发词

- "打扫卫生"
- "清理开发机"
- "清理绿地"
- "让老高去打扫卫生"
- "让顺子去打扫卫生"
- "清理日志"
- "清理临时文件"

## 🚀 核心特性

**异步执行:**
- ✅ 不阻塞主会话
- ✅ 可以并行执行其他任务
- ✅ 完成后主动通知
- ✅ 实时输出进度

## 📋 执行流程

### 1️⃣ 异步调用子 agent

```javascript
sessions_spawn({
  agentId: "agent-ge",  // 或 agent-cc
  task: "清理开发机日志和临时文件",
  mode: "run",
  streamTo: "parent",
  label: "dev-cleanup"
})
```

### 2️⃣ 子 agent 执行清理

SSH 到 datax 开发机,执行:

```bash
# 检查清理前磁盘状态
df -h

# 清理 7 天前的 .log 文件
find /mnt/www -name '*.log' -mtime +7 -delete

# 清理 3 天前的 tmp_* 文件
find /mnt/www -name 'tmp_*' -mtime +3 -delete

# 清理 Docker 悬空镜像(可选)
docker image prune -f

# 检查清理后磁盘状态
df -h
```

### 3️⃣ 实时播报进度

清理过程中输出:
- 📊 清理前磁盘使用率
- 🗑️ 正在删除 XXX 文件...
- ✅ 清理完成
- 📊 清理后磁盘使用率
- 💾 腾出 XX GB 空间

### 4️⃣ 完成后通知

清理完成后自动通知:
```
✅ 开发机清理完成!

清理结果:
- 删除日志文件:XX 个
- 删除临时文件:XX 个
- 腾出空间:1.2 GB

当前状态:
- 根分区 (/):87% → 85%
- 数据分区 (/mnt):60% → 59%
```

## ⚙️ 配置说明

**清理规则:**
| 文件类型 | 保留时间 | 清理位置 |
|---------|---------|---------|
| `*.log` | 7 天 | `/mnt/www` 及子目录 |
| `tmp_*` | 3 天 | `/mnt/www` 及子目录 |
| Docker 悬空镜像 | 总是 | 所有悬空镜像 |

**安全边界:**
- ❌ 不删除 7 天内的日志
- ❌ 不删除 3 天内的临时文件
- ❌ 不删除业务数据文件
- ❌ 不删除配置文件

## 📝 使用示例

```
用户:让老高去打扫卫生
助手:好的,老高正在去开发机清理日志...(异步执行)

用户:让顺子检查 DataWorks 任务
助手:好的,顺子正在检查...(并行执行)

[1 分钟后]
老高:✅ 开发机清理完成!腾出 1.2GB 空间
```

## 🔧 技术实现

**主会话(我):**
```javascript
// 收到"打扫卫生"指令
sessions_spawn({
  agentId: "agent-ge",
  task: `
    1. SSH 到 datax 开发机
    2. 执行清理命令
    3. 报告清理结果
  `,
  mode: "run",
  streamTo: "parent",
  label: "dev-cleanup-${Date.now()}"
})

// 立即回复用户
"好的,老高正在去开发机打扫卫生,完成后会通知你~"
```

**子 agent(老高):**
- 接收任务后 SSH 到开发机
- 执行清理命令(bash)
- 实时输出进度
- 完成后返回结果

## ⚠️ 注意事项

1. **并发控制:** 避免同时启动多个清理任务
2. **磁盘空间:** 清理前检查磁盘使用率,>90% 时告警
3. **日志记录:** 清理结果记录到 `memory/dev-cleanup-YYYY-MM-DD.md`
4. **错误处理:** SSH 失败时立即通知用户

---

**版本历史:**
- v1.0 (2026-03-12): 初始版本,异步执行不阻塞

Related Skills

china-industrial-machinery-sourcing

3880
from openclaw/skills

Comprehensive industrial machinery industry sourcing guide for international buyers – provides detailed information about China's machine tools, construction machinery, agricultural equipment, packaging lines, robotics, and other industrial machinery manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).

Data & Research

draftmachine

3891
from openclaw/skills

Use this skill whenever the user wants to send a batch of personalized emails, do a mail merge, or draft outreach emails for multiple recipients using Gmail. DraftMachine is a CLI tool that creates Gmail drafts (not sends them) from a CSV recipient list and a Markdown/Jinja2 template, so the user can review everything in Gmail before sending. Trigger this skill for requests like "send personalized emails to my contacts", "do a mail merge to Gmail", "draft outreach emails", "email everyone on this list", "create Gmail drafts from a spreadsheet", or any time the user wants to compose similar emails to multiple people at once. Also trigger it if the user asks to use draftmachine directly.

mac-cleanup

3891
from openclaw/skills

Cleans up system caches, trash, and old downloads on macOS.

desktop-cleanup-playbook

3891
from openclaw/skills

为桌面文件生成整理方案、分类规则和阶段性清理计划,先分析再行动。;use for desktop, cleanup, organization workflows;do not use for 自动删除桌面文件, 越权访问系统目录.

---

3891
from openclaw/skills

name: article-factory-wechat

Content & Documentation

humanizer

3891
from openclaw/skills

Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.

Content & Documentation

find-skills

3891
from openclaw/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

General Utilities

tavily-search

3891
from openclaw/skills

Use Tavily API for real-time web search and content extraction. Use when: user needs real-time web search results, research, or current information from the web. Requires Tavily API key.

Data & Research

baidu-search

3891
from openclaw/skills

Search the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.

Data & Research

agent-autonomy-kit

3891
from openclaw/skills

Stop waiting for prompts. Keep working.

Workflow & Productivity

Meeting Prep

3891
from openclaw/skills

Never walk into a meeting unprepared again. Your agent researches all attendees before calendar events—pulling LinkedIn profiles, recent company news, mutual connections, and conversation starters. Generates a briefing doc with talking points, icebreakers, and context so you show up informed and confident. Triggered automatically before meetings or on-demand. Configure research depth, advance timing, and output format. Walking into meetings blind is amateur hour—missed connections, generic small talk, zero leverage. Use when setting up meeting intelligence, researching specific attendees, generating pre-meeting briefs, or automating your prep workflow.

Workflow & Productivity

self-improvement

3891
from openclaw/skills

Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.

Agent Intelligence & Learning