跳到正文
Skillpedia
API 与服务器(后端)7.6k · #13176

recurring-jobs

它能做什么

这项技能说明定期定时任务在 Agent-Native 应用中如何运作,包括任务文件以及其背后的调度器。适合维护旧版任务功能或修复调度器问题的开发者。

适用场景

  • ✓当用户要求智能体按重复的时间表执行某项工作的时候。
  • ✓当你维护使用 manage-jobs 工具的旧版集成的时候。
  • ✓当定时任务在某个托管平台上无法运行的时候。

技能链接

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/recurring-jobs/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/recurring-jobs/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“设置一个每个工作日早上运行的任务,并把结果保存到一个聊天中。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体编写一个带有调度计划的任务文件。调度器大约每分钟检查一次到期的任务,运行它们,并把每个结果保存为一个聊天线程。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Recurring Jobs (Compatibility)

Rule

Recurring Jobs is the legacy name and API for scheduled automations. Jobs live as resource files under jobs/ with YAML frontmatter for scheduling metadata.

Read automations for the product model, trigger types, frontmatter fields, organization scope, and when to prefer manage-automations over manage-jobs. This skill covers only what is specific to the legacy scheduled path: the manage-jobs tool and the cron scheduler behind it.

How It Works

  1. User asks for something recurring via the agent chat
  2. Agent uses manage-jobs tool (action: "create") to write a job file at jobs/<name>.md
  3. A scheduler tick finds due jobs about once a minute. Long-running servers fire it in-process; Netlify, Vercel, and Cloudflare fire it from a platform trigger the build emits; AWS Lambda has no trigger, so jobs never fire there
  4. Due jobs enter the shared background-automation runner, on the same execution lifecycle as event automations
  5. Job results are saved as chat threads

Connected MCPs in background jobs

When a job needs a connected remote MCP, bind the exact advertised mcp__<server>__<tool> names through mcpTools. The scheduler passes that definition to the shared runner, which resolves only that allowlist under the persisted creator/org request context and never stores or exposes OAuth tokens, URLs, or arbitrary proxy targets.

Use an app-owned bounded import/upsert action for writes. Keep provider-specific response mapping, provenance, deduplication, and write policy in the app rather than in core. For example, a job can read meeting notes from any connected MCP and pass normalized action items to an app's idempotent import action.

Job Tool (built in)

Tool Action Purpose
manage-jobs create Create a recurring job (name, cron schedule, instructions); fails if the name exists
manage-jobs list List all jobs and their status
manage-jobs update Update schedule, instructions, or toggle enabled

Job files an app owns

create never replaces an existing job file, so a name that collides with an app's file (Factory's factories/<id>/<name>) is refused instead of reset. An app that stores its own settings in a job's frontmatter marks the file with triggerType, which makes list, update, and delete skip it and sends the caller to manage-automations. Edit those files only through the owning app's actions, and patch fields in place; rebuilding a file from the fields the writer knows drops the rest while the job keeps running.

Any write to a jobs/ file that removes a frontmatter field other than run bookkeeping is recorded as a job-fields-dropped audit event (org admins read it with list-audit-events and action: "job-fields-dropped"). Its input names the writer, the dropped fields, and the agent thread and run that made it.

UI Surface

/agent#jobs is the stable compatibility URL for the Agent page's Automations tab, which lists legacy scheduled jobs alongside trigger-aware automations and is backed by the scoped list/manage actions. Direct users there instead of describing job files when they just want to view or toggle scheduled work.

Key Files

File Purpose
packages/core/src/jobs/cron.ts Cron parsing (nextOccurrence, isValidCron, describeCron)
packages/core/src/jobs/scheduler.ts Job execution engine (processRecurringJobs)
packages/core/src/jobs/tools.ts Agent tool (manage-jobs with create/list/update actions)
packages/core/src/client/agent-page/ AgentJobsTab, the /agent#jobs surface

Related Skills

  • automations — The primary Scheduled/Event product model
  • actions — How tools and actions work
  • delegate-to-agent — How jobs invoke the agent loop
常见问题

调度器多久检查一次到期任务?

据技能说明,大约每分钟一次。

所有托管平台都能运行任务吗?

不能。技能指出 AWS Lambda 没有触发器,因此任务在那里永远不会触发。

新任务应使用哪个工具?

技能建议优先使用 manage-automations,而不是旧的 manage-jobs 工具。

详情

作者的原始描述

The legacy manage-jobs compatibility surface, job files under jobs/, and cron scheduler internals. Use when maintaining manage-jobs integrations or debugging the scheduler.

repo: BuilderIO/agent-native

热度

GitHub 星标
7.6k
排名
#13176
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能