本文へスキップ
Skillpedia
自動化25k · #10105

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がスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-scheduler/skills/nocobase-app-plugin-scheduler/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

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

Development Loop

  1. Establish which tasks and execution records administrators need to see. Check Server/Client/CLI registration, page permissions, the application's jobs configuration (a redis adapter for more than one instance; memory serves one process) and JobExecutorServiceProvider composition and target availability, then choose or register the target type.
  2. Implement business logic and Providers in application source, and call schedulerServiceToken.defineSchedule(definition) with an application-wide stable key from that Provider's register()/boot().
  3. 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

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル