Todo Spend Tracker
Keep the user's to-do list and spending ledger from what they say out loud. The javis-server dispatcher runs this skill once for every completed recording or keyboard unit; the skill reads the open to-dos, extracts the user's own to-dos, purchases and "done" statements, and writes them as PENDING cards the user confirms or discards. In chat it answers "what's on my list" and "what did I spend this month" by running its counting script. Triggers — "what's on my list", "my to-dos", "what did I spend this month", "spending this month", "待办", "这个月花了多少".
To-dos & Spending
Turn the to-dos and purchases the user says out loud into pending cards, and answer "what's on my list?" and "what did I spend this month?" with exact numbers.
Rows live in skill_data (skill=todo-spend-tracker) with three types: ledger_task
(a to-do), ledger_expense (a purchase) and ledger_done (a to-do is finished). Every
row the skill writes is pending; the user taps Confirm (it counts) or Discard (it is
deleted) in the HiJavis app. Only confirmed rows count.
When to run
- Dispatcher run (automatic). After a recording or keyboard unit completes, the
server runs this skill with a prompt like
Run /javis-todo-spend-tracker for <unit>.(the unit isaudio:<id>orkbd:<id>) plus aUNIT CONTEXTblock (transcript,reference_date,tz,source_ref,source_kind). Do the extraction below. If the unit holds nothing to record, do nothing: no push, no reply. - Chat question. "What's on my list?", "what's still on my to-do list", "what did I spend this month?", "how much on food in October?", "我的待办", "这个月花了多少" — run the counting script (see "Answering in chat") and reply.
Core commands
# Step 1 — the open to-dos a "done" may name, plus today's local date
node scripts/todo-spend-tracker.js fetch-open
# Step 3 — write the extracted rows (pending) to /api/skill/data.
# Save the extraction JSON to a file with your file tool, then:
node scripts/todo-spend-tracker.js push --file /tmp/ledger-extraction.json
# or pass it in a QUOTED heredoc (the quotes around the delimiter matter):
node scripts/todo-spend-tracker.js push <<'JAVIS_LEDGER_JSON'
{ ...extraction JSON... }
JAVIS_LEDGER_JSON
# Chat — the counting script (the agent copies its numbers)
node scripts/ledger.js todos
node scripts/ledger.js spending # this month
node scripts/ledger.js spending --month 2026-10 # a given month
# add --json for the raw numbers
Dispatcher run: workflow
-
Fetch the open to-dos. Run
fetch-open. It prints{ reference_date, tz, open: [{ dedup_key, item, since }], source }. A "done" may only name one of thesededup_keys. Ifsourceisunavailable, the server refused the read:openis empty, so record no "done" this run (to-dos and purchases still go in). -
Extract from the
UNIT CONTEXTtranscript (the user's words;reference_dateis the unit's local day). Produce one JSON object:json { "source_ref": "<UNIT CONTEXT source_ref, else the unit id>", "unit": "<the unit from the run prompt, e.g. audio:6f1c… or kbd:123>", "source_kind": "audio", "reference_date": "<UNIT CONTEXT reference_date>", "tasks": [{ "item": "Call the bank about my card", "quote": "I need to call the bank tomorrow about my card" }], "expenses": [{ "item": "lunch", "amount": 12, "currency": "USD", "category": "Food & drink", "quote": "Just paid twelve dollars for lunch" }], "dones": [{ "task_key": "<an open dedup_key from fetch-open, verbatim>", "quote": "OK, I finally called the bank" }] }Leave an array empty when there is nothing of that kind. If all three are empty, stop: do not push.
-
Push. Give the object to
pushwith--file <path>or a quoted heredoc (<<'JAVIS_LEDGER_JSON'). Never useecho '…' |: the quotes are the user's own words, and an apostrophe ("I'll", "don't") would break the command.unitis required for a keyboard unit (itssource_refis shared by everything typed that day).pushvalidates every row, builds the dedup keys (task:<source_ref>:<hash>,exp:<source_ref>:<hash>,done:<task_key>:<source_ref>), setsstart_atto the local day at 00:00, and writes the rows as pending. It prints what it wrote and what it dropped. Running it again for the same unit adds no rows.
Extraction rules
Record only things about the user's own life that the user states. When unsure, leave it out: a missed card costs less than a wrong one.
- Whose words. Only statements in the first person count ("I need to…", "I paid…",
"我得…", "我刚花了…"). Recordings label speakers
speaker_0,speaker_1, …; no label is known to be the user, so treat everyspeaker_Nlabel as unknown and rely on the first-person rule. A keyboard unit (source_kind: keyboard) is always the user. - Skip other people's items. "Alex will order the rain barrel", "Sam paid forty dollars for the pizza", "you should call your mom" → nothing.
- to-do (
tasks): something the user commits to do ("I need to", "I have to", "I'll", "remind me to", "我要", "我得").item= the task in a few words, in the user's language. Skip musing and maybes ("I should probably clean the garage someday, maybe"). - Timed events are not to-dos. Anything with a date and time to attend ("dentist
Tuesday at 3pm", "dinner Saturday at 7") is left to
calendar-extractor; record nothing for it here. - purchase (
expenses): money the user spent.item= what it was for, as said ("lunch", "咖啡");amount= a number;currency= an ISO code (USD,CNY,EUR…; "块"/"元"/"RMB" →CNY, "bucks"/"$" →USD). If the amount or currency is not clear, leave the purchase out. If the user names another day ("yesterday I paid…"), add"date": "YYYY-MM-DD"counted fromreference_date. Only purchases from last month or this month are recorded; an older (or future) date is dropped by the script. Categories (exactly one):Food & drink,Groceries,Transport,Shopping,Bills & subscriptions,Entertainment,Health,Travel,OtherUse these strings exactly; anything else is dropped. PickOtherwhen none fits. - done (
dones): the user says an open to-do is finished ("I finally called the bank", "银行的电话打完了").task_keymust be one of thededup_keysfetch-openprinted, copied verbatim. If no open to-do matches, leave it out (the script drops it anyway). - Language. English and Chinese both work; keep the user's language in
itemandquote. - quote: the user's own words that state the fact, at most 25 words.
Answering in chat
For "what's on my list?" and "what did I spend this month?" (or a given month, in any language), run the counting script and copy its numbers. Never add amounts, count items or work out totals yourself.
- To-dos: run
node scripts/ledger.js todos. It lists the confirmed open to-dos with their since-dates and gives pending to-dos as a count only (do not list pending items). - Spending: run
node scripts/ledger.js spending(or--month YYYY-MM). It gives the month total and a table by category, largest first, confirmed purchases only. A second currency is reported on its own line; never add currencies together. - Reply with the script's text (translate the wording into the user's language if
needed, keeping every number and date). Keep its links:
[Open To-dos & Spending ›](javis://todos)for to-dos and[See by category ›](javis://todos/month)for spending. - If the script says the server refused the read, tell the user the numbers are on the
To-dos & Spending screen and give the
javis://todoslink. Do not guess numbers.
Notes
- Counting rules (
scripts/ledger.js, mirrored by the iOS app and pinned by the sharedtest/fixtures/ledger-cases.json): a to-do is open when itsledger_taskis confirmed and no confirmedledger_donenames itsdedup_key; done recently = confirmed dones of the last 14 days; month spending = confirmedledger_expenseamounts by the local month ofstart_at, per category and per currency; pending rows are counted separately and never added in. - Ticks in the app post a confirmed
ledger_donewithsource: "app"and nosource_ref; Undo discards it. The skill never writes those. - Server reads.
fetch-openandledger.jsreadGET /api/skill/datawith the container's gateway token. If the server refuses that token (401/403),fetch-openreturns no open to-dos (source: unavailable, so no "done" is offered) andledger.jsprints a hint pointing to the app instead of numbers. The skill keeps no local copy of the user's to-dos. - Runtime: Node 18+ built-ins only; no
npm install.
- Downloads
- Security audit
- Pass
- Last updated
- 14h ago
- Current version
- v0.1.2
- License
- MIT-0
