Agent SkillsTinyAGI/tinyagi › schedule

schedule

GitHub

用于管理定时任务,支持创建、列出和删除周期性或一次性任务,将消息发送至指定Agent。提供CLI和REST API两种操作方式,基于cron表达式或ISO时间执行,适用于自动化报告、检查及提醒等场景。

.agents/skills/schedule/SKILL.md TinyAGI/tinyagi

Trigger Scenarios

用户需要设置定期执行的Agent任务 用户希望安排单次未来的Agent工作 用户要求查看或取消已配置的定时任务

Install

npx skills add TinyAGI/tinyagi --skill schedule -g -y
More Options

Non-standard path

npx skills add https://github.com/TinyAGI/tinyagi/tree/main/.agents/skills/schedule -g -y

Use without installing

npx skills use TinyAGI/tinyagi@schedule

指定 Agent (Claude Code)

npx skills add TinyAGI/tinyagi --skill schedule -a claude-code -g -y

安装 repo 全部 skill

npx skills add TinyAGI/tinyagi --all -g -y

预览 repo 内 skill

npx skills add TinyAGI/tinyagi --list

SKILL.md

Frontmatter
{
    "name": "schedule",
    "description": "Create, list, and delete scheduled tasks (recurring or one-time) that send messages to agents. Use when the user wants to: schedule a recurring task for an agent, set up a one-time future task, list existing scheduled tasks, delete or remove a scheduled task, or automate periodic agent work (reports, checks, reminders, syncs)."
}

Schedule Skill

Manage scheduled tasks that deliver messages to agents via the tinyagi API. Schedules can be recurring (cron-based) or one-time (fire once at a specific date/time). Each schedule enqueues a routed message (@agent_id <task>) that the queue processor picks up and invokes.

Schedules are persisted to ~/.tinyagi/schedules.json and run in-process via the croner library — no system crontab required.

API Endpoints

Schedules are managed via REST endpoints on the API server:

  • GET /api/schedules[?agent=ID] — list schedules
  • POST /api/schedules — create a schedule
  • PUT /api/schedules/:id — update a schedule
  • DELETE /api/schedules/:id — delete a schedule

Shell CLI

Use the bundled CLI scripts/schedule.sh for shell-based operations.

Create a recurring schedule

scripts/schedule.sh create \
  --cron "EXPR" \
  --agent AGENT_ID \
  --message "Task context for the agent" \
  [--channel CHANNEL] \
  [--sender SENDER] \
  [--label LABEL]
  • --cron — 5-field cron expression (required for recurring). Examples: "0 9 * * *" (daily 9am), "*/30 * * * *" (every 30 min), "0 0 * * 1" (weekly Monday midnight).
  • --agent — Target agent ID (required). Must match an agent configured in settings.json.
  • --message — The task context / prompt sent to the agent (required).
  • --channel — Channel name in the queue message (default: schedule).
  • --sender — Sender name in the queue message (default: Scheduler).
  • --label — Unique label to identify this schedule (default: auto-generated).

Create a one-time schedule (via API)

One-time schedules are created via the REST API by passing runAt (ISO 8601 datetime) instead of cron:

curl -X POST http://localhost:3777/api/schedules \
  -H "Content-Type: application/json" \
  -d '{
    "runAt": "2026-03-20T09:00:00.000Z",
    "agentId": "coder",
    "message": "Deploy the staging build",
    "label": "staging-deploy"
  }'

One-time schedules automatically disable themselves after firing.

List schedules

scripts/schedule.sh list [--agent AGENT_ID]

Lists all tinyagi schedules. Optionally filter by --agent to show only schedules targeting a specific agent.

Delete a schedule

scripts/schedule.sh delete --label LABEL
scripts/schedule.sh delete --all

Delete a specific schedule by label, or delete all tinyagi schedules.

Workflow

  1. Confirm the target agent ID exists (check settings.json or ask the user).
  2. Determine recurring vs one-time:
    • Recurring: determine the cron expression from the user's description (e.g., "every morning" -> "0 9 * * *").
    • One-time: determine the target date/time and convert to ISO 8601 format.
  3. Compose a clear task message — this is the prompt the agent will receive.
  4. Run scripts/schedule.sh create (recurring) or use the API (one-time) with the parameters.
  5. Verify with scripts/schedule.sh list.

Cron expression quick reference

┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * *
Pattern Meaning
0 9 * * * Daily at 9:00 AM
0 9 * * 1-5 Weekdays at 9:00 AM
*/15 * * * * Every 15 minutes
0 */2 * * * Every 2 hours
0 0 * * 0 Weekly on Sunday midnight
0 0 1 * * Monthly on the 1st
30 8 * * 1 Monday at 8:30 AM

Examples

Daily report

scripts/schedule.sh create \
  --cron "0 9 * * *" \
  --agent analyst \
  --message "Generate the daily metrics report and post a summary" \
  --label daily-report

Periodic health check

scripts/schedule.sh create \
  --cron "*/30 * * * *" \
  --agent devops \
  --message "Run health checks on all services and report any issues" \
  --label health-check

One-time deployment task

curl -X POST http://localhost:3777/api/schedules \
  -H "Content-Type: application/json" \
  -d '{"runAt":"2026-03-20T14:00:00.000Z","agentId":"devops","message":"Deploy v2.1 to production","label":"prod-deploy-v21"}'

List and clean up

# See all schedules
scripts/schedule.sh list

# See only schedules for @coder
scripts/schedule.sh list --agent coder

# Remove one
scripts/schedule.sh delete --label health-check

# Remove all
scripts/schedule.sh delete --all

How it works

  • Schedules are persisted in ~/.tinyagi/schedules.json.
  • The server runs an in-process cron scheduler (using croner) — no system crontab needed.
  • When a schedule fires, it directly enqueues a message in the SQLite queue.
  • The queue processor picks up the message and invokes the target agent, exactly like a message from any channel.
  • One-time schedules (runAt) auto-disable after firing.
  • Responses are stored in the SQLite queue and delivered by channel clients.

TinyOffice UI

Schedules can also be managed via the Schedule tab on each agent's detail page in TinyOffice. The UI provides a calendar view showing upcoming scheduled events and a form to create new schedules (recurring or one-time) without writing cron expressions.

Version History

  • 2db3a03 Current 2026-07-25 10:16

Same Skill Collection

.agents/skills/agent-browser/SKILL.md
.agents/skills/imagegen/SKILL.md
.agents/skills/skill-creator/SKILL.md
.agents/skills/skills-manager/SKILL.md
.agents/skills/tasks/SKILL.md
.agents/skills/memory/SKILL.md
.agents/skills/send-user-message/SKILL.md
.agents/skills/tinyagi-admin/SKILL.md

Metadata

Files
0
Version
2db3a03
Hash
e47611fa
Indexed
2026-07-25 10:16

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-22 04:47
浙ICP备14020137号-1 $Гость$