Task Status Skill
Quick Start
Manual Status Updates
CODEBLOCK0
Automatic Periodic Monitoring (Every 5 seconds)
CODEBLOCK1
Status Types
- - progress: Ongoing work (shows 🔄 or ->)
- success: Task complete (shows ✅ or OK)
- error: Failed task (shows ❌ or !)
- warning: Issue but continuing (shows ⚠️ or ?)
Periodic Monitoring
The monitor_task.py script provides automatic updates:
Starting Monitor
CODEBLOCK2
- - Automatically sends "Still working..." updates every 5 seconds
- Runs in background until stopped
- Can be customized with different intervals
Stopping Monitor
CODEBLOCK3
Example: Long File Processing
CODEBLOCK4
Manual Updates (Quick Status)
For single status updates without monitoring:
CODEBLOCK5
When to Use Each Method
Use Manual Updates When:
- - Task is short (under 30 seconds)
- You want control over when updates are sent
- Task has discrete, meaningful milestones
Use Periodic Monitoring When:
- - Task is long-running (over 1 minute)
- You want consistent "heartbeat" updates every 5 seconds
- Task has long periods of quiet work
- You want to reassure user that work is ongoing
Message Guidelines
Keep status messages under 140 characters. Examples:
- - Progress: "Still fetching data..." or "Processing records: 250/1000"
- Success: "Complete! 3 files ready" or "Task finished successfully"
- Error: "Error: Connection timeout" or "Failed: Missing API key"
- Warning: "Continuing despite timeout" or "Partial success: 5/10 files"
Advanced Usage
With Additional Details
CODEBLOCK6
Different Intervals
CODEBLOCK7
Importing for Python Scripts
CODEBLOCK8
Automation with Clawdbot Cron
For scheduled tasks, use Clawdbot's cron feature:
CODEBLOCK9
This allows status updates even when you're not actively watching.
Installation
To use this skill, copy the task-status folder into your Clawdbot skills directory:
CODEBLOCK10
Or add it to your workspace and reference it from AGENTS.md or TOOLS.md.
Once installed, the skill will be available for any task where you need periodic status updates.
任务状态技能
快速开始
手动状态更新
bash
python scripts/send_status.py 开始数据获取... progress step1
python scripts/send_status.py 处理完成 success final
python scripts/send_status.py 错误:缺少API密钥 error auth
自动定期监控(每5秒)
bash
开始监控一个长时间运行的任务
python scripts/monitor_task.py start 我的长任务 processing
监控器将每5秒发送仍在运行...更新
任务完成后,报告最终状态
python scripts/monitor_task.py stop 我的长任务 success 成功完成!
状态类型
- - progress:正在进行中(显示🔄或->)
- success:任务完成(显示✅或OK)
- error:任务失败(显示❌或!)
- warning:存在问题但继续运行(显示⚠️或?)
定期监控
monitor_task.py脚本提供自动更新:
启动监控
bash
python scripts/monitor_task.py start <任务名称> <状态类型> [--interval <秒数>]
- - 每5秒自动发送仍在运行...更新
- 在后台运行直到停止
- 可通过不同间隔进行自定义
停止监控
bash
python scripts/monitor_task.py stop <任务名称> <最终状态> <最终消息>
示例:长时间文件处理
bash
开始监控
python scripts/monitor_task.py start 视频处理 progress
... 此处进行长时间处理 ...
以最终状态停止
python scripts/monitor_task.py stop 视频处理 success 处理完成!
手动更新(快速状态)
适用于无需监控的单一状态更新:
bash
python scripts/send_status.py 仍在获取数据... progress fetch
python scripts/send_status.py 处理记录:250/1000 progress process
python scripts/send_status.py 完成!3个文件已就绪 success final
python scripts/send_status.py 错误:连接超时 error api
何时使用每种方法
使用手动更新的情况:
- - 任务较短(30秒以内)
- 希望控制更新发送的时间
- 任务有离散且有意义的里程碑
使用定期监控的情况:
- - 任务运行时间较长(超过1分钟)
- 希望每5秒有持续的心跳更新
- 任务有长时间的静默工作期
- 希望向用户确认工作仍在进行
消息指南
保持状态消息在140个字符以内。示例:
- - 进度:仍在获取数据...或处理记录:250/1000
- 成功:完成!3个文件已就绪或任务成功完成
- 错误:错误:连接超时或失败:缺少API密钥
- 警告:尽管超时仍继续运行或部分成功:5/10个文件
高级用法
附带额外详情
bash
python scripts/send_status.py 上传中... progress upload --details 文件:report.pdf(2.4MB)
不同间隔
bash
python scripts/monitor_task.py start 数据同步 progress --interval 10
在Python脚本中导入
python
from send
status import sendstatus
def long_task():
send_status(开始中..., progress, step1)
# ... 工作
send_status(步骤完成, success, step1)
使用Clawdbot Cron自动化
对于定时任务,使用Clawdbot的cron功能:
python
在脚本或会话中
from cron import add
每5秒检查状态
job = {
text: 检查状态更新,
interval: 5s,
enabled: True
}
add(job)
这样即使你没有主动查看,也能进行状态更新。
安装
要使用此技能,将task-status文件夹复制到你的Clawdbot技能目录:
C:\Users\Luffy\AppData\Roaming\npm\node_modules\clawdbot\skills\task-status
或者将其添加到你的工作区,并从AGENTS.md或TOOLS.md中引用。
安装完成后,该技能将可用于任何需要定期状态更新的任务。