技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
cash-flow-snapshot【数据与研究】Create a 30/60/90-day cash-flow forecast from AR, AP, opening cash, payment timing, and fixed-cost data. Use when asked about runway, payroll coverage, liquidity risks, or a near-term cash crunch.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Produces a 30/60/90-day cash flow forecast with percentage-variance confidence bands and named risk flags. Delivers a two-part output: a concise chat summary and a downloadable XLSX workbook.
When inputs are supplied through report URLs, read the SandBase API map. Resolve the listed capability with sandbase_discover, inspect its returned name with sandbase_inspect, then follow execute_as to call sandbase_run(name: "<returned name>", arguments: { ... }) using only the current schema. For async results, poll sandbase_run_get with the returned run_id within the task budget; report pending or failed runs without automatically resubmitting them.
Quick start
"Will I make payroll next month?"
The agent pulls AR/AP and fixed costs from authorized connected sources or supplied files, calculates expected inflows and outflows across 30, 60, and 90-day windows, applies confidence bands based on each customer's historical payment variance, and flags specific risks by name.
Check which authorized sources are available. Prefer them in this order when present:
If no connector is live and no file is attached, ask the user to either connect a source or upload a CSV (income/expense tabular data, any reasonable format). Note which sources were used in the output — this affects confidence band width.
From QuickBooks:
From PayPal / Stripe / Square:
From CSV upload:
For each AR customer (or income source from CSV), calculate:
If fewer than 3 payments exist for a customer, use the population mean as the point estimate and apply a ±30% variance band as the default. When running on CSV data with sufficient history (≥3 payments per source), compute the band from the actual payment variance — do not assume ±30%.
Produce three time windows: 0–30 days, 31–60 days, 61–90 days.
For each window, compute:
| Line | Method |
|---|---|
| Expected inflows | AR due in window, adjusted for mean payment lag |
| Expected outflows | AP due in window + fixed costs falling in window |
| Net cash flow | Inflows − Outflows |
| Confidence band | ± weighted average payment variance as a % of expected inflows |
Confidence band formula:
band_pct = weighted_avg_stddev_days / avg_payment_lag_days
band_amount = expected_inflows × band_pct
low_net_flow = net_cash_flow − band_amount
high_net_flow = net_cash_flow + band_amount
Display band_pct as a percentage rounded to one decimal place. Cap at ±50% — higher variance means the data is too thin to model; flag it instead (see Step 5).
When opening cash is available, calculate liquidity separately:
expected_ending_cash = opening_cash + cumulative_expected_net_flow
low_ending_cash = opening_cash + cumulative_low_net_flow
high_ending_cash = opening_cash + cumulative_high_net_flow
Without opening cash, report net cash flow only and state that ending liquidity and payroll coverage cannot be determined.
Scan for timing gaps and, when opening cash is available, conditions that push low-case ending cash negative or create a liquidity crunch. For each risk found, produce a one-line flag:
Limit to the top 5 risks by severity (largest dollar impact first).
Chat summary (always):
Cash Flow Snapshot — [date range]
Source(s): [connectors used]
Expected Low High
30-day net: $X,XXX $X,XXX $X,XXX
60-day net: $X,XXX $X,XXX $X,XXX
90-day net: $X,XXX $X,XXX $X,XXX
⚠ Risks flagged: [count]
• [risk 1]
• [risk 2]
...
XLSX workbook (when requested and supported): Use the host's spreadsheet capability when the user requests a workbook and that capability is available. Otherwise provide the same tables as Markdown or CSV. A workbook has three sheets:
Summary — the 30/60/90 forecast table with confidence bands. Beneath each window row, expand inline sub-rows showing the individual transactions that make up its inflows (green) and outflows (red). This makes the estimates auditable without leaving the Summary sheet.
Detail — all transactions grouped by window, sorted by date within each group. Include a running net column (cumulative inflows minus outflows within the window) and a subtotal row at the bottom of each window showing total inflows, total outflows, and net. Grey out past transactions in a separate section at the bottom for reference. Ensure all three windows have rows even if one is empty — show a "No transactions in this window" placeholder row.
Risks — the flagged risks with dollar impact and affected window.
Save as cash-flow-snapshot-[YYYY-MM-DD].xlsx.
No destructive actions — this skill is read-only. Generating a forecast from supplied files or already-authorized sources requires no additional approval.
Remind the user after delivery:
"This forecast is based on [sources listed]. It is not a substitute for accounting advice — verify with your bookkeeper before making financing decisions."
| File | Load when |
|---|---|
reference/gotchas.md | When a connector returns unexpected data or variance is extreme |
reference/examples/worked-example.md | When modeling the output format for a new data shape |