Communitygithub.com

baronguyen001/ai-automation-skills

定时运行任何脚本,支持 Windows(任务计划程序)或 Linux(cron),通过一条命令即可注册、列出和移除任务,并带有日志记录和防重叠运行保护。适用于定时脚本、夜间运行、设置 cron 任务、Windows 任务计划程序或定时执行。

ai-automation-skills 是什么?

Cron Dispatch 是一个实用的 AI 技能,用于让脚本能够在无人值守的情况下按计划自动运行,并且保证同一套配置在 Windows 开发机和 Linux 服务器上都能工作。它提供了一键式的设置方案,涵盖 Windows 任务计划程序和 Linux cron,同时内置日志记录和重叠防护机制,避免慢速运行与下一次触发重叠。该技能支持通过简单的命令注册、列出和移除任务,且任务名称稳定,便于重复设置时保持幂等性。适用场景包括用户要求“每晚运行”、“设置 cron 任务”或“使用 Windows 任务计划程序”,以及代码中涉及需要定时执行的独立脚本(Python、Node、shell 等)。它不适用于已存在的常驻服务或事件循环,也不适用于托管云调度器(如 GitHub Actions cron 或云函数)。参考资产文件包括 `assets/setup_task.ps1` 和 `assets/cron_linux.sh`,版本为 v1.0.0。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/baronguyen001/ai-automation-skills/tree/HEAD/skills/cron-dispatch

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Cron Dispatch

当脚本需要在无人值守的情况下按计划运行,且同一模式在 Windows 开发机和 Linux 服务器上都能正常工作时,使用此技能。它提供了 Windows 任务计划程序和 Linux cron 的即用式设置,同时包含日志记录和重叠防护机制,确保慢速运行不会与下一次触发叠加。

何时调用

  • 用户说:“每晚运行此脚本” / “设置一个 cron 任务” / “定时运行脚本” / “Windows 任务计划程序”
  • 对话中的代码涉及:应定时触发而不是手动执行的独立脚本(Python、Node、shell)。

何时不调用

  • 工作属于现有的常驻服务或事件循环,而非操作系统调度器。
  • 用户希望使用托管云调度器(GitHub Actions cron、云函数),而不是本地机器。

具体示例

用户输入:

立即在 Windows 上每天上午 9 点运行我的 scraper.py,并稍后提供服务器上用的 Linux cron 行。

输出:

# Windows:注册一个每天 09:00 的任务(在仓库根目录运行)
powershell -ExecutionPolicy Bypass -File assets/setup_task.ps1 `
  -TaskName "scraper-daily" `
  -Command "python" `
  -Arguments "E:\proj\scraper.py" `
  -Time "09:00"
# Linux:相同的任务,每天 09:00,带日志,无重叠
0 9 * * * cd /srv/proj && flock -n /tmp/scraper.lock python scraper.py >> /srv/proj/cron.log 2>&1

应用模式

  1. 选择一个计划表达式,并将其转换为任务计划程序触发器和 5 字段 cron 行。
  2. 始终从其项目目录运行脚本,以便相对路径能正确解析。
  3. 将标准输出和标准错误追加到日志文件中;切勿依赖无人监控的控制台。
  4. 防止重叠(Linux 上使用 flock,Windows 上使用 -MultipleInstances IgnoreNew),确保长时间运行不会重复执行。
  5. 使用稳定的任务名称进行注册、列出和移除,以便重复设置时保持幂等性。

参考文件:assets/setup_task.ps1、assets/cron_linux.sh。

来源

根据作者在自动化项目中的生产实践提炼而来。v1.0.0。 另见:[[pipeline-orchestrator]]、[[telegram-alerter]]。

→ 使用 Trawlkit 构建完整可运行的机器人。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

baronguyen001/ai-automation-skills

Turn a run's list of result dicts into a schema'd CSV and a Markdown table from one column spec - declare columns once, emit both, with stable ordering and safe escaping, stdlib only, no pandas. Use when the user asks to write results to CSV, export a report, make a markdown summary table, or save a run's output as a spreadsheet.

baronguyen001/ai-automation-skills

Strip HTML to clean plain text with the standard library only (no BeautifulSoup/lxml): drops script/style, turns block tags into line breaks, and collapses whitespace. Use when the user wants readable text from an HTML page/email, to clean scraped HTML before sending it to an LLM, or to build a text index from web content.

baronguyen001/ai-automation-skills

Persist records between scheduled runs as append-only JSON Lines (one object per line) with streaming reads and optional key-based dedup, stdlib only. Use when the user wants to log run results to JSONL, append events to a file, dedup records by id across runs, or keep a simple durable history without a database.

baronguyen001/ai-automation-skills

Extract text and simple table-like rows from a PDF for downstream AI without OCR binaries. Use when the user asks to read a PDF, turn a PDF into text, pull simple tables from statements/reports, or feed PDF content into an LLM pipeline.

baronguyen001/ai-automation-skills

Rotate a pool of HTTP/SOCKS proxies with round-robin selection, failure tracking, and a cooldown that benches dead proxies before retrying. BYO proxy list via env - none are shipped. Use for rotate proxies, spread requests across proxies, avoid IP bans, retry through a different proxy, or proxy health check.

baronguyen001/ai-automation-skills

Parse an RSS 2.0 or Atom feed into normalized item dicts (title, link, id, published, summary) with the standard library only - no feedparser. Use when the user asks to read an RSS/Atom feed, poll a blog/news feed, extract feed entries, or watch a site that publishes a feed.

baronguyen001/ai-automation-skills

Upload and download run artifacts from S3-compatible storage with BYO bucket and credentials from env. Use when the user asks to store scraper output, archive reports, publish artifacts to object storage, fetch a prior run file, or use MinIO/R2/Spaces/S3 without hardcoding credentials.

baronguyen001/ai-automation-skills

Draft a short-form TikTok/Reels/Shorts or long-form video script from a topic and creator persona file - hook variants, beat-structured body, CTA, b-roll cues, caption overlays, and [STORY]/[NUMBER] slots so the model never fabricates personal facts. Use for write a video script, tiktok script, youtube script, or /shortform-script.

baronguyen001/ai-automation-skills

Give scheduled scripts memory between runs with one SQLite file - a seen-set for dedup, a key/value cursor to resume where you left off, and order-preserving new-item filtering. Use for dedup across runs, don't re-alert the same item, remember the last id, resume a scraper, or persist state between cron runs.

相关技能