OR Key
drop another .md file to compare - side-by-side diff against chat-schedule

chat-schedule

Schedules a task to run later, at the time you choose.
personal 2 files 3 recent evals

What it does for you

Schedules a task to run later, at the time you choose.

What it produces

A recent result, so you can see the kind of work it returns.

loading…

How to get it

These run inside the Snappy workspace. Want this working in your business? I set skills like this up with you, in one focused week.

Work with me
For developers how this skill is built, graded, and how it runs

at a glance- the short version

eval modeauto-shape
categoryChat

what's inside - the parts that make up a skill 3/4 present

A skill is just a few plain-text files. Only the main one is required. The rest are optional, added as the work needs them. This is what the skill is made of; how it runs is just below.

The skill
state/skills/chat-schedule/SKILL.md present
the skill itself, in plain text
The main file. It says what the skill is and lays out the steps in plain English.
Code
state/lib/chat-schedule.ts present
code the skill can run
Reusable code this skill can call when it needs to.
Scripts
state/bin/chat-schedule/ not present
helper scripts
Optional. Added when a skill has a few commands to run.
Loader
state/skills/chat-schedule/AGENTS.md present
what the AI loads on the fly
Loaded automatically the moment this skill is needed. Kept short on purpose.

how it runs - the shared frame every skill uses 3/5 present

Every skill runs the same way. One part does the work, a separate part checks it, and a short loader hands the AI exactly what it needs for the job. Anything this skill doesn't use shows a one-line note saying why, on purpose, not by accident.

makes the work The worker
not present

No work step here. This is probably a skill that reads or coordinates, not one that produces something.

checks the work The reviewer
inferred
shape gate an automatic check
The check is an automatic pass or fail on the shape of the result, run separately from the work itself.
frame
learns Self-correction
present
fixes itself learns from gaps
When a run hits a gap, the skill gets edited on the spot [FIXED] or queued for a bigger rewrite [LOGGED], so it keeps getting better.
tidies up Background fixes
present
queued for rewrite runs in the background
Bigger fixes that can't be made on the spot get queued and rewritten in the background later.
remembers Run history
present
state/log/evals.ndjson auto-shape runs
Every run is written down here, so the next time this skill is used it already knows how the last runs went.
Critical rules the things this skill must not get wrong
No must-not-break rules called out for this skill. Anything important lives in the writeup below.

what it has learned - fixes written back in over time sample

When a run hits something this skill didn't handle, the fix gets written back into the skill so it doesn't happen again. FIXED means it was corrected on the spot. LOGGED means it's queued for a bigger rewrite. Either way, the skill gets a little better and never makes the same mistake twice.

  1. Loading feedback rows…

SKILL.md- the skill, written out in plain English

chat-schedule

Enqueue a chat intent to fire at a future time. The scheduled intent is stored in the head-screen server's schedule queue and dispatched at the target timestamp as if the user had typed it.

What it's for

  • Timed briefings. Schedule "morning brief" to fire at 08:00 without a cron job.
  • Deferred dispatch. Queue a follow-up intent after a long-running task completes.
  • QA sequences. Schedule a series of test intents with gaps between them for paced dogfood.

When NOT to use it

  • Immediate dispatch. Use chat-drive for instant push.
  • Recurring schedules. Use the snappy-os schedule recipe for cron-style recurrence. This skill handles one-shot future dispatch only.

Steps

  1. POST to /chat-schedule on the head-screen server:
   curl -XPOST 127.0.0.1:3147/chat-schedule \
     -H "Content-Type: application/json" \
     -d '{"intent":"morning brief","fireAt":"2026-05-01T08:00:00Z"}'
  1. The server returns {"scheduled":true,"id":"<schedule-id>"}.
  2. At fireAt, the server internally calls chat-inject-push with the intent, which the React app picks up on its next poll.
  3. Cancel via DELETE /chat-schedule/<id> before the fire time.

Eval

Kind: auto-shape. Frontmatter + AGENTS.md presence passes the gate. Behavioral test pending the /chat-schedule endpoint being wired in state/bin/head-screen/server.ts.

Files

  • state/bin/head-screen/server.ts - owns /chat-schedule and DELETE /chat-schedule/:id (pending wire-up).
  • state/skills/chat-schedule/SKILL.md - this file.

AGENTS.md- what the AI loads when this skill comes up

chat-schedule - loader

Per-turn rules. Full reference: state/skills/chat-schedule/SKILL.md.

Critical Rules

  1. One-shot only. This skill schedules a single future dispatch. For recurring, use the snappy-os schedule recipe.
  2. fireAt must be ISO 8601 UTC. Malformed timestamps are rejected silently. Always pass UTC (Z suffix).
  3. Head-screen server must be alive AND stay alive. Scheduled intents live in-memory. Server restart = all schedules wiped. Not suitable for overnight scheduling unless the server is daemon-persistent.
  4. Cancel before fire. DELETE /chat-schedule/<id> to cancel. After fire, the entry is removed automatically.
  5. Endpoint may not be wired yet. If /chat-schedule returns 404, file the gap. The schedule skill (snappy-os built-in) is the current workaround for timed dispatch.

Commands

| ui dashboard | state/skills/chat-schedule/resources/ui.openui |

operationcommand
schedulecurl -XPOST 127.0.0.1:3147/chat-schedule -H "Content-Type: application/json" -d '{"intent":"<text>","fireAt":"<ISO8601-UTC>"}'
cancelcurl -XDELETE 127.0.0.1:3147/chat-schedule/<id>
listcurl -s 127.0.0.1:3147/chat-schedule
preflightcurl -s 127.0.0.1:3147/healthz
serverbash state/bin/head-screen/launch.sh (idempotent)

Self-Test

  • [ ] Pass fireAt in ISO 8601 UTC.
  • [ ] Verify server will stay alive until the scheduled fire time.
  • [ ] Cancel before fire if the intent is no longer needed.

Self-correcting loader (PID feedback)

echo "[$(date -u +%FT%TZ)] chat-schedule: <what was missing or fixed> [FIXED|LOGGED] action_kind=skill-ran" >> state/log/loader-feedback.log

OpenUI Resource

  • Skill-owned OpenUI Lang resource: state/skills/chat-schedule/resources/ui.openui. Read it before rendering or editing this skill's generated component surface.
  • Treat this resource as a first-class artifact of the skill, not a generic chat response. Improve it when the skill's user-facing output needs to become richer.
  • System resources compose OpenUI primitives and inherit SnappyChat tokens. Use ui_contract: branded in SKILL.md only for deliberate platform or client visuals.

api.ts- the code it can call

#!/usr/bin/env npx tsx
/**
 * state/lib/chat-schedule.ts — create scheduled agents from the chat surface.
 *
 * Creates a new state/agents/<id>.json with {name, intent, cron} triplet.
 * Minted via snappy-chat POST /agent/create-scheduled.
 *
 * Schema: Agent from state/lib/agents.ts with optional schedule_cron.
 */

import { writeAgent, normalizeId } from "./agents.ts";
import type { Agent } from "./agents.ts";

export interface ScheduleInput {
  name: string;           // display name, kebab-case normalized
  intent: string;         // the prompt/directive the scheduler will run
  cron: string;           // 5-field cron expression (e.g. "0 9 * * 1")
  loader_slug?: string;   // optional explicit loader; defaults to inferred
}

export interface ScheduleOutput {
  ok: boolean;
  id?: string;
  name?: string;
  intent?: string;
  cron?: string;
  loader_slug?: string;
  error?: string;
}

/**
 * Validate cron expression: simple check for 5 space-separated fields.
 * Full validation deferred to scheduler.
 */
function isValidCron(cron: string): boolean {
  const parts = cron.trim().split(/\s+/);
  return parts.length === 5 && parts.every(p => p.length > 0);
}

/**
 * Create a scheduled agent from {name, intent, cron}.
 *
 * Returns {ok: true, id, name, intent, cron, loader_slug} on success.
 * Returns {ok: false, error: "..."} on failure.
 *
 * Idempotent: safe to call multiple times with same inputs (will re-write
 * the agent file but result is deterministic).
 */
export function createScheduledAgent(input: ScheduleInput): ScheduleOutput {
  // Validate inputs
  const name = (input.name || "").trim();
  if (!name || name.length === 0) {
    return { ok: false, error: "name required" };
  }
  if (name.length > 100) {
    return { ok: false, error: "name >100 chars" };
  }

  const intent = (input.intent || "").trim();
  if (!intent || intent.length === 0) {
    return { ok: false, error: "intent required" };
  }
  if (intent.length > 2000) {
    return { ok: false, error: "intent >2000 chars" };
  }

  const cron = (input.cron || "").trim();
  if (!cron || cron.length === 0) {
    return { ok: false, error: "cron required" };
  }
  if (!isValidCron(cron)) {
    return { ok: false, error: "cron must be 5 space-separated fields" };
  }

  const loader_slug = (input.loader_slug || "").trim();

  // Mint a collision-safe id: normalized name + short timestamp suffix
  const tsSuffix = Date.now().toString(36).slice(-6);
  const idBase = normalizeId(name).slice(0, 30) || "scheduled";
  const id = `${idBase}-${tsSuffix}`;

  // Build the agent record
  const agent: Agent = {
    id,
    status: "running",
    prompt: intent,
    ticks: 0,
    max_ticks: 1000,
    started_at: new Date().toISOString(),
    last_tick_at: null,
    last_tick_status: null,
    last_tick_dur_secs: null,
    loader_slug: loader_slug || undefined,
    schedule_cron: cron,
  };

  try {
    writeAgent(agent);
    return {
      ok: true,
      id,
      name,
      intent,
      cron,
      loader_slug: loader_slug || undefined,
    };
  } catch (e: any) {
    return { ok: false, error: e?.message || "writeAgent failed" };
  }
}

scripts- helper scripts it can run

prose-only skill - no sidecar under state/bin/ yet. Steps, if any, are described in SKILL.md.

how we check it- the checks, plus the last 3 runs

rubric auto-shape no rubric declared
recent mean 1.00 · 3 runs actor/auditor: unverifiable
deps none declared
timestamp verb score primary_issue artifact
2026-05-01 09:19Z - 1.00 - -
2026-05-01 09:19Z - 1.00 - -
2026-05-01 09:19Z - 1.00 - -