Step 0 — Orient from the sheet, not from memory
This is a fresh session — there is no prior turn to resume. The sheet is the
memory.
One-time prerequisite, before the first run: the plaid connector only
carries the app-level API credentials (client_id / client_secret /
environment) — it does not by itself grant access to any bank account's
transactions. Reading the actual bank feed for a specific account requires a
per-account Item access_token, which a human obtains once, out-of-band, by
completing Plaid's Link flow (choosing the bank, authenticating, and
exchanging the resulting public token for the Item's access_token) and
storing it as the PLAID_ACCESS_TOKEN secret. This agent never performs
Link itself and cannot mint that token — if PLAID_ACCESS_TOKEN isn't set
when a run starts, stop before Step 2 and escalate asking a human to
complete the Plaid Link step, rather than guessing at a bank feed to read.
- Open
{{reconciliation_sheet}} and read the last dated reconciliation
entry to find the period's start (the day after the last close).
- Read the sheet's "explained mismatches" notes (recurring fees, known
timing lags, standing exceptions) so this run judges new lines against the
same standard as past runs, not from scratch.
- Set the period end to the close date for this run (the day before
{{cadence}} fired, or the explicit period the human gives you).
Step 1 — Pull Stripe activity for the period
Read (never write) Stripe for the period: charges, payouts, and the fees
withheld on each payout. Capture amount, date, associated invoice/customer
reference, and payout ID for every line — you'll need all four to match.
Step 2 — Pull the bank feed for the period
Read (never write) the connected bank feed for the same period, using the
linked account's PLAID_ACCESS_TOKEN (provisioned in Step 0): deposits and
withdrawals, with amount, date, and any reference/memo the bank provides.
Step 3 — Match transactions against invoices
For every invoice due or paid in the period, look for:
- Exact match — a Stripe payout and a bank deposit for the same amount
within 1 business day of each other. Tie out silently.
- Tolerance match — the deposit is short of the invoice/payout amount by
Stripe's disclosed fee (or by an amount the sheet's notes already explain
as a recurring fee), or the timing lag is within the sheet's standing
allowance (default: 3 business days unless the sheet says otherwise).
Tie out and add a one-line explanation.
- Mismatch — anything else: a payout with no matching deposit, a deposit
with no matching payout or invoice, a shortfall bigger than the disclosed
fee, or a lag past the tolerance window.
Step 4 — Classify every mismatch before escalating
Check each mismatch from Step 3 against the sheet's "explained mismatches"
notes:
- Recurring, already explained (e.g., a monthly platform fee the team has
signed off on before) — tie it out and note which prior explanation it
matches.
- New — this is the one a person needs to see. Do not invent an
explanation for it.
Step 5 — Write the summary back to the sheet
Append this run's entry to {{reconciliation_sheet}}: the period covered,
counts (clean matches / tolerance matches / escalated), and a row per
escalated mismatch with both records (Stripe reference + bank reference or
"none found") attached so the person reviewing doesn't have to re-pull them.
Step 6 — Stop — never move money
Your last action is the sheet write. You never issue a refund, initiate a
transfer, or take any action against Stripe or the bank beyond reading. If
something looks like it needs a correction outside the sheet, describe it in
the escalation — don't act on it.