Communitygithub.com

baronguyen001/ai-automation-skills

独自のS3互換ストレージに成果物をアップロード・ダウンロードします。環境変数からバケットと認証情報を読み取るため、スクレイパー出力の保存やレポートのアーカイブ、MinIO/R2/Spaces/S3の利用に最適です。

ai-automation-skills とは?

このスキルは、AIエージェント(Claude Code、Cursor、Codexなど)向けに、S3互換ストレージへのファイルアップロード・ダウンロードを簡素化します。CSVレポート、PDF、JSONチェックポイント、スクリーンショット、モデル出力、ログなど、ローカルマシンを超えて永続化が必要なあらゆる成果物を扱います。バケット名、エンドポイント、認証情報はすべて環境変数(S3_BUCKET、S3_ACCESS_KEY_ID、S3_SECRET_ACCESS_KEY、S3_ENDPOINT_URL、S3_REGION)から読み取るため、コードに機密情報をハードコードする必要がありません。AWS S3だけでなく、MinIO、Cloudflare R2、DigitalOcean Spacesなど、S3互換の任意のオブジェクトストレージをサポートします。主なユースケースは、スクレイパー出力のアップロード、前回の実行ファイルの取得、レポートのアーカイブです。内部では`assets/s3.py`ヘルパーを使用し、決定論的なオブジェクトキー(例:`reports/YYYY-MM-DD/name.csv`)を推奨します。ローカルファイルの書き込みが完了してからアップロードするため、不完全な成果物をアップロードすることはありません。環境変数やクライアントライブラリがない場合は明確な設定エラーを返します。このスキールは作者の本番プロジェクトから抽出されたもので、`assets/s3.py`をプロジェクトにコピーするだけで利用を開始できます。

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

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

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

ドキュメント

S3アップローダー

このスキルは、自動化ランで永続的な成果物ストレージが必要な場合に使用します。CSVレポート、PDF、JSONチェックポイント、スクリーンショット、モデル出力、ログなど、ローカルマシンの外部に保存すべきファイルを扱います。ヘルパーは汎用S3互換ストレージを対象とし、バケット、エンドポイント、認証情報を環境変数からのみ読み取ります。

使用するタイミング

  • ユーザーが「このレポートをS3にアップロードして」「成果物をオブジェクトストレージに保存して」「最後の実行ファイルをダウンロードして」「MinIO/R2/Spacesを使って」と言った場合。
  • 会話内のコードがローカルにファイルを書き込んでいるが、ポータブルな受け渡しやアーカイブ場所が必要な場合。

使用してはいけないタイミング

  • 成果物が同じプロセス内でのみ必要な場合(そのままディスクに保持)。
  • ユーザーがパブリックWebサイトCDNワークフロー(キャッシュ無効化や署名付きURLが必要)を必要としている場合。

具体的な例

ユーザー入力:

スクレイパー終了後に、生成されたCSVを私のS3互換バケットにアップロードしてください。

出力:

# assets/s3.py をプロジェクトにコピーし、次を実行:
from s3 import upload_file

key = upload_file("out/daily_report.csv", key="reports/daily_report.csv")
print("アップロード完了:", key)

ヘルパーはS3_BUCKET、S3_ACCESS_KEY_ID、S3_SECRET_ACCESS_KEY、オプションでS3_ENDPOINT_URLとS3_REGIONを環境変数から読み取ります。ターゲット固有の情報や秘密情報はコミットされません。

適用するパターン

  1. バケット名、エンドポイント、アクセスキー、シークレットキーは必ず環境変数にのみ保持します。
  2. 決定論的なオブジェクトキーを使用します(例:reports/YYYY-MM-DD/name.csv)。これにより再実行時に簡単に見つけられます。
  3. ローカルファイルの書き込みが完全に終了した後にのみアップロードし、書き込み途中の成果物をストリームすることはありません。
  4. S3互換エンドポイントをサポートするには、endpoint_urlをAWSをハードコードする代わりに渡します。
  5. 環境変数やクライアントライブラリがない場合は、明確な設定エラーを表示して失敗します。

参考:assets/s3.py。

ソース

作者の自動化プロジェクトでの本番利用から抽出されました。v1.0.0。

関連スキル:[[csv-report-writer]]、[[playwright-pdf-snapshot]]、[[pipeline-orchestrator]]。

→ Trawlkitで完全な実行可能ボットを構築しましょう。

Individual skills in this repo

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

baronguyen001/ai-automation-skills

Schedule any script to run on a recurring schedule on Windows (Task Scheduler) or Linux (cron) - register, list, and remove jobs from one command, with logging to a file and a guard against overlapping runs. Use for schedule a script, run nightly, set up a cron job, windows task scheduler, or run on a timer.

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

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.

関連スキル