King’s Steward

Today

Projects, access for the developer, your password and this device.

Look

How King’s Steward looks on this device. Each phone or computer keeps its own choice.

Notifications

Projects

Rename a project, pick its color, change the order, archive or delete it. The small grey text at the end of each name is the key the developer uses.

Keyboard shortcuts

These work anywhere on the page except while you are typing in a box.

Access

How the developer uses this list
Claude talks to https://app.kingssteward.com/api.php with curl.
Every request sends the header  X-Daybook-Key: <key>  read from the machine's key file
(~/.daybook/key). Never print the key. The server stamps who did what from the key's machine name.

Routes (?r=...; add &m=PATCH / &m=PUT / &m=DELETE and send POST for those methods)
  GET  ?r=state                          everything: tasks, recurring, projects, days, today
  POST ?r=tasks          {task}          new task (server makes the id and createdAt/By)
  POST ?r=tasks&id=X&m=PATCH {fields}  change a task
  POST ?r=days&id=YYYY-MM-DD&m=PATCH {"appendSummary":"..."}   add to that day's recap
       (works whether or not the day has a recap yet; the server stamps each addition with who and when)
  A day also has notes: the user's own text. Read it if it helps, never write it.

A task: title, details (plain text, URLs become links), project (key from projects),
  date ("YYYY-MM-DD", "today", "tomorrow", or null = Unscheduled, the tab that used to be called Backlog),
  status "open" | "done" | "suggested" | "dismissed" | "skipped", priority "high" or null,
  log [{at, by, text}] (read only; add with {"appendLog":"..."} in a PATCH)
  Setting status "done" stamps doneAt, doneBy and doneDay (today) for you. Send "doneDay":"YYYY-MM-DD" with it to log it as done on an earlier day.

A repeating task (collection "recurring"): title, details, project, time, active, startDate, endDate (last day, or null), lead (days shown early), and rule:
  {"freq":"daily"|"weekdays"|"weekly"|"monthly"|"yearly", "every":n (optional, every n days/weeks/months/years from startDate),
   weekly: "days":[0-6, 0 = Sunday]   monthly: "dom":n, or "doms":[n,...], or "nth":1-4 or -1 with "wd":0-6 (31 = last day)   yearly: "month":1-12, "dom":n}
  The page makes each day's copy itself, with the id r_<recurring id>_<date>. Do not create those copies.
  order (a number, optional) appears when the user arranges tasks by hand. Leave it alone.
  steps [{text, done}] (optional) is a checklist inside a task. To change it, PATCH the whole list.
  time ("HH:MM", 24 hour, optional) is a time of day. Set it only when the user gives a time.

Fitness: an exercise on a day is a normal task in the project "fitness" with one extra field,
  exercise (the exercise id). A workout (a named list of exercises) is ONE task with the field
  workout (the workout id), its exercises and reps in the details. The built-in exercises and
  workouts live in the page. The user's own and their edits of the built-in ones are in the state
  under exercises {name, areas[], targets[], reps, cue, easier, how} and workouts {name, laps, items[{ex, reps}], note}.
  A workout task has steps (one per exercise per lap); a repeating task may carry steps too, copied fresh to each day.
  did {laps, items[{ex, reps}], feel, secs, note} (optional) is what the user logged when ticking a fitness task. Leave it alone.
  nutrition ("check" | "weigh" | "supps", optional) marks the daily checklist task, the weekly weigh-in task and the
  daily supplements task of the nutrition plan. The plan itself is the state's nutrition collection: "plan" {lb, unit, bf, build,
  weighDay, startLb, startDay, adj[], highCarb, style}, "w_<date>" {lb, note} weigh-ins (lb always in pounds), "d_<date>" {meals[]}, "supps" {items[]}.
  Read it if it helps (weight trend, targets); the page writes it.

Rules for Claude
- Work the user asked for: status "open", date "today" unless told otherwise.
- Ideas you noticed on your own: status "suggested", date null. The user accepts or dismisses them.
- When you finish something: PATCH {"status":"done","appendLog":"what changed, commit, anything left"}.
- Never delete tasks. Don't change the user's tasks except to tick them or append to the log.
- Unfinished tasks roll forward to today on their own; leave their date alone.
- At the end of a work session, add a short recap to today's day with appendSummary.
  Organize it by project: one paragraph per project, starting with the name in bold ("**Master Sword:** ...").
  Say what was done; do not add a "Left for you" part (the user does not want one). Each session adds its own entry;
  the page merges the day's entries into one paragraph per project, so always start each part with the project name.
- Never remind the user to upload files: no upload notes in recaps or task logs. They know when to upload.
- Sub-projects: a project with "parent":"<main project key>" sits inside that project (one level deep), e.g.
  POST ?r=projects&id=thechristianking-online-store&m=PUT {"name":"Online Store","parent":"thechristianking","color":4,"order":0}.
  File a task straight under the sub-project's key. The main project's filter shows its sub-projects' tasks too.
  In a recap, start a sub-project's part with its own name ("**Online Store:** ...").
- Files stored IN King’s Steward (a draft, an article, a screenshot for a task): multipart POST ?r=upload with
  -F file=@path -F task=<task id> (or -F project=<key> for a loose file). They show under "files" in the state;
  GET ?r=file&id=<id> downloads one. The user deletes them when the task is done; never delete one yourself unless asked.
- Articles for TheChristianKing.com: POST ?r=publish {"file":"<file id>"} sends a stored .md file to TCK as a DRAFT
  article (only once TCK is connected in Settings; GET ?r=tck says). Sending the same file again updates that draft.
  It answers {tck:{id, title, edit}}; give the user the edit link. Only do this when the user asks. Publishing
  happens on TCK, by the user, never from here. Add "categories":["<topic>", ...] (from GET ?r=tck categories, the
  first is the main one; "category":"<topic>" still works for one) to file it under topics. The newest picture attached to the same task becomes the featured image. POST ?r=tcksync asks
  TCK which drafts went live (files.tck.status, url) and ticks their tasks.
- Recaps, details and logs show **bold**, *italic*, `code`, "- " bullets and "1. " lists.
- Editing a project's files: a Claude Code hook (working-hook.cjs) PUTs ?r=working&id=s-<session id> {"projects":["<key>"],"last":"file name"}
  before the first edit and DELETEs it at the end of each reply, so the project's pill glows on the page while files are open.
  If another session already has that project, the hook stops the edit: tell the user who has it and ask before going on.