/paywhere-smb:tax-sweep-agentfrom paywhere-smb
The weekly sales-tax sweep, automated (scheduled agent). On the owner's sweep day it totals the sales tax inside the payments RECEIVED this week (one QuickBooks cash-basis report, cross-checked against the bank's credits), writes sweeps/YYYY-MM-DD.md, and STAGES one Operating to Tax Reserve transfer for the owner to approve on the bank's /confirm page with a passkey. Five calls: 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 tax sweep," "sweep this week's sales tax," "tax sweep," "move this week's sales tax to the reserve," or schedules "every Friday at 4pm run the tax sweep" (any weekday the owner picks).
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.
The owner's weekly rule — "total the tax in the money that came in this week
and move exactly that to the Tax Reserve" — run 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: "tax-sweep-agent"on every tool call. Writesweeps/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" or "transferred". A missing connector removes a section, not the run. No email, no invites, no questions.
Not tax advice. The sweep uses the business's own sales-tax items as they appear on its invoices; the accountant owns the return.
| Field | Value |
|---|---|
| Schedule | Every <sweep day> at 4:00pm — the weekday the owner sweeps; the run day is the sweep day |
| Prompt | Run the tax sweep |
Cowork must be open for the run to fire. To see a run on demand, use the same prompt interactively. The week is always Monday through the run day.
Tax is owed on what was billed, but the cash for it only exists once the
customer pays. Sweeping on invoiced amounts moves money the business has not
received yet and starves Operating. Sweeping on received amounts keeps the
reserve exactly funded for the cash in hand; the gap to the next remittance
is the unpaid invoices' tax, which ../tax-reserve-check
reports separately.
Schedule fires (or: "run the tax sweep")
→ sweeps/<today>.md exists? → one line, stop.
→ Round 1 — two reads in parallel:
list_accounts (Operating + Tax Reserve, exact unmasked numbers, balances)
get_sales_tax_collected {date_from:<Monday>, date_to:<today>} (tax inside payments RECEIVED this week: total, byItem, byPayment)
→ Round 2 — the moment list_accounts returns, both in parallel:
query_transactions {accountNumbers:[<Operating>], direction:"credit", dateFrom:<Monday>, dateTo:<today>, status:["posted"]} (bank cross-check)
query_transactions {accountNumbers:[<Tax Reserve>], direction:"credit", dateFrom:<7 days ago>} (already swept this week? same-day duplicate?)
`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.
→ amount = collected.total − tax on booked payments with no bank credit − transfers already into the reserve this week
→ ONE make_batch_payment {payments:[{rail:"transfer", fromAccountNumber:<Operating>, toAccountNumber:<Tax Reserve>, amount,
description:"Weekly sales-tax sweep <Mon>–<today>"}], sessionType:"scheduled", taskId:"tax-sweep-agent"}
→ Write sweeps/<today>.md · print the run output with the URL
Never rebuild the tax figure from search_payments and read_invoice; the
report is the books side in one call. If list_accounts lacks balances,
get_account_balance on both accounts joins the same turn.
Progress tracking: call TaskCreate once per numbered step below before
starting step 1 (subject = the step's name, e.g. "1. Dedupe and stamp"), 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.
Resolve today from the actual date; the week is Monday through today (on a
day other than the scheduled one, still Monday through today, and say so).
If sweeps/YYYY-MM-DD.md exists → "Today's sweep exists at
sweeps/YYYY-MM-DD.md — skipping." and stop. Every Paywhere call carries
sessionType: "scheduled" and taskId: "tax-sweep-agent".
Issue the four reads as the Quick start lays them out: two in round 1, the
two scoped bank reads the moment list_accounts returns. Accounts by role, never by
number: Operating = the primary checking; Tax Reserve = the savings account
named for tax or reserve. If Paywhere is unreachable: one-line file, stop.
If QuickBooks is unreachable: the sweep cannot be computed (the bank has no
tax field) — write the file saying so, list the week's bank credits, stage
nothing.
collected.total, with collected.byItem
for the split per tax item.byPayment[] row (txnDate, total,
customer) to a bank credit this week by amount and counterparty; card
payments settle net of fee and grouped, so match a merchant settlement to
the sum of that day's card payments ± fee. A booked payment with no
bank credit is not yet received — subtract its taxCollected and list it.
A bank credit with no payment is received but not booked — its tax
cannot be computed from the books; list it under "needs you", never guess.tax-reserve-check; do not compute it here and do not add it to the
transfer.make_batch_payment{ "payments": [ { "rail": "transfer",
"fromAccountNumber": "<Operating, unmasked>",
"toAccountNumber": "<Tax Reserve, unmasked>",
"amount": <this week's received tax>,
"description": "Weekly sales-tax sweep <Mon>–<today>" } ],
"sessionType": "scheduled", "taskId": "tax-sweep-agent" }
Keep confirmation_url, confirmation_title, expires_at. If the amount
is $0 (nothing received, or already swept), stage nothing and say so. If
the response is { error }, record it in the file. Staging is the default so
the run's notification carries a review link; if the owner has switched this
schedule to a direct move, call transfer_funds with the same fields, read
the reserve balance back, and report the move rather than a link.
sweeps/YYYY-MM-DD.md# Sales-tax sweep — {date} (scheduled) · week {Mon}–{today}
Sweep amount: ${total} ({item A} ${a} · {item B} ${b}) ← tax inside payments RECEIVED this week
Tax Reserve before ${r} → after approval ${r+total}. Prior shortfall, if any: see tax-reserve-check (not included).
## Payments counted
| Date | Customer | Invoice(s) | Paid | Tax portion | Bank credit |
…
## Excluded
- Not yet received (booked payment, no bank credit): …
- Received, not booked (bank credit, no payment — tax unknown): …
- Already into the reserve this week: ${x} on {date}
## Staged for approval — {confirmation_title}
{confirmation_url}
Nothing has moved until you approve this on the bank's page. Expires {expires_at}.
Not tax advice; tax items as they appear on the invoices.
Tax sweep — {date} (scheduled)
Written: sweeps/{date}.md
This week's received tax ${total} ({item A} ${a} / {item B} ${b}) → staged Operating → Tax Reserve · {confirmation_title}
{confirmation_url}
Nothing has moved until you approve this on the bank's page.
Needs you: {unbooked credits}; prior shortfall → tax-reserve-check | Unavailable: {none}
What the bank sees: a scheduled session and an internal transfer
waiting for a human approval.
query_transactions on the Tax Reserve); after a direct transfer_funds,
only once the balance read confirms it.../_shared/AUTONOMY.md · ../_shared/APPROVAL.md../tax-reserve-check/SKILL.md — the interactive check, the shortfall and the catch-up transferWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
15 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."
npx claudepluginhub paywhereb/paywhere-claude-plugins --plugin paywhere-smb