AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Cron Manager

skill-countbot-ai-countbot-cron-manager · by countbot-ai

定时任务管理。创建、查看、修改、删除定时任务,管理任务会话数据。当用户需要设置提醒、定时执行任务、管理调度计划时使用。

No reviews yet
0 installs
5 views
0.0% view→install

Install

$ agentstack add skill-countbot-ai-countbot-cron-manager

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-countbot-ai-countbot-cron-manager)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Cron Manager? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

定时任务管理

通过命令行管理 CountBot 的定时任务系统,支持完整的 CRUD 操作和会话数据管理。

使用场景

  • 用户说"每天早上9点提醒我开会" -> 创建定时任务
  • 用户说"帮我设置一个每小时查天气的任务" -> 创建定时任务
  • 用户说"看看我有哪些定时任务" -> 列出任务
  • 用户说"把那个天气任务改成每2小时执行" -> 修改任务
  • 用户说"删掉那个新闻任务" -> 删除任务
  • 用户说"暂停/恢复某个任务" -> 禁用/启用任务
  • 用户说"立即执行一次那个任务" -> 手动触发
  • 用户说"看看天气任务的历史消息" -> 查看会话消息
  • 用户说"清理一下定时任务的历史记录" -> 清理会话

命令行调用

开始前先快速确认后端可用:

curl -s http://127.0.0.1:8000/api/cron/jobs || echo "后端服务没在运行!"

所有操作优先通过 exec 工具执行这个脚本:

python3 skills/cron-manager/scripts/cron_manager.py  [args]

硬性规则:

  • 只用 skills/cron-manager/scripts/cron_manager.py 这个脚本名,不要猜 cron.py
  • info/delete/enable/disable/run/messages/clean/reset 都优先传位置参数 ``
  • 不要先 ls、再 help、再试错多次;优先直接按下面的准确命令执行
  • 只有在命令返回参数错误时,才补一条 -h 查看帮助

创建任务

# 基本创建(默认启用自动重试1次)
python3 skills/cron-manager/scripts/cron_manager.py create --name "每日天气" --schedule "0 9 * * *" --message "查询今天的天气并生成播报"

# 创建不重试的任务
python3 skills/cron-manager/scripts/cron_manager.py create --name "简单任务" --schedule "0 9 * * *" --message "执行简单任务" --max-retries 0

# 创建并推送到当前渠道(多机器人渠道应同时指定 account_id)
python3 skills/cron-manager/scripts/cron_manager.py create --name "每日天气" --schedule "0 9 * * *" --message "查询今天的天气并生成播报" --channel feishu --account-id bot --chat-id ou_xxxx --deliver

# 创建带自定义重试的任务(失败后最多重试 3 次,每次间隔 60 秒)
python3 skills/cron-manager/scripts/cron_manager.py create --name "重要任务" --schedule "0 9 * * *" --message "执行重要任务" --max-retries 3 --retry-delay 60

# 创建一次性任务(成功后自动删除)
python3 skills/cron-manager/scripts/cron_manager.py create --name "一次性提醒" --schedule "0 14 * * *" --message "下午2点提醒" --delete-on-success

列出任务

curl -s http://127.0.0.1:8000/api/cron/jobs || echo "后端服务没在运行!"

# 需要更易读的格式时再用脚本
python3 skills/cron-manager/scripts/cron_manager.py list

查看任务详情

python3 skills/cron-manager/scripts/cron_manager.py info 

修改任务

# 修改调度时间
python3 skills/cron-manager/scripts/cron_manager.py update  --schedule "0 */2 * * *"

# 修改名称
python3 skills/cron-manager/scripts/cron_manager.py update  --name "新名称"

# 修改执行消息
python3 skills/cron-manager/scripts/cron_manager.py update  --message "新的执行指令"

# 修改渠道投递(注意:update 的 --deliver 需要显式写 true/false)
python3 skills/cron-manager/scripts/cron_manager.py update  --channel telegram --account-id default --chat-id 123456 --deliver true

删除任务

python3 skills/cron-manager/scripts/cron_manager.py delete 

启用/禁用任务

python3 skills/cron-manager/scripts/cron_manager.py enable 
python3 skills/cron-manager/scripts/cron_manager.py disable 

手动触发执行

python3 skills/cron-manager/scripts/cron_manager.py run 

验证 Cron 表达式

python3 skills/cron-manager/scripts/cron_manager.py validate "0 9 * * *"

批量创建任务

# 从 JSON 文件批量创建任务
python3 skills/cron-manager/scripts/cron_manager.py batch-create --file tasks.json

JSON 文件格式示例:

[
  {
    "name": "每日天气",
    "schedule": "0 9 * * *",
    "message": "查询今天的天气",
    "enabled": true,
    "max_retries": 3,
    "retry_delay": 60
  },
  {
    "name": "每周报告",
    "schedule": "0 10 * * 1",
    "message": "生成本周工作报告",
    "enabled": true,
    "delete_on_success": false
  }
]

批量删除任务

# 批量删除多个任务(支持 ID 前缀匹配)
python3 skills/cron-manager/scripts/cron_manager.py batch-delete abc123 def456 ghi789

查看任务会话消息

python3 skills/cron-manager/scripts/cron_manager.py messages  --limit 20

清理任务会话消息

# 保留最近10条
python3 skills/cron-manager/scripts/cron_manager.py clean  --keep 10

# 清空所有消息
python3 skills/cron-manager/scripts/cron_manager.py clean  --keep 0

重置任务会话

python3 skills/cron-manager/scripts/cron_manager.py reset 

Cron 表达式参考

格式: 分钟 小时 日 月 星期

| 表达式 | 含义 | |--------|------| | 0 9 * * * | 每天 9:00 | | */30 * * * * | 每 30 分钟 | | 0 9 * * 1-5 | 工作日 9:00 | | 0 0 1 * * | 每月 1 日 0:00 | | 0 */2 * * * | 每 2 小时整点 | | 0 8,12,18 * * * | 每天 8:00、12:00、18:00 |

注意事项

  • job_id 支持前缀匹配,输入前几位即可
  • 内置系统任务完全隐藏,不可见也不可操作
  • message 字段是任务执行时发送给 AI 的指令,应该写清楚要做什么
  • 优先先跑 curl -s http://127.0.0.1:8000/api/cron/jobs || echo "后端服务没在运行!",确认后端在线
  • 严禁把脚本名写成 cron.py;规范入口是 cron_manager.py
  • 对接受 job_id 的命令,只使用位置参数,不要写 --id
  • create--deliver 是无参开关;update--deliver 必须写成 truefalse
  • 创建任务时如果需要推送结果到渠道,必须指定 --deliver
  • 多机器人渠道(如飞书)必须区分 --account-id,否则会默认落到 default
  • 在带渠道上下文的会话中执行时,脚本会自动补全当前 channel/chat_id/account_id
  • clean 操作不可撤销,清理前建议先用 messages 查看内容
  • reset 会删除整个会话,任务下次执行时会自动创建新会话

新功能说明

自动重试机制

  • 默认启用自动重试,失败后重试1次,间隔60秒
  • 使用 --max-retries 指定最大重试次数(0 = 不重试,最多5次)
  • 使用 --retry-delay 指定重试间隔秒数(默认 60 秒)
  • 任务失败后会自动重试,直到成功或达到最大重试次数
  • 重试期间任务状态显示为 "retrying"
  • 重试耗尽后按原定 cron 表达式继续执行

成功后自动删除

  • 使用 --delete-on-success 标记任务为一次性任务
  • 任务执行成功后会自动从数据库中删除
  • 适用于一次性提醒、临时任务等场景
  • 如果任务失败,不会删除,会按重试策略处理

批量操作

  • batch-create 支持从 JSON 文件批量创建任务
  • batch-delete 支持一次删除多个任务
  • 批量操作会显示成功和失败的统计信息
  • 部分失败不影响其他任务的处理

渠道自动识别

当用户通过飞书、钉钉、QQ、Telegram 等渠道与 AI 对话时,系统提示词中会自动包含当前渠道信息:

Channel: feishu
Chat ID: ou_xxxx
Account ID: bot

创建定时任务时,应主动利用这些信息:

  • 如果用户说"每天提醒我",自动使用当前渠道和 chat_id 作为投递目标
  • 如果当前渠道支持多机器人,必须同时带上当前 Account ID
  • 如果用户说"推送到这个群",从上下文获取 channel 和 chat_id
  • 如果是网页端对话(无渠道信息),创建任务时不设置投递,仅在系统内执行

示例:用户在飞书群中说"每天9点提醒我看天气"

python3 skills/cron-manager/scripts/cron_manager.py create --name "每日天气提醒" --schedule "0 9 * * *" --message "查询今天的天气并生成播报" --channel feishu --account-id bot --chat-id ou_xxxx --deliver

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.