Pular para o conteúdo
Skillpedia
Automações25 mil · #10105

nocobase-app-plugin-scheduler

O que ela faz

Esta skill orienta desenvolvedores na criação de tarefas agendadas em um app NocoBase 3, com o status visível aos administradores de negócio. Ela é indicada para equipes que precisam acompanhar trabalhos recorrentes.

Quando usar

  • ✓Quando administradores de negócio precisam ver e acompanhar tarefas recorrentes no app.
  • ✓Quando você quer definir uma agenda no código com um status visível na interface.
  • ✓Quando uma tarefa em segundo plano não precisa de visibilidade na interface, e você precisa escolher outro mecanismo de jobs.

Link da skill

https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-scheduler/skills/nocobase-app-plugin-scheduler/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-scheduler/skills/nocobase-app-plugin-scheduler/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Você pode adicionar uma tarefa noturna que arquive pedidos antigos e permitir que os administradores vejam as execuções e a desativem?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A IA define a agenda e a lógica de execução no código, registra o alvo e informa o status final. O Scheduler guarda o histórico de disparos para que os administradores acompanhem cada execução.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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
Perguntas frequentes

Todo job em segundo plano deve usar o Scheduler?

Não. A skill diz que tarefas que não precisam de visibilidade na interface não devem usá-lo.

Quem pode ativar ou desativar uma tarefa?

Administradores de negócio autorizados, pela interface.

O Scheduler contém a lógica de negócio?

Não. A aplicação é dona da lógica, e o Scheduler cuida da agenda e do status.

Detalhes

Descrição original do autor

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

Popularidade

Estrelas no GitHub
25 mil
Posição no ranking
#10105
Licença
—
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas