nocobase-app-plugin-scheduler
できること
NocoBase 3アプリで、業務の管理者から状態が見える定期実行のタスクを作る開発者を案内します。定期的な作業を監視したいチーム向けです。
使う場面
- ✓業務の管理者が、アプリ内で定期的なタスクを確認、追跡したいとき。
- ✓コードでスケジュールを定義し、その状態をUIで見せたいとき。
- ✓バックグラウンドのタスクにUIでの可視化が不要で、別のジョブの仕組みを選ぶ必要があるとき。
スキルのリンク
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-scheduler/skills/nocobase-app-plugin-scheduler/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“古い注文を毎晩アーカイブするタスクを追加し、管理者が実行の履歴を見られ、オフにできるようにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIはスケジュールとその実行ロジックをコードで定義し、対象を登録し、最終的な状態を報告します。Schedulerは、管理者が各実行を追跡できるよう、トリガーの履歴を保持します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Develop Scheduled Tasks in an Application
Use the installed version's public exports, without importing plugin internals. The application owns business logic, schedule declarations, Providers, permissions, and deployment timing. Scheduler owns scheduling projections, trigger history, and execution state. The plugin's skills/ directory is the source of truth; do not edit the synchronized application copy under .agents/skills/.
Decide Whether to Use Scheduler
The primary reason to define tasks through Scheduler is UI observability for business administrators. Developers define schedules and execution logic in code. Business administrators use the task list and detail pages the application builds on the Scheduler API to view schedules, track individual executions, and enable or disable tasks when authorized.
Tasks that do not need to be viewed and tracked through the UI must not be managed by the Scheduler plugin. Give recurring ones a ScheduleExecutor of their own from the application's jobs service (jobExecutorServiceToken in @nocobase/app-server/jobs), and one-off background work a JobExecutor; the application development Skill describes both. For administrator-visible tasks, deliver Client registration, access permissions, meaningful task names, and accurate final execution status together; successful server-side dispatch alone is incomplete.
Then Choose the Execution Model
After deciding to use Scheduler, choose according to business complexity:
| Scenario | Choice | Implementation boundary |
|---|---|---|
| Periodic cleanup, cache refresh, a single report, or one business Service call | Own target type | Short operations may complete directly; hand lengthy work to a JobExecutor |
| A simple operation that happens hourly | Own target type | Cron alone is not a reason to introduce a heavier execution system |
| Immediate asynchronous execution | JobExecutor |
No Cron Schedule is needed |
| A one-time delay, such as ten minutes after a request | Queue delay |
No Cron Schedule is needed; JobExecutor has no delay |
| Another execution system with its own references, status queries, and completion protocol | Own target type | The same registerTarget() call, with inspect() and completion reporting for work that finishes later |
Every schedule points at a registered target; registerTarget() is the target extension surface, and there is no built-in target type. A target does not guarantee exactly-once external business effects; design business idempotency.
Read by Task
- To create or change a schedule, read Definitions, Registration, and Synchronization.
- To register or review a target, hand its work to a
JobExecutor, report completion, or diagnose a historical occurrence after retargeting, read Target Extensions and Execution Protocol. - To integrate or review the UI/API and permissions, interpret status, or diagnose missing definitions, read Operations and Verification, including the complete management route table, separate status dimensions, and application identity checks.
Development Loop
- Establish which tasks and execution records administrators need to see. Check Server/Client/CLI registration, page permissions, the application's
jobsconfiguration (aredisadapter for more than one instance;memoryserves one process) andJobExecutorServiceProvidercomposition and target availability, then choose or register the target type. - Implement business logic and Providers in application source, and call
schedulerServiceToken.defineSchedule(definition)with an application-wide stable key from that Provider'sregister()/boot(). - Validate payload/inpu
よくある質問
すべてのバックグラウンドジョブでSchedulerを使うべきですか?
いいえ。UIでの可視化が不要なタスクには使うべきではないと、このスキルは説明しています。
タスクのオンとオフは誰が切り替えられますか?
許可された業務の管理者が、UIを通じて切り替えられます。
ビジネスロジックはSchedulerが持ちますか?
いいえ。ロジックはアプリケーションが持ち、Schedulerはスケジュールと状態を扱います。
詳細
作者による元の説明
Develop scheduled tasks in NocoBase 3 that business administrators need to view and track through the application UI. Define schedules in code, register the target a schedule points at, integrate execution status, and report completion. Do not use Scheduler to manage tasks that do not need UI visibility.
repo: nocobase/nocobase
人気
- GitHubのスター
- 25k
- ランキング
- #10105
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
nocobase-app-development
25kエージェントが、NocoBase 3の完全なビジネスアプリケーションのために、ページ、ルーティング、データ、権限、テストを作れるよう支援します。
shadcn
25kエージェントが、公式のドキュメントとレジストリを使い、Webプロジェクトの shadcn/uiコンポーネントを見つけ、追加し、修正し、スタイルを整えられるよう支援します。
nocobase-app-plugin-development
25kエージェントが、既存のNocoBase 3アプリの中で、サーバー、クライアント、データベース、登録の部分を含むプラグインを作成し、保守できるよう支援します。
nocobase-app-upgrade
25kエージェントが、NocoBaseのアプリを新しいテンプレートのリリースにアップグレードし、テンプレートの変更を取り込みつつ、あなた自身の作業を保てるよう支援します。