Cash Flow Forecast Skill
When to Use
- - Client asks for a 13-week (or rolling n-week) cash flow forecast
- Need to project runway for a high-burn client (GlowLabs-type)
- Monthly or quarterly cash flow advisory deliverable
- Any time cash position monitoring or scenario modeling is needed
- SOP for the client marks "Cash Flow Forecast: ✅"
NOT for
- - Historical cash flow analysis (use P&L Deep Analysis pipeline)
- Bank reconciliation (use bank-reconciliation.py)
- Full audit of cash flows (use QBO CF report directly)
- Balance sheet projections / full financial models
Script Location
INLINECODE0
Quick Start
CODEBLOCK0
All CLI Options
| Flag | Default | Description |
|---|
| INLINECODE1 | required | QBO company slug |
| INLINECODE2 |
13 | Forecast horizon (weeks) |
|
--months | 3 | Months of CF history to pull (1–6) |
|
--low-cash-threshold | 25000 | Warn when balance < X |
|
--critical-threshold | 10000 | Critical alert when balance < X |
|
--account | auto | Specific bank account name filter |
|
--out | ~/Desktop | Output directory |
|
--sandbox | false | Use QBO sandbox |
Output Excel Tabs
Tab 1: Cash Flow Summary
- - Current cash position (all bank/cash accounts from Balance Sheet)
- 13-week KPI summary: total inflows, outflows, net flow, end balance
- Burn rate and runway in callout box
- Full weekly trajectory table with alert coloring
- SOP notes printed at top (client-specific warnings)
Tab 2: Weekly Detail
- - Matrix: each row = a CF subcategory, each column = a week
- Inflows section (green) → Outflows section (red)
- Subtotals, Net Flow row, Running Balance row
- Alert coloring: yellow = warn, orange/red = critical
Tab 3: Scenarios
- - Side-by-side: Base | Optimistic | Pessimistic
- 12 KPI rows: inflows, outflows, net, end balance, burn, runway, alert weeks
- Weekly balance comparison table across all 3 scenarios
- Best/Worst delta and % spread columns
Tab 4: Burn Rate
- - Detailed burn metrics (base case)
- Runway comparison table (all 3 scenarios)
- Week-by-week burn trend
- 🔴 High burn emphasis for GlowLabs-type clients
Tab 5: Assumptions
- - All parameters used (thresholds, adjustments, seasonality weights)
- Monthly averages per category (the baseline used)
- Client SOP config summary
- Methodology notes
Tab 6: CDC Log
- - Run-over-run changes: starting cash, burn rate, runway
- Forecast accuracy: compares prior-run predicted starting cash vs. actual
- First run: saves baseline; second+ run shows deltas
Scenario Definitions
| Scenario | Collections | Expenses |
|---|
| Base | Historical avg | Historical avg |
| Optimistic |
+10% | Unchanged |
| Pessimistic | -15% | +5% |
Cash Flow Categories
Automatically classified from QBO CF rows:
Operating — Inflows
- -
collections: Revenue, AR, Net Income, payment processor receipts - INLINECODE10 : Interest income
Operating — Outflows
- -
payroll: Wages, salaries, officer comp, Deel (GlowLabs) - INLINECODE12 : Rent, lease, occupancy
- INLINECODE13 : AP, COGS, professional fees, software, subscriptions
- INLINECODE14 : Interest expense (SB Paulson: material line)
- INLINECODE15 , INLINECODE16
Investing
- -
capex: Equipment, property, asset purchases
Financing
- -
debt: Loans, line of credit, notes payable - INLINECODE19 : Owner distributions/contributions
- INLINECODE20 : SAFE notes (GlowLabs)
Client SOP Integration
The script reads
clients/{slug}/sop.md automatically and adjusts:
| SOP Signal | Effect |
|---|
| "burn rate", "runway", "high cash burn" | Burn Rate tab emphasized, 🔴 alert |
| "interest expense" |
Interest tracked separately |
| "POS collection", "collected at POS" | No AR lag — flat weekly inflow distribution |
| "accounts receivable" | AR-based: note 30-45 day receipt lag |
| "SAFE" | SAFE financing category added |
| "crypto", "wallet", "ETH" | Crypto wallet note added |
| "Deel" | Deel inbound classified as expense reduction |
Seasonality Weights
Default week-of-month distribution (configurable in script CONFIG section):
| Week | Inflows | Outflows | Rationale |
|---|
| Week 1 (days 1–7) | 30% | 35% | Collections/payroll land early |
| Week 2 (days 8–14) |
20% | 20% | Mid-month quiet |
| Week 3 (days 15–21) | 20% | 25% | Mid-month payroll + rent |
| Week 4 (days 22–28) | 30% | 20% | End-month collections |
| Week 5 (overflow) | 0% | 0% | Rarely used |
POS clients (e.g. SB Paulson): inflows flattened to equal weekly distribution.
CDC Accuracy Loop
- 1. First run: saves
starting_cash, first_week_balance, avg_monthly_burn, INLINECODE25 - Second run: compares new
starting_cash against prior INLINECODE27 - Accuracy % = how close the forecast was to reality
- Burn rate and runway deltas tracked run-over-run
- Cache stored in INLINECODE28
Low-Cash Alert Colors
| Color | Excel Fill | Condition |
|---|
| ✅ OK | White | Balance ≥ low threshold |
| ⚠ Warn |
Yellow | Balance < $25K (configurable) |
| 🔴 Critical | Orange/Red | Balance < $10K (configurable) |
Client-Specific Notes
GlowLabs (High Burn)
- -
--low-cash-threshold 50000 --critical-threshold 25000 recommended - SOP auto-detected: burn rate tab emphasized with red header
- SAFE financing and Deel categories auto-classified
- Runway is the #1 KPI — shown prominently in Summary tab
SB Paulson / Willo Salons
- -
--months 6 for better seasonality (salon business is seasonal) - POS collection = no AR lag; inflows distributed flat across weeks
- Interest expense tracked as separate operating outflow category
- Cash Flow Forecast frequency: quarterly advisory (per SOP)
Dependencies
pip install openpyxl
Node.js QBO client must be authenticated with a valid token.
Output Naming
CashFlowForecast_{slug}_{YYYY-MM-DD}.xlsx
Default output: INLINECODE32
Related Pipelines
- -
pl-quick-compare.py — P&L variance analysis - INLINECODE34 — Controller-level with GL drill-down
- INLINECODE35 — Bank statement reconciliation
技能名称: 现金流预测
使用场景
- - 客户要求提供13周(或滚动n周)现金流预测
- 需要为高消耗客户(如GlowLabs类型)预测资金跑道
- 月度或季度现金流咨询交付物
- 任何需要现金头寸监控或情景建模的情况
- 客户的SOP中标注现金流预测:✅
不适用场景
- - 历史现金流分析(请使用损益表深度分析流程)
- 银行对账(请使用bank-reconciliation.py)
- 现金流全面审计(请直接使用QBO CF报告)
- 资产负债表预测/完整财务模型
脚本位置
scripts/pipelines/cash-flow-forecast.py
快速启动
bash
cd /Users/samshouse/.openclaw/workspace
标准13周预测
python3 scripts/pipelines/cash-flow-forecast.py --slug glowlabs
6个月历史数据以获得更好的季节性
python3 scripts/pipelines/cash-flow-forecast.py --slug sb-paulson --months 6
自定义低现金阈值(GlowLabs:高消耗)
python3 scripts/pipelines/cash-flow-forecast.py --slug glowlabs \
--low-cash-threshold 50000 \
--critical-threshold 25000 \
--out ~/Desktop/reports
沙箱测试
python3 scripts/pipelines/cash-flow-forecast.py --slug glowlabs --sandbox
所有CLI选项
| 标志 | 默认值 | 描述 |
|---|
| --slug | 必填 | QBO公司标识 |
| --weeks |
13 | 预测周期(周) |
| --months | 3 | 拉取的现金流历史月数(1–6) |
| --low-cash-threshold | 25000 | 余额低于此值时发出警告 |
| --critical-threshold | 10000 | 余额低于此值时发出严重警报 |
| --account | 自动 | 特定银行账户名称筛选 |
| --out | ~/Desktop | 输出目录 |
| --sandbox | false | 使用QBO沙箱 |
输出Excel标签页
标签页1:现金流摘要
- - 当前现金头寸(资产负债表中的所有银行/现金账户)
- 13周KPI摘要:总流入、总流出、净流量、期末余额
- 消耗率和资金跑道(标注框内)
- 完整的每周趋势表(带警报颜色标记)
- 顶部打印的SOP备注(客户特定警告)
标签页2:每周明细
- - 矩阵:每行=一个现金流子类别,每列=一周
- 流入部分(绿色)→ 流出部分(红色)
- 小计、净流量行、滚动余额行
- 警报颜色:黄色=警告,橙色/红色=严重
标签页3:情景分析
- - 并列展示:基准 | 乐观 | 悲观
- 12个KPI行:流入、流出、净额、期末余额、消耗、跑道、警报周数
- 所有3种情景的每周余额对比表
- 最佳/最差差异和百分比差异列
标签页4:消耗率
- - 详细消耗指标(基准情况)
- 资金跑道对比表(所有3种情景)
- 逐周消耗趋势
- 🔴 针对GlowLabs类型客户的高消耗强调
标签页5:假设条件
- - 使用的所有参数(阈值、调整、季节性权重)
- 每个类别的月平均值(使用的基准)
- 客户SOP配置摘要
- 方法论说明
标签页6:CDC日志
- - 逐次运行变化:期初现金、消耗率、资金跑道
- 预测准确性:比较上次预测的期初现金与实际值
- 首次运行:保存基准;第二次及以上运行:显示差异
情景定义
+10% | 不变 |
| 悲观 | -15% | +5% |
现金流类别
从QBO CF行自动分类:
经营活动 — 流入
- - 收款:收入、应收账款、净利润、支付处理商收款
- 利息:利息收入
经营活动 — 流出
- - 工资:工资、薪金、高管薪酬、Deel(GlowLabs)
- 租金:租金、租赁、占用费
- 供应商:应付账款、销售成本、专业服务费、软件、订阅
- 利息:利息支出(SB Paulson:重要项目)
- 税费、保险
投资活动
融资活动
- - 债务:贷款、信用额度、应付票据
- 权益:所有者分配/出资
- SAFE:SAFE票据(GlowLabs)
客户SOP集成
脚本自动读取clients/{slug}/sop.md并进行调整:
| SOP信号 | 效果 |
|---|
| 消耗率、资金跑道、高现金消耗 | 消耗率标签页强调,🔴 警报 |
| 利息支出 |
利息单独跟踪 |
| POS收款、在POS收款 | 无应收账款滞后——每周流入均匀分布 |
| 应收账款 | 基于应收账款:注意30-45天收款滞后 |
| SAFE | 添加SAFE融资类别 |
| 加密货币、钱包、ETH | 添加加密货币钱包备注 |
| Deel | Deel入账归类为费用减少 |
季节性权重
默认的月内周分布(可在脚本CONFIG部分配置):
| 周次 | 流入 | 流出 | 理由 |
|---|
| 第1周(第1-7天) | 30% | 35% | 收款/工资在月初发生 |
| 第2周(第8-14天) |
20% | 20% | 月中平静期 |
| 第3周(第15-21天) | 20% | 25% | 月中工资+租金 |
| 第4周(第22-28天) | 30% | 20% | 月末收款 |
| 第5周(溢出) | 0% | 0% | 很少使用 |
POS客户(如SB Paulson):流入调整为每周均匀分布。
CDC准确性循环
- 1. 首次运行:保存期初现金、第一周余额、月均消耗、资金跑道月数
- 第二次运行:将新的期初现金与之前的第一周余额进行比较
- 准确性% = 预测与实际的接近程度
- 消耗率和资金跑道差异逐次跟踪
- 缓存存储在.cache/cash-flow-forecast/{slug}.json
低现金警报颜色
| 颜色 | Excel填充 | 条件 |
|---|
| ✅ 正常 | 白色 | 余额 ≥ 低阈值 |
| ⚠ 警告 |
黄色 | 余额 < $25K(可配置) |
| 🔴 严重 | 橙色/红色 | 余额 < $10K(可配置) |
客户特定说明
GlowLabs(高消耗)
- - 推荐使用--low-cash-threshold 50000 --critical-threshold 25000
- SOP自动检测:消耗率标签页强调,红色标题
- SAFE融资和Deel类别自动分类
- 资金跑道是#1关键指标——在摘要标签页中突出显示
SB Paulson / Willo Salons
- - 使用--months 6以获得更好的季节性(沙龙业务具有季节性)
- POS收款=无应收账款滞后;流入在周间均匀分布
- 利息支出作为单独的经营活动流出类别跟踪
- 现金流预测频率:季度咨询(按SOP)
依赖项
pip install openpyxl
Node.js QBO客户端必须使用有效令牌进行身份验证。
输出命名
CashFlowForecast
{slug}{YYYY-MM-DD}.xlsx
默认输出:~/Desktop/
相关流程
- - pl-quick-compare.py — 损益表差异分析
- pl-deep-analysis.py — 控制级别,含总账钻取
- bank-reconciliation.py — 银行对账单核对