background-job-processing
時間のかかる処理や大量データの処理、メール送信、レポート作成などを、タスクキューやワーカーを使って裏側で効率的に実行し、失敗時の再試行も自動化するSkill。
📜 元の英語説明(参考)
Implement background job processing systems with task queues, workers, scheduling, and retry mechanisms. Use when handling long-running tasks, sending emails, generating reports, and processing large datasets asynchronously.
🇯🇵 日本人クリエイター向け解説
時間のかかる処理や大量データの処理、メール送信、レポート作成などを、タスクキューやワーカーを使って裏側で効率的に実行し、失敗時の再試行も自動化するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o background-job-processing.zip https://jpskill.com/download/21347.zip && unzip -o background-job-processing.zip && rm background-job-processing.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21347.zip -OutFile "$d\background-job-processing.zip"; Expand-Archive "$d\background-job-processing.zip" -DestinationPath $d -Force; ri "$d\background-job-processing.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
background-job-processing.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
background-job-processingフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 7
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] バックグラウンドジョブ処理
バックグラウンドジョブ処理
目次
概要
分散タスクキュー、ワーカープール、ジョブスケジューリング、エラー処理、リトライポリシー、監視機能を備えた堅牢なバックグラウンドジョブ処理システムを構築し、効率的な非同期タスク実行を実現します。
使用する場面
- 時間のかかる操作を非同期で処理する場合
- バックグラウンドでメールを送信する場合
- レポートやエクスポートを生成する場合
- 大規模なデータセットを処理する場合
- 定期的なタスクをスケジュールする場合
- 計算負荷の高い操作を分散する場合
クイックスタート
最小限の動作例:
# celery_app.py
from celery import Celery
from kombu import Exchange, Queue
import os
app = Celery('myapp')
# Configuration
app.conf.update(
broker_url=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
result_backend=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
task_serializer='json',
accept_content=['json'],
result_serializer='json',
timezone='UTC',
enable_utc=True,
task_track_started=True,
task_time_limit=30 * 60, # 30 minutes
task_soft_time_limit=25 * 60, # 25 minutes
broker_connection_retry_on_startup=True,
)
# Queue configuration
default_exchange = Exchange('tasks', type='direct')
app.conf.task_queues = (
// ... (完全な実装についてはリファレンスガイドを参照してください)
リファレンスガイド
references/ ディレクトリにある詳細な実装:
| ガイド | 内容 |
|---|---|
| Python with Celery and Redis | Celery と Redis を使用した Python |
| Node.js with Bull Queue | Bull Queue を使用した Node.js |
| Ruby with Sidekiq | Sidekiq を使用した Ruby |
| Job Retry and Error Handling | ジョブのリトライとエラー処理 |
| Monitoring and Observability | 監視と可観測性 |
ベストプラクティス
✅ 実行すべきこと
- ハングアップするジョブを防ぐためにタスクのタイムアウトを使用する
- 指数バックオフによるリトライロジックを実装する
- タスクを冪等にする
- 重要なタスクにはジョブの優先度を使用する
- キューの深さとジョブの失敗を監視する
- ジョブの実行詳細をログに記録する
- 完了したジョブをクリーンアップする
- メモリ効率のために適切なバッチサイズを設定する
- 失敗したジョブにはデッドレターキューを使用する
- ジョブを個別にテストする
❌ 実行すべきでないこと
- 非同期タスクで同期操作を使用する
- ジョブの失敗を無視する
- タスクを外部の状態に依存させる
- 無制限のリトライを使用する
- ジョブデータに大きなオブジェクトを保存する
- タイムアウトの処理を忘れる
- 監視なしでジョブを実行する
- キューでブロッキング操作を使用する
- ジョブの進捗状況の追跡を忘れる
- 関連性のない操作を1つのジョブに混在させる
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Background Job Processing
Table of Contents
Overview
Build robust background job processing systems with distributed task queues, worker pools, job scheduling, error handling, retry policies, and monitoring for efficient asynchronous task execution.
When to Use
- Handling long-running operations asynchronously
- Sending emails in background
- Generating reports or exports
- Processing large datasets
- Scheduling recurring tasks
- Distributing compute-intensive operations
Quick Start
Minimal working example:
# celery_app.py
from celery import Celery
from kombu import Exchange, Queue
import os
app = Celery('myapp')
# Configuration
app.conf.update(
broker_url=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
result_backend=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
task_serializer='json',
accept_content=['json'],
result_serializer='json',
timezone='UTC',
enable_utc=True,
task_track_started=True,
task_time_limit=30 * 60, # 30 minutes
task_soft_time_limit=25 * 60, # 25 minutes
broker_connection_retry_on_startup=True,
)
# Queue configuration
default_exchange = Exchange('tasks', type='direct')
app.conf.task_queues = (
// ... (see reference guides for full implementation)
Reference Guides
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Python with Celery and Redis | Python with Celery and Redis |
| Node.js with Bull Queue | Node.js with Bull Queue |
| Ruby with Sidekiq | Ruby with Sidekiq |
| Job Retry and Error Handling | Job Retry and Error Handling |
| Monitoring and Observability | Monitoring and Observability |
Best Practices
✅ DO
- Use task timeouts to prevent hanging jobs
- Implement retry logic with exponential backoff
- Make tasks idempotent
- Use job priorities for critical tasks
- Monitor queue depths and job failures
- Log job execution details
- Clean up completed jobs
- Set appropriate batch sizes for memory efficiency
- Use dead-letter queues for failed jobs
- Test jobs independently
❌ DON'T
- Use synchronous operations in async tasks
- Ignore job failures
- Make tasks dependent on external state
- Use unbounded retries
- Store large objects in job data
- Forget to handle timeouts
- Run jobs without monitoring
- Use blocking operations in queues
- Forget to track job progress
- Mix unrelated operations in one job
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (3,087 bytes)
- 📎 references/job-retry-and-error-handling.md (1,348 bytes)
- 📎 references/monitoring-and-observability.md (1,189 bytes)
- 📎 references/nodejs-with-bull-queue.md (3,383 bytes)
- 📎 references/python-with-celery-and-redis.md (5,573 bytes)
- 📎 references/ruby-with-sidekiq.md (2,083 bytes)
- 📎 scripts/health-check.sh (383 bytes)