---
name: payment-batch-stager
description: "Build the commission payment batch ready for the operator's approval. Stages an export for the agent's bank or a payroll-style spreadsheet. Never initiates a transfer. Built for use inside month-end-close."
---

# Payment batch stager

A building-block skill called by `month-end-close`. Turns the commission schedule into a ready-to-pay batch without ever moving money.

## What it does

Reads the commission schedule produced by `commission-calculator`. For each payee with a non-zero net, the skill produces a row in the batch:

- Payee name
- Payee bank account (sort code, account number) from the profile's payees table
- Amount
- Reference (the deal references, abbreviated to fit the bank's reference length limit)
- Pay date (the operator's preferred pay date)

Two outputs are produced:

1. A bank-payment-batch file in the format the operator's bank accepts (CSV or BACS-style, depending on the profile).
2. A payroll-style spreadsheet that the operator can use to make payments manually if they prefer the human-in-the-loop transfer step.

The operator approves the batch. Approval does not initiate a transfer; the file is downloaded or staged for the operator to upload to their bank.

## What it does not do

- It does not initiate a transfer. Ever.
- It does not store bank credentials.
- It does not bypass the operator on any change to a payee's bank details. Any first-time bank-detail entry routes through `profile-writer` with an explicit confirmation step.

## Connectors

Read: profile (payees table, bank format), commission schedule from `commission-calculator`.
Write: file artefact in the agent's Drive.

## Profile keys

- `realagent.payees` (per-agent bank details)
- `realagent.bank.batch_format` ("csv" | "bacs" | "open_banking_pain001" | "manual")
- `realagent.bank.preferred_pay_date_offset_days` (days after period end, default 7)
