Communitygithub.com

baronguyen001/ai-automation-skills

在 Windows (工作排程器) 或 Linux (cron) 上排程任何指令碼定期執行,只需一個指令即可註冊、列出和移除工作,並支援檔案記錄與防止重疊執行。適用於排程指令碼、夜間執行、設定 cron 工作、Windows 工作排程器或定時執行。

ai-automation-skills 是什麼?

這個技能讓開發者能夠從單一命令列介面,在 Windows 和 Linux 上建立、列出和移除排程工作。它會為 Windows 工作排程器和 Linux cron 產生對應的設定,確保程式碼在兩個作業系統之間可攜帶。主要功能包括:從特定目錄執行指令碼、將標準輸出與錯誤輸出附加到記錄檔、以及加入重疊防護機制(Linux 使用 flock,Windows 使用 MultipleInstances IgnoreNew),以防止執行時間過長的工作堆疊。使用者只需提供排程表達式(例如「每天 09:00」),技能就會自動將其轉換為 Windows 觸發條件和 cron 時間欄位,並以穩定的工作名稱註冊,以便重複執行時保持冪等性。支援的平台包括 Claude Code、Cursor 和 Codex 等 AI 代理工具,搭配 PowerShell 指令碼和 Bash 指令碼運作。

相容平台~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、雲端函數),而不是本機機器。

具體範例

使用者輸入:

Run my scraper.py every day at 9am on Windows now, and give me the Linux cron line for the server later.

輸出:

# Windows: register a daily 09:00 task (run from the repo root)
powershell -ExecutionPolicy Bypass -File assets/setup_task.ps1 `
  -TaskName "scraper-daily" `
  -Command "python" `
  -Arguments "E:\proj\scraper.py" `
  -Time "09:00"
# Linux: same job, 09:00 daily, logged, no overlap
0 9 * * * cd /srv/proj && flock -n /tmp/scraper.lock python scraper.py >> /srv/proj/cron.log 2>&1

要套用的模式

  1. 選擇一個排程表達式,並將其同時轉換為工作排程器觸發條件和五欄位 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.

相關技能