[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BYG56M9T7PAGV5KA29FBA4":3,"skill-same:01M7BYG56M9T7PAGV5KA29FBA4":43},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M7BYG56M9T7PAGV5KA29FBA4","officecli-financial-model",null,"Use this skill when the user wants to build a financial model — 3-statement model, DCF valuation, LBO, SaaS unit economics, sensitivity \u002F scenario analysis, debt schedule, or fundraising projections — in Excel. Trigger on: 'financial model', '3-statement model', 'P&L + BS + CF', 'DCF', 'WACC', 'NPV', 'terminal value', 'LBO', 'debt schedule', 'cash sweep', 'MOIC', 'IRR \u002F XIRR', 'sensitivity table', 'scenario analysis', 'ARR model', 'unit economics', 'CAC \u002F LTV', 'cap table forecast'. Output is a single formula-driven .xlsx. This skill is a scene layer on top of officecli-xlsx — it inherits every xlsx v2 rule (4-color code, visual floor, number formats, cache-drift, Known Issues, Delivery Gate minimum cycle). DO NOT invoke for a simple budget tracker, CSV dump, or operational KPI sheet — route those to officecli-xlsx base.","makeyzhang-cpu\u002Fgeekclaw","makeyzhang-cpu","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F282184316?v=4","01M7BY92NE8R5TAVDAV2CTBGHV","01M7BY92P6TYAA1XX1E7XCX7GS",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu\u002Fgeekclaw\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-app\u002Fassets\u002Fbuiltin-skills\u002Fofficecli-financial-model\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: officecli-financial-model\ndescription: \"Use this skill when the user wants to build a financial model — 3-statement model, DCF valuation, LBO, SaaS unit economics, sensitivity \u002F scenario analysis, debt schedule, or fundraising projections — in Excel. Trigger on: 'financial model', '3-statement model', 'P&L + BS + CF', 'DCF', 'WACC', 'NPV', 'terminal value', 'LBO', 'debt schedule', 'cash sweep', 'MOIC', 'IRR \u002F XIRR', 'sensitivity table', 'scenario analysis', 'ARR model', 'unit economics', 'CAC \u002F LTV', 'cap table forecast'. Output is a single formula-driven .xlsx. This skill is a scene layer on top of officecli-xlsx — it inherits every xlsx v2 rule (4-color code, visual floor, number formats, cache-drift, Known Issues, Delivery Gate minimum cycle). DO NOT invoke for a simple budget tracker, CSV dump, or operational KPI sheet — route those to officecli-xlsx base.\"\n---\n\n# OfficeCLI Financial-Model Skill\n\n**This skill is a scene layer on top of `officecli-xlsx`.** Every xlsx hard rule — shell quoting, incremental execution, Help-First Rule, visual delivery floor, CFO 4-color code (blue input \u002F black formula \u002F green cross-sheet \u002F yellow-fill assumption), number-format standards (years as text, zero as `-`, `%` one decimal, negatives in parens), assumption-cell discipline, CSV batch import, chart data-feed forms (a\u002Fb\u002Fc), the 5-gate Delivery cycle, cache-drift guidance, Known Issues (the cross-sheet `!` trap, batch + resident for formulas, renderer caveats) — is **inherited, not re-taught**. This file adds only what a **financial model** requires on top: three-zone architecture, 3 model-type recipes (3-statement \u002F DCF \u002F LBO), sensitivity + scenario protocols, financial-function patterns, circular-reference discipline, and model-specific Delivery Gates 4–6.\n\nWhen the xlsx base rules cover it, the text here says `→ see xlsx v2 §X`. Read `skills\u002Fofficecli-xlsx\u002FSKILL.md` first if you have not.\n\n## Setup\n\nIf `officecli` is missing:\n\n- **macOS \u002F Linux**: `curl -fsSL https:\u002F\u002Fd.officecli.ai\u002Finstall.sh | bash`\n- **Windows (PowerShell)**: `irm https:\u002F\u002Fd.officecli.ai\u002Finstall.ps1 | iex`\n\nVerify with `officecli --version` (open a new terminal if PATH hasn't picked up). If install fails, download a binary from https:\u002F\u002Fgithub.com\u002FiOfficeAI\u002FOfficeCLI\u002Freleases.\n\n## Help-First Rule\n\nThis skill teaches what a financial model requires, not every CLI flag. When a prop name \u002F alias \u002F enum is uncertain, consult help BEFORE guessing: `officecli help xlsx [element] [--json]`. Help is pinned to installed version — when this skill and help disagree, **help wins**. Every `--prop X=` below was verified against `officecli help xlsx \u003Celement>` on v1.0.63.\n\n## Mental Model & Inheritance\n\n**Inherits xlsx v2.** Read `skills\u002Fofficecli-xlsx\u002FSKILL.md` first. This skill assumes you know `create` \u002F `open` \u002F `close`, `set` values\u002Fformulas, `batch` heredocs for cross-sheet formulas, `\u002FSheetName\u002FA1` paths, named ranges, the 5-gate Delivery cycle, the cross-sheet `!` trap, and that **cross-sheet formulas go non-resident (single batch OR individual `set`), never batch-while-resident**.\n\n## Shell & Execution Discipline\n\nShell quoting, incremental execution, `$FILE` convention → see xlsx v2 §Shell & Execution Discipline. Same rules: quote every `[N]` path, single-quote any prop containing `$` (every number format here — `$#,##0;($#,##0);\"-\"` — needs single quotes), no hand-written `\\$`\u002F`\\t`\u002F`\\n`, one command at a time. Examples below use `$FILE` (`FILE=\"model.xlsx\"`).\n\n## Core Principles (identity)\n\nA financial model is an xlsx with a **decision-grade, formula-driven layer**: every output traces an unbroken chain to blue-font assumptions, every statement balances every period, every valuation is re-auditable. Eight deltas on top of a general xlsx:\n\n1. **Three-zone architecture mandatory:** Inputs → Calc → Outputs. Collapsing zones → unauditable.\n2. **Assumptions live in cells, never inside formulas.** `=B5*(1+Assumptions!GrowthRate)`, never `=B5*1.05`.\n3. **Statements balance every period.** `Assets − Liab − Equity = 0`, `CF.EndingCash = BS.Cash`. Gate 4 fails on `IMBALANCED`.\n4. **Hardcodes audited.** Calc sheets carry zero hardcoded numbers; Gate 6 counts.\n5. **Sensitivity \u002F scenario is first-class.** 2-axis grid, dropdown `INDEX\u002FMATCH` switch, or Base\u002FUpside\u002FDownside cols. Excel Data Tables not reliably supported — manual grids only.\n6. **Cached values on valuation cells load-bearing.** NPV \u002F IRR \u002F XNPV caching `0` ships a wrong number to non-recalculating readers. Gate 5 spot-checks.\n7. **Circularity is a design choice.** Legitimate rings (interest ↔ cash, revolver plug ↔ ending cash) use `calc.iterate=true`. Accidental circularity is broken algebra — never papered with `iterate`.\n8. **Named ranges for ≥ 3-use assumptions.** `WACC`, `TaxRate`, `TerminalGrowth`, `ExitMultiple`, `ChurnRate`. Declared-unused names are dead decoration — Gate 6 flags.\n\n### Reverse handoff — when to go BACK to xlsx base\n\nStay in **xlsx base** for: budget trackers, CSV-to-report dumps, operational KPI sheets, simple templates, cap tables without forecast logic. Use **this skill** only when the ask mentions: 3-statement \u002F DCF \u002F WACC \u002F NPV \u002F TV \u002F LBO \u002F debt schedule \u002F MOIC \u002F IRR \u002F unit economics \u002F ARR roll-forward \u002F sensitivity grid \u002F scenario switch \u002F pro forma.\n\n## Three-zone architecture (hard rule)\n\nEvery model in this skill builds on three zones. **Name them, tab-color them, and enforce them with executable audits.** Breaking the zone rule is the single most common cause of an unauditable model.\n\n| Zone | Sheet names (convention) | Tab color | Content | Hardcodes | Formulas |\n|---|---|---|---|---|---|\n| **Inputs** | `Assumptions`, `Inputs`, `Drivers` | Yellow `FFC000` | Raw drivers: growth rates, margins, tax, WACC, FTE, pricing, working-capital days | Blue `0000FF` on every cell | Allowed only for derived assumptions (e.g. `=MonthlyARPU*12`) |\n| **Calc** | `P&L`, `Balance Sheet`, `Cash Flow`, `DCF`, `Debt`, `ARR` | Blue `4472C4` | All derivations and statements | **Zero** (enforced by Gate 6) | Black `000000` for same-sheet, green `008000` for cross-sheet |\n| **Outputs** | `Summary`, `Dashboard`, `Sensitivity`, `Returns` | Green `70AD47` | KPIs, sensitivity grids, charts, returns waterfall | Only for labels (non-numeric); Gate 6 counts numeric hardcodes → 0 | Black \u002F green per above |\n\n**Build order is cross-zone-aware.** Assumptions first, then Calc bottom-up on the dependency chain (`IS → BS → CF` for 3-statement; `FCF → WACC → NPV` for DCF), then Outputs last. Building Outputs first caches `0` everywhere and downstream inherits zeros.\n\n**Executable zone audit** (run before Gate 4):\n\n```bash\n# Calc zone: zero numeric hardcodes allowed. NOTE: `:not(:has(formula))` pseudo doesn't filter on v1.0.63+ — filter via jq on .format.formula == null.\nHARDCODE=$(officecli query \"$FILE\" 'cell[type=Number]' --json | jq '[.data.results[] | select(.format.formula == null) | select(.path | test(\"\u002F(P&L|Balance Sheet|Cash Flow|DCF|Debt|ARR)\u002F\"))] | length')\n[ \"$HARDCODE\" -eq 0 ] && echo \"Zone audit OK\" || { echo \"REJECT: $HARDCODE hardcoded numeric cells on Calc sheets — move to Assumptions\"; exit 1; }\n# Assumptions zone: should be non-zero.\nINPUTS=$(officecli query \"$FILE\" '\u002FAssumptions\u002Fcell[type=Number]' --json | jq '[.data.results[] | select(.format.formula == null)] | length')\n[ \"$INPUTS\" -ge 5 ] && echo \"Assumptions has $INPUTS hardcoded drivers\" || echo \"WARN: Assumptions has only $INPUTS inputs\"\n```\n\n## Print delivery (board \u002F IC \u002F LP)\n\nWhen the ask contains \"print\" \u002F \"一页\" \u002F \"董事会\" \u002F \"投资人\" \u002F \"IC memo\" \u002F \"LP update\", the print pipeline must emit **only** the Outputs zone. Two artefacts:\n\n```bash\n# 1. Print_Area scoped to the Outputs sheet (Summary or Dashboard).\nofficecli add \"$FILE\" \u002F --type namedrange --prop name=_xlnm.Print_Area --prop scope=Summary --prop 'refersTo=Summary!$A$1:$H$40'\n# 2. Hide every non-Outputs sheet — Print_Area scope alone does NOT stop the print pipeline from emitting every visible sheet.\nfor S in Assumptions 'P&L' 'Balance Sheet' 'Cash Flow' DCF WACC Debt FCF 'S&U' Exit Returns; do\n  officecli raw-set \"$FILE\" \u002Fworkbook --xpath \"\u002F\u002Fx:sheet[@name='$S']\" --action setattr --xml \"state=hidden\" || true\ndone\n# 3. fit-to-page landscape on Outputs sheet.\nofficecli raw-set \"$FILE\" \u002FSummary --xpath \"\u002F\u002Fx:worksheet\" --action prepend --xml '\u003CsheetPr xmlns=\"http:\u002F\u002Fschemas.openxmlformats.org\u002Fspreadsheetml\u002F2006\u002Fmain\">\u003CpageSetUpPr fitToPage=\"1\"\u002F>\u003C\u002FsheetPr>'\n```\n\nDelete any `Print_Area` set on Calc sheets — conflicting scopes emit multi-page output with Assumptions \u002F statement sheets leaking.\n\n## Build-order & cache-drift rule (critical for 3-statement)\n\nThree facts cause silent wrong numbers: (1) new formulas ship without cached values — Excel recomputes on open, HTML preview \u002F older viewers do not; (2) downstream written in the same sequence as upstream caches `0` from upstream's pre-cache state; (3) cross-sheet `batch` while resident is open deadlocks at 3–5 ops.\n\n**Discipline (every recipe):**\n- Build order follows the data chain: `P&L → BS → CF` (3-statement); `FCF → WACC → NPV → Sensitivity` (DCF); `S&U → Debt → P&L → CF → Returns` (LBO).\n- After the cross-sheet chain, **cache-refresh pass:** re-issue `set` on every summary \u002F valuation \u002F balance-check cell, non-resident.\n- Spot-check: `officecli get \"$FILE\" \u002FSummary\u002FB2 --json | jq .format.cachedValue` returns non-zero non-null. `null` ≠ `0`: `null` means Excel will compute on open (OK for delivery); `0` is a cached lie. If `0` persists: close residents, re-set; still `0` → cache-fallback (§Financial function patterns).\n\n## Recipes — three model types\n\nEach recipe below is **runnable skeleton, not finance theory**. Substitute numbers; don't restructure. All recipes assume `FILE=\"model.xlsx\"` is set and you have run `officecli create \"$FILE\"` + `officecli open \"$FILE\"`. Close with `officecli close \"$FILE\"` at the end.\n\n### Recipe A — 3-statement model (P&L + BS + CF)\n\n**What this recipe produces.** 4 sheets: `Assumptions`, `P&L`, `Balance Sheet`, `Cash Flow`, plus `Summary`. Year columns 2024A · 2025E · 2026E · 2027E. Balance-check row on BS; cash-reconciliation row on CF. Every statement row = formula → Assumptions.\n\n**Build order (MANDATORY).** `Assumptions → P&L → Balance Sheet → Cash Flow → Summary`. Do NOT build BS before P&L — `RetainedEarnings` depends on `NI`. Do NOT build CF before BS — `CF.OpeningCash = prior period CF.EndingCash` self-chain requires BS cash anchored for Y1. The skill's Gate 4 balance check fails silently if order is wrong.\n\n**Step 1 — sheets + tab colors + freeze panes.**\n\n```bash\nofficecli add \"$FILE\" \u002F --type sheet --prop name=Assumptions --prop tabColor=FFC000\nofficecli add \"$FILE\" \u002F --type sheet --prop name=P&L --prop tabColor=4472C4\nofficecli add \"$FILE\" \u002F --type sheet --prop name='Balance Sheet' --prop tabColor=4472C4\nofficecli add \"$FILE\" \u002F --type sheet --prop name='Cash Flow' --prop tabColor=4472C4\nofficecli add \"$FILE\" \u002F --type sheet --prop name=Summary --prop tabColor=70AD47\nofficecli set \"$FILE\" \u002FAssumptions --prop freeze=B2\nofficecli set \"$FILE\" \u002FP&L --prop freeze=B3\nofficecli set \"$FILE\" \"\u002FBalance Sheet\" --prop freeze=B3\nofficecli set \"$FILE\" \"\u002FCash Flow\" --prop freeze=B3\n```\n\n**Step 2 — assumptions (blue, yellow-fill on key drivers).** Year headers row 2, labels down col A, blue numeric inputs on B:E. Drivers: `RevenueGrowth`, `GrossMargin`, `OpExRatio`, `TaxRate`, `DaysReceivable\u002FInventory\u002FPayable`, `CapExRatio`, `DepreciationYears`. `font.color=0000FF` on B:E. Yellow-fill (`fill=FFFF00`) the 3–5 scenario-switched drivers.\n\n**Declare named ranges for ≥3-use drivers and reference them** (`StartingARR`, `TaxRate`, `OpeningCash`, `GrowthRate`, `GrossMargin`). Formulas: `=StartingARR` not `=Assumptions!B4`; `=EBT*TaxRate` not `=EBT*Assumptions!B8`. Declared-unused names = dead decoration, Gate 6 rejects.\n\n**Step 3 — P&L rows (all formulas).** Rows: `Revenue` \u002F `COGS` \u002F `Gross Profit` \u002F `OpEx` \u002F `EBITDA` \u002F `D&A` \u002F `EBIT` \u002F `Interest` \u002F `EBT` \u002F `Tax` \u002F `Net Income`. Every row = formula referencing `Assumptions` or prior-row cells. Example revenue-side block — **substitute your row numbers**. Row-map for this example: `B3=Revenue, B4=COGS, B5=Gross Profit, B7=OpEx, B9=EBITDA, B10=EBIT, B15=Net Income`. Submit as single non-resident batch:\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FB3\",\"props\":{\"formula\":\"Assumptions!B5\",\"font.color\":\"008000\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FC3\",\"props\":{\"formula\":\"B3*(1+Assumptions!C6)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FD3\",\"props\":{\"formula\":\"C3*(1+Assumptions!D6)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FE3\",\"props\":{\"formula\":\"D3*(1+Assumptions!E6)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FB4\",\"props\":{\"formula\":\"-B3*(1-Assumptions!B7)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FB5\",\"props\":{\"formula\":\"B3+B4\"}}\n]\nEOF\n```\n\nAssumptions refs (`B5`, `C6`, `B7`) are also placeholder rows — better: **define named ranges** for each driver (Step 2) so formulas read `=StartingRevenue*(1+RevenueGrowth_Y2)` regardless of row layout. Repeat for `OpEx` \u002F `D&A` \u002F `Interest` \u002F `Tax` \u002F `NI`. `font.color=008000` on every cross-sheet-reference cell; same-sheet cells default `000000`. `numFmt='$#,##0;($#,##0);\"-\"'` on all $ rows.\n\n**Step 4 — Balance Sheet rows (all formulas).** Assets = `Cash + AR + Inventory + Net PP&E`. Liab = `AP + Debt`. Equity = `OpeningEquity + RetainedEarnings`. Working-capital rows use Days assumptions: `AR = Revenue × DaysReceivable \u002F 365`. `Net PP&E` rolls forward: `Beg + CapEx − Depreciation`. **`BS.Cash` is NOT an independent plug** — it MUST equal `'Cash Flow'!B\u003Cending-cash-row>` (populated in Step 5).\n\n**Retained Earnings — live formula every period.** `BS.RE(t) = BS.RE(t-1) + 'P&L'!NI(t) − Dividends(t)`. Hardcoded RE rounds to whole dollar → BS shows ±$1 off every period (CFO reads \"model doesn't balance\"). For Y1 Historical RE (no prior NI), compute via BS identity as a **live formula**: `BS!RE_Y1 = TotalAssets − TotalLiabilities − PaidInCapital`. Blue-font + classic comment on the Y1 cell; Y2..Y5 stay NI-driven.\n\n**Step 5 — Cash Flow rows (all formulas).** Operating: `NI + D&A − ΔWorkingCapital`. Investing: `−CapEx`. Financing: `ΔDebt − Dividends`. Ending Cash = `Opening + Operating + Investing + Financing`. **Year 2+ Opening Cash = prior period Ending Cash** — self-chain on the same sheet: `C17 = B19`, `D17 = C19`, `E17 = D19`. The Y1 `OpeningCash` is an Assumptions input.\n\n**Step 6 — Balance check + cash reconciliation rows (hard delivery checks).** Row-map for this example: `Balance Sheet: B10=Total Assets, B15=Total Liab, B17=Total Equity, B18=Balance Check`; `Cash Flow: B5=BS.Cash (cross-sheet anchor), B19=CF.Ending Cash, B21=CF-BS Cash Recon`. Substitute your layout's rows — the logic is the check, not the cell addresses.\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FBalance Sheet\u002FB18\",\"props\":{\"formula\":\"IF(ABS(B10-B15-B17)\u003C0.01,\\\"OK\\\",\\\"IMBALANCED: \\\"&ROUND(B10-B15-B17,0))\",\"bold\":\"true\",\"font.color\":\"000000\"}},\n  {\"command\":\"set\",\"path\":\"\u002FCash Flow\u002FB21\",\"props\":{\"formula\":\"IF(ABS(B19-'Balance Sheet'!B5)\u003C0.01,\\\"OK\\\",\\\"CF != BS CASH: \\\"&ROUND(B19-'Balance Sheet'!B5,0))\",\"bold\":\"true\"}}\n]\nEOF\n```\n\nReplicate across columns C\u002FD\u002FE. Apply red fill (`fill=FFC7CE`) conditionally via `type=containsText --prop text=IMBALANCED` or `text=\"CF !=\"`. Gate 4 queries these rows and refuses delivery on any `IMBALANCED`.\n\n**Step 7 — cache refresh + format pass.** Re-set every summary cell on `Summary`, every balance-check \u002F recon cell, and every cross-sheet reference on BS \u002F CF (non-resident, single batch per sheet). Apply column widths (`col[A]=28`, `col[B:E]=15`), `numberformat='$#,##0;($#,##0);\"-\"'` on all dollar rows, header fills (`fill=1F3864`, `font.color=FFFFFF`, `bold=true`) on section-header rows (REVENUE \u002F COGS \u002F ASSETS \u002F LIABILITIES). Header fill must cover A:E, not just the label cell (→ xlsx v2 §visual floor).\n\n**Step 8 — Summary \u002F Dashboard KPIs + charts.** Minimum 4 KPIs: `Revenue 27E`, `EBITDA Margin 27E`, `Ending Cash 27E`, `Net Income CAGR` — each a formula referencing a statement cell, green font.\n\n**Minimum 3 charts on any Dashboard delivered to a board \u002F executive audience** — one chart is a draft, three is a deliverable. Pre-populate `Summary!A10:E13` with Gross Margin \u002F EBITDA Margin \u002F NI Margin ratio rows (formulas referencing `P&L`) before adding the margin chart.\n\n```bash\n# (1) Top-line trend (Revenue + EBITDA).\nofficecli add \"$FILE\" \u002FSummary --type chart --prop chartType=column --prop dataRange='P&L!A2:E5' --prop title='Revenue & EBITDA' --prop width=14cm --prop height=8cm\n# (2) Margin trend (Gross \u002F EBITDA \u002F NI margin).\nofficecli add \"$FILE\" \u002FSummary --type chart --prop chartType=line --prop dataRange='Summary!A10:E13' --prop title='Margin trend' --prop width=14cm --prop height=8cm\n# (3) Cash trajectory (Ending Cash ± Runway).\nofficecli add \"$FILE\" \u002FSummary --type chart --prop chartType=area --prop dataRange='Cash Flow!A19:E19' --prop title='Ending cash' --prop width=14cm --prop height=8cm\n```\n\n**Verification (run all three):**\n\n```bash\n# Balance check every period must say OK\nofficecli get \"$FILE\" \"\u002FBalance Sheet\u002FB18:E18\" --json | jq '.data[].cachedValue \u002F\u002F .data[].value'\n# Cash recon every period must say OK\nofficecli get \"$FILE\" \"\u002FCash Flow\u002FB21:E21\" --json | jq '.data[].cachedValue \u002F\u002F .data[].value'\n# Summary KPIs are plausible numbers, not 0 or null\nofficecli get \"$FILE\" \"\u002FSummary\u002FB2:B5\" --json | jq '.data[].cachedValue'\n```\n\n### Recipe B — DCF valuation\n\n**What this recipe produces.** Sheets: `Assumptions`, `FCF` (10-year forecast), `WACC` (panel), `DCF` (NPV + TV + equity bridge), `Sensitivity` (2-axis grid). Output: `Implied Equity Value` + `Implied Per-Share`, with a `WACC × g` sensitivity.\n\n**Build order.** `Assumptions → FCF → WACC → DCF → Sensitivity`.\n\n**Step 1 — named ranges for key drivers.** DCF's readability depends on names. Every formula below uses `WACC`, `TaxRate`, `g` — not `$B$6`:\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"WACC\",\"ref\":\"WACC!$B$12\"}},\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"TaxRate\",\"ref\":\"Assumptions!$B$8\"}},\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"TerminalGrowth\",\"ref\":\"Assumptions!$B$15\"}},\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"NetDebt\",\"ref\":\"Assumptions!$B$20\"}},\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"SharesOut\",\"ref\":\"Assumptions!$B$21\"}}\n]\nEOF\n```\n\n**Step 2 — FCF build (10 years).** Columns B:K = Y1..Y10. Rows: `Revenue` (from growth) \u002F `EBIT` (revenue × margin) \u002F `EBIT × (1 − TaxRate)` (NOPAT) \u002F `+ D&A` \u002F `− CapEx` \u002F `− ΔNWC` \u002F `= FCF`. Use Assumptions-driven ratios (`CapEx = Revenue × CapExRatio`). All cells formulas, black font, `numFmt='$#,##0;($#,##0);\"-\"'`.\n\n**Step 3 — WACC panel.** On `WACC` sheet, an 8-row panel: `Risk-free rate` \u002F `Equity risk premium` \u002F `Beta` \u002F `Cost of equity` (=Rf + β×ERP) \u002F `Pre-tax debt cost` \u002F `After-tax debt cost` (=×(1−TaxRate)) \u002F `Equity weight` \u002F `Debt weight` \u002F `WACC` (=We×Re + Wd×Rd_after_tax). Inputs blue; derived rows black.\n\n**Step 4 — Terminal value + NPV + equity bridge.** Row-map: `DCF: B\u002FC 3=TV, 4=PV explicit FCF, 5=PV terminal, 6=EV, 7=Net Debt, 8=Equity Value, 9=Per-Share`; `FCF: row 2 = periods (1..10), row 11 = FCF, B:K = Y1..Y10`. Substitute your rows. Notes column cells use `{\"value\":\"text\"}`, never `{\"formula\":\"...\"}` — formula-style prose yields `#NAME?` on open (see callout after Recipe C Step 5). On `DCF` sheet:\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB3\",\"props\":{\"value\":\"Terminal value (Gordon growth)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC3\",\"props\":{\"formula\":\"FCF!K11*(1+TerminalGrowth)\u002F(WACC-TerminalGrowth)\",\"font.color\":\"008000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB4\",\"props\":{\"value\":\"PV of explicit-period FCF (10 yr)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC4\",\"props\":{\"formula\":\"SUMPRODUCT(FCF!B11:K11\u002F(1+WACC)^FCF!B2:K2)\",\"font.color\":\"008000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB5\",\"props\":{\"value\":\"PV of terminal value\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC5\",\"props\":{\"formula\":\"C3\u002F(1+WACC)^10\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB6\",\"props\":{\"value\":\"Enterprise value\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC6\",\"props\":{\"formula\":\"C4+C5\",\"bold\":\"true\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB7\",\"props\":{\"value\":\"Less: Net debt\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC7\",\"props\":{\"formula\":\"-NetDebt\",\"font.color\":\"008000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB8\",\"props\":{\"value\":\"Equity value\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC8\",\"props\":{\"formula\":\"C6+C7\",\"bold\":\"true\",\"font.color\":\"000000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB9\",\"props\":{\"value\":\"Implied per-share\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC9\",\"props\":{\"formula\":\"C8\u002FSharesOut\",\"bold\":\"true\",\"numberformat\":\"$0.00\"}}\n]\nEOF\n```\n\n**Why `SUMPRODUCT` not `NPV`.** `NPV(rate, cross_sheet_range)` silently caches `0` on v1.0.63 — ships a wrong valuation to any non-recalculating reader. `SUMPRODUCT(values\u002F(1+rate)^periods)` is algebraically equivalent and caches correctly (period row `FCF!B2:K2 = 1..10` is a one-time setup). For irregular dates (`XNPV`), use `SUMPRODUCT(values\u002F(1+rate)^((dates-base_date)\u002F365))`. See §Known Issues.\n\n**Step 5 — 2-axis sensitivity grid (WACC × g).** 5×5 grid. Rows = WACC values `7.5% ... 11.5%`, cols = `g` values `1.5% ... 3.5%`. Each cell = one self-contained formula re-running the DCF with the grid's WACC and g substituted. Template:\n\n```bash\n# Cell D14 (first data cell, grid anchor at C14 = WACC label, C15 = first WACC value)\n# Substitute $D$13 (this cell's g) and $C15 (this cell's WACC) into a replicated EV + equity formula.\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FSensitivity\u002FD15\",\"props\":{\"formula\":\"(NPV($C15,FCF!$B$11:$K$11)+(FCF!$K$11*(1+D$14)\u002F($C15-D$14))\u002F(1+$C15)^10+(-NetDebt))\u002FSharesOut\",\"numberformat\":\"$0.00\"}}\n]\nEOF\n```\n\nCopy the formula across D15:H19 (5×5 grid). Row 14 carries g values (blue input); column C carries WACC values (blue input). Row 13 and column B carry labels. Apply 3-color gradient CF for quick-read (green = upside, red = downside):\n\n```bash\nofficecli add \"$FILE\" \u002FSensitivity --type conditionalformatting \\\n  --prop type=colorScale --prop ref=D15:H19\n```\n\n**No Excel Data Tables.** Excel's native `\u002FData\u002FTable` 2-variable table is not reliably supported via the CLI — each grid cell MUST be an explicit formula. Copy the template, do not try `Data Table` input cells.\n\n**Verification.**\n\n```bash\nofficecli get \"$FILE\" \"\u002FDCF\u002FC8\" --json | jq .format.cachedValue   # equity value, plausible $\nofficecli get \"$FILE\" \"\u002FDCF\u002FC9\" --json | jq .format.cachedValue   # per-share, in $XX.XX range\nofficecli get \"$FILE\" \"\u002FSensitivity\u002FF17\" --json | jq .format.cachedValue   # grid center cell, plausible\n```\n\nIf `C8` or `C9` cache `0`, re-set them (non-resident) — see §Build-order & cache-drift.\n\n### Recipe C — LBO model\n\n**What this recipe produces.** Sheets: `Assumptions`, `S&U` (Sources & Uses), `Debt` (multi-tranche schedule), `P&L` (5-yr), `CF`, `Exit` \u002F `Returns`. Outputs: `MOIC`, `IRR`, and a 4-tier returns waterfall. LBO is the stress test — expect circular refs (interest ↔ cash), deepest cross-sheet chains, and the heaviest use of named ranges.\n\n**Build order.** `Assumptions → S&U → P&L → Debt → CF → Exit → Returns`. P&L before Debt (debt interest depends on P&L EBIT for coverage checks); Debt before CF (CF uses interest + principal amortization). Enable `calc.iterate` before Step 5.\n\n**Step 1 — Sources & Uses (balance required, every fee line itemized).**\n\n```\nUses    = Purchase_EV (EntryEBITDA × EntryMultiple) + Transaction_fees (Purchase_EV × TxnFeePct, typ 1.5–2.5%)\n        + Financing_fees ((Senior + Mezz) × FinFeePct, typ 1–3%) + Refinanced_debt\nSources = Senior_TLB + Mezz + Revolver_drawn + Sponsor_equity\n```\n\n**Sponsor equity — pick one, never both.** (a) **Stated:** `Sponsor_equity = Assumptions!SponsorEquity`, then scale senior\u002Fmezz so Sources = Uses (fees absorbed by debt, not a silent plug). (b) **Solved:** `Sponsor_equity = Uses − Senior − Mezz − Revolver − Refinanced`, label \"Sponsor Equity (solved)\", no standalone Assumptions ref. Hardcoded `SponsorEquity` PLUS a `=Uses − Senior − Mezz` plug guarantees silent fee absorption — stated $140M vs plug $194.67M = $54.67M unaccounted fees, CFO rejection on sight.\n\n```bash\n# Sources = Uses hard check.\nofficecli set \"$FILE\" \u002FS&U\u002FB12 --prop formula='IF(ABS(SUM(B4:B7)-SUM(B9:B11))\u003C1,\"BALANCED\",\"S&U IMBALANCE: \"&ROUND(SUM(B4:B7)-SUM(B9:B11),0))' --prop bold=true\n\n# Stated-vs-plug consistency (Gate 4 addendum; only run if you chose pattern (a)).\nSTATED=$(officecli get \"$FILE\" \u002FAssumptions\u002FB12 --json | jq -r '.format.cachedValue \u002F\u002F \"null\"')\nPLUGGED=$(officecli get \"$FILE\" \u002FS&U\u002FB10 --json | jq -r '.format.cachedValue \u002F\u002F \"null\"')   # B10 = sponsor-equity row on S&U\nDELTA=$(python3 -c \"print(abs(float('$STATED') - float('$PLUGGED')))\" 2>\u002Fdev\u002Fnull || echo 99999)\npython3 -c \"import sys; sys.exit(0 if float('$DELTA') \u003C= 1 else 1)\" && echo \"S&U sponsor OK (stated=$STATED plug=$PLUGGED)\" || { echo \"REJECT Gate 4 S&U: stated $STATED ≠ plug $PLUGGED (Δ=$DELTA) — fees silently absorbed\"; exit 1; }\n```\n\nEvery non-sponsor line on `S&U` is a blue Assumptions input (target EBITDA, entry multiple, fee %s) or a derived formula. No hardcoded Uses \u002F Sources numbers.\n\n**Step 2 — Debt schedule (multi-tranche).** One row per tranche per year. Columns: `BeginningBalance` \u002F `Mandatory amortization` \u002F `Cash sweep` \u002F `EndingBalance` \u002F `AverageBalance` \u002F `InterestExpense`. Senior TLB: 1% mandatory amortization + all excess cash to sweep. Mezz: 0% amortization, interest-only cash-pay. Row-map for this example (senior TLB tranche, year 2 column C): `C4=Beginning Balance, C5=Mandatory Amort, C6=Ending Balance, C7=Cash Sweep, C8=Average Balance, C9=Interest Expense`. `CF!C20` = free cash available to sweep (year-2 ending cash pre-sweep on CF sheet). Substitute your tranche row block per layout.\n\n```bash\n# year 2 senior TLB\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC4\",\"props\":{\"formula\":\"B6\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC5\",\"props\":{\"formula\":\"-C4*Assumptions!$B$30\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC6\",\"props\":{\"formula\":\"C4+C5+C7\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC7\",\"props\":{\"formula\":\"-MIN(-CF!C20,C4+C5)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC8\",\"props\":{\"formula\":\"(C4+C6)\u002F2\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC9\",\"props\":{\"formula\":\"-C8*Assumptions!$B$31\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}}\n]\nEOF\n# Add the sweep-rule comment as a classic comment (comment is NOT a cell prop — separate --type comment).\nofficecli add \"$FILE\" \u002FDebt --type comment --prop ref=C7 --prop text='cash sweep capped at available cash and remaining tranche balance'\n```\n\n**Revolver capacity cap.** If your deal uses a revolver tranche, the revolver balance each period is bounded by the commitment ceiling:\n```\nRevolver_Balance = MIN(Assumptions!RevolverCapacity, MAX(0, prior_revolver + draw − paydown))\n```\nWithout the `MIN(capacity, ...)` outer, a shortfall quarter silently over-draws the facility.\n\nAdjust row indices to your layout. Repeat for each tranche (senior \u002F mezz \u002F revolver) and each year.\n\n**Step 3 — P&L (5-year) + interest from Debt.** P&L interest row pulls from Debt: `Interest = 'Debt'!TotalInterestRowY\u003CN>`. This creates the **circular reference**: Interest → NI → CF → Cash Sweep → Debt balance → Interest.\n\n**Write-order warning.** `calc.iterate=true` governs _recalculation_, not write-phase. Appending the closing leg of a cross-sheet ring to a file that already contains the ring deadlocks the engine at 100% CPU regardless of `iterate`. For complex rings (multi-tranche LBO, revolver + TLB + mezz), use §Write-order surgery below (de-ring → write downstream → re-ring). Enable `calc.iterate=true` BEFORE writing ring formulas:\n\n```bash\nofficecli set \"$FILE\" \u002F --prop calc.iterate=true --prop calc.iterateCount=100 --prop calc.iterateDelta=0.001\n```\n\n`iterate` converges via successive approximation for naturally-dampening loops (higher interest → less cash → less sweep → higher balance, bounded by EBIT). `#REF!` or divergent values = pause; fix algebra, do not raise `iterateCount` to 1000.\n\n**Step 4 — CF + cash sweep.** Ending cash = Opening + CFO − CapEx − Mandatory amort − Cash sweep. Cash sweep = `MIN(freeCashAfterCapEx, seniorDebtBalance + seniorMandatoryAmort)`. The `MIN` cap prevents swept-below-zero.\n\n**Step 5 — Exit + Returns.** Row-map: `Exit: B3=Exit EV, B4=Less: remaining debt, B5=Exit equity to sponsor`; `Returns: B3=MOIC, B4=IRR`.\n\n```bash\n# Values\u002Fformulas — single non-resident batch.\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FExit\u002FB3\",\"props\":{\"formula\":\"'P&L'!F8*Assumptions!$B$25\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FExit\u002FB4\",\"props\":{\"formula\":\"-('Debt'!F6+'Debt'!F13)\",\"font.color\":\"008000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FExit\u002FB5\",\"props\":{\"formula\":\"B3+B4\",\"bold\":\"true\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FReturns\u002FB3\",\"props\":{\"formula\":\"'Exit'!B5\u002F('S&U'!B9)\",\"numberformat\":\"0.00\\\"x\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FReturns\u002FB4\",\"props\":{\"formula\":\"IRR({-'S&U'!B9,0,0,0,0,'Exit'!B5})\",\"numberformat\":\"0.0%\"}}\n]\nEOF\n# Classic comments — one --type comment per anchor cell.\nofficecli add \"$FILE\" \u002FExit --type comment --prop ref=B3 --prop text='Exit EV = Y5 EBITDA × exit multiple'\nofficecli add \"$FILE\" \u002FReturns --type comment --prop ref=B3 --prop text='MOIC = exit equity \u002F sponsor equity'\nofficecli add \"$FILE\" \u002FReturns --type comment --prop ref=B4 --prop text='IRR — 5-yr, entry + exit only; use XIRR for mid-year dividends'\n```\n\n**Callout — labels: `comment` element vs Notes column vs `formula` (three distinct mechanics).**\n- **Hover tooltip** → `officecli add ... --type comment --prop ref=\u003Ccell> --prop text='...'`. The **`comment` key is NOT a valid prop on `set cell`** (not in `officecli help xlsx cell` on v1.0.63) — it silently drops when embedded inside a `set cell` props dict. Use the dedicated element.\n- **Visible text in an adjacent Notes column** → `{\"command\":\"set\",\"path\":\"\u002FDCF\u002FD3\",\"props\":{\"value\":\"TV = FCF × (1+g) \u002F (WACC−g)\"}}` — **`value`, not `formula`**, plain quoted string.\n- **Formula-style prose written as a real formula** → NEVER. `{\"formula\":\"FCF10*(1+g)\u002F(WACC-g)\"}` produces `#NAME?` in Excel (`FCF10`, `g`, `WACC` are unbound identifiers in that cell context).\n\nFor mid-year dividends or partial exits, use `XIRR({cashflows}, {dates})` instead of `IRR`.\n\n**Step 6 — Returns waterfall (optional, 4-tier LP\u002FGP).** Tiers: (1) LP preferred return 8% ; (2) GP catch-up to 20% ; (3) 80\u002F20 split above hurdle ; (4) 100% to LP on loss. Each tier is a `MAX(0, MIN(...))` clamp. See §Sensitivity & scenarios for the general grid pattern.\n\n**Verification.**\n\n```bash\nofficecli get \"$FILE\" \u002FS&U\u002FB12 --json | jq '.data.value \u002F\u002F .data.cachedValue'   # must say BALANCED\nofficecli get \"$FILE\" \u002FReturns\u002FB3 --json | jq .format.cachedValue                # MOIC, expect 2.0x-4.0x typical\nofficecli get \"$FILE\" \u002FReturns\u002FB4 --json | jq .format.cachedValue                # IRR, expect 0.15-0.30 typical\n# Iterate converged?\nofficecli query \"$FILE\" 'cell:contains(\"#REF!\")' --json | jq '.data.results | length'   # must be 0\n```\n\n## Sensitivity & scenarios\n\n**Three patterns, pick one:**\n- **(a) Base \u002F Upside \u002F Downside columns** on Assumptions — side-by-side scenarios, dropdown-less switch via an \"Active\" column + `INDEX\u002FMATCH`.\n- **(b) Dropdown + `INDEX\u002FMATCH` switch** — one validation dropdown on Summary drives every driver via `INDEX(Base:Downside, MATCH(Dropdown, ScenLabels, 0))`.\n- **(c) 2-axis sensitivity grid** — 5×5 or 7×7, one self-contained formula per cell, row\u002Fcol headers are the two drivers. See Recipe B Step 5 for WACC × g.\n\nMixing (a)+(b) creates circular input (scenario picked by dropdown AND overwritten by Active column) — pick one.\n\n**Grid rule:** each cell substitutes row-driver and col-driver into a self-contained copy of the output formula. Cannot reference the `WACC` named range (that's the panel) — reference the grid's axis cell.\n\n**Dropdown scenario switch.** One `validation` dropdown on Summary drives every `Assumptions` row:\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"add\",\"parent\":\"\u002FSummary\",\"type\":\"validation\",\"props\":{\"sqref\":\"B1\",\"type\":\"list\",\"formula1\":\"Base,Upside,Downside\"}},\n  {\"command\":\"set\",\"path\":\"\u002FAssumptions\u002FB5\",\"props\":{\"formula\":\"INDEX(C5:E5,MATCH(Summary!$B$1,$C$4:$E$4,0))\"}}\n]\nEOF\n# If you want a hover tooltip on B5, add it separately:\nofficecli add \"$FILE\" \u002FAssumptions --type comment --prop ref=B5 --prop text='Revenue growth — picked by Summary!B1 scenario dropdown'\n```\n\nEvery `Assumptions` driver row gets the same `INDEX\u002FMATCH`. Base \u002F Upside \u002F Downside columns on C:E stay blue (hardcoded scenario inputs).\n\n**Football-field chart pattern (DCF valuation summary).** Horizontal Low→High bars for 3–5 valuation methods (DCF base, DCF bear, Trading comps, Precedent txns, LBO floor) stacked vertically. On a `Football` sheet: col A = method label, col B = Low $, col C = High $, col D = `=C−B` (width). Chart as a stacked bar with column B as an invisible first series (white\u002Fno-fill) and column D as the visible series — `dataRange=Football!A3:D7`, `chartType=bar`. Excel reads this as a floating bar per method.\n\n## Financial function patterns\n\nTerse reference — not a finance textbook. If you don't know what these do, pause and ask the user.\n\n| Function | Prefer over | Why |\n|---|---|---|\n| `XNPV(rate, values, dates)` | `NPV` | Irregular cash flow dates (M&A close mid-year, staggered tranches) |\n| `XIRR(values, dates)` | `IRR` | Irregular dates; multiple sign changes handled better |\n| `INDEX(range, MATCH(lookup, key, 0))` | `VLOOKUP` | Insert-safe (VLOOKUP breaks when a column is inserted in the source range) |\n| `IFERROR(x\u002Fy, 0)` or `IF(y=0, 0, x\u002Fy)` | bare division | Guard every `\u002F` in a financial model — `#DIV\u002F0!` shipped = delivery failure |\n| `MIRR(values, financeRate, reinvestRate)` | `IRR` with sign flips | When cash-flow pattern has 2+ sign changes |\n| `SUMIFS(sumRange, criteriaRange1, criterion1, ...)` | `SUMPRODUCT((...))` array | Avoids the cached-value trap on array formulas (→ xlsx v2 §Common Workflow Step 5 array-formula fallback) |\n\n**`SUMPRODUCT(1\u002FCOUNTIF(...))` distinct-count trap.** The CLI engine caches the inner division per-row → `1\u002FN` (e.g. `0.001543`) rather than the true distinct count. `SUMPRODUCT(--((range\u003C>\"\")\u002FCOUNTIF(range,range&\"\")))` pattern is likewise affected. **Fallback (from xlsx v2):** hardcode the correct distinct count with a blue font + adjacent comment `\"hardcoded distinct count; update if rows change\"`, and disclose at delivery. LBO deal-count or portfolio headcount from a transactions list is the typical pattern that hits this.\n\n**Cross-sheet `NPV()` \u002F `XNPV()` cache-0 fallback (preferred).** When the engine caches `0` on a cross-sheet `NPV()` \u002F `XNPV()`, replace the formula with its algebraic equivalent `SUMPRODUCT(values\u002F(1+rate)^periods)` — same result, caches correctly, audits cleanly. This is the first-line fix, used in Recipe B Step 4 by default. For `XNPV`, the period exponent is `(dates - base_date) \u002F 365`.\n\n**Cache fallback on `IRR` \u002F `MOIC` \u002F summary KPI cells (last resort).** If a valuation cell still ships with `cachedValue = 0` after algebraic rewrite + re-set after close, hardcode the computed value with a blue font and add a classic comment via `officecli add \"$FILE\" \u002FSheet --type comment --prop ref=\u003Ccell> --prop text='cached valuation; refreshes on open in Excel — do not edit'`. Disclose in delivery notes. Prefer re-set after close first.\n\n## Circular references & iterative calc\n\n**Enable `calc.iterate` ONLY when circularity is algebraically justified:** Interest ↔ Cash (LBO revolver \u002F cash sweep), Tax shield ↔ NI (rare — most 3-statement models compute interest before tax and avoid), Revolver plug ↔ Ending cash (corporate cash waterfall with min-cash).\n\n```bash\nofficecli set \"$FILE\" \u002F --prop calc.iterate=true --prop calc.iterateCount=100 --prop calc.iterateDelta=0.001\n```\n\n`iterateCount=100` \u002F `iterateDelta=0.001` are Excel defaults, fine for naturally dampening loops.\n\n### Write-order surgery (de-ring → write downstream → re-ring)\n\n`calc.iterate` controls recalc, not write-phase. Appending the closing leg of an already-wired cross-sheet ring (Debt.Interest ↔ CF.Cash ↔ Debt.CashSweep) deadlocks at 100% CPU; `view html` \u002F `get` also hang on a non-converged ring.\n\n**3-step playbook:**\n1. **De-ring** — write Debt with the 10–20 ring cells set to literal `0` (e.g. `C7=0`, not `=-MIN(...)`). Removes the ring.\n2. **Write downstream** — build all non-circular chains (P&L, CF, Exit, Returns, Summary, grid) non-resident, one heredoc per sheet. Everything caches against the zeroed cells.\n3. **Re-ring** — close all residents, re-set each circular cell with its real formula, one `set` per cell, non-resident.\n\n**Acceptance.** `get \u002FDebt\u002FC7 --json | jq .format.cachedValue` returns non-zero non-null. If a cell still deadlocks, leave `=0` + classic comment `\"circular; recalculates in Excel on F9\"`, flag at delivery. Never paper over with `iterateCount=1000`.\n\n**Do NOT use `iterate` as a band-aid for `#REF!` \u002F divergent values.** Raising `iterateCount` to 1000 hides the bug and ships a plausibly-wrong value; `validate` does not catch it. Break the loop algebraically (e.g. interest on opening balance only, not average).\n\n**Verify convergence.** Read the loop cell, bump a driving assumption and back, re-read — values must match:\n\n```bash\nV1=$(officecli get \"$FILE\" \u002FDebt\u002FC9 --json | jq .format.cachedValue)\nofficecli set \"$FILE\" \u002FAssumptions\u002FB31 --prop value=0.085\nofficecli set \"$FILE\" \u002FAssumptions\u002FB31 --prop value=0.0845\nV2=$(officecli get \"$FILE\" \u002FDebt\u002FC9 --json | jq .format.cachedValue)\n[ \"$V1\" = \"$V2\" ] && echo \"Iterate converged\" || echo \"WARN: drift V1=$V1 V2=$V2 — tighten iterateDelta or check algebra\"\n```\n\n## Audit & Delivery Gate\n\n**Assume there are problems.** First build is almost never correct. Run every gate below; every check must print its success line. `validate` passing is not delivery — the model can pass schema and still be wrong by a factor of 10.\n\n### Gates 1–3 — inherited from xlsx v2 verbatim\n\n→ see xlsx v2 §QA minimum cycle (Gates 1–3 cover `view issues`, error-cell query, `validate` after close). Run them first, exactly as written in xlsx v2. No financial-model-specific tweaks.\n\n### Gate 4 — statement integrity (3-statement & LBO)\n\nBalance-check and cash-reconciliation rows produced by Recipe A \u002F C must show `OK` \u002F `BALANCED` every period. `query` the check rows and refuse on any `IMBALANCED` \u002F `CF !=`:\n\n```bash\nBS_FAIL=$(officecli query \"$FILE\" 'cell:contains(\"IMBALANCED\")' --json | jq '.data.results | length')\nCF_FAIL=$(officecli query \"$FILE\" 'cell:contains(\"CF !=\")' --json | jq '.data.results | length')\nSU_FAIL=$(officecli query \"$FILE\" 'cell:contains(\"S&U IMBALANCE\")' --json | jq '.data.results | length')\nif [ \"$BS_FAIL\" -eq 0 ] && [ \"$CF_FAIL\" -eq 0 ] && [ \"$SU_FAIL\" -eq 0 ]; then\n  echo \"Gate 4 OK (balance + recon + S&U all pass)\"\nelse\n  echo \"REJECT Gate 4: BS=$BS_FAIL CF=$CF_FAIL S&U=$SU_FAIL\"; exit 1\nfi\n```\n\nIf any fail, the model is silently wrong — fix the upstream chain before delivery. Most common cause: a cross-sheet formula stored `\\!` (shell-mangled) — run `officecli query \"$FILE\" 'cell:contains(\"\\\\\\\\!\")'` and re-enter via batch heredoc.\n\n### Gate 5 — cached-value sanity on valuation cells\n\nNPV \u002F IRR \u002F XIRR \u002F equity-bridge \u002F MOIC \u002F summary KPI cells cached `0` = wrong number shipped to a reader who does not recalc on open. List every valuation cell and check `cachedValue`:\n\n```bash\n# Customize the path list per recipe — this is the DCF example\nfor P in \"\u002FDCF\u002FC4\" \"\u002FDCF\u002FC5\" \"\u002FDCF\u002FC6\" \"\u002FDCF\u002FC8\" \"\u002FDCF\u002FC9\"; do\n  V=$(officecli get \"$FILE\" \"$P\" --json | jq -r '.format.cachedValue \u002F\u002F \"null\"')\n  if [ \"$V\" = \"0\" ] || [ \"$V\" = \"null\" ]; then\n    echo \"REJECT Gate 5: $P cached $V — re-set after close (see §Build-order & cache-drift)\"; exit 1\n  fi\n  echo \"Gate 5 $P: cached=$V OK\"\ndone\n```\n\nFor LBO, extend the list: `\u002FExit\u002FB5`, `\u002FReturns\u002FB3`, `\u002FReturns\u002FB4`. For 3-statement, extend with `\u002FSummary\u002FB2:B5`.\n\n### Gate 6 — hardcode \u002F zone discipline\n\nEvery Calc sheet has zero numeric hardcodes. Executable:\n\n```bash\nHARDCODE=$(officecli query \"$FILE\" 'cell[type=Number]:not(:has(formula))' --json \\\n  | jq '[.data.results[] | select(.path | test(\"\u002F(P&L|Balance Sheet|Cash Flow|DCF|Debt|FCF|WACC|Exit|Returns)\u002F\"))] | length')\n[ \"$HARDCODE\" -eq 0 ] && echo \"Gate 6 OK (no hardcodes on Calc sheets)\" || { echo \"REJECT Gate 6: $HARDCODE hardcoded numeric cells on Calc zone — move to Assumptions\"; exit 1; }\n\n# Named-range coverage + dead-decoration audit: ≥3 ranges declared AND each referenced by ≥1 formula.\nNR=$(officecli query \"$FILE\" namedrange --json | jq '.data.results | length')\n[ \"$NR\" -ge 3 ] && echo \"Gate 6 OK ($NR named ranges)\" || echo \"WARN Gate 6: only $NR named ranges\"\nDEAD=0\nfor NR_NAME in $(officecli query \"$FILE\" namedrange --json | jq -r '.data.results[].name'); do\n  USES=$(officecli query \"$FILE\" \"cell:has(formula):contains(\\\"$NR_NAME\\\")\" --json | jq '.data.results | length')\n  [ \"$USES\" -ge 1 ] && echo \"  $NR_NAME: $USES uses OK\" || { echo \"  WARN: $NR_NAME unused\"; DEAD=$((DEAD+1)); }\ndone\n[ \"$DEAD\" -eq 0 ] && echo \"Gate 6 named-range audit OK\" || { echo \"REJECT Gate 6: $DEAD dead-decoration name(s)\"; exit 1; }\n```\n\n### Gate 5b — visual audit via HTML preview (mandatory)\n\nGates 1–4\u002F6 are grep defenses — they cannot see a rendered sheet. Run `officecli view \"$FILE\" html` and Read the returned HTML. Walk every sheet (inherits xlsx v2 visual floor):\n\n- No `###` in any numeric cell (widen column).\n- No truncated labels \u002F section headers (widen column or `alignment.wrapText=true`).\n- No placeholder tokens (`TBD`, `{var}`, `xxxx`) — Gate 6.1 grep below.\n- Balance-check \u002F recon rows say `OK` \u002F `BALANCED` every period column.\n- Dashboard charts render, y-axis = 0 on ARR\u002Frevenue lines, source data matches statement sheet.\n- Sensitivity grid colors read green (upside) → red (downside) — color-scale CF applied.\n- No stale cached `0` on summary KPIs; if present, run cache-refresh pass.\n\nREJECT on any defect. **Human preview:** `officecli watch \"$FILE\"`, or open in Excel \u002F WPS \u002F Numbers — final colors + chart fidelity only fully render in the target viewer.\n\n### Gate 6.1 — token \u002F placeholder sweep\n\n```bash\nLEAK=$(officecli view \"$FILE\" text | grep -niE 'TBD|\\(fill in\\)|xxxx|lorem|\\{\\{|placeholder|coming soon')\n[ -z \"$LEAK\" ] && echo \"Gate 6.1 OK (no placeholder tokens)\" || { echo \"REJECT Gate 6.1:\"; echo \"$LEAK\"; exit 1; }\n```\n\n### Honest limit\n\n`validate` catches schema errors, not finance errors. A model passes `validate` with `BS.Cash` hardcoded to force balance, an `NPV` cached at `0`, a sensitivity grid all-zero because it was built before FCF, a `#NAME?` runtime on a `P&L`-named sheet with unquoted refs. Gates 4 \u002F 5 \u002F 6 \u002F 5b exist because schema-level `validate` cannot catch any of this.\n\n## Known Issues & Pitfalls\n\n→ Base pitfalls (cross-sheet `!` trap, batch JSON dotted-name rule, resident + formula batch deadlock, renderer caveats, `labelRotation` \u002F `pareto` \u002F databar-min-max bugs, `validate` while resident): see xlsx v2 §Known Issues & Pitfalls — all apply.\n\nFinancial-model-specific:\n\n- **AP sign on COGS.** Accounts Payable: if COGS is stored negative on the P&L, AP formula must negate — `=-COGS*DaysPayable\u002F365`. Wrong sign inflates NWC and flips CF direction. Silent; passes `validate`.\n- **`#NAME?` not caught by `query` \u002F `validate`.** A cross-sheet formula referencing `P&L!B3` without quoting the sheet name (because `&` is special) lands at runtime as `#NAME?`. Always write cross-sheet refs as `'P&L'!B3` — single-quote the sheet name if it contains `&`, space, `(`, `)`, etc. Gate 5b visual check is the only detection.\n- **Iterative calc silent non-convergence.** `calc.iterate=true iterateCount=100` converges at whatever the cap lands on — even if the true answer is 2× that. Always run convergence verify (§Circular references). Complex LBO rings (multi-tranche debt + sweep + tax shield) may not converge; when `cachedValue=0` on a ring cell, use §Write-order surgery.\n- **Batch-while-resident deadlock on circular writes.** Writing the closing leg of a cross-sheet ring via `batch` with a resident open deadlocks at 100% CPU. Even single `set` on a ring cell can hang. Fix: close residents, write the ring in two passes per §Write-order surgery. Non-resident single-heredoc is the only safe form.\n- **Cross-sheet cached value stale in `view html`.** Downstream written in the same sequence as upstream caches `0`. Excel resolves on open; HTML preview does NOT. Re-set every downstream non-resident after the chain (§Build-order & cache-drift).\n- **`NPV()` \u002F `XNPV()` cross-sheet caches `0` on v1.0.63.** Rewrite as `SUMPRODUCT(values\u002F(1+rate)^periods)` — algebraically equivalent, caches correctly. Applied by default in Recipe B Step 4.\n- **Sensitivity-grid cache trap.** Grid built before FCF\u002FWACC → every cell caches `0`. Build FCF + WACC + DCF first, then grid in a separate non-resident batch. Fallback: hardcode blue + comment `\"hardcoded sensitivity; refresh on assumption change\"`.\n- **`BS.Cash` = CF ending cash always** (including Y1: `BS.Cash = 'Cash Flow'!B19`). Never an independent plug or Assumptions ref — a plugged `BS.Cash` hides balance errors.\n- **Year 2+ `Opening Cash` = prior period `Ending Cash`** (`C17=B19`, `D17=C19`). Independent Y2+ opening-cash inputs silently drift from BS.\n- **Waterfall chart \"total\" bars.** `chartType=waterfall` cannot mark total programmatically — use `colors=` convention (dark = total, medium = positive, red = negative). See `help xlsx chart`.\n- **DCF per-share when `SharesOut` is a formula.** `=BasicShares + OptionPool × ExerciseAssumption` → add a blue-font assumption cell and point the `SharesOut` named range at the computed cell, not the raw input.\n\n## Help pointer\n\nWhen in doubt: `officecli help xlsx [element] [--json]`. Help is the authoritative schema; this skill is the decision guide for financial-modeling deltas.\n","# OfficeCLI Financial-Model Skill\n\n**This skill is a scene layer on top of `officecli-xlsx`.** Every xlsx hard rule — shell quoting, incremental execution, Help-First Rule, visual delivery floor, CFO 4-color code (blue input \u002F black formula \u002F green cross-sheet \u002F yellow-fill assumption), number-format standards (years as text, zero as `-`, `%` one decimal, negatives in parens), assumption-cell discipline, CSV batch import, chart data-feed forms (a\u002Fb\u002Fc), the 5-gate Delivery cycle, cache-drift guidance, Known Issues (the cross-sheet `!` trap, batch + resident for formulas, renderer caveats) — is **inherited, not re-taught**. This file adds only what a **financial model** requires on top: three-zone architecture, 3 model-type recipes (3-statement \u002F DCF \u002F LBO), sensitivity + scenario protocols, financial-function patterns, circular-reference discipline, and model-specific Delivery Gates 4–6.\n\nWhen the xlsx base rules cover it, the text here says `→ see xlsx v2 §X`. Read `skills\u002Fofficecli-xlsx\u002FSKILL.md` first if you have not.\n\n## Setup\n\nIf `officecli` is missing:\n\n- **macOS \u002F Linux**: `curl -fsSL https:\u002F\u002Fd.officecli.ai\u002Finstall.sh | bash`\n- **Windows (PowerShell)**: `irm https:\u002F\u002Fd.officecli.ai\u002Finstall.ps1 | iex`\n\nVerify with `officecli --version` (open a new terminal if PATH hasn't picked up). If install fails, download a binary from https:\u002F\u002Fgithub.com\u002FiOfficeAI\u002FOfficeCLI\u002Freleases.\n\n## Help-First Rule\n\nThis skill teaches what a financial model requires, not every CLI flag. When a prop name \u002F alias \u002F enum is uncertain, consult help BEFORE guessing: `officecli help xlsx [element] [--json]`. Help is pinned to installed version — when this skill and help disagree, **help wins**. Every `--prop X=` below was verified against `officecli help xlsx \u003Celement>` on v1.0.63.\n\n## Mental Model & Inheritance\n\n**Inherits xlsx v2.** Read `skills\u002Fofficecli-xlsx\u002FSKILL.md` first. This skill assumes you know `create` \u002F `open` \u002F `close`, `set` values\u002Fformulas, `batch` heredocs for cross-sheet formulas, `\u002FSheetName\u002FA1` paths, named ranges, the 5-gate Delivery cycle, the cross-sheet `!` trap, and that **cross-sheet formulas go non-resident (single batch OR individual `set`), never batch-while-resident**.\n\n## Shell & Execution Discipline\n\nShell quoting, incremental execution, `$FILE` convention → see xlsx v2 §Shell & Execution Discipline. Same rules: quote every `[N]` path, single-quote any prop containing `$` (every number format here — `$#,##0;($#,##0);\"-\"` — needs single quotes), no hand-written `\\$`\u002F`\\t`\u002F`\\n`, one command at a time. Examples below use `$FILE` (`FILE=\"model.xlsx\"`).\n\n## Core Principles (identity)\n\nA financial model is an xlsx with a **decision-grade, formula-driven layer**: every output traces an unbroken chain to blue-font assumptions, every statement balances every period, every valuation is re-auditable. Eight deltas on top of a general xlsx:\n\n1. **Three-zone architecture mandatory:** Inputs → Calc → Outputs. Collapsing zones → unauditable.\n2. **Assumptions live in cells, never inside formulas.** `=B5*(1+Assumptions!GrowthRate)`, never `=B5*1.05`.\n3. **Statements balance every period.** `Assets − Liab − Equity = 0`, `CF.EndingCash = BS.Cash`. Gate 4 fails on `IMBALANCED`.\n4. **Hardcodes audited.** Calc sheets carry zero hardcoded numbers; Gate 6 counts.\n5. **Sensitivity \u002F scenario is first-class.** 2-axis grid, dropdown `INDEX\u002FMATCH` switch, or Base\u002FUpside\u002FDownside cols. Excel Data Tables not reliably supported — manual grids only.\n6. **Cached values on valuation cells load-bearing.** NPV \u002F IRR \u002F XNPV caching `0` ships a wrong number to non-recalculating readers. Gate 5 spot-checks.\n7. **Circularity is a design choice.** Legitimate rings (interest ↔ cash, revolver plug ↔ ending cash) use `calc.iterate=true`. Accidental circularity is broken algebra — never papered with `iterate`.\n8. **Named ranges for ≥ 3-use assumptions.** `WACC`, `TaxRate`, `TerminalGrowth`, `ExitMultiple`, `ChurnRate`. Declared-unused names are dead decoration — Gate 6 flags.\n\n### Reverse handoff — when to go BACK to xlsx base\n\nStay in **xlsx base** for: budget trackers, CSV-to-report dumps, operational KPI sheets, simple templates, cap tables without forecast logic. Use **this skill** only when the ask mentions: 3-statement \u002F DCF \u002F WACC \u002F NPV \u002F TV \u002F LBO \u002F debt schedule \u002F MOIC \u002F IRR \u002F unit economics \u002F ARR roll-forward \u002F sensitivity grid \u002F scenario switch \u002F pro forma.\n\n## Three-zone architecture (hard rule)\n\nEvery model in this skill builds on three zones. **Name them, tab-color them, and enforce them with executable audits.** Breaking the zone rule is the single most common cause of an unauditable model.\n\n| Zone | Sheet names (convention) | Tab color | Content | Hardcodes | Formulas |\n|---|---|---|---|---|---|\n| **Inputs** | `Assumptions`, `Inputs`, `Drivers` | Yellow `FFC000` | Raw drivers: growth rates, margins, tax, WACC, FTE, pricing, working-capital days | Blue `0000FF` on every cell | Allowed only for derived assumptions (e.g. `=MonthlyARPU*12`) |\n| **Calc** | `P&L`, `Balance Sheet`, `Cash Flow`, `DCF`, `Debt`, `ARR` | Blue `4472C4` | All derivations and statements | **Zero** (enforced by Gate 6) | Black `000000` for same-sheet, green `008000` for cross-sheet |\n| **Outputs** | `Summary`, `Dashboard`, `Sensitivity`, `Returns` | Green `70AD47` | KPIs, sensitivity grids, charts, returns waterfall | Only for labels (non-numeric); Gate 6 counts numeric hardcodes → 0 | Black \u002F green per above |\n\n**Build order is cross-zone-aware.** Assumptions first, then Calc bottom-up on the dependency chain (`IS → BS → CF` for 3-statement; `FCF → WACC → NPV` for DCF), then Outputs last. Building Outputs first caches `0` everywhere and downstream inherits zeros.\n\n**Executable zone audit** (run before Gate 4):\n\n```bash\n# Calc zone: zero numeric hardcodes allowed. NOTE: `:not(:has(formula))` pseudo doesn't filter on v1.0.63+ — filter via jq on .format.formula == null.\nHARDCODE=$(officecli query \"$FILE\" 'cell[type=Number]' --json | jq '[.data.results[] | select(.format.formula == null) | select(.path | test(\"\u002F(P&L|Balance Sheet|Cash Flow|DCF|Debt|ARR)\u002F\"))] | length')\n[ \"$HARDCODE\" -eq 0 ] && echo \"Zone audit OK\" || { echo \"REJECT: $HARDCODE hardcoded numeric cells on Calc sheets — move to Assumptions\"; exit 1; }\n# Assumptions zone: should be non-zero.\nINPUTS=$(officecli query \"$FILE\" '\u002FAssumptions\u002Fcell[type=Number]' --json | jq '[.data.results[] | select(.format.formula == null)] | length')\n[ \"$INPUTS\" -ge 5 ] && echo \"Assumptions has $INPUTS hardcoded drivers\" || echo \"WARN: Assumptions has only $INPUTS inputs\"\n```\n\n## Print delivery (board \u002F IC \u002F LP)\n\nWhen the ask contains \"print\" \u002F \"一页\" \u002F \"董事会\" \u002F \"投资人\" \u002F \"IC memo\" \u002F \"LP update\", the print pipeline must emit **only** the Outputs zone. Two artefacts:\n\n```bash\n# 1. Print_Area scoped to the Outputs sheet (Summary or Dashboard).\nofficecli add \"$FILE\" \u002F --type namedrange --prop name=_xlnm.Print_Area --prop scope=Summary --prop 'refersTo=Summary!$A$1:$H$40'\n# 2. Hide every non-Outputs sheet — Print_Area scope alone does NOT stop the print pipeline from emitting every visible sheet.\nfor S in Assumptions 'P&L' 'Balance Sheet' 'Cash Flow' DCF WACC Debt FCF 'S&U' Exit Returns; do\n  officecli raw-set \"$FILE\" \u002Fworkbook --xpath \"\u002F\u002Fx:sheet[@name='$S']\" --action setattr --xml \"state=hidden\" || true\ndone\n# 3. fit-to-page landscape on Outputs sheet.\nofficecli raw-set \"$FILE\" \u002FSummary --xpath \"\u002F\u002Fx:worksheet\" --action prepend --xml '\u003CsheetPr xmlns=\"http:\u002F\u002Fschemas.openxmlformats.org\u002Fspreadsheetml\u002F2006\u002Fmain\">\u003CpageSetUpPr fitToPage=\"1\"\u002F>\u003C\u002FsheetPr>'\n```\n\nDelete any `Print_Area` set on Calc sheets — conflicting scopes emit multi-page output with Assumptions \u002F statement sheets leaking.\n\n## Build-order & cache-drift rule (critical for 3-statement)\n\nThree facts cause silent wrong numbers: (1) new formulas ship without cached values — Excel recomputes on open, HTML preview \u002F older viewers do not; (2) downstream written in the same sequence as upstream caches `0` from upstream's pre-cache state; (3) cross-sheet `batch` while resident is open deadlocks at 3–5 ops.\n\n**Discipline (every recipe):**\n- Build order follows the data chain: `P&L → BS → CF` (3-statement); `FCF → WACC → NPV → Sensitivity` (DCF); `S&U → Debt → P&L → CF → Returns` (LBO).\n- After the cross-sheet chain, **cache-refresh pass:** re-issue `set` on every summary \u002F valuation \u002F balance-check cell, non-resident.\n- Spot-check: `officecli get \"$FILE\" \u002FSummary\u002FB2 --json | jq .format.cachedValue` returns non-zero non-null. `null` ≠ `0`: `null` means Excel will compute on open (OK for delivery); `0` is a cached lie. If `0` persists: close residents, re-set; still `0` → cache-fallback (§Financial function patterns).\n\n## Recipes — three model types\n\nEach recipe below is **runnable skeleton, not finance theory**. Substitute numbers; don't restructure. All recipes assume `FILE=\"model.xlsx\"` is set and you have run `officecli create \"$FILE\"` + `officecli open \"$FILE\"`. Close with `officecli close \"$FILE\"` at the end.\n\n### Recipe A — 3-statement model (P&L + BS + CF)\n\n**What this recipe produces.** 4 sheets: `Assumptions`, `P&L`, `Balance Sheet`, `Cash Flow`, plus `Summary`. Year columns 2024A · 2025E · 2026E · 2027E. Balance-check row on BS; cash-reconciliation row on CF. Every statement row = formula → Assumptions.\n\n**Build order (MANDATORY).** `Assumptions → P&L → Balance Sheet → Cash Flow → Summary`. Do NOT build BS before P&L — `RetainedEarnings` depends on `NI`. Do NOT build CF before BS — `CF.OpeningCash = prior period CF.EndingCash` self-chain requires BS cash anchored for Y1. The skill's Gate 4 balance check fails silently if order is wrong.\n\n**Step 1 — sheets + tab colors + freeze panes.**\n\n```bash\nofficecli add \"$FILE\" \u002F --type sheet --prop name=Assumptions --prop tabColor=FFC000\nofficecli add \"$FILE\" \u002F --type sheet --prop name=P&L --prop tabColor=4472C4\nofficecli add \"$FILE\" \u002F --type sheet --prop name='Balance Sheet' --prop tabColor=4472C4\nofficecli add \"$FILE\" \u002F --type sheet --prop name='Cash Flow' --prop tabColor=4472C4\nofficecli add \"$FILE\" \u002F --type sheet --prop name=Summary --prop tabColor=70AD47\nofficecli set \"$FILE\" \u002FAssumptions --prop freeze=B2\nofficecli set \"$FILE\" \u002FP&L --prop freeze=B3\nofficecli set \"$FILE\" \"\u002FBalance Sheet\" --prop freeze=B3\nofficecli set \"$FILE\" \"\u002FCash Flow\" --prop freeze=B3\n```\n\n**Step 2 — assumptions (blue, yellow-fill on key drivers).** Year headers row 2, labels down col A, blue numeric inputs on B:E. Drivers: `RevenueGrowth`, `GrossMargin`, `OpExRatio`, `TaxRate`, `DaysReceivable\u002FInventory\u002FPayable`, `CapExRatio`, `DepreciationYears`. `font.color=0000FF` on B:E. Yellow-fill (`fill=FFFF00`) the 3–5 scenario-switched drivers.\n\n**Declare named ranges for ≥3-use drivers and reference them** (`StartingARR`, `TaxRate`, `OpeningCash`, `GrowthRate`, `GrossMargin`). Formulas: `=StartingARR` not `=Assumptions!B4`; `=EBT*TaxRate` not `=EBT*Assumptions!B8`. Declared-unused names = dead decoration, Gate 6 rejects.\n\n**Step 3 — P&L rows (all formulas).** Rows: `Revenue` \u002F `COGS` \u002F `Gross Profit` \u002F `OpEx` \u002F `EBITDA` \u002F `D&A` \u002F `EBIT` \u002F `Interest` \u002F `EBT` \u002F `Tax` \u002F `Net Income`. Every row = formula referencing `Assumptions` or prior-row cells. Example revenue-side block — **substitute your row numbers**. Row-map for this example: `B3=Revenue, B4=COGS, B5=Gross Profit, B7=OpEx, B9=EBITDA, B10=EBIT, B15=Net Income`. Submit as single non-resident batch:\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FB3\",\"props\":{\"formula\":\"Assumptions!B5\",\"font.color\":\"008000\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FC3\",\"props\":{\"formula\":\"B3*(1+Assumptions!C6)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FD3\",\"props\":{\"formula\":\"C3*(1+Assumptions!D6)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FE3\",\"props\":{\"formula\":\"D3*(1+Assumptions!E6)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FB4\",\"props\":{\"formula\":\"-B3*(1-Assumptions!B7)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FP&L\u002FB5\",\"props\":{\"formula\":\"B3+B4\"}}\n]\nEOF\n```\n\nAssumptions refs (`B5`, `C6`, `B7`) are also placeholder rows — better: **define named ranges** for each driver (Step 2) so formulas read `=StartingRevenue*(1+RevenueGrowth_Y2)` regardless of row layout. Repeat for `OpEx` \u002F `D&A` \u002F `Interest` \u002F `Tax` \u002F `NI`. `font.color=008000` on every cross-sheet-reference cell; same-sheet cells default `000000`. `numFmt='$#,##0;($#,##0);\"-\"'` on all $ rows.\n\n**Step 4 — Balance Sheet rows (all formulas).** Assets = `Cash + AR + Inventory + Net PP&E`. Liab = `AP + Debt`. Equity = `OpeningEquity + RetainedEarnings`. Working-capital rows use Days assumptions: `AR = Revenue × DaysReceivable \u002F 365`. `Net PP&E` rolls forward: `Beg + CapEx − Depreciation`. **`BS.Cash` is NOT an independent plug** — it MUST equal `'Cash Flow'!B\u003Cending-cash-row>` (populated in Step 5).\n\n**Retained Earnings — live formula every period.** `BS.RE(t) = BS.RE(t-1) + 'P&L'!NI(t) − Dividends(t)`. Hardcoded RE rounds to whole dollar → BS shows ±$1 off every period (CFO reads \"model doesn't balance\"). For Y1 Historical RE (no prior NI), compute via BS identity as a **live formula**: `BS!RE_Y1 = TotalAssets − TotalLiabilities − PaidInCapital`. Blue-font + classic comment on the Y1 cell; Y2..Y5 stay NI-driven.\n\n**Step 5 — Cash Flow rows (all formulas).** Operating: `NI + D&A − ΔWorkingCapital`. Investing: `−CapEx`. Financing: `ΔDebt − Dividends`. Ending Cash = `Opening + Operating + Investing + Financing`. **Year 2+ Opening Cash = prior period Ending Cash** — self-chain on the same sheet: `C17 = B19`, `D17 = C19`, `E17 = D19`. The Y1 `OpeningCash` is an Assumptions input.\n\n**Step 6 — Balance check + cash reconciliation rows (hard delivery checks).** Row-map for this example: `Balance Sheet: B10=Total Assets, B15=Total Liab, B17=Total Equity, B18=Balance Check`; `Cash Flow: B5=BS.Cash (cross-sheet anchor), B19=CF.Ending Cash, B21=CF-BS Cash Recon`. Substitute your layout's rows — the logic is the check, not the cell addresses.\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FBalance Sheet\u002FB18\",\"props\":{\"formula\":\"IF(ABS(B10-B15-B17)\u003C0.01,\\\"OK\\\",\\\"IMBALANCED: \\\"&ROUND(B10-B15-B17,0))\",\"bold\":\"true\",\"font.color\":\"000000\"}},\n  {\"command\":\"set\",\"path\":\"\u002FCash Flow\u002FB21\",\"props\":{\"formula\":\"IF(ABS(B19-'Balance Sheet'!B5)\u003C0.01,\\\"OK\\\",\\\"CF != BS CASH: \\\"&ROUND(B19-'Balance Sheet'!B5,0))\",\"bold\":\"true\"}}\n]\nEOF\n```\n\nReplicate across columns C\u002FD\u002FE. Apply red fill (`fill=FFC7CE`) conditionally via `type=containsText --prop text=IMBALANCED` or `text=\"CF !=\"`. Gate 4 queries these rows and refuses delivery on any `IMBALANCED`.\n\n**Step 7 — cache refresh + format pass.** Re-set every summary cell on `Summary`, every balance-check \u002F recon cell, and every cross-sheet reference on BS \u002F CF (non-resident, single batch per sheet). Apply column widths (`col[A]=28`, `col[B:E]=15`), `numberformat='$#,##0;($#,##0);\"-\"'` on all dollar rows, header fills (`fill=1F3864`, `font.color=FFFFFF`, `bold=true`) on section-header rows (REVENUE \u002F COGS \u002F ASSETS \u002F LIABILITIES). Header fill must cover A:E, not just the label cell (→ xlsx v2 §visual floor).\n\n**Step 8 — Summary \u002F Dashboard KPIs + charts.** Minimum 4 KPIs: `Revenue 27E`, `EBITDA Margin 27E`, `Ending Cash 27E`, `Net Income CAGR` — each a formula referencing a statement cell, green font.\n\n**Minimum 3 charts on any Dashboard delivered to a board \u002F executive audience** — one chart is a draft, three is a deliverable. Pre-populate `Summary!A10:E13` with Gross Margin \u002F EBITDA Margin \u002F NI Margin ratio rows (formulas referencing `P&L`) before adding the margin chart.\n\n```bash\n# (1) Top-line trend (Revenue + EBITDA).\nofficecli add \"$FILE\" \u002FSummary --type chart --prop chartType=column --prop dataRange='P&L!A2:E5' --prop title='Revenue & EBITDA' --prop width=14cm --prop height=8cm\n# (2) Margin trend (Gross \u002F EBITDA \u002F NI margin).\nofficecli add \"$FILE\" \u002FSummary --type chart --prop chartType=line --prop dataRange='Summary!A10:E13' --prop title='Margin trend' --prop width=14cm --prop height=8cm\n# (3) Cash trajectory (Ending Cash ± Runway).\nofficecli add \"$FILE\" \u002FSummary --type chart --prop chartType=area --prop dataRange='Cash Flow!A19:E19' --prop title='Ending cash' --prop width=14cm --prop height=8cm\n```\n\n**Verification (run all three):**\n\n```bash\n# Balance check every period must say OK\nofficecli get \"$FILE\" \"\u002FBalance Sheet\u002FB18:E18\" --json | jq '.data[].cachedValue \u002F\u002F .data[].value'\n# Cash recon every period must say OK\nofficecli get \"$FILE\" \"\u002FCash Flow\u002FB21:E21\" --json | jq '.data[].cachedValue \u002F\u002F .data[].value'\n# Summary KPIs are plausible numbers, not 0 or null\nofficecli get \"$FILE\" \"\u002FSummary\u002FB2:B5\" --json | jq '.data[].cachedValue'\n```\n\n### Recipe B — DCF valuation\n\n**What this recipe produces.** Sheets: `Assumptions`, `FCF` (10-year forecast), `WACC` (panel), `DCF` (NPV + TV + equity bridge), `Sensitivity` (2-axis grid). Output: `Implied Equity Value` + `Implied Per-Share`, with a `WACC × g` sensitivity.\n\n**Build order.** `Assumptions → FCF → WACC → DCF → Sensitivity`.\n\n**Step 1 — named ranges for key drivers.** DCF's readability depends on names. Every formula below uses `WACC`, `TaxRate`, `g` — not `$B$6`:\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"WACC\",\"ref\":\"WACC!$B$12\"}},\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"TaxRate\",\"ref\":\"Assumptions!$B$8\"}},\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"TerminalGrowth\",\"ref\":\"Assumptions!$B$15\"}},\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"NetDebt\",\"ref\":\"Assumptions!$B$20\"}},\n  {\"command\":\"add\",\"parent\":\"\u002F\",\"type\":\"namedrange\",\"props\":{\"name\":\"SharesOut\",\"ref\":\"Assumptions!$B$21\"}}\n]\nEOF\n```\n\n**Step 2 — FCF build (10 years).** Columns B:K = Y1..Y10. Rows: `Revenue` (from growth) \u002F `EBIT` (revenue × margin) \u002F `EBIT × (1 − TaxRate)` (NOPAT) \u002F `+ D&A` \u002F `− CapEx` \u002F `− ΔNWC` \u002F `= FCF`. Use Assumptions-driven ratios (`CapEx = Revenue × CapExRatio`). All cells formulas, black font, `numFmt='$#,##0;($#,##0);\"-\"'`.\n\n**Step 3 — WACC panel.** On `WACC` sheet, an 8-row panel: `Risk-free rate` \u002F `Equity risk premium` \u002F `Beta` \u002F `Cost of equity` (=Rf + β×ERP) \u002F `Pre-tax debt cost` \u002F `After-tax debt cost` (=×(1−TaxRate)) \u002F `Equity weight` \u002F `Debt weight` \u002F `WACC` (=We×Re + Wd×Rd_after_tax). Inputs blue; derived rows black.\n\n**Step 4 — Terminal value + NPV + equity bridge.** Row-map: `DCF: B\u002FC 3=TV, 4=PV explicit FCF, 5=PV terminal, 6=EV, 7=Net Debt, 8=Equity Value, 9=Per-Share`; `FCF: row 2 = periods (1..10), row 11 = FCF, B:K = Y1..Y10`. Substitute your rows. Notes column cells use `{\"value\":\"text\"}`, never `{\"formula\":\"...\"}` — formula-style prose yields `#NAME?` on open (see callout after Recipe C Step 5). On `DCF` sheet:\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB3\",\"props\":{\"value\":\"Terminal value (Gordon growth)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC3\",\"props\":{\"formula\":\"FCF!K11*(1+TerminalGrowth)\u002F(WACC-TerminalGrowth)\",\"font.color\":\"008000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB4\",\"props\":{\"value\":\"PV of explicit-period FCF (10 yr)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC4\",\"props\":{\"formula\":\"SUMPRODUCT(FCF!B11:K11\u002F(1+WACC)^FCF!B2:K2)\",\"font.color\":\"008000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB5\",\"props\":{\"value\":\"PV of terminal value\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC5\",\"props\":{\"formula\":\"C3\u002F(1+WACC)^10\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB6\",\"props\":{\"value\":\"Enterprise value\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC6\",\"props\":{\"formula\":\"C4+C5\",\"bold\":\"true\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB7\",\"props\":{\"value\":\"Less: Net debt\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC7\",\"props\":{\"formula\":\"-NetDebt\",\"font.color\":\"008000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB8\",\"props\":{\"value\":\"Equity value\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC8\",\"props\":{\"formula\":\"C6+C7\",\"bold\":\"true\",\"font.color\":\"000000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FB9\",\"props\":{\"value\":\"Implied per-share\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDCF\u002FC9\",\"props\":{\"formula\":\"C8\u002FSharesOut\",\"bold\":\"true\",\"numberformat\":\"$0.00\"}}\n]\nEOF\n```\n\n**Why `SUMPRODUCT` not `NPV`.** `NPV(rate, cross_sheet_range)` silently caches `0` on v1.0.63 — ships a wrong valuation to any non-recalculating reader. `SUMPRODUCT(values\u002F(1+rate)^periods)` is algebraically equivalent and caches correctly (period row `FCF!B2:K2 = 1..10` is a one-time setup). For irregular dates (`XNPV`), use `SUMPRODUCT(values\u002F(1+rate)^((dates-base_date)\u002F365))`. See §Known Issues.\n\n**Step 5 — 2-axis sensitivity grid (WACC × g).** 5×5 grid. Rows = WACC values `7.5% ... 11.5%`, cols = `g` values `1.5% ... 3.5%`. Each cell = one self-contained formula re-running the DCF with the grid's WACC and g substituted. Template:\n\n```bash\n# Cell D14 (first data cell, grid anchor at C14 = WACC label, C15 = first WACC value)\n# Substitute $D$13 (this cell's g) and $C15 (this cell's WACC) into a replicated EV + equity formula.\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FSensitivity\u002FD15\",\"props\":{\"formula\":\"(NPV($C15,FCF!$B$11:$K$11)+(FCF!$K$11*(1+D$14)\u002F($C15-D$14))\u002F(1+$C15)^10+(-NetDebt))\u002FSharesOut\",\"numberformat\":\"$0.00\"}}\n]\nEOF\n```\n\nCopy the formula across D15:H19 (5×5 grid). Row 14 carries g values (blue input); column C carries WACC values (blue input). Row 13 and column B carry labels. Apply 3-color gradient CF for quick-read (green = upside, red = downside):\n\n```bash\nofficecli add \"$FILE\" \u002FSensitivity --type conditionalformatting \\\n  --prop type=colorScale --prop ref=D15:H19\n```\n\n**No Excel Data Tables.** Excel's native `\u002FData\u002FTable` 2-variable table is not reliably supported via the CLI — each grid cell MUST be an explicit formula. Copy the template, do not try `Data Table` input cells.\n\n**Verification.**\n\n```bash\nofficecli get \"$FILE\" \"\u002FDCF\u002FC8\" --json | jq .format.cachedValue   # equity value, plausible $\nofficecli get \"$FILE\" \"\u002FDCF\u002FC9\" --json | jq .format.cachedValue   # per-share, in $XX.XX range\nofficecli get \"$FILE\" \"\u002FSensitivity\u002FF17\" --json | jq .format.cachedValue   # grid center cell, plausible\n```\n\nIf `C8` or `C9` cache `0`, re-set them (non-resident) — see §Build-order & cache-drift.\n\n### Recipe C — LBO model\n\n**What this recipe produces.** Sheets: `Assumptions`, `S&U` (Sources & Uses), `Debt` (multi-tranche schedule), `P&L` (5-yr), `CF`, `Exit` \u002F `Returns`. Outputs: `MOIC`, `IRR`, and a 4-tier returns waterfall. LBO is the stress test — expect circular refs (interest ↔ cash), deepest cross-sheet chains, and the heaviest use of named ranges.\n\n**Build order.** `Assumptions → S&U → P&L → Debt → CF → Exit → Returns`. P&L before Debt (debt interest depends on P&L EBIT for coverage checks); Debt before CF (CF uses interest + principal amortization). Enable `calc.iterate` before Step 5.\n\n**Step 1 — Sources & Uses (balance required, every fee line itemized).**\n\n```\nUses    = Purchase_EV (EntryEBITDA × EntryMultiple) + Transaction_fees (Purchase_EV × TxnFeePct, typ 1.5–2.5%)\n        + Financing_fees ((Senior + Mezz) × FinFeePct, typ 1–3%) + Refinanced_debt\nSources = Senior_TLB + Mezz + Revolver_drawn + Sponsor_equity\n```\n\n**Sponsor equity — pick one, never both.** (a) **Stated:** `Sponsor_equity = Assumptions!SponsorEquity`, then scale senior\u002Fmezz so Sources = Uses (fees absorbed by debt, not a silent plug). (b) **Solved:** `Sponsor_equity = Uses − Senior − Mezz − Revolver − Refinanced`, label \"Sponsor Equity (solved)\", no standalone Assumptions ref. Hardcoded `SponsorEquity` PLUS a `=Uses − Senior − Mezz` plug guarantees silent fee absorption — stated $140M vs plug $194.67M = $54.67M unaccounted fees, CFO rejection on sight.\n\n```bash\n# Sources = Uses hard check.\nofficecli set \"$FILE\" \u002FS&U\u002FB12 --prop formula='IF(ABS(SUM(B4:B7)-SUM(B9:B11))\u003C1,\"BALANCED\",\"S&U IMBALANCE: \"&ROUND(SUM(B4:B7)-SUM(B9:B11),0))' --prop bold=true\n\n# Stated-vs-plug consistency (Gate 4 addendum; only run if you chose pattern (a)).\nSTATED=$(officecli get \"$FILE\" \u002FAssumptions\u002FB12 --json | jq -r '.format.cachedValue \u002F\u002F \"null\"')\nPLUGGED=$(officecli get \"$FILE\" \u002FS&U\u002FB10 --json | jq -r '.format.cachedValue \u002F\u002F \"null\"')   # B10 = sponsor-equity row on S&U\nDELTA=$(python3 -c \"print(abs(float('$STATED') - float('$PLUGGED')))\" 2>\u002Fdev\u002Fnull || echo 99999)\npython3 -c \"import sys; sys.exit(0 if float('$DELTA') \u003C= 1 else 1)\" && echo \"S&U sponsor OK (stated=$STATED plug=$PLUGGED)\" || { echo \"REJECT Gate 4 S&U: stated $STATED ≠ plug $PLUGGED (Δ=$DELTA) — fees silently absorbed\"; exit 1; }\n```\n\nEvery non-sponsor line on `S&U` is a blue Assumptions input (target EBITDA, entry multiple, fee %s) or a derived formula. No hardcoded Uses \u002F Sources numbers.\n\n**Step 2 — Debt schedule (multi-tranche).** One row per tranche per year. Columns: `BeginningBalance` \u002F `Mandatory amortization` \u002F `Cash sweep` \u002F `EndingBalance` \u002F `AverageBalance` \u002F `InterestExpense`. Senior TLB: 1% mandatory amortization + all excess cash to sweep. Mezz: 0% amortization, interest-only cash-pay. Row-map for this example (senior TLB tranche, year 2 column C): `C4=Beginning Balance, C5=Mandatory Amort, C6=Ending Balance, C7=Cash Sweep, C8=Average Balance, C9=Interest Expense`. `CF!C20` = free cash available to sweep (year-2 ending cash pre-sweep on CF sheet). Substitute your tranche row block per layout.\n\n```bash\n# year 2 senior TLB\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC4\",\"props\":{\"formula\":\"B6\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC5\",\"props\":{\"formula\":\"-C4*Assumptions!$B$30\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC6\",\"props\":{\"formula\":\"C4+C5+C7\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC7\",\"props\":{\"formula\":\"-MIN(-CF!C20,C4+C5)\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC8\",\"props\":{\"formula\":\"(C4+C6)\u002F2\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FDebt\u002FC9\",\"props\":{\"formula\":\"-C8*Assumptions!$B$31\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}}\n]\nEOF\n# Add the sweep-rule comment as a classic comment (comment is NOT a cell prop — separate --type comment).\nofficecli add \"$FILE\" \u002FDebt --type comment --prop ref=C7 --prop text='cash sweep capped at available cash and remaining tranche balance'\n```\n\n**Revolver capacity cap.** If your deal uses a revolver tranche, the revolver balance each period is bounded by the commitment ceiling:\n```\nRevolver_Balance = MIN(Assumptions!RevolverCapacity, MAX(0, prior_revolver + draw − paydown))\n```\nWithout the `MIN(capacity, ...)` outer, a shortfall quarter silently over-draws the facility.\n\nAdjust row indices to your layout. Repeat for each tranche (senior \u002F mezz \u002F revolver) and each year.\n\n**Step 3 — P&L (5-year) + interest from Debt.** P&L interest row pulls from Debt: `Interest = 'Debt'!TotalInterestRowY\u003CN>`. This creates the **circular reference**: Interest → NI → CF → Cash Sweep → Debt balance → Interest.\n\n**Write-order warning.** `calc.iterate=true` governs _recalculation_, not write-phase. Appending the closing leg of a cross-sheet ring to a file that already contains the ring deadlocks the engine at 100% CPU regardless of `iterate`. For complex rings (multi-tranche LBO, revolver + TLB + mezz), use §Write-order surgery below (de-ring → write downstream → re-ring). Enable `calc.iterate=true` BEFORE writing ring formulas:\n\n```bash\nofficecli set \"$FILE\" \u002F --prop calc.iterate=true --prop calc.iterateCount=100 --prop calc.iterateDelta=0.001\n```\n\n`iterate` converges via successive approximation for naturally-dampening loops (higher interest → less cash → less sweep → higher balance, bounded by EBIT). `#REF!` or divergent values = pause; fix algebra, do not raise `iterateCount` to 1000.\n\n**Step 4 — CF + cash sweep.** Ending cash = Opening + CFO − CapEx − Mandatory amort − Cash sweep. Cash sweep = `MIN(freeCashAfterCapEx, seniorDebtBalance + seniorMandatoryAmort)`. The `MIN` cap prevents swept-below-zero.\n\n**Step 5 — Exit + Returns.** Row-map: `Exit: B3=Exit EV, B4=Less: remaining debt, B5=Exit equity to sponsor`; `Returns: B3=MOIC, B4=IRR`.\n\n```bash\n# Values\u002Fformulas — single non-resident batch.\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"set\",\"path\":\"\u002FExit\u002FB3\",\"props\":{\"formula\":\"'P&L'!F8*Assumptions!$B$25\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FExit\u002FB4\",\"props\":{\"formula\":\"-('Debt'!F6+'Debt'!F13)\",\"font.color\":\"008000\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FExit\u002FB5\",\"props\":{\"formula\":\"B3+B4\",\"bold\":\"true\",\"numberformat\":\"$#,##0;($#,##0);\\\"-\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FReturns\u002FB3\",\"props\":{\"formula\":\"'Exit'!B5\u002F('S&U'!B9)\",\"numberformat\":\"0.00\\\"x\\\"\"}},\n  {\"command\":\"set\",\"path\":\"\u002FReturns\u002FB4\",\"props\":{\"formula\":\"IRR({-'S&U'!B9,0,0,0,0,'Exit'!B5})\",\"numberformat\":\"0.0%\"}}\n]\nEOF\n# Classic comments — one --type comment per anchor cell.\nofficecli add \"$FILE\" \u002FExit --type comment --prop ref=B3 --prop text='Exit EV = Y5 EBITDA × exit multiple'\nofficecli add \"$FILE\" \u002FReturns --type comment --prop ref=B3 --prop text='MOIC = exit equity \u002F sponsor equity'\nofficecli add \"$FILE\" \u002FReturns --type comment --prop ref=B4 --prop text='IRR — 5-yr, entry + exit only; use XIRR for mid-year dividends'\n```\n\n**Callout — labels: `comment` element vs Notes column vs `formula` (three distinct mechanics).**\n- **Hover tooltip** → `officecli add ... --type comment --prop ref=\u003Ccell> --prop text='...'`. The **`comment` key is NOT a valid prop on `set cell`** (not in `officecli help xlsx cell` on v1.0.63) — it silently drops when embedded inside a `set cell` props dict. Use the dedicated element.\n- **Visible text in an adjacent Notes column** → `{\"command\":\"set\",\"path\":\"\u002FDCF\u002FD3\",\"props\":{\"value\":\"TV = FCF × (1+g) \u002F (WACC−g)\"}}` — **`value`, not `formula`**, plain quoted string.\n- **Formula-style prose written as a real formula** → NEVER. `{\"formula\":\"FCF10*(1+g)\u002F(WACC-g)\"}` produces `#NAME?` in Excel (`FCF10`, `g`, `WACC` are unbound identifiers in that cell context).\n\nFor mid-year dividends or partial exits, use `XIRR({cashflows}, {dates})` instead of `IRR`.\n\n**Step 6 — Returns waterfall (optional, 4-tier LP\u002FGP).** Tiers: (1) LP preferred return 8% ; (2) GP catch-up to 20% ; (3) 80\u002F20 split above hurdle ; (4) 100% to LP on loss. Each tier is a `MAX(0, MIN(...))` clamp. See §Sensitivity & scenarios for the general grid pattern.\n\n**Verification.**\n\n```bash\nofficecli get \"$FILE\" \u002FS&U\u002FB12 --json | jq '.data.value \u002F\u002F .data.cachedValue'   # must say BALANCED\nofficecli get \"$FILE\" \u002FReturns\u002FB3 --json | jq .format.cachedValue                # MOIC, expect 2.0x-4.0x typical\nofficecli get \"$FILE\" \u002FReturns\u002FB4 --json | jq .format.cachedValue                # IRR, expect 0.15-0.30 typical\n# Iterate converged?\nofficecli query \"$FILE\" 'cell:contains(\"#REF!\")' --json | jq '.data.results | length'   # must be 0\n```\n\n## Sensitivity & scenarios\n\n**Three patterns, pick one:**\n- **(a) Base \u002F Upside \u002F Downside columns** on Assumptions — side-by-side scenarios, dropdown-less switch via an \"Active\" column + `INDEX\u002FMATCH`.\n- **(b) Dropdown + `INDEX\u002FMATCH` switch** — one validation dropdown on Summary drives every driver via `INDEX(Base:Downside, MATCH(Dropdown, ScenLabels, 0))`.\n- **(c) 2-axis sensitivity grid** — 5×5 or 7×7, one self-contained formula per cell, row\u002Fcol headers are the two drivers. See Recipe B Step 5 for WACC × g.\n\nMixing (a)+(b) creates circular input (scenario picked by dropdown AND overwritten by Active column) — pick one.\n\n**Grid rule:** each cell substitutes row-driver and col-driver into a self-contained copy of the output formula. Cannot reference the `WACC` named range (that's the panel) — reference the grid's axis cell.\n\n**Dropdown scenario switch.** One `validation` dropdown on Summary drives every `Assumptions` row:\n\n```bash\ncat \u003C\u003C'EOF' | officecli batch \"$FILE\"\n[\n  {\"command\":\"add\",\"parent\":\"\u002FSummary\",\"type\":\"validation\",\"props\":{\"sqref\":\"B1\",\"type\":\"list\",\"formula1\":\"Base,Upside,Downside\"}},\n  {\"command\":\"set\",\"path\":\"\u002FAssumptions\u002FB5\",\"props\":{\"formula\":\"INDEX(C5:E5,MATCH(Summary!$B$1,$C$4:$E$4,0))\"}}\n]\nEOF\n# If you want a hover tooltip on B5, add it separately:\nofficecli add \"$FILE\" \u002FAssumptions --type comment --prop ref=B5 --prop text='Revenue growth — picked by Summary!B1 scenario dropdown'\n```\n\nEvery `Assumptions` driver row gets the same `INDEX\u002FMATCH`. Base \u002F Upside \u002F Downside columns on C:E stay blue (hardcoded scenario inputs).\n\n**Football-field chart pattern (DCF valuation summary).** Horizontal Low→High bars for 3–5 valuation methods (DCF base, DCF bear, Trading comps, Precedent txns, LBO floor) stacked vertically. On a `Football` sheet: col A = method label, col B = Low $, col C = High $, col D = `=C−B` (width). Chart as a stacked bar with column B as an invisible first series (white\u002Fno-fill) and column D as the visible series — `dataRange=Football!A3:D7`, `chartType=bar`. Excel reads this as a floating bar per method.\n\n## Financial function patterns\n\nTerse reference — not a finance textbook. If you don't know what these do, pause and ask the user.\n\n| Function | Prefer over | Why |\n|---|---|---|\n| `XNPV(rate, values, dates)` | `NPV` | Irregular cash flow dates (M&A close mid-year, staggered tranches) |\n| `XIRR(values, dates)` | `IRR` | Irregular dates; multiple sign changes handled better |\n| `INDEX(range, MATCH(lookup, key, 0))` | `VLOOKUP` | Insert-safe (VLOOKUP breaks when a column is inserted in the source range) |\n| `IFERROR(x\u002Fy, 0)` or `IF(y=0, 0, x\u002Fy)` | bare division | Guard every `\u002F` in a financial model — `#DIV\u002F0!` shipped = delivery failure |\n| `MIRR(values, financeRate, reinvestRate)` | `IRR` with sign flips | When cash-flow pattern has 2+ sign changes |\n| `SUMIFS(sumRange, criteriaRange1, criterion1, ...)` | `SUMPRODUCT((...))` array | Avoids the cached-value trap on array formulas (→ xlsx v2 §Common Workflow Step 5 array-formula fallback) |\n\n**`SUMPRODUCT(1\u002FCOUNTIF(...))` distinct-count trap.** The CLI engine caches the inner division per-row → `1\u002FN` (e.g. `0.001543`) rather than the true distinct count. `SUMPRODUCT(--((range\u003C>\"\")\u002FCOUNTIF(range,range&\"\")))` pattern is likewise affected. **Fallback (from xlsx v2):** hardcode the correct distinct count with a blue font + adjacent comment `\"hardcoded distinct count; update if rows change\"`, and disclose at delivery. LBO deal-count or portfolio headcount from a transactions list is the typical pattern that hits this.\n\n**Cross-sheet `NPV()` \u002F `XNPV()` cache-0 fallback (preferred).** When the engine caches `0` on a cross-sheet `NPV()` \u002F `XNPV()`, replace the formula with its algebraic equivalent `SUMPRODUCT(values\u002F(1+rate)^periods)` — same result, caches correctly, audits cleanly. This is the first-line fix, used in Recipe B Step 4 by default. For `XNPV`, the period exponent is `(dates - base_date) \u002F 365`.\n\n**Cache fallback on `IRR` \u002F `MOIC` \u002F summary KPI cells (last resort).** If a valuation cell still ships with `cachedValue = 0` after algebraic rewrite + re-set after close, hardcode the computed value with a blue font and add a classic comment via `officecli add \"$FILE\" \u002FSheet --type comment --prop ref=\u003Ccell> --prop text='cached valuation; refreshes on open in Excel — do not edit'`. Disclose in delivery notes. Prefer re-set after close first.\n\n## Circular references & iterative calc\n\n**Enable `calc.iterate` ONLY when circularity is algebraically justified:** Interest ↔ Cash (LBO revolver \u002F cash sweep), Tax shield ↔ NI (rare — most 3-statement models compute interest before tax and avoid), Revolver plug ↔ Ending cash (corporate cash waterfall with min-cash).\n\n```bash\nofficecli set \"$FILE\" \u002F --prop calc.iterate=true --prop calc.iterateCount=100 --prop calc.iterateDelta=0.001\n```\n\n`iterateCount=100` \u002F `iterateDelta=0.001` are Excel defaults, fine for naturally dampening loops.\n\n### Write-order surgery (de-ring → write downstream → re-ring)\n\n`calc.iterate` controls recalc, not write-phase. Appending the closing leg of an already-wired cross-sheet ring (Debt.Interest ↔ CF.Cash ↔ Debt.CashSweep) deadlocks at 100% CPU; `view html` \u002F `get` also hang on a non-converged ring.\n\n**3-step playbook:**\n1. **De-ring** — write Debt with the 10–20 ring cells set to literal `0` (e.g. `C7=0`, not `=-MIN(...)`). Removes the ring.\n2. **Write downstream** — build all non-circular chains (P&L, CF, Exit, Returns, Summary, grid) non-resident, one heredoc per sheet. Everything caches against the zeroed cells.\n3. **Re-ring** — close all residents, re-set each circular cell with its real formula, one `set` per cell, non-resident.\n\n**Acceptance.** `get \u002FDebt\u002FC7 --json | jq .format.cachedValue` returns non-zero non-null. If a cell still deadlocks, leave `=0` + classic comment `\"circular; recalculates in Excel on F9\"`, flag at delivery. Never paper over with `iterateCount=1000`.\n\n**Do NOT use `iterate` as a band-aid for `#REF!` \u002F divergent values.** Raising `iterateCount` to 1000 hides the bug and ships a plausibly-wrong value; `validate` does not catch it. Break the loop algebraically (e.g. interest on opening balance only, not average).\n\n**Verify convergence.** Read the loop cell, bump a driving assumption and back, re-read — values must match:\n\n```bash\nV1=$(officecli get \"$FILE\" \u002FDebt\u002FC9 --json | jq .format.cachedValue)\nofficecli set \"$FILE\" \u002FAssumptions\u002FB31 --prop value=0.085\nofficecli set \"$FILE\" \u002FAssumptions\u002FB31 --prop value=0.0845\nV2=$(officecli get \"$FILE\" \u002FDebt\u002FC9 --json | jq .format.cachedValue)\n[ \"$V1\" = \"$V2\" ] && echo \"Iterate converged\" || echo \"WARN: drift V1=$V1 V2=$V2 — tighten iterateDelta or check algebra\"\n```\n\n## Audit & Delivery Gate\n\n**Assume there are problems.** First build is almost never correct. Run every gate below; every check must print its success line. `validate` passing is not delivery — the model can pass schema and still be wrong by a factor of 10.\n\n### Gates 1–3 — inherited from xlsx v2 verbatim\n\n→ see xlsx v2 §QA minimum cycle (Gates 1–3 cover `view issues`, error-cell query, `validate` after close). Run them first, exactly as written in xlsx v2. No financial-model-specific tweaks.\n\n### Gate 4 — statement integrity (3-statement & LBO)\n\nBalance-check and cash-reconciliation rows produced by Recipe A \u002F C must show `OK` \u002F `BALANCED` every period. `query` the check rows and refuse on any `IMBALANCED` \u002F `CF !=`:\n\n```bash\nBS_FAIL=$(officecli query \"$FILE\" 'cell:contains(\"IMBALANCED\")' --json | jq '.data.results | length')\nCF_FAIL=$(officecli query \"$FILE\" 'cell:contains(\"CF !=\")' --json | jq '.data.results | length')\nSU_FAIL=$(officecli query \"$FILE\" 'cell:contains(\"S&U IMBALANCE\")' --json | jq '.data.results | length')\nif [ \"$BS_FAIL\" -eq 0 ] && [ \"$CF_FAIL\" -eq 0 ] && [ \"$SU_FAIL\" -eq 0 ]; then\n  echo \"Gate 4 OK (balance + recon + S&U all pass)\"\nelse\n  echo \"REJECT Gate 4: BS=$BS_FAIL CF=$CF_FAIL S&U=$SU_FAIL\"; exit 1\nfi\n```\n\nIf any fail, the model is silently wrong — fix the upstream chain before delivery. Most common cause: a cross-sheet formula stored `\\!` (shell-mangled) — run `officecli query \"$FILE\" 'cell:contains(\"\\\\\\\\!\")'` and re-enter via batch heredoc.\n\n### Gate 5 — cached-value sanity on valuation cells\n\nNPV \u002F IRR \u002F XIRR \u002F equity-bridge \u002F MOIC \u002F summary KPI cells cached `0` = wrong number shipped to a reader who does not recalc on open. List every valuation cell and check `cachedValue`:\n\n```bash\n# Customize the path list per recipe — this is the DCF example\nfor P in \"\u002FDCF\u002FC4\" \"\u002FDCF\u002FC5\" \"\u002FDCF\u002FC6\" \"\u002FDCF\u002FC8\" \"\u002FDCF\u002FC9\"; do\n  V=$(officecli get \"$FILE\" \"$P\" --json | jq -r '.format.cachedValue \u002F\u002F \"null\"')\n  if [ \"$V\" = \"0\" ] || [ \"$V\" = \"null\" ]; then\n    echo \"REJECT Gate 5: $P cached $V — re-set after close (see §Build-order & cache-drift)\"; exit 1\n  fi\n  echo \"Gate 5 $P: cached=$V OK\"\ndone\n```\n\nFor LBO, extend the list: `\u002FExit\u002FB5`, `\u002FReturns\u002FB3`, `\u002FReturns\u002FB4`. For 3-statement, extend with `\u002FSummary\u002FB2:B5`.\n\n### Gate 6 — hardcode \u002F zone discipline\n\nEvery Calc sheet has zero numeric hardcodes. Executable:\n\n```bash\nHARDCODE=$(officecli query \"$FILE\" 'cell[type=Number]:not(:has(formula))' --json \\\n  | jq '[.data.results[] | select(.path | test(\"\u002F(P&L|Balance Sheet|Cash Flow|DCF|Debt|FCF|WACC|Exit|Returns)\u002F\"))] | length')\n[ \"$HARDCODE\" -eq 0 ] && echo \"Gate 6 OK (no hardcodes on Calc sheets)\" || { echo \"REJECT Gate 6: $HARDCODE hardcoded numeric cells on Calc zone — move to Assumptions\"; exit 1; }\n\n# Named-range coverage + dead-decoration audit: ≥3 ranges declared AND each referenced by ≥1 formula.\nNR=$(officecli query \"$FILE\" namedrange --json | jq '.data.results | length')\n[ \"$NR\" -ge 3 ] && echo \"Gate 6 OK ($NR named ranges)\" || echo \"WARN Gate 6: only $NR named ranges\"\nDEAD=0\nfor NR_NAME in $(officecli query \"$FILE\" namedrange --json | jq -r '.data.results[].name'); do\n  USES=$(officecli query \"$FILE\" \"cell:has(formula):contains(\\\"$NR_NAME\\\")\" --json | jq '.data.results | length')\n  [ \"$USES\" -ge 1 ] && echo \"  $NR_NAME: $USES uses OK\" || { echo \"  WARN: $NR_NAME unused\"; DEAD=$((DEAD+1)); }\ndone\n[ \"$DEAD\" -eq 0 ] && echo \"Gate 6 named-range audit OK\" || { echo \"REJECT Gate 6: $DEAD dead-decoration name(s)\"; exit 1; }\n```\n\n### Gate 5b — visual audit via HTML preview (mandatory)\n\nGates 1–4\u002F6 are grep defenses — they cannot see a rendered sheet. Run `officecli view \"$FILE\" html` and Read the returned HTML. Walk every sheet (inherits xlsx v2 visual floor):\n\n- No `###` in any numeric cell (widen column).\n- No truncated labels \u002F section headers (widen column or `alignment.wrapText=true`).\n- No placeholder tokens (`TBD`, `{var}`, `xxxx`) — Gate 6.1 grep below.\n- Balance-check \u002F recon rows say `OK` \u002F `BALANCED` every period column.\n- Dashboard charts render, y-axis = 0 on ARR\u002Frevenue lines, source data matches statement sheet.\n- Sensitivity grid colors read green (upside) → red (downside) — color-scale CF applied.\n- No stale cached `0` on summary KPIs; if present, run cache-refresh pass.\n\nREJECT on any defect. **Human preview:** `officecli watch \"$FILE\"`, or open in Excel \u002F WPS \u002F Numbers — final colors + chart fidelity only fully render in the target viewer.\n\n### Gate 6.1 — token \u002F placeholder sweep\n\n```bash\nLEAK=$(officecli view \"$FILE\" text | grep -niE 'TBD|\\(fill in\\)|xxxx|lorem|\\{\\{|placeholder|coming soon')\n[ -z \"$LEAK\" ] && echo \"Gate 6.1 OK (no placeholder tokens)\" || { echo \"REJECT Gate 6.1:\"; echo \"$LEAK\"; exit 1; }\n```\n\n### Honest limit\n\n`validate` catches schema errors, not finance errors. A model passes `validate` with `BS.Cash` hardcoded to force balance, an `NPV` cached at `0`, a sensitivity grid all-zero because it was built before FCF, a `#NAME?` runtime on a `P&L`-named sheet with unquoted refs. Gates 4 \u002F 5 \u002F 6 \u002F 5b exist because schema-level `validate` cannot catch any of this.\n\n## Known Issues & Pitfalls\n\n→ Base pitfalls (cross-sheet `!` trap, batch JSON dotted-name rule, resident + formula batch deadlock, renderer caveats, `labelRotation` \u002F `pareto` \u002F databar-min-max bugs, `validate` while resident): see xlsx v2 §Known Issues & Pitfalls — all apply.\n\nFinancial-model-specific:\n\n- **AP sign on COGS.** Accounts Payable: if COGS is stored negative on the P&L, AP formula must negate — `=-COGS*DaysPayable\u002F365`. Wrong sign inflates NWC and flips CF direction. Silent; passes `validate`.\n- **`#NAME?` not caught by `query` \u002F `validate`.** A cross-sheet formula referencing `P&L!B3` without quoting the sheet name (because `&` is special) lands at runtime as `#NAME?`. Always write cross-sheet refs as `'P&L'!B3` — single-quote the sheet name if it contains `&`, space, `(`, `)`, etc. Gate 5b visual check is the only detection.\n- **Iterative calc silent non-convergence.** `calc.iterate=true iterateCount=100` converges at whatever the cap lands on — even if the true answer is 2× that. Always run convergence verify (§Circular references). Complex LBO rings (multi-tranche debt + sweep + tax shield) may not converge; when `cachedValue=0` on a ring cell, use §Write-order surgery.\n- **Batch-while-resident deadlock on circular writes.** Writing the closing leg of a cross-sheet ring via `batch` with a resident open deadlocks at 100% CPU. Even single `set` on a ring cell can hang. Fix: close residents, write the ring in two passes per §Write-order surgery. Non-resident single-heredoc is the only safe form.\n- **Cross-sheet cached value stale in `view html`.** Downstream written in the same sequence as upstream caches `0`. Excel resolves on open; HTML preview does NOT. Re-set every downstream non-resident after the chain (§Build-order & cache-drift).\n- **`NPV()` \u002F `XNPV()` cross-sheet caches `0` on v1.0.63.** Rewrite as `SUMPRODUCT(values\u002F(1+rate)^periods)` — algebraically equivalent, caches correctly. Applied by default in Recipe B Step 4.\n- **Sensitivity-grid cache trap.** Grid built before FCF\u002FWACC → every cell caches `0`. Build FCF + WACC + DCF first, then grid in a separate non-resident batch. Fallback: hardcode blue + comment `\"hardcoded sensitivity; refresh on assumption change\"`.\n- **`BS.Cash` = CF ending cash always** (including Y1: `BS.Cash = 'Cash Flow'!B19`). Never an independent plug or Assumptions ref — a plugged `BS.Cash` hides balance errors.\n- **Year 2+ `Opening Cash` = prior period `Ending Cash`** (`C17=B19`, `D17=C19`). Independent Y2+ opening-cash inputs silently drift from BS.\n- **Waterfall chart \"total\" bars.** `chartType=waterfall` cannot mark total programmatically — use `colors=` convention (dark = total, medium = positive, red = negative). See `help xlsx chart`.\n- **DCF per-share when `SharesOut` is a formula.** `=BasicShares + OptionPool × ExerciseAssumption` → add a blue-font assumption cell and point the `SharesOut` named range at the computed cell, not the raw input.\n\n## Help pointer\n\nWhen in doubt: `officecli help xlsx [element] [--json]`. Help is the authoritative schema; this skill is the decision guide for financial-modeling deltas.\n",{"name":5,"description":7},"main","1f321f8966b6741235f35f79c97c0ffdcffb11ba","crates\u002Fbackend\u002Fnomifun-app\u002Fassets\u002Fbuiltin-skills\u002Fofficecli-financial-model","https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu\u002Fgeekclaw","https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu","2026-11-08 16:23:21",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add makeyzhang-cpu\u002Fgeekclaw --skill officecli-financial-model",{"tool":35,"command":36},"bunx","bunx skills add makeyzhang-cpu\u002Fgeekclaw --skill officecli-financial-model",{"tool":38,"command":39},"pnpm","pnpm dlx skills add makeyzhang-cpu\u002Fgeekclaw --skill officecli-financial-model","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu\u002Fgeekclaw\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-app\u002Fassets\u002Fbuiltin-skills\u002Fofficecli-financial-model\u002FSKILL.md",true,[],[44,51,58,65,72,79],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":50,"publishedAt":18},"01M7BYJ19XV75TDGRGXBFJN1T4","drive-geekclaw","Use to connect to and drive a GeekClaw instance from an external agent (Claude Code \u002F Cursor \u002F any MCP client). Drive its browser \u002F computer \u002F knowledge base \u002F files and manage the platform over MCP or REST, with a per-companion access token (you run AS the bound companion). Use this whenever the user asks to control, automate, or hand work off to \"GeekClaw\", \"their GeekClaw\", \"the desktop companion\", or a running GeekClaw server.","https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu\u002Fgeekclaw\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Fdrive-nomifun\u002FSKILL.md",[],[],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M7BYHZBZNHHBX8M87JZ6Y031","example-skill","Fixture skill used by startup_materialize integration tests.","https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu\u002Fgeekclaw\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-extension\u002Ftests\u002Ffixtures\u002Fbuiltin-skills-fixture\u002Fexample-skill\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7BYHWFXC17GE9SXDK1X3GTD","ui-ux-pro-max","Professional UI\u002FUX design research skill with a bundled searchable database for product patterns, visual styles, color palettes, typography, landing-page structure, dashboard charts, UX practices, and stack guidance. Use when designing, building, reviewing, or improving interfaces.","https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu\u002Fgeekclaw\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-app\u002Fassets\u002Fbuiltin-skills\u002Fui-ux-pro-max\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M7BYHR24XK92Z2YYQHK2732Y","planning-with-files","Maintain durable task plans, findings, and progress logs in workspace files for long-running or research-heavy work. Use when a task spans many steps or sessions, needs an auditable evidence trail, or risks losing important decisions to context limits. Do not use for short tasks that fit comfortably in the active conversation.","https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu\u002Fgeekclaw\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-app\u002Fassets\u002Fbuiltin-skills\u002Fplanning-with-files\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7BYHKQ6A4CNTQB0JXRJ5AXX","officecli","Create, analyze, proofread, and modify Office documents (.docx, .xlsx, .pptx) using the officecli CLI tool. Use when the user wants to create, inspect, check formatting, find issues, add charts, or modify Office documents.","https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu\u002Fgeekclaw\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-app\u002Fassets\u002Fbuiltin-skills\u002Fofficecli\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7BYHD30974T2E9FBTJZN3R2","officecli-xlsx","Use this skill any time a .xlsx file is involved -- as input, output, or both. This includes: creating spreadsheets, financial models, dashboards, or trackers; reading, parsing, or extracting data from any .xlsx file; editing, modifying, or updating existing workbooks; working with formulas, charts, pivot tables, or templates; importing CSV\u002FTSV data into Excel format. Trigger whenever the user mentions 'spreadsheet', 'workbook', 'Excel', 'financial model', 'tracker', 'dashboard', or references a .xlsx\u002F.csv filename.","https:\u002F\u002Fgithub.com\u002Fmakeyzhang-cpu\u002Fgeekclaw\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-app\u002Fassets\u002Fbuiltin-skills\u002Fofficecli-xlsx\u002FSKILL.md",[],[]]