Skill 寫法圖鑑

plan-payroll

Anthropic | 商業與營運 | 原文 | Apache-2.0

串接現金預測、催收發票和發薪準備,確認發得出薪水

中文翻譯

---
name: plan-payroll
description: 從頭到尾跑完「有把握發薪」這條串接:先用 cash-flow-snapshot 預測發薪期間的現金,再用 invoice-chase 排序並擬好逾期發票的催款提醒來補任何缺口,然後用 payroll-prep 彙整工時、標出每個異常並排好發薪批次。在 Gusto 上,發薪批次排好後由老闆送出;在 QuickBooks Payroll 上,或沒有薪資系統時,最後一步是驗證過、由老闆鍵入的發薪清單。這條串接絕不按下發薪的按鈕。以帳本(MYOB、NetSuite、QuickBooks、Xero 或 Zoho Books)為基礎,搭配 Gmail 或 M365、PayPal、Square、Stripe,以及 Gusto 或 QuickBooks Payroll 補充細節,並備有 CSV 和工時表上傳作為退路。只要發薪是擔心的事就用,包括「can I make payroll」、「payroll is due Friday」、「plan payroll」、「will I have enough to pay the crew」,或「I need to run payroll but money is tight」。可接受選用的期間(horizon)和發薪日參數。
allowed-tools: Read, WebFetch
---

# 規劃發薪(Plan Payroll)

依序三個 skill:確認發薪有著落,沒有的話補上缺口,然後執行。

老闆在這裡不會問兩個分開的問題。「Can I make payroll」和「run payroll」是同一個擔心,把它們拆到兩個 session,就會變成晚上 11 點有人在沒查過銀行餘額的情況下就把發薪批次鍵入。

解析參數:

- `--horizon`(預設 `30`):預測的天數視窗:30、60 或 90
- `--payroll-date`(選填):發薪執行的日期;預設為下一個排定的發薪日

## 步驟 1:發薪有著落嗎?(cash-flow-snapshot)

呼叫 `cash-flow-snapshot`。預測的運算、信賴區間和 CSV 備援都歸它管,這裡一項都不要重建。

- **輸入:** 預測期間和發薪日。
- **輸出:** 30/60/90 天預測、點名的風險旗標、一段聊天摘要,以及一份 XLSX。

在其他任何事情之前,先用一句話說出結論:夠、吃緊,或在某個明確的日期短缺某個明確的金額。

**關卡:串接接下來往哪裡走。** 如果發薪綽綽有餘,就問要不要跳過催收步驟,直接進入執行。如果有缺口,就呈現出來,等到明確的「see what we can collect」才進入步驟 2。

## 步驟 2:補上缺口(invoice-chase)

呼叫 `invoice-chase`。排序、語氣配合,以及依發票類型的寄送路徑都歸它管。

- **輸入:** 步驟 1 得出的缺口金額和它出現的日期。
- **輸出:** 排好名次的逾期發票,每張附一份擬好的提醒,PayPal 開立的發票排成 PayPal 寄送,其他的則成為信件草稿。

把排序跟步驟 1 連起來:顯示在預測期間內會收回多少,以及這是否真的補上了發薪缺口。一份 45 天後才會付款的提醒,對週五的發薪毫無幫助,要直說。

**關卡:沒有核准,什麼都不准寄。** 老闆說寄之前,都只是草稿,逐封或以他們指名的批次核准。

## 步驟 3:排好發薪批次(payroll-prep)

呼叫 `payroll-prep`。期間設定、工時加總、異常檢查和帳務同步都歸它管。

- **輸入:** 發薪期間、名單,以及步驟 1 的現金結論。
- **輸出:** 逐人的發薪清單,每個異常都標在所屬的那個人身上,總計,以及發薪日需要的現金。

沿用步驟 1 的結果,不要重算。當 `payroll-prep` 回報這批發薪付不付得出來時,用的是這條串接已經產生的預測,再加上步驟 2 預期會收到的任何款項。

**關卡:旗標,一次一個。** `payroll-prep` 會逐一走過每個異常。不要把它們合併成一個「看起來沒問題嗎?」,每一個都是某個人的薪水。

**關卡:發薪本身。** 連了 Gusto 時,發薪批次排在 Gusto 裡(`payroll-prep` 用 `update_payroll` 寫入核准的輸入;絕不呼叫 `run_payroll`)。連了 QuickBooks Payroll 時,connector 只有讀取、沒有排發薪批次的寫入,所以成果是驗證過、由老闆鍵入的發薪清單,這是 connector 目前擁有的,不是比較差的路徑。排程只有在來源真的回傳了名單和排程時才成立:當已連接的來源回報有員工卻沒交付任何員工時,payroll-prep 會停下排程路徑,這條串接就以發薪清單收尾,並明白說出來。**由老闆送出。** 兩者都沒有時,交付物是供手動輸入的驗證過的發薪清單,這是完整的成果,不是降級的成果。這也包括 Gusto 回報 blocker 的情況,發薪清單會從 `payroll-prep` 繼承 blocker 清單。

## 步驟 4:收尾

一份回顧,依這個順序:現金結論、寄了什麼給誰、如果提醒轉換成收款後預估的狀況,以及排好的發薪批次:人數、總工時、總毛薪、離開帳戶的現金、發薪日,以及任何還沒處理的旗標。

Ray Okonkwo 四行就看完:15 日現金短缺 USD 4,200,寄出三則提醒涵蓋 USD 6,800,其中兩筆很可能在期間內到帳,發薪批次排好 9 個人、USD 18,340,Marcus 還有一筆漏打卡尚未處理。

## 輸出

**依老闆儲存的輸出偏好交付步驟 4 的回顧,絕對不要預設產出 markdown 檔。** 檢查 `## Business context` 區塊裡的 `Output preference`(共用風格指南規則,`../../shared/artifact-style.md`):

- **視覺化 artifact(預設):** 用 house style 把回顧渲染成 HTML 頁面,現金結論做成最前面的數字卡片(stat tile),寄出的提醒和它們預估的收款用 tabular-nums,排好的發薪批次的總計,任何還沒處理的旗標都帶標籤。預估的現金要標示為預估。
- **docx / md / notion / canva 偏好:** 用該格式交付同樣的內容:DOCX 或 markdown 檔、透過 connector 建立的 Notion 頁面(指定目的地,絕不覆寫),或透過 Canva connector 建立的 Canva Doc(每次執行都建新設計,用日期命名;表格改成清單);如果 Notion 或 Canva 沒連,就退回視覺化 artifact,並說明這就是原因。
- **Best for skill:** 用視覺化 artifact,因為這份輸出是一個畫面,回答「can I make payroll」。

## Connector 失敗

如果連不到任何帳本(MYOB、NetSuite、QuickBooks、Xero 或 Zoho Books,老闆用哪個就是哪個),就停下來,並依類別說明,因為預測是這條串接的基礎。如果支付 connector 或信件 connector(Gmail 或 M365)失敗,就點名它,其餘繼續。如果薪資系統失敗,就退到發薪清單路徑,不要中止;老闆仍然能拿到一份可以執行的薪資。當發薪批次無法排好或同步進帳務時(blocker、缺少寫入權限),就在步驟 4 的回顧中說明,並交付發薪清單加上傳票摘要,由記帳人員鍵入;由 `payroll-prep` 的 blocker 檢查決定適用哪條路徑。

## 不要做的事

- **不要送出薪資。** 串接負責排好;由老闆送出。就算老闆要求直接做下去,這一點也不變。
- **沒有核准不要寄提醒。** 在被告知之前都是草稿。
- **不要因為老闆要求「just run payroll」就跳過步驟 1。** 現金檢查只要三十秒,而且是這條串接存在的理由。
- **不要在步驟 3 裡重算預測。** 現金數字只有一組,只有一個來源。
- **不要批次檢視異常。** 每個人每個問題一個決定。
- **不要把缺少薪資 connector 當成阻礙。** 發薪清單是設計好的路徑。在斷定沒有薪資來源之前,先查有沒有 QuickBooks Payroll;用 QuickBooks 的企業常常有它,但沒有 Gusto。
- **不要把還沒收到的款項當成已經到帳來承諾。** 預估就是預估;要標示出來。
- **不要在這條串接的任何輸出中重現任何人的 SSN、生日、住家地址或銀行帳號**(`../../shared/personal-data.md`)。

## 串接之後

發薪有著落,提醒已經寄出,發薪批次已排好等老闆送出。很自然的下一步是「pay the bills」,`/pay-the-bills` 會在同一份現金狀況擺在畫面上的情況下處理廠商那一端。附近還有:「cash forecast」(`cash-flow-snapshot`)在提醒轉換成收款的過程中追蹤現金狀況,以及期間結束時的「close the month」(`/close-month`)。最多提議三個,而且這個 session 裡老闆已經拒絕過的提議就跳過。

## 使用沒列出來的工具

這個 skill 裡提到的 connector 是測試過的路徑,不是一道牆。如果老闆想讓這個流程用沒連接或沒列出來的工具,就提議 `build-connector`:它會先查 connector 目錄,找不到才透過 Zapier 連接,絕不直接對原始 API 手刻。連線建立之後,這個工具就像任何其他選用的 connector 一樣加入這個 skill,並遵守同樣的核准關卡。

英文原文

---
name: plan-payroll
description: Runs the payroll-confidence chain end to end — forecasts cash across the payroll window with cash-flow-snapshot, ranks and drafts overdue-invoice reminders with invoice-chase to close any gap, then assembles timesheets, flags every anomaly, and stages the run with payroll-prep. On Gusto the run is staged for the owner to submit; on QuickBooks Payroll, or with no payroll system, the last step is a validated run sheet the owner keys in. This chain never presses the payroll button. Builds on the ledger (MYOB, NetSuite, QuickBooks, Xero, or Zoho Books), with Gmail or M365, PayPal, Square, Stripe, and either Gusto or QuickBooks Payroll adding detail, and falls back to CSV and timesheet uploads. Use it whenever payroll is the worry, including "can I make payroll," "payroll is due Friday," "plan payroll," "will I have enough to pay the crew," or "I need to run payroll but money is tight." Accepts optional horizon and payroll-date arguments.
allowed-tools: Read, WebFetch
---

# Plan Payroll

Three skills in order: know payroll is covered, close the gap if it is not, then run it.

Owners do not ask two separate questions here. "Can I make payroll" and "run payroll" are one worry, and splitting them across two sessions is how a run gets keyed in at 11pm without anyone checking the bank balance first.

Parse arguments:

- `--horizon` (default `30`) — forecast window in days: 30, 60, or 90
- `--payroll-date` (optional) — the date payroll runs; defaults to the next scheduled pay date

## Step 1 — Is payroll covered? (cash-flow-snapshot)

Invoke `cash-flow-snapshot`. It owns the forecast math, the confidence bands, and the CSV fallback — do not rebuild any of it here.

- **Goes in:** the horizon and the payroll date.
- **Comes out:** a 30/60/90-day forecast, named risk flags, a chat summary, and an XLSX.

Say the verdict in one line before anything else: covered, tight, or short by a named dollar amount on a named date.

**Gate — where the chain goes next.** If payroll is comfortably covered, ask whether to skip the collection step and go straight to the run. If there is a gap, present it and wait for an explicit "see what we can collect" before Step 2.

## Step 2 — Close the gap (invoice-chase)

Invoke `invoice-chase`. It owns the ranking, the tone matching, and the send path per invoice type.

- **Goes in:** the gap amount and the date it lands, from Step 1.
- **Comes out:** ranked overdue invoices with a drafted reminder each, PayPal-issued invoices queued as PayPal sends and the rest as mail drafts.

Tie the ranking back to Step 1: show what gets collected inside the horizon and whether that actually closes the payroll gap. A reminder that pays in 45 days does nothing for a Friday run — say so.

**Gate — nothing sends without approval.** Drafts only until the owner says send, per reminder or as a batch they name.

## Step 3 — Stage the run (payroll-prep)

Invoke `payroll-prep`. It owns the period setup, the hour totals, the anomaly checks, and the books sync.

- **Goes in:** the pay period, the roster, and the cash verdict from Step 1.
- **Comes out:** a run sheet person by person, every anomaly flagged against the person it belongs to, totals, and the cash needed on the pay date.

Carry Step 1 forward instead of recomputing it. When `payroll-prep` reports whether the run clears, it uses the forecast this chain already produced, plus anything Step 2 is expected to collect.

**Gate — the flags, one at a time.** `payroll-prep` walks each anomaly separately. Do not collapse them into a single "looks good?" — each one is a person's pay.

**Gate — the run itself.** With Gusto connected, the run is staged in Gusto (`payroll-prep` writes the approved inputs with `update_payroll`; `run_payroll` is never called). With QuickBooks Payroll connected, the connector holds the reads and no run-staging write, so the outcome is the validated run sheet the owner keys in — what the connector holds today, not a lesser path. Staging holds only when the source actually returned a roster and a schedule: payroll-prep stops the staging path when a connected source reports employees but delivers none, and the chain then ends on the run sheet, stated plainly. **The owner submits it.** With neither, the deliverable is a validated run sheet for manual entry, and that is a complete outcome, not a degraded one. This includes when Gusto reports blockers — the run sheet inherits the blocker list from `payroll-prep`.

## Step 4 — Close the loop

One recap, in this order: the cash verdict, what was sent and to whom, the projected position if the reminders convert, and the staged run — headcount, total hours, total gross, cash leaving the account, pay date, and any flags left open.

Ray Okonkwo sees it in four lines: cash short USD 4,200 on the 15th, three reminders sent covering USD 6,800, two likely inside the window, run staged for 9 people at USD 18,340 with one missing punch still open on Marcus.

## Output

**Deliver the Step 4 recap per the owner's stored output preference — never default to a markdown file.** Check the `## Business context` block's `Output preference` (shared style guide rule, `../../shared/artifact-style.md`):

- **Visual artifact (the default):** render the recap as an HTML page in the house style — the cash verdict as the lead stat tile, the reminders sent and their projected collections in tabular-nums, and the staged run's totals with a pill on any flag left open. Projected cash is labeled projected.
- **docx / md / notion / canva preference:** deliver the same content in that form — a DOCX or markdown file, a Notion page created via the connector (named destination, never overwriting), or a Canva Doc created via the Canva connector (a new design each run, named with the date; tables become lists); fall back to the visual artifact if Notion or Canva is not connected — and say that is why.
- **Best for skill:** use the visual artifact — this output is one screen that answers "can I make payroll".

## Connector failures

If no ledger is reachable (MYOB, NetSuite, QuickBooks, Xero, or Zoho Books — whichever the owner uses), stop and say so by category — the forecast is the foundation of the chain. If a payment connector or the mail connector (Gmail or M365) fails, name it and continue with the rest. If the payroll system fails, fall to the run sheet path rather than aborting; the owner still gets a payroll they can run. When the run cannot be staged or synced into the books — blockers, missing write access — say so in the Step 4 recap and deliver the run sheet plus the journal-entry summary for the bookkeeper to key in; `payroll-prep`'s blocker check decides which path applies.

## What not to do

- **Do not submit payroll.** The chain stages; the owner submits. This holds even when the owner asks it to go ahead.
- **Do not send a reminder without approval.** Drafts until told otherwise.
- **Do not skip Step 1 because the owner asked to "just run payroll."** The cash check is thirty seconds and it is the reason this chain exists.
- **Do not recompute the forecast inside Step 3.** One set of cash numbers, from one place.
- **Do not batch the anomaly review.** One decision per person per issue.
- **Do not treat a missing payroll connector as a blocker.** The run sheet is a designed path. Check for QuickBooks Payroll before concluding there is no payroll source; a business on QuickBooks often has it without having Gusto.
- **Do not promise collected cash as if it landed.** Projected is projected; label it.
- **Do not reproduce anyone's SSN, date of birth, home address, or bank number** anywhere in the chain's outputs (`../../shared/personal-data.md`).

## After the chain

Payroll is covered, the reminders are out, and the run is staged for the owner to submit. The natural next step is "pay the bills" — `/pay-the-bills` handles the vendor side with the same cash picture on screen. Also nearby: "cash forecast" (`cash-flow-snapshot`) to watch the position as the reminders convert, and "close the month" (`/close-month`) when the period wraps. Offer at most three, and skip any offer the owner already declined this session.

## Using a tool that isn't listed

The connectors named in this skill are the tested paths, not a wall. If the owner wants this flow to use a tool that isn't connected or listed, offer `build-connector` — it checks the connector directory first and connects through Zapier otherwise, never hand-building against a raw API. Once the connection exists, the tool joins this skill like any other optional connector, under the same approval gates.