SCF Deep Analysis — SKILL.md
What This Skill Does
Runs a controller-level Statement of Cash Flows deep analysis for a QBO-connected client. Extends the SCF Quick Compare with:
- - CF Quality Ratio: Operating CF ÷ Net Income (>1.0 = cash-backed quality earnings)
- Free Cash Flow: Operating CF − CapEx (pulled from investing section)
- Working Capital Movement: AR, AP, Inventory, Prepaid — which WC components drove operating CF changes
- 3-Month Rolling Averages: Per-account and per-section CF trend baseline
- GL Drill-Down: Vendor-level transaction detail for every flagged CF account
- Controller Findings: Plain-English narratives with urgency — "Operating CF decreased 15% because AR increased $8K (collections lagging) while AP decreased $4K (paying faster)"
- Action Proposals: Specific, actionable recommendations (HIGH / MEDIUM / LOW urgency)
- CDC: Tracks what changed in CF since last run
Output: Excel workbook with 7 tabs:
INLINECODE0
When To Use
- - Monthly close: controller-level CF review beyond the Quick Compare
- Client with CF concerns (declining operating CF, negative FCF, low CF quality)
- Board prep: need to explain why cash changed this period
- Internal review: identify AR collection problems, AP timing, capex overruns
When NOT To Use
- - Quick period-over-period CF snapshot → use
scf-quick-compare.py instead - P&L variance analysis → use INLINECODE2
- Budget vs. actual → use
budget-vs-actual skill - Non-QBO clients (no integration) → use
bank-reconciliation skill
Prerequisites
- - QBO client connected for the slug
- QBO auth token configured
- INLINECODE5 installed: INLINECODE6
- Node.js available on PATH
Script Location
CODEBLOCK0
Usage
CODEBLOCK1
Arguments
| Argument | Required | Description |
|---|
| INLINECODE7 | ✅ | Company slug (must match qbo-client connection) |
| INLINECODE8 |
✅* | Current period start YYYY-MM-DD |
|
--current-end | ✅* | Current period end YYYY-MM-DD |
|
--prior-start | ❌ | Prior period start — auto-calculated if omitted |
|
--prior-end | ❌ | Prior period end — auto-calculated if omitted |
|
--ytd | ❌ | YTD mode: Jan 1 → end of last completed month |
|
--year | ❌ | Year for --ytd (default: current year) |
|
--skip-gl | ❌ | Skip GL drill-down (faster run) |
|
--out | ❌ | Output directory (default: ~/Desktop) |
|
--sandbox | ❌ | Use QBO sandbox environment |
*Required unless --ytd is used.
Pipeline Steps (8 Steps)
- 1. Pull CF — current + prior period CF from QBO via INLINECODE18
- Pull P&L — current + prior period P&L for Net Income extraction (CF quality ratio)
- Rolling Averages — pull 3 prior months of CF; compute per-account and per-section averages
- CDC — compare current flat map vs. INLINECODE19
- CF Quality + FCF — compute ratio + extract CapEx from investing section
- Working Capital Movement — classify AR / AP / Inventory / Prepaid from operating section
- Variance + Flags + GL — flag material variances (≥10% or ≥$2,500); pull GL for flagged accounts
- Controller Findings — generate narrative findings with urgency and action proposals
Output: Excel Workbook (7 Tabs)
Tab 1: Summary
- - Section totals: Operating / Investing / Financing / Net Change / Beginning / Ending Cash
- vs. prior period + 3-month rolling average
- CF Quality Ratio block (with color coding)
- Free Cash Flow calculation
- Controller Findings summary (top 8 findings, HIGH in red)
Tab 2: Detail
- - Every CF line item with prior period, current period, $ variance, % variance, rolling avg
- Section-grouped with color bands (Operating = blue, Investing = yellow, Financing = purple)
- F/U column (Favorable = more cash, Unfavorable = less cash)
Tab 3: ⚠ Flags
- - Material variances only: ≥10% change OR ≥$2,500 absolute delta
- Includes rolling avg comparison
- Sorted by absolute dollar variance
Tab 4: GL Drill-Down
- - Vendor-level transaction detail for every flagged account
- Top 3 vendor contributors shown in sub-header per account
- Max 50 transactions per account
- Skipped if
--skip-gl flag used
Tab 5: Working Capital Movement
- - AR, AP, Inventory, Prepaid, Other WC — current vs. prior vs. delta
- Cash Impact column (Source / Use)
- Plain-English analysis note per component (e.g., "AR increased $8K — collections lagging sales")
- Total WC impact row
Tab 6: Controller Findings
- - Full narrative findings sorted HIGH → MEDIUM → LOW
- Detail / GL attribution per finding
- Specific recommended action per finding
- $ Impact column
Tab 7: CDC Log
- - All accounts/line items that changed vs. last cached run
- Prior value, current value, $ delta, % change, note (New / Changed / Removed)
- Color coded: green = cash increased, red = cash decreased
Cache
CODEBLOCK2
Stored after each run. Contains:
- -
flat_map — all CF line items and amounts - INLINECODE22 — section totals (operating, investing, financing, netchange, endingcash)
- INLINECODE23 — CF quality label
- INLINECODE24 — Free Cash Flow amount
- INLINECODE25 — Net Income for the period
- INLINECODE26 — ISO date of last run
Key Metrics Explained
CF Quality Ratio
Operating CF / Net Income
| Ratio | Quality | Color |
|---|
| ≥ 1.0x | ✅ Quality Earnings — cash-backed | Green |
| 0.5–1.0x |
⚠ Adequate — partially cash-backed | Yellow |
| < 0.5x | ⚠ Low Quality — accrual-heavy | Orange |
| < 0 | 🔴 Cash Drain — cash negative despite reported profit | Red |
Free Cash Flow
FCF = Operating CF + CapEx (CapEx is negative outflow, so this subtracts it)
CapEx detected by keyword matching in investing section (equipment, property, asset, capital expenditure, etc.)
Working Capital Movement (in Operating section)
- - AR change (negative = AR grew = cash used; positive = AR shrank = cash released)
- AP change (positive = AP grew = cash deferred; negative = AP shrank = cash paid out)
- Inventory change (negative = inventory built = cash used; positive = inventory drawn = cash released)
- Prepaid change (negative = more prepaid = cash used; positive = prepaid expensed = cash released)
Materiality Thresholds
- - Percent threshold: ≥10% change in any CF line item
- Absolute threshold: ≥$2,500 absolute variance
- Both thresholds checked — either triggers a flag
Safety Rules
- - Read-only: No writes to QBO — only pulls reports
- All Decimal math: No floating-point for financial calculations
- Disclaimer footer: Controller Findings tab includes audit disclaimer
- Cache separation: Uses
.cache/scf-deep-analysis/ — separate from scf-quick-compare cache
Related Pipelines
| Pipeline | Use When |
|---|
| INLINECODE28 | Quick CF period-over-period snapshot (4 tabs, no GL) |
| INLINECODE29 |
Controller-level CF with GL drill-down, CF quality, FCF, WC movement |
|
pl-deep-analysis.py | Same depth for P&L (not CF) |
|
budget-builder.py | Build annual CF budget / BvA |
SCF 深度分析 — SKILL.md
该技能的功能
对已连接QBO的客户执行控制层级的现金流量表深度分析。在SCF快速对比基础上扩展以下功能:
- - 现金流质量比率:经营活动现金流 ÷ 净利润(>1.0 = 现金支撑的优质收益)
- 自由现金流:经营活动现金流 − 资本支出(从投资活动部分提取)
- 营运资本变动:应收账款、应付账款、存货、预付款项——哪些营运资本项目驱动了经营活动现金流变化
- 3个月滚动平均值:每个账户和每个部分的现金流趋势基线
- 总账明细查询:每个被标记的现金流账户的供应商级交易明细
- 控制层发现:带紧急程度的通俗叙述——经营活动现金流下降15%,原因是应收账款增加8,000美元(回款滞后),而应付账款减少4,000美元(付款加快)
- 行动建议:具体、可操作的建议(高/中/低紧急程度)
- 变化检测:追踪自上次运行以来现金流的变化
输出:包含7个工作表的Excel工作簿:
汇总 | 明细 | ⚠ 标记 | 总账明细查询 | 营运资本变动 | 控制层发现 | 变化检测日志
使用时机
- - 月度结账:超出快速对比范围的控制层级现金流审查
- 客户存在现金流问题(经营活动现金流下降、自由现金流为负、现金流质量低)
- 董事会准备:需要解释本期间现金变化的原因
- 内部审查:识别应收账款回款问题、应付账款时机、资本支出超支
不使用时机
- - 快速期间对比现金流快照 → 改用 scf-quick-compare.py
- 损益差异分析 → 改用 pl-deep-analysis.py
- 预算与实际对比 → 改用 budget-vs-actual 技能
- 非QBO客户(无集成) → 改用 bank-reconciliation 技能
前提条件
- - 已为slug连接QBO客户
- 已配置QBO认证令牌
- 已安装 openpyxl:pip install openpyxl
- PATH中可用Node.js
脚本位置
scripts/pipelines/scf-deep-analysis.py
使用方法
bash
基础:当月 vs 上月(自动计算)
python3 scripts/pipelines/scf-deep-analysis.py \
--slug my-client \
--current-start 2026-03-01 --current-end 2026-03-31
明确指定前期
python3 scripts/pipelines/scf-deep-analysis.py \
--slug my-client \
--current-start 2026-02-01 --current-end 2026-02-28 \
--prior-start 2026-01-01 --prior-end 2026-01-31
年初至今 vs 上年同期
python3 scripts/pipelines/scf-deep-analysis.py \
--slug my-client --ytd --year 2026
跳过总账明细查询(更快——当总账不可用或不需要时使用)
python3 scripts/pipelines/scf-deep-analysis.py \
--slug my-client \
--current-start 2026-03-01 --current-end 2026-03-31 --skip-gl
自定义输出目录
python3 scripts/pipelines/scf-deep-analysis.py \
--slug glowlabs \
--current-start 2026-03-01 --current-end 2026-03-31 \
--out ~/Desktop/reports
沙盒模式(QBO沙盒环境)
python3 scripts/pipelines/scf-deep-analysis.py \
--slug glowlabs \
--current-start 2026-03-01 --current-end 2026-03-31 --sandbox
参数
| 参数 | 必填 | 说明 |
|---|
| --slug | ✅ | 公司slug(必须与qbo-client连接匹配) |
| --current-start |
✅* | 当前期间开始日期 YYYY-MM-DD |
| --current-end | ✅* | 当前期间结束日期 YYYY-MM-DD |
| --prior-start | ❌ | 前期开始日期——省略时自动计算 |
| --prior-end | ❌ | 前期结束日期——省略时自动计算 |
| --ytd | ❌ | 年初至今模式:1月1日 → 上个月最后一天 |
| --year | ❌ | --ytd的年份(默认:当前年份) |
| --skip-gl | ❌ | 跳过总账明细查询(运行更快) |
| --out | ❌ | 输出目录(默认:~/Desktop) |
| --sandbox | ❌ | 使用QBO沙盒环境 |
*除非使用 --ytd,否则为必填。
流水线步骤(8步)
- 1. 提取现金流 — 通过 report {slug} cf 从QBO提取当前和前期现金流
- 提取损益表 — 提取当前和前期损益表以获取净利润(现金流质量比率)
- 滚动平均值 — 提取前3个月的现金流;计算每个账户和每个部分的平均值
- 变化检测 — 比较当前平面映射与 .cache/scf-deep-analysis/{slug}.json
- 现金流质量 + 自由现金流 — 计算比率 + 从投资活动部分提取资本支出
- 营运资本变动 — 从经营活动部分分类应收账款/应付账款/存货/预付款项
- 差异 + 标记 + 总账 — 标记重大差异(≥10%或≥2,500美元);为标记账户提取总账
- 控制层发现 — 生成带紧急程度和行动建议的叙述性发现
输出:Excel工作簿(7个工作表)
工作表1:汇总
- - 各部分合计:经营活动/投资活动/筹资活动/净变动/期初/期末现金
- 与前期及3个月滚动平均值对比
- 现金流质量比率区块(带颜色编码)
- 自由现金流计算
- 控制层发现摘要(前8项发现,高紧急程度标红)
工作表2:明细
- - 每个现金流行项目,含前期、当期、金额差异、百分比差异、滚动平均值
- 按部分分组并带颜色条(经营活动=蓝色,投资活动=黄色,筹资活动=紫色)
- 有利/不利列(有利=现金增加,不利=现金减少)
工作表3:⚠ 标记
- - 仅重大差异:≥10%变化或≥2,500美元绝对差额
- 包含滚动平均值对比
- 按绝对金额差异排序
工作表4:总账明细查询
- - 每个被标记账户的供应商级交易明细
- 每个账户子标题显示前3大供应商贡献者
- 每个账户最多50笔交易
- 使用 --skip-gl 标志时跳过
工作表5:营运资本变动
- - 应收账款、应付账款、存货、预付款项、其他营运资本——当前 vs 前期 vs 差额
- 现金影响列(来源/使用)
- 每个组成部分的通俗分析说明(例如:应收账款增加8,000美元——回款滞后于销售)
- 营运资本总影响行
工作表6:控制层发现
- - 完整叙述性发现,按高→中→低排序
- 每个发现的明细/总账归因
- 每个发现的具体建议行动
- 金额影响列
工作表7:变化检测日志
- - 与上次缓存运行相比发生变化的所有账户/行项目
- 前期值、当前值、金额差额、百分比变化、备注(新增/变更/移除)
- 颜色编码:绿色=现金增加,红色=现金减少
缓存
.cache/scf-deep-analysis/{slug}.json
每次运行后存储。包含:
- - flatmap — 所有现金流行项目和金额
- totals — 各部分合计(经营活动、投资活动、筹资活动、净变动、期末现金)
- cfquality — 现金流质量标签
- fcf — 自由现金流金额
- netincome — 期间净利润
- savedat — 上次运行的ISO日期
关键指标说明
现金流质量比率
经营活动现金流 / 净利润
| 比率 | 质量 | 颜色 |
|---|
| ≥ 1.0倍 | ✅ 优质收益——现金支撑 | 绿色 |
| 0.5–1.0倍 |
⚠ 尚可——部分现金支撑 | 黄色 |
| < 0.5倍 | ⚠ 低质量——应计项目占比高 | 橙色 |
| < 0 | 🔴 现金流失——尽管报告盈利但现金为负 | 红色 |
自由现金流
自由现金流 = 经营活动现金流 + 资本支出(资本支出为负流出,因此此为减法)
通过在投资活动部分进行关键词匹配检测