/aweek:recurringfrom aweek
Manages recurring tasks per agent with daily/weekly/biweekly/monthly rules. Provides CLI operations to list, add, update, and remove tasks, which expand into calendar occurrences and execute via the heartbeat loop.
Ships in aweek. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Per-agent recurring-task management. Users define recurrence rules
(daily / weekly / biweekly / monthly with INTERVAL, BYDAY,
BYMONTHDAY, BYSETPOS, COUNT, UNTIL) on an agent. Each rule lives
as a RecurringTask document on disk at
.aweek/agents/<slug>/recurring-tasks.json. Occurrences themselves are
never persisted in the recurring-task store — they are derived from
the rule by the expander on every read:
weekly-plans/<YYYY-Www>.json file).WeeklyPlanStore and execute through the
same heartbeat loop as hand-authored weekly tasks).This skill is the CLI surface for the four lifecycle operations
(list / add / update / remove). All persistence and AJV validation lives
in src/storage/recurring-task-store.ts; this skill wraps
src/skills/recurring.ts, which adds friendly pre-flight validation,
auto-derives rec-<slug> ids, stamps createdAt / updatedAt, and
enforces the destructive-operation confirmation gate. Never write
recurring-tasks.json directly — always route through
aweek exec recurring <fn>.
The dispatcher / validators explicitly reject v1-out-of-scope inputs so the failure surfaces here instead of in AJV blob errors downstream:
freq is restricted to daily | weekly | monthly. FREQ=YEARLY is
rejected up-front.RDATE / EXDATE are not accepted on the rule. Per-occurrence
exceptions go through the exceptions array (kinds: skip or
override).If the user asks for any of the above, point them at the v2 backlog and do not extend the skill.
Per project policy, every destructive surface requires explicit
AskUserQuestion confirmation before confirmed: true is passed to the
dispatcher. The underlying validators throw
code: ERECURRING_NOT_CONFIRMED otherwise — do not bypass the gate.
| Operation | Destructive | Confirmation required |
|---|---|---|
listRecurringTasks | No | No |
addRecurringTask | No (additive — never overwrites unless caller supplies an existing id) | No |
updateRecurringTask (template / exceptions only) | No | No |
updateRecurringTask (rule overlay) | Yes — rule edits affect every future occurrence | Yes |
removeRecurringTask | Yes — drops every future occurrence | Yes |
The validators check the confirmed: true flag at the dispatcher
boundary; the SKILL.md is the first line of defense — never hardcode
confirmed: true ahead of the human's response.
You MUST follow this exact workflow when this skill is invoked. Use
AskUserQuestion for every interactive prompt. Each numbered step maps
to one or more dispatcher calls — never inline node -e snippets.
List all agents so the user can choose which one's recurrence rules to operate on:
echo '{"dataDir":".aweek/agents"}' \
| aweek exec agent-helpers listAllAgents --input-json -
The response is an array of { config } records. Project each entry to
{ id: config.id, name: config.identity?.name, role: config.identity?.role }
for display. If the list is empty, tell the user "No agents found.
Use /aweek:hire to create one first." and stop.
AskUserQuestion.Carry the chosen slug forward as AGENT_ID.
Ask via AskUserQuestion:
Route to the matching branch. After each branch finishes, loop back to Step 2 until the user picks Done.
Read-only — no confirmation gate.
echo '{"agentId":"<AGENT_ID>","dataDir":".aweek/agents"}' \
| aweek exec recurring listRecurringTasks --input-json -
The response shape is { agentId, recurringTasks: RecurringTask[] }.
Pipe it through the formatter for a compact multi-line summary:
echo '{"result":<LIST_RESPONSE>}' \
| aweek exec recurring formatListResult --input-json -
Echo the formatted string back to the user as direct assistant
output — Bash blocks collapse in the UI. An empty list returns
"No recurring tasks configured for <AGENT_ID>." and is not an error.
Collect the template + rule, preview the validated record, then call the
dispatcher. No confirmation gate — add is additive and never
overwrites unless the caller supplies an id matching an existing
record (idempotent re-run, mirrors RecurringTaskStore.save()).
The template is the set of task fields every occurrence inherits.
Collect via AskUserQuestion:
| Field | Required | Notes |
|---|---|---|
title | Yes | Short single-line label (1–80 chars). |
prompt | Yes | Long-form instruction sent to Claude when the task fires. |
objectiveId | Optional | Free-form tag linking back to a section heading in plan.md. |
priority | Optional | critical / high / medium / low (defaults to medium). |
estimatedMinutes | Optional | Integer 1–480. |
track | Optional | Independent pacing lane (e.g. "x-com"). Falls back to objectiveId at selector time when omitted. |
Ask via AskUserQuestion for the recurrence frequency first:
interval: 2 for biweekly).Then collect the remaining fields based on freq:
| Field | Required | Notes |
|---|---|---|
freq | Yes | daily / weekly / monthly. yearly is rejected (v1 out of scope). |
interval | Yes | Integer ≥ 1. 2 = every other / biweekly. 3 = every third. |
dtStart | Yes | Anchor instant as a UTC ISO-8601 date-time. Defines wall-clock hour/minute of every occurrence (via timeZone projection) AND the lower bound — no occurrence fires before dtStart. |
timeZone | Yes | IANA zone (e.g. "America/Los_Angeles"). DST seams handled via localWallClockToUtc. Default to the project's .aweek/config.json timeZone. |
byDay | Weekly: optional · Monthly + bySetPos: required | Array of ["MO","TU","WE","TH","FR","SA","SU"]. Weekly: which day(s) of the week the event fires (e.g. ["MO","WE","FR"]). Monthly + bySetPos: which weekday the nth-of-month rule selects. |
byMonthDay | Monthly: optional | Integer 1–31. Months with fewer days silently skip per RFC 5545. |
bySetPos | Monthly: optional | Integer in {-5..-1, 1..5} (never 0). Combined with byDay for "nth weekday of month" — e.g. {byDay:["TU"], bySetPos:2} = second Tuesday of each month. |
count | Optional (XOR with until) | Integer ≥ 1. Terminate after N occurrences. |
until | Optional (XOR with count) | UTC ISO date-time. Inclusive upper bound — no occurrence after this. |
RFC 5545 XOR.
countanduntilare mutually exclusive — the AJVoneOfrejects a rule that declares both. The skill validator surfaces a clearer error before AJV runs. A rule with neither terminator recurs indefinitely (open-ended).
Validate the collected payload without writing — the pre-flight surfaces shape errors as a friendly message before AJV would:
echo '{
"agentId": "<AGENT_ID>",
"template": {
"title": "<TITLE>",
"prompt": "<PROMPT>"
/* optional: objectiveId, priority, estimatedMinutes, track */
},
"rule": {
"freq": "<FREQ>",
"interval": <INTERVAL>,
"dtStart": "<DTSTART_UTC_ISO>",
"timeZone": "<IANA_ZONE>"
/* optional: byDay, byMonthDay, bySetPos, count XOR until */
}
}' | aweek exec recurring validateAddParams --input-json -
Echo the validated payload back to the user inline so they can spot typos before the write lands. If the pre-flight throws, surface the error message verbatim and loop back to B1 / B2.
Call the dispatcher with the same payload (no confirmed flag — add
is not destructive):
echo '{
"agentId": "<AGENT_ID>",
"dataDir": ".aweek/agents",
"template": { /* … */ },
"rule": { /* … */ }
}' | aweek exec recurring addRecurringTask --input-json -
The response is the persisted RecurringTask record — the handler
auto-derives a rec-<slug> id from template.title and stamps
createdAt to now(). Pipe back through the formatter for the
summary line:
echo '{"record":<ADD_RESPONSE>}' \
| aweek exec recurring formatAddResult --input-json -
Echo the formatted summary back inline.
When the user wants idempotent re-runs (e.g. re-applying a rule from a
fixture file), pass id explicitly. The id must match the
^rec-[a-z0-9-]+$ pattern. A second add with the same id replaces
the prior record verbatim — this is the documented re-run path.
Patch an existing record's template, rule, and/or exceptions. A
rule overlay is destructive (it affects every future occurrence)
and requires the confirmation gate; template-only or exceptions-only
updates do not.
Run Branch A first to show the user the list, then ask via
AskUserQuestion which rec-<slug> id to update.
Ask via AskUserQuestion which surface the user wants to edit:
count clears until (and vice-versa) at
merge time so the RFC 5545 XOR stays satisfied even on a half-edit.originalRunAt (UTC ISO of the occurrence the expander would
have produced) and kind:
skip — drops the occurrence outright.override — replaces template fields per the overlay body. The
overlay may also carry an optional runAt to move this
occurrence in time (Google-Calendar "move this occurrence" UX).[] to clear all exceptions.At least one of template, rule, exceptions is required — the
validator throws otherwise.
Confirmation gate (required for rule overlays).
confirmed: trueMUST NOT be set on the dispatcher payload until after the user has explicitly answeredconfirmto theAskUserQuestionin this step. The dispatcher throwsERECURRING_NOT_CONFIRMEDotherwise — but the markdown is the first line of defense.
Skip this step entirely when the user is only editing template or
exceptions. When a rule overlay is present, render a preview block
inline as direct assistant output:
This update will replace the recurrence rule for <rec-id>:
Before : <describeRule(current)>
After : <describeRule(merged)>
Every future occurrence will use the new rule. Past occurrences that
have already materialized into weekly-plans/<YYYY-Www>.json are NOT
rewritten (the materializer is additive and idempotent by occurrence id).
Then collect the confirmation:
AskUserQuestion:
"Apply this rule change to <rec-id>? This affects every future
occurrence."
options:
- value: confirm
label: "Yes — update the rule"
description: "Patch the recurrence rule. Future occurrences fire on the new schedule."
- value: cancel
label: "Cancel"
description: "Discard the overlay. No disk writes."
If the answer is anything other than confirm, stop here and do
not issue any dispatcher call with confirmed: true.
echo '{
"agentId": "<AGENT_ID>",
"dataDir": ".aweek/agents",
"id": "<REC_ID>",
"template": { /* optional partial overlay */ },
"rule": { /* optional partial overlay */ },
"exceptions": [ /* optional — replaces wholesale */ ],
"confirmed": true /* required ONLY when rule is present */
}' | aweek exec recurring updateRecurringTask --input-json -
Pipe the response through the formatter:
echo '{"record":<UPDATE_RESPONSE>}' \
| aweek exec recurring formatUpdateResult --input-json -
The handler auto-stamps updatedAt inside RecurringTaskStore.update().
Unconditionally destructive — confirmed: true is always required.
Deleting a recurring task drops every future occurrence; past
materialized occurrences in weekly-plans/<YYYY-Www>.json are NOT
rolled back (the materializer is additive by design).
Run Branch A first to show the list, then ask via AskUserQuestion
which rec-<slug> id to remove.
Confirmation gate (required).
confirmed: trueMUST NOT be set on the dispatcher payload until after the user has explicitly answeredconfirm. The dispatcher throwsERECURRING_NOT_CONFIRMEDotherwise.
Render a preview inline:
This will delete recurring task <rec-id> from <AGENT_ID>:
Title : <template.title>
Rule : <describeRule(rule)>
Every future occurrence will stop firing. Past occurrences that have
already materialized into weekly-plans/<YYYY-Www>.json are NOT rolled
back. This action cannot be undone — re-add the rule from scratch if
you change your mind.
Then collect the confirmation:
AskUserQuestion:
"Delete recurring task <rec-id>? This drops every future occurrence."
options:
- value: confirm
label: "Yes — delete the rule"
description: "Remove the record from recurring-tasks.json. Future occurrences stop firing."
- value: cancel
label: "Cancel"
description: "Keep the rule. No disk writes."
If the answer is anything other than confirm, stop here.
echo '{
"agentId": "<AGENT_ID>",
"dataDir": ".aweek/agents",
"id": "<REC_ID>",
"confirmed": true
}' | aweek exec recurring removeRecurringTask --input-json -
The response shape is { agentId, id, removed: boolean }. removed: false is not an error — it means the id wasn't on disk (stale UI,
already-deleted, typo). Pipe through the formatter:
echo '{"result":<REMOVE_RESPONSE>}' \
| aweek exec recurring formatRemoveResult --input-json -
End-to-end examples of common rule shapes. Plug the JSON into
aweek exec recurring addRecurringTask --input-json - after filling in
<AGENT_ID>, <DTSTART_UTC_ISO>, and <IANA_ZONE>.
FREQ=DAILY doesn't carry a byDay filter — weekday-only patterns
should use weekly + byDay:
{
"agentId": "<AGENT_ID>",
"template": {
"title": "Daily standup",
"prompt": "Post today's standup update to #team.",
"priority": "medium",
"estimatedMinutes": 15
},
"rule": {
"freq": "weekly",
"interval": 1,
"byDay": ["MO", "TU", "WE", "TH", "FR"],
"dtStart": "2026-05-11T16:00:00.000Z",
"timeZone": "America/Los_Angeles"
}
}
interval: 2 is the biweekly knob:
{
"agentId": "<AGENT_ID>",
"template": {
"title": "Sprint retrospective",
"prompt": "Run the sprint retrospective and post action items to #retro.",
"estimatedMinutes": 60
},
"rule": {
"freq": "weekly",
"interval": 2,
"byDay": ["FR"],
"dtStart": "2026-05-15T21:00:00.000Z",
"timeZone": "America/Los_Angeles"
}
}
byMonthDay pins the calendar day. Months with fewer days than
byMonthDay silently skip per RFC 5545 (so byMonthDay: 31 fires only
in months that have a 31st).
{
"agentId": "<AGENT_ID>",
"template": {
"title": "Monthly billing review",
"prompt": "Review last month's billing, file the invoice."
},
"rule": {
"freq": "monthly",
"interval": 1,
"byMonthDay": 1,
"dtStart": "2026-06-01T17:00:00.000Z",
"timeZone": "America/Los_Angeles"
}
}
bySetPos + byDay is the "nth weekday of the month" pattern.
{
"agentId": "<AGENT_ID>",
"template": {
"title": "Team townhall",
"prompt": "Prep and chair the monthly town hall."
},
"rule": {
"freq": "monthly",
"interval": 1,
"byDay": ["TU"],
"bySetPos": 2,
"dtStart": "2026-06-09T18:00:00.000Z",
"timeZone": "America/Los_Angeles"
}
}
Negative bySetPos counts from the end of the recurrence set
(-1 = last, -2 = second-to-last):
{
"agentId": "<AGENT_ID>",
"template": {
"title": "Month-end wrap",
"prompt": "Close out the month — file reports, archive Slack threads."
},
"rule": {
"freq": "monthly",
"interval": 1,
"byDay": ["FR"],
"bySetPos": -1,
"dtStart": "2026-05-29T23:00:00.000Z",
"timeZone": "America/Los_Angeles"
}
}
count and until are mutually exclusive (RFC 5545 XOR). Use count
when the user knows how many occurrences they want:
{
"agentId": "<AGENT_ID>",
"template": {
"title": "12-week course check-in",
"prompt": "Post this week's course check-in thread."
},
"rule": {
"freq": "weekly",
"interval": 1,
"byDay": ["WE"],
"count": 12,
"dtStart": "2026-05-13T17:00:00.000Z",
"timeZone": "America/Los_Angeles"
}
}
until is the alternate terminator. The date is inclusive:
{
"agentId": "<AGENT_ID>",
"template": {
"title": "Election day reminder",
"prompt": "Remind the team to vote."
},
"rule": {
"freq": "daily",
"interval": 1,
"until": "2026-11-03T23:59:59.000Z",
"dtStart": "2026-10-01T16:00:00.000Z",
"timeZone": "America/Los_Angeles"
}
}
update with an exceptions overlay. The originalRunAt field is the
UTC ISO instant the expander would have produced before the
exception applied — copy it from the calendar's task chip / occurrence
id, NOT a fresh ISO timestamp:
{
"agentId": "<AGENT_ID>",
"id": "<REC_ID>",
"exceptions": [
{
"originalRunAt": "2026-07-06T16:00:00.000Z",
"kind": "skip"
}
]
}
No confirmation needed —
exceptions-only updates are not destructive (they're additive metadata on the same record).
kind: 'override' with a runAt in the overlay body:
{
"agentId": "<AGENT_ID>",
"id": "<REC_ID>",
"exceptions": [
{
"originalRunAt": "2026-07-07T17:00:00.000Z",
"kind": "override",
"override": {
"runAt": "2026-07-08T17:00:00.000Z",
"title": "Standup (rescheduled from Tue)"
}
}
]
}
A template-only overlay does NOT require confirmed: true:
{
"agentId": "<AGENT_ID>",
"id": "<REC_ID>",
"template": {
"priority": "high"
}
}
A rule overlay does:
{
"agentId": "<AGENT_ID>",
"id": "<REC_ID>",
"rule": {
"interval": 2
},
"confirmed": true
}
Every interaction with recurring-tasks.json goes through one of these
dispatcher entries. The skill markdown MUST NOT inline node -e
snippets or hand-write the on-disk file.
| Entry | Confirmation gated | Purpose |
|---|---|---|
recurring listRecurringTasks | No | Read every rule for one agent. Returns [] when no file exists. |
recurring addRecurringTask | No | Append a new rule. Auto-derives rec-<slug> id from template.title; idempotent re-run when caller supplies an existing id. |
recurring updateRecurringTask | Yes (when rule overlay is present) | Patch template / rule / exceptions on an existing record. Auto-stamps updatedAt. |
recurring removeRecurringTask | Yes | Delete a rule by id. No-op (returns removed: false) when id missing. |
recurring validateListParams | No | Pre-flight validator for the list call. |
recurring validateAddParams | No | Pre-flight validator — surfaces shape errors before AJV runs in save(). |
recurring validateUpdateParams | No | Pre-flight validator — enforces confirmed: true when a rule overlay is present. |
recurring validateRemoveParams | No | Pre-flight validator — enforces confirmed: true. |
recurring formatListResult | No | Format the list response as a compact multi-line summary. |
recurring formatAddResult | No | Format the persisted record as a human-readable add summary. |
recurring formatUpdateResult | No | Format the persisted record as a human-readable update summary. |
recurring formatRemoveResult | No | Format the remove response (`removed: true |
agentId — non-empty string, must reference an existing agent on
disk (the handlers fail fast with Agent not found: <slug> when the
agent JSON is absent).id — when supplied, must match ^rec-[a-z0-9-]+$. The validator
surfaces a friendlier error than AJV's pattern message.template.title — non-empty string, 1–80 chars.template.prompt — non-empty string.template.priority — critical / high / medium / low.template.estimatedMinutes — integer 1–480.template.track — non-empty string, ≤ 64 chars.rule.freq — daily / weekly / monthly. yearly is
rejected up-front (v1 out of scope).rule.interval — integer ≥ 1.rule.byDay — non-empty array of unique ["MO","TU","WE","TH","FR","SA","SU"] codes.rule.byMonthDay — integer 1–31.rule.bySetPos — non-zero integer in [-5, 5].rule.dtStart / rule.until / exceptions[].originalRunAt — UTC
ISO-8601 date-time strings (parsed via Date.parse).rule.timeZone — non-empty IANA zone string.rule.count XOR rule.until — never both. The skill validator
surfaces a clearer error than AJV's oneOf.exceptions[].kind — skip or override. override requires
a non-empty override body.exceptions[].override — partial template overlay with an extra
optional runAt (UTC ISO) for the "move this occurrence" UX. Unknown
keys are rejected.confirmed — must be the literal boolean true for any
destructive call. Truthy-but-non-true values ("true", 1, …) are
treated as missing and the dispatcher throws
ERECURRING_NOT_CONFIRMED./aweek:hire.update — the handler throws RecurringTask not found: <rec-id> (agent <slug>). Re-list (Branch A) and have the
user pick a real id.remove — removed: false is not an
error — the no-op response means the id wasn't on disk (stale UI,
already-deleted, typo).count and until both set — the pre-flight rejects with "rule.count
and rule.until are mutually exclusive (RFC 5545 XOR)". On update,
the merger automatically clears the OTHER terminator when one is
supplied, so the AJV oneOf stays satisfied..aweek/agents/<slug>/recurring-tasks.json. One
file per agent, an array of RecurringTask documents.src/services/recurrence-expander.ts produces an
Occurrence[] for a given ISO week and time-zone projection. Pure
function — no I/O, no shared state, deterministic for a given
(rule, weekMondayUtc, tz) triple.src/services/recurring-materializer.ts merges the
expander's output into the existing WeeklyPlanStore. Idempotent by
occurrence id (task-rec-<ruleId>-<yyyymmddThhmm>) — re-running a
tick blits the same record without duplication.src/serve/data/calendar.ts's
gatherAgentCalendar merges expansion with on-disk plan tasks at
read time, so every week navigates and renders even when there's no
weekly-plans/<YYYY-Www>.json file.WeeklyTask records and execute through the
same heartbeat loop as hand-authored tasks./aweek:plan — hand-author / edit weekly-plans/<YYYY-Www>.json
tasks for a single week. Use /aweek:recurring instead when the
task should repeat across many weeks./aweek:calendar — visualize the active weekly plan as a day × hour
grid. Recurring occurrences appear inline alongside hand-authored
tasks; the SPA calendar at aweek serve does the same with prev /
next / today navigation across every ISO week./aweek:hire — create a new agent. An agent with no
recurring-tasks.json behaves byte-identically to one created before
this skill existed./aweek:config — edit .aweek/config.json (timeZone,
heartbeatIntervalSec, …). The project's timeZone is the default
for rule.timeZone when the user hasn't supplied an override..aweek/agents/<slug>/recurring-tasks.json — per-agent
RecurringTask[] document (this skill's primary write surface)..aweek/agents/<slug>/weekly-plans/<YYYY-Www>.json — per-week task
lists (the materializer writes here at heartbeat tick time)..aweek/config.json — project config (timeZone default).Explicitly not implemented by this skill — point users at the v2 backlog instead:
FREQ=YEARLY recurrence.RecurringTask (multi-rule composition).RDATE (extra one-off dates added to the rule).EXDATE (one-off exclusion dates — use the exceptions array with
kind: 'skip' instead).If the user asks for any of these, point them at the v2 backlog and do not extend the skill.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub runbear-io/aweek --plugin aweek14 skills in this plugin
/calendarDisplay an agent's weekly plan as a calendar grid with day columns and hour rows/configShow the project's `.aweek/config.json` knobs (plus the hardcoded scheduler/lock constants the dashboard surfaces) and edit the config-backed fields with a confirmation gate/delegate-taskDelegate a task from one agent to another via the async inbox queue/hireHire (create) a new aweek agent — collect identity, then interview the user to author plan.md (long-term goals, monthly plans, strategies, notes) so the agent is plan-ready immediately./manageManage an agent's lifecycle — resume paused agents, pause/stop agents, edit identity, or delete/archive agents/planEdit an agent's free-form planning markdown and adjust weekly tasks from a single entry pointOther plugins' skills for the same job