Communitygithub.com

バロンゴエン001/ai-automation-skills

Windows(タスクスケジューラ)またはLinux(cron)上で任意のスクリプトを定期実行するためのスキル。登録、一覧表示、削除を1つのコマンドで行い、ファイルへのログ出力や重複実行防止機能を備えています。スクリプトの定期実行、夜間実行、cronジョブの設定、Windowsタスクスケジューラ、タイマー実行に利用します。

ai-automation-skills とは?

このスキルは、WindowsとLinuxの両方で一貫した方法でスクリプトを定期実行するためのツールです。ユーザーが「毎日9時にスクリプトを実行したい」といったリクエストをすると、WindowsタスクスケジューラとLinux cronの両方に対応した設定コマンドを生成します。主な特徴として、プロジェクトディレクトリからの実行、ログファイルへの出力、そして`flock`(Linux)や`-MultipleInstances IgnoreNew`(Windows)による重複実行防止機能があります。これにより、長時間実行されるスクリプトでも安全に定期実行でき、タスクの登録・一覧表示・削除も可能です。主にPython、Node.js、シェルスクリプトなどのスタンドアロンスクリプトに最適で、常時稼働のサービスやクラウドスケジューラを使う場合には推奨されません。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/baronguyen001/ai-automation-skills/tree/HEAD/skills/cron-dispatch

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Cron Dispatch

このスキルは、スクリプトを無人で定期実行する必要があり、かつ同じパターンをWindowsの開発環境とLinuxのサーバーの両方で動作させる場合に使用します。WindowsタスクスケジューラとLinux cronの両方に対応したコピペ可能な設定と、ログ出力、重複実行防止機能を提供します。

呼び出すタイミング

  • ユーザーが「毎日夜間に実行して」「cronジョブを設定して」「スクリプトをスケジュールして」「Windowsタスクスケジューラ」と言った場合
  • 会話内のコードが、手動ではなくタイマーで実行すべきスタンドアロンスクリプト(Python、Node、シェル)を使用している場合

呼び出さない方が良いタイミング

  • 作業が、OSのスケジューラではなく、既存の常時稼働サービスやイベントループ内に収めるべき場合
  • ユーザーがローカルマシンではなく、管理されたクラウドスケジューラ(GitHub Actionsのcron、クラウド関数など)を希望している場合

具体例

ユーザー入力:

私のscraper.pyを今すぐWindowsで毎日午前9時に実行し、後でサーバーで使う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. 1つのスケジュール式を選び、それをTask Schedulerのトリガーと5フィールドのcron行の両方に変換します。
  2. 常にスクリプトをそのプロジェクトディレクトリから実行し、相対パスが正しく解決されるようにします。
  3. stdoutとstderrをログファイルに追記します。誰も見ていないコンソールに頼らないようにします。
  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.

関連スキル