/paywhere-smb:sweep-to-savingsfrom paywhere-smb
The idle-cash sweep, automated (scheduled agent). On its run day it works out how much of the operating balance is genuinely spare — net of everything committed through the next pay cycle, the operating buffer the business's own history says it needs, and any money earmarked and not yet moved — then writes savings/YYYY-MM-DD.md and STAGES one operating-to-savings transfer for the owner to approve on the bank's /confirm page with a passkey. Four reads in two rounds, one staged transfer. Stages by default so the owner approves on the bank's /confirm page; a direct transfer_funds only if the owner opts the schedule in. Use when the owner says "run the savings sweep," "sweep the spare cash to savings," "how much can I move to savings," "how much spare cash do I have," or schedules "every Friday at 6am run the savings sweep" (any day the owner picks). NOT for the sales-tax reserve — that is tax-sweep-agent, and a tax reserve is a liability, not spare cash.
Ships in paywhere-smb. 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.
Most operating accounts carry a balance the business never touches, because nobody has ever worked out what the real floor is. This agent works it out from the account's own history and stages the difference — once, behind one approval, on a schedule.
Follows ../_shared/AUTONOMY.md and
../_shared/APPROVAL.md. The load-bearing rules,
repeated because this file is loaded on its own:
Stamp
sessionType: "scheduled"andtaskId: "sweep-to-savings"on every tool call. Writesavings/YYYY-MM-DD.md; if today's exists, stop and say so. Stage by default: the transfer is staged as ONEmake_batch_paymentwith a single{rail: "transfer", fromAccountNumber, toAccountNumber, amount, description}item (directtransfer_fundsonly if the owner has opted this schedule in) — and the returned/confirm/<id>/<nonce>URL is printed verbatim with itsconfirmation_titleand "Nothing has moved until you approve this on the bank's page." Never say "swept", "moved" or "transferred". A missing connector removes a term, not the run. No email, no invites, no questions — nobody is there to answer them, which is also why the run shows its arithmetic in full.
The figure is deliberately conservative: being wrong here bounces payroll, so it rounds DOWN and says what the number is net of.
| Field | Value |
|---|---|
| Schedule | Every Friday at 6:00am — any day the owner picks; a weekly cadence suits a business paid weekly, monthly suits one paid monthly |
| Prompt | Run the savings sweep |
Cowork must be open for the run to fire. To see a run on demand, use the same prompt interactively.
Scheduled task fires: "Run the savings sweep"
→ Round 1 — three reads in parallel, never one after another:
list_accounts (roles, balances, exact unmasked numbers)
search_bills {status:"open", due_before:<window end>} (ONLY bills due inside the window)
get_sales_tax_collected {date_from:<1st of the month last remitted>} (earmarked: collected, not yet swept)
→ Round 2 — the moment list_accounts returns, one read:
query_transactions {accountNumbers:[<operating>], direction:"debit",
dateFrom:<90 days ago>, status:["posted"], limit:400} (recurring debits, payroll cadence, average weekly outflow)
`query_transactions` takes EXACT unmasked account numbers and reads EVERY account when
`accountNumbers` is omitted or empty, so a scoped read cannot go in the same round as the
`list_accounts` that supplies the number. Never guess it and never leave the field empty to
keep one round: an unscoped read folds the owner's own transfers (tax sweeps, savings moves)
into the totals, and they do not net out — a transfer out is a debit whether or not it comes
back somewhere else. If you have already read unscoped, re-read scoped rather than reasoning
from the wide number, and do not narrate the correction to the owner.
→ Window = today through the next payroll date + 7 days (payroll cadence comes from the processor debits)
→ safeToSweep = operating − committed − buffer − earmarked, floored at 0, rounded DOWN
→ If safeToSweep is 0: write the file saying so, stage NOTHING, and stop.
→ ONE make_batch_payment {payments:[{rail:"transfer", fromAccountNumber:<operating>, toAccountNumber:<savings>,
amount:<safeToSweep>, description:"Idle-cash sweep to savings"}]} → confirmation_url renders
→ write_file savings/YYYY-MM-DD.md — the figure, the arithmetic, the staged transfer, the /confirm URL
→ Run output: the figure, what it is net of, the transfer, the link, "nothing has moved until you approve it".
Nobody is asked anything. There is no "Stage it?" turn: the run stages the transfer itself and the owner approves it — or does not — when they next open Cowork. That is the whole point of a scheduled agent, and it is safe precisely because staging is not moving.
Nothing else is read: no balance sheet, no P&L, no per-invoice loop, no calendar, no email. Four reads, one stage, one file — six calls. If the books are not connected, skip the tax call, subtract nothing for earmarked money, and say in one line that the figure does not account for collected tax.
Defined once in ../_shared/AVAILABLE-CASH.md
and shared with plan-payroll, which answers the other half of the same
question. That skill asks will payroll clear and subtracts committed and
earmarked; this one asks can I take money out and subtracts the buffer too.
Same definitions, same figures — the demo must never show two numbers for the
same money. The summary below is the local restatement; the shared file wins
if they ever drift.
operating — the operating account's current balance from
list_accounts. It already nets pending card authorizations; do not subtract
them again.
committed — every outflow that will leave the operating account inside the window, from the debit history:
search_bills); if only
get_aged_payables is available, count the overdue buckets plus what is due
this week and exclude the rest of "current", which is mostly bills due
weeks from now. Counting the whole payables balance is the single easiest
way to arrive at a wrong zero.buffer — the floor the operating account should not drop below:
buffer = mean of the last three payroll runs + one week of average outflows
One week of average outflows = total posted operating debits over the lookback ÷ weeks in it (the 90-day debit list ÷ 12.9); no exclusions — payroll and the owner's own transfers stay in, which keeps it conservative and the same figure from either read. Same cushion the purchase decision uses, so two skills never give the owner two different floors. Do not use the worst week in the quarter: the worst week contains a payroll AND the month's supplier statements, so it double-counts payroll and quietly swallows the entire answer.
earmarked — money sitting in the operating account that belongs to someone else and has not moved yet. The common case is sales tax collected and not yet swept to a reserve.
Use ONE definition of that shortfall, the reserve skill's, so two skills can never put two different numbers for the same money on the same screen:
earmarked = max(0, sales tax collected on RECEIVED payments not yet remitted − reserve balance)
The window, the one call that produces the collected figure, and the traps are
in ../tax-reserve-check/reference/true-available.md
— follow it exactly. In particular:
tax-reserve-check by a few hundred. Name the missed dates
as evidence, then state the shortfall from the formula above.If the shortfall cannot be established inside this skill's budget, say so in
one line, subtract nothing, and name tax-reserve-check as the follow-up
rather than guessing.
safeToSweep = max(0, operating − committed − buffer − earmarked), rounded
DOWN to the nearest 100 of the account's currency. A figure at or below zero
is a legitimate answer: say the operating account has no spare cash this
cycle and why, and stage nothing.
Progress tracking: call TaskCreate once per numbered step below before
starting step 1 (subject = the step's name, e.g. "2. Read — four calls, two
rounds"), then TaskUpdate it to in_progress when you begin that step and
completed when it's done. This is what drives Cowork's visible progress
display — it does not happen unless you do it explicitly. The owner reads the
finished run in the morning, but the steps are what a presenter watches live.
Stamp sessionType: "scheduled" and taskId: "sweep-to-savings" on every
call. If savings/YYYY-MM-DD.md already exists for today, the sweep has run:
stop and say so. Never stage a second transfer for the same day.
The four reads in the quick start: three together in round 1 (balances and
roles, the open bills due inside the window, the sales tax collected since
the month last remitted), then ninety days of operating debits the moment
list_accounts returns the account number the scoped read needs.
Window = today through the next payroll date + 7 days. Then
safeToSweep = operating − committed − buffer − earmarked, floored at 0 and
rounded DOWN to the nearest 100 — every term as defined above and in
../_shared/AVAILABLE-CASH.md. Sanity-check a
zero before reporting one.
make_batch_paymentA single {rail: "transfer", fromAccountNumber: <operating>, toAccountNumber: <savings>, amount: <safeToSweep>, description: "Idle-cash sweep to savings"}
item. No dryRun first — an agent has nobody to show a table to. Staging is
the default so the morning notification carries a review link; if the owner
has switched this schedule to a direct move, call transfer_funds with the
same fields instead, read the balance back, and report the move rather than a
link. If the figure is zero, skip this step entirely and record why. Read back
confirmation_url, confirmation_title and expires_at.
savings/YYYY-MM-DD.mdThe figure, the arithmetic one line per term, the staged transfer and the
/confirm URL verbatim. This file is what the owner actually reads; the run
output is its summary.
What Cowork shows in the notification: the figure, what it is net of, the transfer, the link, and one line saying nothing has moved until it is approved.
The run writes savings/YYYY-MM-DD.md and says the same thing in its output.
Show the work: the owner reads this the next morning with nobody to ask, so
a bare figure is not actionable. The derivation is required — three or four
lines, not three or four sections.
<window end> — the total, then the pieces in a
clause: the payroll run (say it is the mean of the last three), the bills
due inside the window (name the vendors), the recurring debits landing in
that window.confirmation_title, and
the /confirm/<id>/<nonce> URL verbatim.tax-reserve-check for the earmarked shortfall is
welcome; anything more is not.It stays a run report, not an essay: no 13-week forecast, no month-by-month history, no per-invoice ledger, no unrelated analysis. Naming four vendors inline is right; itemising four bills as a table is not.
Sanity-check a zero before you report it. A healthy operating account should usually have something to sweep. If the figure lands at or below zero, re-check the two mistakes that cause a false zero — counting open bills that fall due after the window, and using a worst-case week as the buffer — before writing that there is nothing spare. A legitimate zero is fine: say why, stage nothing.
savings/YYYY-MM-DD.md already exists, the sweep has run — stop and say so.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub paywhereb/paywhere-claude-plugins --plugin paywhere-smb15 skills in this plugin
/ap-timingAnswers "am I paying anyone early, and what should I hold?" for accounts payable in one QuickBooks call: every open bill split into due-within-7-days and not-yet-due, plus each vendor's 12-month habit (bills paid at least 5 days before the due date, mean days early, dollars paid early, habitually early when 3 or more bills were). Produces a PAY NOW / HOLD / NOT YET DUE table with the cash a hold keeps in the account until the due date, and checks the pay-now total against the Operating balance. Read-only; hands off to pay-bills to stage payments. Use when the owner says "am I paying anyone early," "which vendors do I pay earlier than necessary," "what should I hold," "what's due this week and what can wait," or "what bills are coming due." NOT for staging or paying bills — that is pay-bills.
/big-purchase-decisionAnswers "can I afford this?" for a large purchase (a work van, a truck, equipment) from cleared cash rather than book profit, in five tool calls: today's balance, twelve months of monthly cash from the bank (the year's highs and lows), the last payroll debits (the cushion), and the dealer / lender / insurer emails for the price, terms and deadline. Always answers SHORT — a verdict, the number behind it, one caveat, under 120 words — and offers depth rather than volunteering it; preparing a lender application is credit-readiness, invoked explicitly. Read-only, stages nothing. Use when the owner says "can I afford the van / a new truck / new equipment," "can I buy a van this week for $X," "cash or finance," "when is the safest month to buy," "should I buy a second van," or "what if I put $10k down."