superkit-mcp-server 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/ARCHITECTURE.md +102 -102
  2. package/README.md +71 -71
  3. package/SUPERKIT.md +168 -168
  4. package/agents/code-archaeologist.md +106 -106
  5. package/agents/coder.md +90 -90
  6. package/agents/data-engineer.md +28 -28
  7. package/agents/devops-engineer.md +242 -242
  8. package/agents/git-manager.md +203 -203
  9. package/agents/orchestrator.md +420 -420
  10. package/agents/penetration-tester.md +188 -188
  11. package/agents/performance-optimizer.md +187 -187
  12. package/agents/planner.md +270 -270
  13. package/agents/qa-automation-engineer.md +103 -103
  14. package/agents/quant-developer.md +32 -32
  15. package/agents/reviewer.md +100 -100
  16. package/agents/scout.md +222 -222
  17. package/agents/tester.md +274 -274
  18. package/agents/ui-designer.md +208 -208
  19. package/build/__tests__/test_apply_prompt_args.js +104 -0
  20. package/build/index.js +106 -45
  21. package/build/tools/todoTools.js +39 -39
  22. package/build/tools/validators/__tests__/apiSchema.test.js +23 -23
  23. package/build/tools/validators/__tests__/convertRules.test.js +5 -5
  24. package/build/tools/validators/__tests__/frontendDesign.test.js +12 -12
  25. package/build/tools/validators/__tests__/geoChecker.test.js +19 -19
  26. package/build/tools/validators/__tests__/mobileAudit.test.js +12 -12
  27. package/build/tools/validators/__tests__/reactPerformanceChecker.test.js +17 -17
  28. package/build/tools/validators/__tests__/securityScan.test.js +6 -6
  29. package/build/tools/validators/__tests__/seoChecker.test.js +16 -16
  30. package/build/tools/validators/__tests__/typeCoverage.test.js +14 -14
  31. package/commands/README.md +122 -122
  32. package/commands/ask.toml +72 -72
  33. package/commands/brainstorm.toml +119 -119
  34. package/commands/chat.toml +77 -77
  35. package/commands/code-preview.toml +37 -37
  36. package/commands/code.toml +28 -28
  37. package/commands/content.toml +200 -200
  38. package/commands/cook.toml +77 -77
  39. package/commands/copywrite.toml +131 -131
  40. package/commands/db.toml +192 -192
  41. package/commands/debug.toml +166 -166
  42. package/commands/design.toml +158 -158
  43. package/commands/dev-rules.toml +14 -14
  44. package/commands/do.toml +117 -117
  45. package/commands/doc-rules.toml +14 -14
  46. package/commands/docs.toml +148 -148
  47. package/commands/fix.toml +440 -440
  48. package/commands/fullstack.toml +175 -175
  49. package/commands/git.toml +235 -235
  50. package/commands/help.toml +84 -84
  51. package/commands/integrate.toml +127 -127
  52. package/commands/journal.toml +136 -136
  53. package/commands/kit-setup.toml +40 -40
  54. package/commands/mcp.toml +183 -183
  55. package/commands/orchestration.toml +15 -15
  56. package/commands/plan.toml +206 -172
  57. package/commands/pm.toml +148 -148
  58. package/commands/pr.toml +50 -50
  59. package/commands/project.toml +32 -32
  60. package/commands/research.toml +117 -117
  61. package/commands/review-pr.toml +63 -63
  62. package/commands/review.toml +190 -190
  63. package/commands/scout-ext.toml +97 -97
  64. package/commands/scout.toml +79 -79
  65. package/commands/screenshot.toml +65 -65
  66. package/commands/session.toml +102 -102
  67. package/commands/skill.toml +384 -384
  68. package/commands/status.toml +22 -22
  69. package/commands/team.toml +56 -56
  70. package/commands/test.toml +164 -164
  71. package/commands/ticket.toml +70 -70
  72. package/commands/use.toml +106 -106
  73. package/commands/video.toml +83 -83
  74. package/commands/watzup.toml +71 -71
  75. package/commands/workflow.toml +14 -14
  76. package/package.json +35 -35
  77. package/skills/meta/README.md +30 -30
  78. package/skills/meta/api-design/SKILL.md +134 -134
  79. package/skills/meta/code-review/SKILL.md +44 -44
  80. package/skills/meta/code-review/checklists/pre-merge.md +25 -25
  81. package/skills/meta/code-review/workflows/architecture-pass.md +26 -26
  82. package/skills/meta/code-review/workflows/performance-pass.md +27 -27
  83. package/skills/meta/code-review/workflows/security-pass.md +29 -29
  84. package/skills/meta/compound-docs/SKILL.md +133 -133
  85. package/skills/meta/debug/SKILL.md +40 -40
  86. package/skills/meta/debug/templates/bug-report.template.md +31 -31
  87. package/skills/meta/debug/workflows/reproduce-issue.md +20 -20
  88. package/skills/meta/docker/SKILL.md +126 -126
  89. package/skills/meta/examples/supabase/SKILL.md +46 -46
  90. package/skills/meta/examples/supabase/references/best-practices.md +319 -319
  91. package/skills/meta/examples/supabase/references/common-patterns.md +373 -373
  92. package/skills/meta/examples/supabase/templates/migration-template.sql +49 -49
  93. package/skills/meta/examples/supabase/templates/rls-policy-template.sql +77 -77
  94. package/skills/meta/examples/supabase/workflows/debugging.md +260 -260
  95. package/skills/meta/examples/supabase/workflows/migration-workflow.md +211 -211
  96. package/skills/meta/examples/supabase/workflows/rls-policies.md +244 -244
  97. package/skills/meta/examples/supabase/workflows/schema-design.md +321 -321
  98. package/skills/meta/file-todos/SKILL.md +88 -88
  99. package/skills/meta/mobile/SKILL.md +140 -140
  100. package/skills/meta/nextjs/SKILL.md +101 -101
  101. package/skills/meta/performance/SKILL.md +130 -130
  102. package/skills/meta/react-patterns/SKILL.md +83 -83
  103. package/skills/meta/security/SKILL.md +114 -114
  104. package/skills/meta/session-resume/SKILL.md +96 -96
  105. package/skills/meta/tailwind/SKILL.md +139 -139
  106. package/skills/meta/testing/SKILL.md +43 -43
  107. package/skills/meta/testing/references/vitest-patterns.md +45 -45
  108. package/skills/meta/testing/templates/component-test.template.tsx +37 -37
  109. package/skills/tech/alpha-vantage/SKILL.md +142 -142
  110. package/skills/tech/alpha-vantage/references/commodities.md +153 -153
  111. package/skills/tech/alpha-vantage/references/economic-indicators.md +158 -158
  112. package/skills/tech/alpha-vantage/references/forex-crypto.md +154 -154
  113. package/skills/tech/alpha-vantage/references/fundamentals.md +223 -223
  114. package/skills/tech/alpha-vantage/references/intelligence.md +138 -138
  115. package/skills/tech/alpha-vantage/references/options.md +93 -93
  116. package/skills/tech/alpha-vantage/references/technical-indicators.md +374 -374
  117. package/skills/tech/alpha-vantage/references/time-series.md +157 -157
  118. package/skills/tech/financial-modeling/SKILL.md +18 -18
  119. package/skills/tech/financial-modeling/skills/3-statements/SKILL.md +368 -368
  120. package/skills/tech/financial-modeling/skills/3-statements/references/formatting.md +118 -118
  121. package/skills/tech/financial-modeling/skills/3-statements/references/formulas.md +292 -292
  122. package/skills/tech/financial-modeling/skills/3-statements/references/sec-filings.md +125 -125
  123. package/skills/tech/financial-modeling/skills/dcf-model/SKILL.md +1210 -1210
  124. package/skills/tech/financial-modeling/skills/dcf-model/TROUBLESHOOTING.md +40 -40
  125. package/skills/tech/financial-modeling/skills/dcf-model/requirements.txt +8 -8
  126. package/skills/tech/financial-modeling/skills/dcf-model/scripts/validate_dcf.py +292 -292
  127. package/skills/tech/financial-modeling/skills/lbo-model/SKILL.md +236 -236
  128. package/skills/tech/financial-modeling/skills/merger-model/SKILL.md +108 -108
  129. package/skills/workflows/README.md +203 -203
  130. package/skills/workflows/adr.md +174 -174
  131. package/skills/workflows/changelog.md +74 -74
  132. package/skills/workflows/compound.md +323 -323
  133. package/skills/workflows/compound_health.md +74 -74
  134. package/skills/workflows/create-agent-skill.md +138 -138
  135. package/skills/workflows/cycle.md +144 -144
  136. package/skills/workflows/deploy-docs.md +84 -84
  137. package/skills/workflows/development-rules.md +42 -42
  138. package/skills/workflows/doc.md +95 -95
  139. package/skills/workflows/documentation-management.md +34 -34
  140. package/skills/workflows/explore.md +146 -146
  141. package/skills/workflows/generate_command.md +106 -106
  142. package/skills/workflows/heal-skill.md +97 -97
  143. package/skills/workflows/housekeeping.md +229 -229
  144. package/skills/workflows/kit-setup.md +102 -102
  145. package/skills/workflows/map-codebase.md +78 -78
  146. package/skills/workflows/orchestration-protocol.md +43 -43
  147. package/skills/workflows/plan-compound.md +439 -439
  148. package/skills/workflows/plan_review.md +269 -269
  149. package/skills/workflows/primary-workflow.md +37 -37
  150. package/skills/workflows/promote_pattern.md +86 -86
  151. package/skills/workflows/release-docs.md +82 -82
  152. package/skills/workflows/report-bug.md +135 -135
  153. package/skills/workflows/reproduce-bug.md +118 -118
  154. package/skills/workflows/resolve_pr.md +133 -133
  155. package/skills/workflows/resolve_todo.md +128 -128
  156. package/skills/workflows/review-compound.md +376 -376
  157. package/skills/workflows/skill-review.md +127 -127
  158. package/skills/workflows/specs.md +257 -257
  159. package/skills/workflows/triage-sprint.md +102 -102
  160. package/skills/workflows/triage.md +152 -152
  161. package/skills/workflows/work.md +399 -399
  162. package/skills/workflows/xcode-test.md +93 -93
@@ -1,1211 +1,1211 @@
1
- ---
2
- name: dcf-model
3
- description: Real DCF (Discounted Cash Flow) model creation for equity valuation. Retrieves financial data from SEC filings and analyst reports, builds comprehensive cash flow projections with proper WACC calculations, performs sensitivity analysis, and outputs professional Excel models with executive summaries. Use when users need to value a company using DCF methodology, request intrinsic value analysis, or ask for detailed financial modeling with growth projections and terminal value calculations.
4
- ---
5
-
6
- # DCF Model Builder
7
-
8
- ## Overview
9
-
10
- This skill creates institutional-quality DCF models for equity valuation following investment banking standards. Each analysis produces a detailed Excel model (with sensitivity analysis included at the bottom of the DCF sheet).
11
-
12
- ## Tools
13
-
14
- - Default to using all of the information provided by the user and MCP servers available for data sourcing.
15
-
16
- ## Critical Constraints - Read These First
17
-
18
- These constraints apply throughout all DCF model building. Review before starting:
19
-
20
- **Sensitivity Tables:**
21
- - Populate ALL 75 cells (3 tables × 25 cells) with full DCF recalculation formulas
22
- - Use openpyxl loops to write formulas programmatically
23
- - NO placeholder text, NO linear approximations, NO manual steps required
24
- - Each cell must recalculate full DCF for that assumption combination
25
-
26
- **Cell Comments:**
27
- - Add cell comments AS each hardcoded value is created
28
- - Format: "Source: [System/Document], [Date], [Reference], [URL if applicable]"
29
- - Every blue input must have a comment before moving to next section
30
- - Do not defer to end or write "TODO: add source"
31
-
32
- **Model Layout Planning:**
33
- - Define ALL section row positions BEFORE writing any formulas
34
- - Write ALL headers and labels first
35
- - Write ALL section dividers and blank rows second
36
- - THEN write formulas using the locked row positions
37
- - Test formulas immediately after creation
38
-
39
- **Formula Recalculation:**
40
- - Run `python recalc.py model.xlsx 30` before delivery
41
- - Fix ALL errors until status is "success"
42
- - Zero formula errors required (#REF!, #DIV/0!, #VALUE!, etc.)
43
-
44
- **Scenario Blocks:**
45
- - Create separate blocks for Bear/Base/Bull cases
46
- - Show assumptions horizontally across projection years within each block
47
- - Use IF formulas: `=IF($B$6=1,[Bear cell],IF($B$6=2,[Base cell],[Bull cell]))`
48
- - Verify formulas reference correct scenario block cells
49
-
50
- ## DCF Process Workflow
51
-
52
- ### Step 1: Data Retrieval and Validation
53
-
54
- Fetch data from MCP servers, user provided data, and the web.
55
-
56
- **Data Sources Priority:**
57
- 1. **MCP Servers** (if configured) - Structured financial data from providers like Daloopa
58
- 2. **User-Provided Data** - Historical financials from their research
59
- 3. **Web Search/Fetch** - Current prices, beta, debt and cash when needed
60
-
61
- **Validation Checklist:**
62
- - Verify net debt vs net cash (critical for valuation)
63
- - Confirm diluted shares outstanding (check for recent buybacks/issuances)
64
- - Validate historical margins are consistent with business model
65
- - Cross-check revenue growth rates with industry benchmarks
66
- - Verify tax rate is reasonable (typically 21-28%)
67
-
68
- ### Step 2: Historical Analysis (3-5 years)
69
-
70
- Analyze and document:
71
- - **Revenue growth trends**: Calculate CAGR, identify drivers
72
- - **Margin progression**: Track gross margin, EBIT margin, FCF margin
73
- - **Capital intensity**: D&A and CapEx as % of revenue
74
- - **Working capital efficiency**: NWC changes as % of revenue growth
75
- - **Return metrics**: ROIC, ROE trends
76
-
77
- Create summary tables showing:
78
- ```
79
- Historical Metrics (LTM):
80
- Revenue: $X million
81
- Revenue growth: X% CAGR
82
- Gross margin: X%
83
- EBIT margin: X%
84
- D&A % of revenue: X%
85
- CapEx % of revenue: X%
86
- FCF margin: X%
87
- ```
88
-
89
- ### Step 3: Build Revenue Projections
90
-
91
- **Methodology:**
92
- 1. Start with latest actual revenue (LTM or most recent fiscal year)
93
- 2. Apply growth rates for each projection year
94
- 3. Show both dollar amounts AND calculated growth %
95
-
96
- **Growth Rate Framework:**
97
- - Year 1-2: Higher growth reflecting near-term visibility
98
- - Year 3-4: Gradual moderation toward industry average
99
- - Year 5+: Approaching terminal growth rate
100
-
101
- **Formula structure:**
102
- - Revenue(Year N) = Revenue(Year N-1) × (1 + Growth Rate)
103
- - Growth %(Year N) = Revenue(Year N) / Revenue(Year N-1) - 1
104
-
105
- **Three-scenario approach:**
106
- ```
107
- Bear Case: Conservative growth (e.g., 8-12%)
108
- Base Case: Most likely scenario (e.g., 12-16%)
109
- Bull Case: Optimistic growth (e.g., 16-20%)
110
- ```
111
-
112
- ### Step 4: Operating Expense Modeling
113
-
114
- **Fixed/Variable Cost Analysis:**
115
-
116
- Operating expenses should model realistic operating leverage:
117
- - **Sales & Marketing**: Typically 15-40% of revenue depending on business model
118
- - **Research & Development**: Typically 10-30% for technology companies
119
- - **General & Administrative**: Typically 8-15% of revenue, shows leverage as company scales
120
-
121
- **Key principles:**
122
- - ALL percentages based on REVENUE, not gross profit
123
- - Model operating leverage: % should decline as revenue scales
124
- - Maintain separate line items for S&M, R&D, G&A
125
- - Calculate EBIT = Gross Profit - Total OpEx
126
-
127
- **Margin expansion framework:**
128
- ```
129
- Current State → Target State (Year 5)
130
- Gross Margin: X% → Y% (justify based on scale, efficiency)
131
- EBIT Margin: X% → Y% (result of revenue growth + opex leverage)
132
- ```
133
-
134
- ### Step 5: Free Cash Flow Calculation
135
-
136
- **Build FCF in proper sequence:**
137
-
138
- ```
139
- EBIT
140
- (-) Taxes (EBIT × Tax Rate)
141
- = NOPAT (Net Operating Profit After Tax)
142
- (+) D&A (non-cash expense, % of revenue)
143
- (-) CapEx (% of revenue, typically 4-8%)
144
- (-) Δ NWC (change in working capital)
145
- = Unlevered Free Cash Flow
146
- ```
147
-
148
- **Working Capital Modeling:**
149
- - Calculate as % of revenue change (delta revenue)
150
- - Typical range: -2% to +2% of revenue change
151
- - Negative number = source of cash (working capital release)
152
- - Positive number = use of cash (working capital build)
153
-
154
- **Maintenance vs Growth CapEx:**
155
- - Maintenance CapEx: Sustains current operations (~2-3% revenue)
156
- - Growth CapEx: Supports expansion (additional 2-5% revenue)
157
- - Total CapEx should align with company's growth strategy
158
-
159
- ### Step 6: Cost of Capital (WACC) Research
160
-
161
- **CAPM Methodology for Cost of Equity:**
162
-
163
- ```
164
- Cost of Equity = Risk-Free Rate + Beta × Equity Risk Premium
165
-
166
- Where:
167
- - Risk-Free Rate = Current 10-Year Treasury Yield
168
- - Beta = 5-year monthly stock beta vs market index
169
- - Equity Risk Premium = 5.0-6.0% (market standard)
170
- ```
171
-
172
- **Cost of Debt Calculation:**
173
-
174
- ```
175
- After-Tax Cost of Debt = Pre-Tax Cost of Debt × (1 - Tax Rate)
176
-
177
- Determine Pre-Tax Cost of Debt from:
178
- - Credit rating (if available)
179
- - Current yield on company bonds
180
- - Interest expense / Total Debt from financials
181
- ```
182
-
183
- **Capital Structure Weights:**
184
-
185
- ```
186
- Market Value Equity = Current Stock Price × Shares Outstanding
187
- Net Debt = Total Debt - Cash & Equivalents
188
- Enterprise Value = Market Cap + Net Debt
189
-
190
- Equity Weight = Market Cap / Enterprise Value
191
- Debt Weight = Net Debt / Enterprise Value
192
-
193
- WACC = (Cost of Equity × Equity Weight) + (After-Tax Cost of Debt × Debt Weight)
194
- ```
195
-
196
- **Special Cases:**
197
- - **Net Cash Position**: If Cash > Debt, Net Debt is NEGATIVE
198
- - Debt Weight may be negative
199
- - WACC calculation adjusts accordingly
200
- - **No Debt**: WACC = Cost of Equity
201
-
202
- **Typical WACC Ranges:**
203
- - Large Cap, Stable: 7-9%
204
- - Growth Companies: 9-12%
205
- - High Growth/Risk: 12-15%
206
-
207
- ### Step 7: Discount Rate Application (5-10 Year Forecast)
208
-
209
- **Mid-Year Convention:**
210
- - Cash flows assumed to occur mid-year
211
- - Discount Period: 0.5, 1.5, 2.5, 3.5, 4.5, etc.
212
- - Discount Factor = 1 / (1 + WACC)^Period
213
-
214
- **Present Value Calculation:**
215
- ```
216
- For each projection year:
217
- PV of FCF = Unlevered FCF × Discount Factor
218
-
219
- Example (Year 1):
220
- FCF = $1,000
221
- WACC = 10%
222
- Period = 0.5
223
- Discount Factor = 1 / (1.10)^0.5 = 0.9535
224
- PV = $1,000 × 0.9535 = $954
225
- ```
226
-
227
- **Projection Period Selection:**
228
- - **5 years**: Standard for most analyses
229
- - **7-10 years**: High growth companies with longer runway
230
- - **3 years**: Mature, stable businesses
231
-
232
- ### Step 8: Terminal Value Calculation
233
-
234
- **Perpetuity Growth Method (Preferred):**
235
-
236
- ```
237
- Terminal FCF = Final Year FCF × (1 + Terminal Growth Rate)
238
- Terminal Value = Terminal FCF / (WACC - Terminal Growth Rate)
239
-
240
- Critical Constraint: Terminal Growth < WACC (otherwise infinite value)
241
- ```
242
-
243
- **Terminal Growth Rate Selection:**
244
- - Conservative: 2.0-2.5% (GDP growth rate)
245
- - Moderate: 2.5-3.5%
246
- - Aggressive: 3.5-5.0% (only for market leaders)
247
-
248
- **Do not exceed**: Risk-free rate or long-term GDP growth
249
-
250
- **Exit Multiple Method (Alternative):**
251
- ```
252
- Terminal Value = Final Year EBITDA × Exit Multiple
253
-
254
- Where Exit Multiple comes from:
255
- - Industry comparable trading multiples
256
- - Precedent transaction multiples
257
- - Typical range: 8-15x EBITDA
258
- ```
259
-
260
- **Present Value of Terminal Value:**
261
- ```
262
- PV of Terminal Value = Terminal Value / (1 + WACC)^Final Period
263
-
264
- Where Final Period accounts for timing:
265
- 5-year model with mid-year convention: Period = 4.5
266
- ```
267
-
268
- **Terminal Value Sanity Check:**
269
- - Should represent 50-70% of Enterprise Value
270
- - If >75%, model may be over-reliant on terminal assumptions
271
- - If <40%, check if terminal assumptions are too conservative
272
-
273
- ### Step 9: Enterprise to Equity Value Bridge
274
-
275
- **Valuation Summary Structure:**
276
-
277
- ```
278
- (+) Sum of PV of Projected FCFs = $X million
279
- (+) PV of Terminal Value = $Y million
280
- = Enterprise Value = $Z million
281
-
282
- (-) Net Debt [or + Net Cash if negative] = $A million
283
- = Equity Value = $B million
284
-
285
- ÷ Diluted Shares Outstanding = C million shares
286
- = Implied Price per Share = $XX.XX
287
-
288
- Current Stock Price = $YY.YY
289
- Implied Return = (Implied Price / Current Price) - 1 = XX%
290
- ```
291
-
292
- **Critical Adjustments:**
293
- - **Net Debt = Total Debt - Cash & Equivalents**
294
- - If positive: Subtract from EV (reduces equity value)
295
- - If negative (Net Cash): Add to EV (increases equity value)
296
- - **Use Diluted Shares**: Includes options, RSUs, convertible securities
297
- - **Other adjustments** (if applicable):
298
- - Minority interests
299
- - Pension liabilities
300
- - Operating lease obligations
301
-
302
- **Valuation Output Format:**
303
- ```csv
304
- Valuation Component,Amount ($M)
305
- PV Explicit FCFs,X.X
306
- PV Terminal Value,Y.Y
307
- Enterprise Value,Z.Z
308
- (-) Net Debt,A.A
309
- Equity Value,B.B
310
- ,,
311
- Shares Outstanding (M),C.C
312
- Implied Price per Share,$XX.XX
313
- Current Share Price,$YY.YY
314
- Implied Upside/(Downside),+XX%
315
- ```
316
-
317
- ### Step 10: Sensitivity Analysis
318
-
319
- Build **three sensitivity tables** at the bottom of the DCF sheet showing how valuation changes with different assumptions:
320
-
321
- 1. **WACC vs Terminal Growth** - Shows enterprise value sensitivity to discount rate and perpetuity growth
322
- 2. **Revenue Growth vs EBIT Margin** - Shows impact of top-line growth and operating leverage
323
- 3. **Beta vs Risk-Free Rate** - Shows sensitivity to cost of equity components
324
-
325
- **Implementation**: These are simple 2D grids (NOT Excel's "Data Table" feature) with formulas in each cell. Each cell must contain a full DCF recalculation for that specific assumption combination. See Critical Constraints section for detailed requirements on populating all 75 cells programmatically using openpyxl.
326
-
327
- <correct_patterns>
328
-
329
- This section contains all the CORRECT patterns to follow when building DCF models.
330
-
331
- ### Scenario Block Selection Pattern - Follow This Approach
332
-
333
- **Assumptions are organized in separate blocks for each scenario:**
334
-
335
- **CRITICAL STRUCTURE - Three rows per section header:**
336
-
337
- ```csv
338
- BEAR CASE ASSUMPTIONS (section header, merge cells across)
339
- Assumption,FY1,FY2,FY3,FY4,FY5
340
- Revenue Growth (%),12%,10%,9%,8%,7%
341
- EBIT Margin (%),45%,44%,43%,42%,41%
342
-
343
- BASE CASE ASSUMPTIONS (section header, merge cells across)
344
- Assumption,FY1,FY2,FY3,FY4,FY5
345
- Revenue Growth (%),16%,14%,12%,10%,9%
346
- EBIT Margin (%),48%,49%,50%,51%,52%
347
-
348
- BULL CASE ASSUMPTIONS (section header, merge cells across)
349
- Assumption,FY1,FY2,FY3,FY4,FY5
350
- Revenue Growth (%),20%,18%,15%,13%,11%
351
- EBIT Margin (%),50%,51%,52%,53%,54%
352
- ```
353
-
354
- **Each scenario block MUST have a column header row** showing the projection years (FY2025E, FY2026E, etc.) immediately below the section title. Without this, users cannot tell which assumption value corresponds to which year.
355
-
356
- **How to reference assumptions - Create a consolidation column:**
357
- 1. Case selector cell (e.g., B6) contains 1=Bear, 2=Base, or 3=Bull
358
- 2. Create a consolidation column with INDEX or OFFSET formulas to pull from the correct scenario block
359
- 3. Projection formulas reference the consolidation column (clean cell references)
360
- 4. Each scenario block contains full set of DCF assumptions across projection years
361
-
362
- **Recommended consolidation column pattern (using INDEX):**
363
- `=INDEX(B10:D10, 1, $B$6)`
364
-
365
- **NOT this - scattered IF statements throughout:**
366
- `=IF($B$6=1,[Bear block cell],IF($B$6=2,[Base block cell],[Bull block cell]))`
367
-
368
- The consolidation column approach centralizes logic and makes the model easier to audit.
369
-
370
- ### Correct Revenue Projection Pattern
371
-
372
- **Create a consolidation column with INDEX formulas, then reference it in projections:**
373
-
374
- **Step 1 - Consolidation column for FY1 growth:**
375
- `=INDEX([Bear FY1 growth]:[Bull FY1 growth], 1, $B$6)`
376
-
377
- **Step 2 - Revenue projection references the consolidation column:**
378
- `Revenue Year 1: =D29*(1+$E$10)`
379
-
380
- Where:
381
- - D29 = Prior year revenue
382
- - $E$10 = Consolidation column cell for FY1 growth (contains INDEX formula)
383
- - $B$6 = Case selector (1=Bear, 2=Base, 3=Bull)
384
-
385
- **This approach is cleaner than embedding IF statements in every projection formula** and makes it much easier to audit which scenario assumptions are being used.
386
-
387
- ### Correct FCF Formula Pattern
388
-
389
- **Use consolidation columns with INDEX formulas, then reference them in FCF calculations:**
390
-
391
- **Consolidation column approach:**
392
- ```csv
393
- Item,Formula,Reference
394
- D&A,=E29*$E$21,$E$21 = consolidation column for D&A %
395
- CapEx,=E29*$E$22,$E$22 = consolidation column for CapEx %
396
- Δ NWC,=(E29-D29)*$E$23,$E$23 = consolidation column for NWC %
397
- Unlevered FCF,=E57+E58-E60-E62,E57=NOPAT E58=D&A E60=CapEx E62=Δ NWC
398
- ```
399
-
400
- **Each consolidation column cell contains an INDEX formula** that pulls from the appropriate scenario block based on case selector. This keeps projection formulas clean and auditable.
401
-
402
- Before writing formulas, confirm scenario block row locations and set up consolidation columns.
403
-
404
- ### Correct Cell Comment Format
405
-
406
- **Every hardcoded value needs this format:**
407
-
408
- "Source: [System/Document], [Date], [Reference], [URL if applicable]"
409
-
410
- **Examples:**
411
- ```csv
412
- Item,Source Comment
413
- Stock price,Source: Market data script 2025-10-12 Close price
414
- Shares outstanding,Source: 10-K FY2024 Page 45 Note 12
415
- Historical revenue,Source: 10-K FY2024 Page 32 Consolidated Statements
416
- Beta,Source: Market data script 2025-10-12 5-year monthly beta
417
- Consensus estimates,Source: Management guidance Q3 2024 earnings call
418
- ```
419
-
420
- ### Correct Assumption Table Structure
421
-
422
- **CRITICAL: Each scenario block requires THREE structural elements:**
423
-
424
- 1. **Section header row** (merged cells): e.g., "BEAR CASE ASSUMPTIONS"
425
- 2. **Column header row** showing years - THIS IS REQUIRED, DO NOT SKIP
426
- 3. **Data rows** with assumption values
427
-
428
- **Structure:**
429
- ```csv
430
- BEAR CASE ASSUMPTIONS (section header - merge across columns A:G)
431
- Assumption,FY1,FY2,FY3,FY4,FY5
432
- Revenue Growth (%),X%,X%,X%,X%,X%
433
- EBIT Margin (%),X%,X%,X%,X%,X%
434
- Terminal Growth,X%,,,,
435
- WACC,X%,,,,
436
-
437
- BASE CASE ASSUMPTIONS (section header - merge across columns A:G)
438
- Assumption,FY1,FY2,FY3,FY4,FY5
439
- Revenue Growth (%),X%,X%,X%,X%,X%
440
- EBIT Margin (%),X%,X%,X%,X%,X%
441
- Terminal Growth,X%,,,,
442
- WACC,X%,,,,
443
-
444
- BULL CASE ASSUMPTIONS (section header - merge across columns A:G)
445
- Assumption,FY1,FY2,FY3,FY4,FY5
446
- Revenue Growth (%),X%,X%,X%,X%,X%
447
- EBIT Margin (%),X%,X%,X%,X%,X%
448
- Terminal Growth,X%,,,,
449
- WACC,X%,,,,
450
- ```
451
-
452
- **WITHOUT the column header row showing projection years (FY2025E, FY2026E, etc.), users cannot tell which assumption value corresponds to which year. This row is MANDATORY.**
453
-
454
- **Then create a consolidation column** (typically the next column to the right) that uses INDEX formulas to pull from the selected scenario block based on the case selector. This consolidation column is what your projection formulas reference.
455
-
456
- ### Correct Row Planning Process
457
-
458
- **1. Write ALL headers and labels FIRST:**
459
- ```csv
460
- Row,Content
461
- 1,[Company Name] DCF Model
462
- 2,Ticker | Date | Year End
463
- 4,Case Selector
464
- 7,KEY ASSUMPTIONS
465
- 26,Assumption headers
466
- 27-31,Growth assumptions
467
- ...,...
468
- ```
469
-
470
- **2. Write ALL section dividers and blank rows**
471
-
472
- **3. THEN write formulas using the locked row positions**
473
-
474
- **4. Test formulas immediately after creation**
475
-
476
- **Think of it like construction:**
477
- - Good: Pour foundation, then build walls (stable structure)
478
- - Bad: Build walls, then pour foundation (walls collapse)
479
-
480
- **Excel version:**
481
- - Good: Add headers, then write formulas (formulas stable)
482
- - Bad: Write formulas, then add headers (formulas break)
483
-
484
- ### Correct Sensitivity Table Implementation
485
-
486
- **IMPORTANT**: These are NOT Excel's "Data Table" feature. These are simple grids where you write regular formulas using openpyxl. Yes, this means ~75 formulas total (3 tables × 25 cells each), but this is straightforward and required.
487
-
488
- **Programmatic Population with Formulas:**
489
-
490
- Each sensitivity table must be fully populated with formulas that recalculate the implied share price for each combination of assumptions. **Do not use Excel's Data Table feature** (it requires manual intervention and cannot be automated via openpyxl).
491
-
492
- **Implementation approach - CONCRETE EXAMPLE:**
493
-
494
- **Table Structure (5x5 grid):**
495
- ```csv
496
- WACC vs Terminal Growth,2.0%,2.5%,3.0%,3.5%,4.0%
497
- 8.0%,[B88 formula],[C88 formula],[D88 formula],[E88 formula],[F88 formula]
498
- 9.0%,[B89 formula],[C89 formula],[D89 formula],[E89 formula],[F89 formula]
499
- ...,...,...,...,...,...
500
- ```
501
-
502
- **Formula Pattern - Cell B88 (WACC=8.0%, Terminal Growth=2.0%):**
503
-
504
- The formula in B88 should recalculate the implied price using:
505
- - WACC from row header: `$A88` (8.0%)
506
- - Terminal Growth from column header: `B$87` (2.0%)
507
-
508
- **Recommended approach:** Reference the main DCF calculation but substitute these values.
509
-
510
- **Example formula structure:**
511
- `=([SUM of PV FCFs using $A88 as discount rate] + [Terminal Value using B$87 as growth rate and $A88 as WACC] - [Net Debt]) / [Shares]`
512
-
513
- **CRITICAL - Write a formula for EVERY cell in the 5x5 grid (25 cells per table, 75 cells total).** Use openpyxl to write these formulas programmatically in a loop. Do NOT skip this step or leave placeholder text.
514
-
515
- **Python implementation pattern:**
516
- ```python
517
- # Pseudocode for populating sensitivity table
518
- for row_idx, wacc_value in enumerate(wacc_range):
519
- for col_idx, term_growth_value in enumerate(term_growth_range):
520
- # Build formula that uses wacc_value and term_growth_value
521
- formula = f"=<DCF recalc using {wacc_value} and {term_growth_value}>"
522
- ws.cell(row=start_row+row_idx, column=start_col+col_idx).value = formula
523
- ```
524
-
525
- **The sensitivity tables must work immediately when the model is opened, with no manual steps required from the user.**
526
-
527
- </correct_patterns>
528
-
529
- <common_mistakes>
530
-
531
- This section contains all the WRONG patterns to avoid when building DCF models.
532
-
533
- ### WRONG: Simplified Sensitivity Table Approximations or Placeholder Text
534
-
535
- **Don't use linear approximations:**
536
-
537
- ```
538
- // WRONG - Linear approximation
539
- B97: =B88*(1+(0.096-0.116)) // Assumes linear relationship
540
-
541
- // WRONG - Division shortcut
542
- B105: =B88/(1+(E48-0.07)) // Doesn't recalculate full DCF
543
- ```
544
-
545
- **Don't leave placeholder text:**
546
- ```
547
- // WRONG - Placeholder note
548
- "Note: Use Excel Data Table feature (Data → What-If Analysis → Data Table) to populate sensitivity tables."
549
-
550
- // WRONG - Empty cells
551
- [leaving cells blank because "this is complex"]
552
- ```
553
-
554
- **Don't confuse terminology:**
555
- - ❌ "Sensitivity tables need Excel's Data Table feature" (NO - that's a specific Excel tool we can't use)
556
- - ✅ "Sensitivity tables are simple grids with formulas in each cell" (YES - this is what we build)
557
-
558
- **Why these shortcuts are wrong:**
559
- - Linear approximation formulas don't actually recalculate the DCF - they just apply simple math adjustments
560
- - The relationships are not linear, so the results will be inaccurate
561
- - Placeholder text requires manual user intervention
562
- - Model is not immediately usable when delivered
563
- - Not professional or client-ready
564
- - Empty cells = incomplete deliverable
565
-
566
- **Common rationalization to REJECT:**
567
- "Writing 75+ formulas feels complex, so I'll leave a note for the user to complete it manually."
568
-
569
- **Reality:** Writing 75 formulas is straightforward when you use a loop in Python with openpyxl. Each formula follows the same pattern - just substitute the row/column values. This is a required part of the deliverable.
570
-
571
- **Instead:** Populate every sensitivity cell with formulas that recalculate the full DCF for that specific combination of assumptions
572
-
573
- ### WRONG: Missing Cell Comments
574
-
575
- **Don't do this:**
576
- - Create all hardcoded inputs without comments
577
- - Think "I'll add them later"
578
- - Write "TODO: add source"
579
- - Leave blue inputs without documentation
580
-
581
- **Why it's wrong:**
582
- - Can't verify where data came from
583
- - Fails xlsx skill requirements
584
- - Not audit-ready
585
- - Wastes time fixing later
586
-
587
- **Instead:** Add cell comment AS EACH hardcoded value is created
588
-
589
- ### WRONG: Formula Row References Off
590
-
591
- **Symptom:**
592
- The FCF section references wrong assumption rows:
593
- `D&A: =E29*$E$34 // Should be $E$21, but referencing wrong row`
594
- `CapEx: =E29*$E$41 // Should be $E$22, but row shifted`
595
-
596
- **Why this happens:**
597
- 1. Formulas written first
598
- 2. Then headers inserted
599
- 3. All row references shifted
600
- 4. Now formulas point to wrong cells → #REF! errors
601
-
602
- **Instead:** Lock row layout FIRST, then write formulas
603
-
604
- ### WRONG: Single Row for Each Assumption Across Scenarios
605
-
606
- **Don't structure assumptions like this:**
607
- ```csv
608
- Assumption,Bear,Base,Bull
609
- Revenue Growth FY1,10%,13%,16%
610
- Revenue Growth FY2,9%,12%,15%
611
- ```
612
- This vertical layout makes it hard to see the progression across years within each scenario.
613
-
614
- **Why it's wrong:**
615
- - Makes it difficult to see assumptions evolving across years within each scenario
616
- - Harder to compare scenario assumptions across full projection period
617
- - Less intuitive for reviewing scenario logic
618
-
619
- **Instead:**
620
- - Create separate blocks for each scenario (Bear, Base, Bull)
621
- - Within each block, show assumptions horizontally across projection years
622
- - This makes each scenario's assumptions easier to review as a cohesive set
623
-
624
- ### WRONG: No Borders
625
-
626
- **Don't deliver a model without borders:**
627
- - No section delineation
628
- - All cells blend together
629
- - Hard to read and unprofessional
630
-
631
- **Why it's wrong:**
632
- - Not client-ready
633
- - Difficult to navigate
634
- - Looks amateur
635
-
636
- **Instead:** Add borders around all major sections
637
-
638
- ### WRONG: Wrong Font Colors or No Font Color Distinction
639
-
640
- **Don't do this:**
641
- - All text is black
642
- - Only use fill colors (no font color changes)
643
- - Mix up which cells are blue vs black
644
-
645
- **Why it's wrong:**
646
- - Can't distinguish inputs from formulas
647
- - Auditing becomes impossible
648
- - Violates xlsx skill requirements
649
-
650
- **Instead:** Blue text for ALL hardcoded inputs, black text for ALL formulas, green for sheet links
651
-
652
- ### WRONG: Operating Expenses Based on Gross Profit
653
-
654
- **Don't do this:**
655
- `S&M: =E33*0.15 // E33 = Gross Profit (WRONG)`
656
-
657
- **Why it's wrong:**
658
- - Operating expenses scale with revenue, not gross profit
659
- - Produces unrealistic margin progression
660
- - Not how businesses actually operate
661
-
662
- **Instead:**
663
- `S&M: =E29*0.15 // E29 = Revenue (CORRECT)`
664
-
665
- ### TOP 5 ERRORS SUMMARY
666
-
667
- 1. **Formula row references off** → Define ALL row positions BEFORE writing formulas
668
- 2. **Missing cell comments** → Add comments AS cells are created, not at end
669
- 3. **Simplified sensitivity tables** → Populate all cells with full DCF recalc formulas, not approximations
670
- 4. **Scenario block references wrong** → Ensure IF formulas pull from correct Bear/Base/Bull blocks
671
- 5. **No borders** → Add professional section borders for client-ready appearance
672
-
673
- In addition, be aware of these errors:
674
-
675
- ### WACC Calculation Errors
676
- - Mixing book and market values in capital structure
677
- - Using equity beta instead of asset/unlevered beta incorrectly
678
- - Wrong tax rate application to cost of debt
679
- - Incorrect risk-free rate (must use current 10Y Treasury)
680
- - Failure to adjust for net debt vs net cash position
681
-
682
- ### Growth Assumption Flaws
683
- - Terminal growth > WACC (creates infinite value)
684
- - Projection growth rates inconsistent with historical performance
685
- - Ignoring industry growth constraints
686
- - Revenue growth not aligned with unit economics
687
- - Margin expansion without operational justification
688
-
689
- ### Terminal Value Mistakes
690
- - Using wrong growth method (perpetuity vs exit multiple)
691
- - Terminal value >80% of enterprise value (suggests over-reliance)
692
- - Inconsistent terminal margins with steady state assumptions
693
- - Wrong discount period for terminal value
694
-
695
- ### Cash Flow Projection Errors
696
- - Operating expenses based on gross profit instead of revenue
697
- - D&A/CapEx percentages misaligned with business model
698
- - Working capital changes not properly calculated
699
- - Tax rate inconsistency between years
700
- - NOPAT calculation errors
701
-
702
- **These errors are the most common. Re-read this section before starting any DCF build.**
703
-
704
- </common_mistakes>
705
-
706
- ## Excel File Creation
707
-
708
- **This skill uses the `xlsx` skill for all spreadsheet operations.** The xlsx skill provides:
709
- - Standardized formula construction rules
710
- - Number formatting conventions
711
- - Automated formula recalculation via `recalc.py` script
712
- - Comprehensive error checking and validation
713
-
714
- All Excel files created by this skill must follow xlsx skill requirements, including zero formula errors and proper recalculation.
715
-
716
- ## Quality Rubric
717
-
718
- Every DCF model must maximize for:
719
- 1. **Realistic revenue and margin assumptions** based on historical performance
720
- 2. **Appropriate cost of capital calculation** with proper CAPM methodology
721
- 3. **Comprehensive sensitivity analysis** showing valuation ranges
722
- 4. **Clear terminal value calculation** with supporting rationale
723
- 5. **Professional model structure** enabling scenario analysis
724
- 6. **Transparent documentation** of all key assumptions
725
-
726
- ## Input Requirements
727
-
728
- ### Minimum Required Inputs
729
- 1. **Company identifier**: Ticker symbol or company name
730
- 2. **Growth assumptions**: Revenue growth rates for projection period (or "use consensus")
731
- 3. **Optional parameters**:
732
- - Projection period (default: 5 years)
733
- - Scenario cases (Bear/Base/Bull growth and margin assumptions)
734
- - Terminal growth rate (default: 2.5-3.0%)
735
- - Specific WACC inputs if not using CAPM
736
-
737
- ## Excel Model Structure
738
-
739
- ### Sheet Architecture
740
-
741
- Create **two sheets**:
742
-
743
- 1. **DCF** - Main valuation model with sensitivity analysis at bottom
744
- 2. **WACC** - Cost of capital calculation
745
-
746
- **CRITICAL**: Sensitivity tables go at the BOTTOM of the DCF sheet (not on a separate sheet). This keeps all valuation outputs together.
747
-
748
- ### Formula Recalculation (MANDATORY)
749
-
750
- After creating or modifying the Excel model, **recalculate all formulas** using the recalc.py script from the xlsx skill:
751
-
752
- ```bash
753
- python recalc.py [path_to_excel_file] [timeout_seconds]
754
- ```
755
-
756
- Example:
757
- ```bash
758
- python recalc.py AAPL_DCF_Model_2025-10-12.xlsx 30
759
- ```
760
-
761
- The script will:
762
- - Recalculate all formulas in all sheets using LibreOffice
763
- - Scan ALL cells for Excel errors (#REF!, #DIV/0!, #VALUE!, #NAME?, #NULL!, #NUM!, #N/A)
764
- - Return detailed JSON with error locations and counts
765
-
766
- **Expected output format:**
767
- ```json
768
- {
769
- "status": "success", // or "errors_found"
770
- "total_errors": 0, // Total error count
771
- "total_formulas": 42, // Number of formulas in file
772
- "error_summary": {} // Only present if errors found
773
- }
774
- ```
775
-
776
- **If errors are found**, the output will include details:
777
- ```json
778
- {
779
- "status": "errors_found",
780
- "total_errors": 2,
781
- "total_formulas": 42,
782
- "error_summary": {
783
- "#REF!": {
784
- "count": 2,
785
- "locations": ["DCF!B25", "DCF!C25"]
786
- }
787
- }
788
- }
789
- ```
790
-
791
- **Fix all errors** and re-run recalc.py until status is "success" before delivering the model.
792
-
793
- ### Formatting Standards
794
-
795
- **IMPORTANT**: Follow the xlsx skill for formula construction rules and number formatting conventions. The DCF skill adds specific visual presentation standards.
796
-
797
- **Color Scheme - Two Layers**:
798
-
799
- **Layer 1: Font Colors (MANDATORY from xlsx skill)**
800
- - **Blue text (RGB: 0,0,255)**: ALL hardcoded inputs (stock price, shares, historical data, assumptions)
801
- - **Black text (RGB: 0,0,0)**: ALL formulas and calculations
802
- - **Green text (RGB: 0,128,0)**: Links to other sheets (WACC sheet references)
803
-
804
- **Layer 2: Fill Colors (Optional for enhanced presentation)**
805
- - Fill colors are optional and should only be applied if requested by the user or if enhancing presentation
806
- - If the user requests colors or professional formatting, use this standard scheme:
807
- - **Section headers**: Dark blue (RGB: 68,114,196) background with white text
808
- - **Sub-headers/column headers**: Light blue (RGB: 217,225,242) background with black text
809
- - **Input cells**: Light green/cream (RGB: 226,239,218) background with blue text
810
- - **Calculated cells**: White background with black text
811
- - Users can override with custom brand colors if specified
812
-
813
- **How the layers work together (if fill colors are used):**
814
- - Input cell: Blue text + light green fill = "Hardcoded input"
815
- - Formula cell: Black text + white background = "Calculated value"
816
- - Sheet link: Green text + white background = "Reference from WACC sheet"
817
-
818
- **Font color tells you WHAT it is. Fill color tells you WHERE it is (if used).**
819
-
820
- **IMPORTANT:** Font colors from xlsx skill are mandatory. Fill colors are optional - default is white/no fill unless the user requests enhanced formatting or colors.
821
-
822
- ### Border Standards (REQUIRED for Professional Appearance)
823
-
824
- **Thick borders** (1.5pt) around major sections:
825
- - KEY INPUTS section
826
- - PROJECTION ASSUMPTIONS section
827
- - 5-YEAR CASH FLOW PROJECTION section
828
- - TERMINAL VALUE section
829
- - VALUATION SUMMARY section
830
- - Each SENSITIVITY ANALYSIS table
831
-
832
- **Medium borders** (1pt) between sub-sections:
833
- - Company Details vs Historical Performance
834
- - Growth Assumptions vs EBIT Margin vs FCF Parameters
835
-
836
- **Thin borders** (0.5pt) around data tables:
837
- - Scenario assumption tables (Bear | Base | Bull | Selected)
838
- - Historical vs projected financials matrix
839
-
840
- **No borders:** Individual cells within tables (keep clean, scannable)
841
-
842
- **Borders are mandatory** - models without professional borders are not client-ready.
843
-
844
- **Number Formats** (follows xlsx skill standards):
845
- - **Years**: Format as text strings (e.g., "2024" not "2,024")
846
- - **Percentages**: `0.0%` (one decimal place)
847
- - **Currency**: `$#,##0` for millions; `$#,##0.00` for per-share - ALWAYS specify units in headers ("Revenue ($mm)")
848
- - **Zeros**: Use number formatting to make all zeros "-" (e.g., `$#,##0;($#,##0);-`)
849
- - **Large numbers**: `#,##0` with thousands separator
850
- - **Negative numbers**: `(#,##0)` in parentheses (NOT minus sign)
851
-
852
- **Cell Comments (MANDATORY for all hardcoded inputs)**:
853
-
854
- Per the xlsx skill, ALL hardcoded values must have cell comments documenting the source. Format: "Source: [System/Document], [Date], [Reference], [URL if applicable]"
855
-
856
- **CRITICAL**: Add comments AS CELLS ARE CREATED. Do not defer to the end.
857
-
858
- ### DCF Sheet Detailed Structure
859
-
860
- **Section 1: Header**
861
- ```csv
862
- Row,Content
863
- 1,[Company Name] DCF Model
864
- 2,Ticker: [XXX] | Date: [Date] | Year End: [FYE]
865
- 3,Blank
866
- 4,Case Selector Cell (1=Bear 2=Base 3=Bull)
867
- 5,Case Name Display (formula: =IF([Selector]=1"Bear"IF([Selector]=2"Base""Bull")))
868
- ```
869
-
870
- **Section 2: Market Data (NOT case dependent)**
871
- ```csv
872
- Item,Value
873
- Current Stock Price,$XX.XX
874
- Shares Outstanding (M),XX.X
875
- Market Cap ($M),[Formula]
876
- Net Debt ($M),XXX [or Net Cash if negative]
877
- ```
878
-
879
- **Section 3: DCF Scenario Assumptions**
880
-
881
- Create separate assumption blocks for each scenario (Bear, Base, Bull) with DCF-specific assumptions (Revenue Growth %, EBIT Margin %, Tax Rate %, D&A % of Revenue, CapEx % of Revenue, NWC Change % of ΔRev, Terminal Growth Rate, WACC) laid out horizontally across projection years. Each block must include section header, column header row showing the projection years (FY1, FY2, etc.), and data rows. See `<correct_patterns>` section "Correct Assumption Table Structure" for the exact layout.
882
-
883
- **Section 4: Historical & Projected Financials**
884
-
885
- **Reference a consolidation column (e.g., "Selected Case") that pulls from scenario blocks**, not scattered IF formulas in every projection row.
886
-
887
- ```csv
888
- Income Statement ($M),2020A,2021A,2022A,2023A,2024E,2025E,2026E
889
- Revenue,XXX,XXX,XXX,XXX,[=E29*(1+$E$10)],[=F29*(1+$E$11)],[=G29*(1+$E$12)]
890
- % growth,XX%,XX%,XX%,XX%,[=E29/D29-1],[=F29/E29-1],[=G29/F29-1]
891
- ,,,,,,
892
- Gross Profit,XXX,XXX,XXX,XXX,[=E29*E33],[=F29*F33],[=G29*G33]
893
- % margin,XX%,XX%,XX%,XX%,[=E33/E29],[=F33/F29],[=G33/G29]
894
- ,,,,,,
895
- Operating Expenses:,,,,,,,
896
- S&M,XXX,XXX,XXX,XXX,[=E29*0.15],[=F29*0.14],[=G29*0.13]
897
- R&D,XXX,XXX,XXX,XXX,[=E29*0.12],[=F29*0.11],[=G29*0.10]
898
- G&A,XXX,XXX,XXX,XXX,[=E29*0.08],[=F29*0.07],[=G29*0.07]
899
- Total OpEx,XXX,XXX,XXX,XXX,[=E36+E37+E38],[=F36+F37+F38],[=G36+G37+G38]
900
- ,,,,,,
901
- EBIT,XXX,XXX,XXX,XXX,[=E33-E39],[=F33-F39],[=G33-G39]
902
- % margin,XX%,XX%,XX%,XX%,[=E41/E29],[=F41/F29],[=G41/G29]
903
- ,,,,,,
904
- Taxes,(XX),(XX),(XX),(XX),[=E41*$E$24],[=F41*$E$24],[=G41*$E$24]
905
- Tax rate,XX%,XX%,XX%,XX%,[=E43/E41],[=F43/F41],[=G43/G41]
906
- ,,,,,,
907
- NOPAT,XXX,XXX,XXX,XXX,[=E41-E43],[=F41-F43],[=G41-G43]
908
- ```
909
-
910
- **Key Formula Pattern**:
911
- - Revenue growth: `=E29*(1+$E$10)` where $E$10 is consolidation column for Year 1 growth
912
- - NOT: `=E29*(1+IF($B$6=1,$B$10,IF($B$6=2,$C$10,$D$10)))`
913
-
914
- This approach is cleaner, easier to audit, and prevents formula errors by centralizing the scenario logic.
915
-
916
- **Section 5: Free Cash Flow Build**
917
-
918
- **CRITICAL**: Verify row references point to the CORRECT assumption rows. Test formulas immediately after creation.
919
-
920
- ```csv
921
- Cash Flow ($M),2020A,2021A,2022A,2023A,2024E,2025E,2026E
922
- NOPAT,XXX,XXX,XXX,XXX,[=E45],[=F45],[=G45]
923
- (+) D&A,XXX,XXX,XXX,XXX,[=E29*$E$21],[=F29*$E$21],[=G29*$E$21]
924
- % of Rev,XX%,XX%,XX%,XX%,[=E58/E29],[=F58/F29],[=G58/G29]
925
- (-) CapEx,(XX),(XX),(XX),(XX),[=E29*$E$22],[=F29*$E$22],[=G29*$E$22]
926
- % of Rev,XX%,XX%,XX%,XX%,[=E60/E29],[=F60/F29],[=G60/G29]
927
- (-) Δ NWC,(XX),(XX),(XX),(XX),[=(E29-D29)*$E$23],[=(F29-E29)*$E$23],[=(G29-F29)*$E$23]
928
- % of Δ Rev,XX%,XX%,XX%,XX%,[=E62/(E29-D29)],[=F62/(F29-E29)],[=G62/(G29-F29)]
929
- ,,,,,,
930
- Unlevered FCF,XXX,XXX,XXX,XXX,[=E57+E58-E60-E62],[=F57+F58-F60-F62],[=G57+G58-G60-G62]
931
- ```
932
-
933
- **Row reference examples** (based on layout planning):
934
- - $E$21 = D&A % assumption (consolidation column, row 21)
935
- - $E$22 = CapEx % assumption (consolidation column, row 22)
936
- - $E$23 = NWC % assumption (consolidation column, row 23)
937
- - E29 = Revenue for year (row 29)
938
- - E45 = NOPAT for year (row 45)
939
-
940
- **Before writing formulas**: Confirm these row numbers match the actual layout. Test one column, then copy across.
941
-
942
- **Section 6: Discounting & Valuation**
943
- ```csv
944
- DCF Valuation,2024E,2025E,2026E,2027E,2028E,Terminal
945
- Unlevered FCF ($M),XXX,XXX,XXX,XXX,XXX,
946
- Period,0.5,1.5,2.5,3.5,4.5,
947
- Discount Factor,0.XX,0.XX,0.XX,0.XX,0.XX,
948
- PV of FCF ($M),XXX,XXX,XXX,XXX,XXX,
949
- ,,,,,,
950
- Terminal FCF ($M),,,,,,,XXX
951
- Terminal Value ($M),,,,,,,XXX
952
- PV Terminal Value ($M),,,,,,,XXX
953
- ,,,,,,
954
- Valuation Summary ($M),,,,,,
955
- Sum of PV FCFs,XXX,,,,,
956
- PV Terminal Value,XXX,,,,,
957
- Enterprise Value,XXX,,,,,
958
- (-) Net Debt,(XX),,,,,
959
- Equity Value,XXX,,,,,
960
- ,,,,,,
961
- Shares Outstanding (M),XX.X,,,,,
962
- IMPLIED PRICE PER SHARE,$XX.XX,,,,,
963
- Current Stock Price,$XX.XX,,,,,
964
- Implied Upside/(Downside),XX%,,,,,
965
- ```
966
-
967
- ### WACC Sheet Structure
968
-
969
- ```csv
970
- COST OF EQUITY CALCULATION,,
971
- Risk-Free Rate (10Y Treasury),X.XX%,[Yellow input]
972
- Beta (5Y monthly),X.XX,[Yellow input]
973
- Equity Risk Premium,X.XX%,[Yellow input]
974
- Cost of Equity,X.XX%,[Calculated blue]
975
- ,,
976
- COST OF DEBT CALCULATION,,
977
- Credit Rating,AA-,[Yellow input]
978
- Pre-Tax Cost of Debt,X.XX%,[Yellow input]
979
- Tax Rate,XX.X%,[Link to DCF sheet]
980
- After-Tax Cost of Debt,X.XX%,[Calculated blue]
981
- ,,
982
- CAPITAL STRUCTURE,,
983
- Current Stock Price,$XX.XX,[Link to DCF]
984
- Shares Outstanding (M),XX.X,[Link to DCF]
985
- Market Capitalization ($M),"X,XXX",[Calculated]
986
- ,,
987
- Total Debt ($M),XXX,[Yellow input]
988
- Cash & Equivalents ($M),XXX,[Yellow input]
989
- Net Debt ($M),XXX,[Calculated]
990
- ,,
991
- Enterprise Value ($M),"X,XXX",[Calculated]
992
- ,,
993
- WACC CALCULATION,Weight,Cost,Contribution
994
- Equity,XX.X%,X.X%,X.XX%
995
- Debt,XX.X%,X.X%,X.XX%
996
- ,,
997
- WEIGHTED AVERAGE COST OF CAPITAL,X.XX%,[Green output]
998
- ```
999
-
1000
- **Key WACC Formulas:**
1001
- ```
1002
- Market Cap = Price × Shares
1003
- Net Debt = Total Debt - Cash
1004
- Enterprise Value = Market Cap + Net Debt
1005
- Equity Weight = Market Cap / EV
1006
- Debt Weight = Net Debt / EV
1007
- WACC = (Cost of Equity × Equity Weight) + (After-tax Cost of Debt × Debt Weight)
1008
- ```
1009
-
1010
- ### Sensitivity Analysis (Bottom of DCF Sheet)
1011
-
1012
- **TERMINOLOGY REMINDER**: "Sensitivity tables" = simple 2D grids with row headers, column headers, and formulas in each data cell. NOT Excel's "Data Table" feature (Data → What-If Analysis → Data Table). You will use openpyxl to write regular Excel formulas into each cell.
1013
-
1014
- **Location**: Rows 87+ on DCF sheet (NOT a separate sheet)
1015
-
1016
- **Three sensitivity tables, vertically stacked:**
1017
-
1018
- 1. **WACC vs Terminal Growth** (rows 87-100) - 5x5 grid = 25 cells with formulas
1019
- 2. **Revenue Growth vs EBIT Margin** (rows 102-115) - 5x5 grid = 25 cells with formulas
1020
- 3. **Beta vs Risk-Free Rate** (rows 117-130) - 5x5 grid = 25 cells with formulas
1021
-
1022
- **Total formulas to write: 75** (this is required, not optional)
1023
-
1024
- **CRITICAL**: All sensitivity table cells must be populated programmatically with formulas using openpyxl. DO NOT use linear approximation shortcuts. DO NOT leave placeholder text or notes about manual steps. DO NOT rationalize leaving cells empty because "it's complex" - use a Python loop to generate the formulas.
1025
-
1026
- **Table Setup:**
1027
- 1. Create table structure with row/column headers (the assumption values to test)
1028
- 2. Populate EVERY data cell with a formula that:
1029
- - Uses the row header value (e.g., WACC = 9.0%)
1030
- - Uses the column header value (e.g., Terminal Growth = 3.0%)
1031
- - Recalculates the full DCF with those specific assumptions
1032
- - Returns the implied share price for that scenario
1033
- 3. All cells must contain working formulas when delivered
1034
- 4. Format cells with conditional formatting: Green scale for higher values, red scale for lower values
1035
- 5. Bold the base case cell
1036
- 6. Leave 1-2 blank rows between tables
1037
-
1038
- **No manual intervention required** - the sensitivity tables must be fully functional when the user opens the file.
1039
-
1040
- ## Case Selector Implementation
1041
-
1042
- **Three-Case Framework:**
1043
-
1044
- ### Bear Case
1045
- - Conservative revenue growth (low end of historical range)
1046
- - Margin compression or no expansion
1047
- - Higher WACC (risk premium increase)
1048
- - Lower terminal growth rate
1049
- - Higher CapEx assumptions
1050
-
1051
- ### Base Case
1052
- - Consensus or management guidance revenue growth
1053
- - Moderate margin expansion based on operating leverage
1054
- - Current market-implied WACC
1055
- - GDP-aligned terminal growth (2.5-3.0%)
1056
- - Standard CapEx assumptions
1057
-
1058
- ### Bull Case
1059
- - Optimistic revenue growth (high end of projections)
1060
- - Significant margin expansion
1061
- - Lower WACC (reduced risk premium)
1062
- - Higher terminal growth (3.5-5.0%)
1063
- - Reduced CapEx intensity
1064
-
1065
- **Formula Implementation:**
1066
-
1067
- **DO NOT use nested IF formulas scattered throughout.** Instead, create a consolidation column that uses INDEX or OFFSET formulas to pull from the appropriate scenario block.
1068
-
1069
- **Recommended pattern (using INDEX):**
1070
- `=INDEX(B10:D10, 1, $B$6)` where `B10:D10` = Bear/Base/Bull values, `1` = row offset, `$B$6` = case selector cell (1, 2, or 3)
1071
-
1072
- **Then reference the consolidation column** in all projections:
1073
- `Revenue Year 1: =D29*(1+$E$10)` where $E$10 is the consolidation column value for Year 1 growth.
1074
-
1075
- This approach centralizes scenario logic, making the model easier to audit and maintain.
1076
-
1077
- ## Deliverables Structure
1078
-
1079
- **File naming**: `[Ticker]_DCF_Model_[Date].xlsx`
1080
-
1081
- **Two sheets**:
1082
- 1. **DCF** - Complete model with Bear/Base/Bull cases + three sensitivity tables at bottom (WACC vs Terminal Growth, Revenue Growth vs EBIT Margin, Beta vs Risk-Free Rate)
1083
- 2. **WACC** - Cost of capital calculation
1084
-
1085
- **Key features**: Case selector (1/2/3), consolidation column with INDEX/OFFSET formulas, color-coded cells, cell comments on all inputs, professional borders
1086
-
1087
- ## Best Practices
1088
-
1089
- ### Model Construction
1090
- 1. **Build incrementally**: Complete each section before moving to next
1091
- 2. **Test as building**: Enter sample numbers to verify formulas
1092
- 3. **Use consistent structure**: Similar calculations follow similar patterns
1093
- 4. **Comment complex formulas**: Add notes for unusual calculations
1094
- 5. **Build in checks**: Sum checks and balance checks where applicable
1095
-
1096
- ### Documentation
1097
- 1. **Document all assumptions**: Explain reasoning behind key inputs
1098
- 2. **Cite data sources**: Note where each data point came from
1099
- 3. **Explain methodology**: Describe any non-standard approaches
1100
- 4. **Flag uncertainties**: Highlight areas with limited visibility
1101
-
1102
- ### Quality Control
1103
- 1. **Cross-check calculations**: Verify math in multiple ways
1104
- 2. **Stress test assumptions**: Run sensitivity to ensure model is robust
1105
- 3. **Peer review**: Have someone else check formulas
1106
- 4. **Version control**: Save versions as work progresses
1107
-
1108
- ## Common Variations
1109
-
1110
- ### High-Growth Technology Companies
1111
- - Longer projection period (7-10 years)
1112
- - Higher initial growth rates (20-30%)
1113
- - Significant margin expansion over time
1114
- - Higher WACC (12-15%)
1115
- - Model unit economics (users, ARPU, etc.)
1116
-
1117
- ### Mature/Stable Companies
1118
- - Shorter projection period (3-5 years)
1119
- - Modest growth rates (GDP +1-3%)
1120
- - Stable margins
1121
- - Lower WACC (7-9%)
1122
- - Focus on cash generation and capital allocation
1123
-
1124
- ### Cyclical Companies
1125
- - Model through economic cycle
1126
- - Normalize margins at mid-cycle
1127
- - Consider trough and peak scenarios
1128
- - Adjust beta for cyclicality
1129
-
1130
- ### Multi-Segment Companies
1131
- - Separate DCFs for each business unit
1132
- - Different growth rates and margins by segment
1133
- - Sum-of-parts valuation
1134
- - Consider synergies
1135
-
1136
- ## Troubleshooting
1137
-
1138
- **If you encounter errors or unreasonable results, read [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for detailed debugging guidance.**
1139
-
1140
- ## Workflow Integration
1141
-
1142
- ### At Start of DCF Build
1143
-
1144
- 1. **Gather market data**:
1145
- - Check for available MCP servers for current market data
1146
- - Use web search/fetch for stock prices, beta, and other market metrics
1147
- - Request from user if specific data is needed
1148
-
1149
- 2. **Gather historical financials**:
1150
- - Check for available MCP servers (Daloopa, etc.)
1151
- - Request from user if not available via MCP
1152
- - Manual extraction from 10-Ks if necessary
1153
-
1154
- 3. **Begin model construction** using the DCF methodology detailed in this skill
1155
-
1156
- ### During Model Construction
1157
-
1158
- 1. **Build Excel model** using openpyxl with formulas (not hardcoded values)
1159
- 2. **Follow xlsx skill conventions** for formula construction and formatting
1160
- 3. **Apply fill colors only if requested** by user or if specific brand guidelines are provided
1161
-
1162
- ### Before Delivering Model (MANDATORY)
1163
-
1164
- 1. **Verify structure**:
1165
- - Scenario blocks for Bear/Base/Bull with assumptions across projection years
1166
- - Case selector functional with formulas referencing correct scenario blocks
1167
- - Sensitivity tables at bottom of DCF sheet (not separate sheet)
1168
- - Font colors: Blue inputs, black formulas, green sheet links
1169
- - Cell comments on ALL hardcoded inputs
1170
- - Professional borders around major sections
1171
-
1172
- 2. **Recalculate formulas**: Run `python recalc.py model.xlsx 30`
1173
-
1174
- 3. **Check output**:
1175
- - If `status` is `"success"` → Continue to step 4
1176
- - If `status` is `"errors_found"` → Check `error_summary` and read [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for debugging guidance
1177
-
1178
- 4. **Fix errors and re-run recalc.py** until status is "success"
1179
-
1180
- 5. **Spot-check formulas**:
1181
- - Test one FCF formula - does it reference the correct assumption rows?
1182
- - Change case selector - does the consolidation column update properly?
1183
- - Verify revenue formulas reference consolidation column (not nested IF formulas)
1184
-
1185
- 6. **Deliver model**
1186
-
1187
- ### Available Data Sources
1188
-
1189
- - **MCP servers**: If configured (Daloopa for historical financials)
1190
- - **Web search/fetch**: For current stock prices, beta, and market data
1191
- - **User-provided data**: Historical financials, consensus estimates
1192
- - **Manual extraction**: SEC EDGAR filings as fallback
1193
-
1194
- ## Final Output Checklist
1195
-
1196
- Before delivering DCF model:
1197
-
1198
- **Required:**
1199
- - Run `python recalc.py model.xlsx 30` until status is "success" (zero formula errors)
1200
- - Two sheets: DCF (with sensitivity at bottom), WACC
1201
- - Font colors: Blue=inputs, Black=formulas, Green=sheet links
1202
- - Cell comments on ALL hardcoded inputs
1203
- - Sensitivity tables fully populated with formulas
1204
- - Professional borders around major sections
1205
-
1206
- **Validation:**
1207
- - OpEx based on revenue (not gross profit)
1208
- - Terminal value 50-70% of EV
1209
- - Terminal growth < WACC
1210
- - Tax rate 21-28%
1
+ ---
2
+ name: dcf-model
3
+ description: Real DCF (Discounted Cash Flow) model creation for equity valuation. Retrieves financial data from SEC filings and analyst reports, builds comprehensive cash flow projections with proper WACC calculations, performs sensitivity analysis, and outputs professional Excel models with executive summaries. Use when users need to value a company using DCF methodology, request intrinsic value analysis, or ask for detailed financial modeling with growth projections and terminal value calculations.
4
+ ---
5
+
6
+ # DCF Model Builder
7
+
8
+ ## Overview
9
+
10
+ This skill creates institutional-quality DCF models for equity valuation following investment banking standards. Each analysis produces a detailed Excel model (with sensitivity analysis included at the bottom of the DCF sheet).
11
+
12
+ ## Tools
13
+
14
+ - Default to using all of the information provided by the user and MCP servers available for data sourcing.
15
+
16
+ ## Critical Constraints - Read These First
17
+
18
+ These constraints apply throughout all DCF model building. Review before starting:
19
+
20
+ **Sensitivity Tables:**
21
+ - Populate ALL 75 cells (3 tables × 25 cells) with full DCF recalculation formulas
22
+ - Use openpyxl loops to write formulas programmatically
23
+ - NO placeholder text, NO linear approximations, NO manual steps required
24
+ - Each cell must recalculate full DCF for that assumption combination
25
+
26
+ **Cell Comments:**
27
+ - Add cell comments AS each hardcoded value is created
28
+ - Format: "Source: [System/Document], [Date], [Reference], [URL if applicable]"
29
+ - Every blue input must have a comment before moving to next section
30
+ - Do not defer to end or write "TODO: add source"
31
+
32
+ **Model Layout Planning:**
33
+ - Define ALL section row positions BEFORE writing any formulas
34
+ - Write ALL headers and labels first
35
+ - Write ALL section dividers and blank rows second
36
+ - THEN write formulas using the locked row positions
37
+ - Test formulas immediately after creation
38
+
39
+ **Formula Recalculation:**
40
+ - Run `python recalc.py model.xlsx 30` before delivery
41
+ - Fix ALL errors until status is "success"
42
+ - Zero formula errors required (#REF!, #DIV/0!, #VALUE!, etc.)
43
+
44
+ **Scenario Blocks:**
45
+ - Create separate blocks for Bear/Base/Bull cases
46
+ - Show assumptions horizontally across projection years within each block
47
+ - Use IF formulas: `=IF($B$6=1,[Bear cell],IF($B$6=2,[Base cell],[Bull cell]))`
48
+ - Verify formulas reference correct scenario block cells
49
+
50
+ ## DCF Process Workflow
51
+
52
+ ### Step 1: Data Retrieval and Validation
53
+
54
+ Fetch data from MCP servers, user provided data, and the web.
55
+
56
+ **Data Sources Priority:**
57
+ 1. **MCP Servers** (if configured) - Structured financial data from providers like Daloopa
58
+ 2. **User-Provided Data** - Historical financials from their research
59
+ 3. **Web Search/Fetch** - Current prices, beta, debt and cash when needed
60
+
61
+ **Validation Checklist:**
62
+ - Verify net debt vs net cash (critical for valuation)
63
+ - Confirm diluted shares outstanding (check for recent buybacks/issuances)
64
+ - Validate historical margins are consistent with business model
65
+ - Cross-check revenue growth rates with industry benchmarks
66
+ - Verify tax rate is reasonable (typically 21-28%)
67
+
68
+ ### Step 2: Historical Analysis (3-5 years)
69
+
70
+ Analyze and document:
71
+ - **Revenue growth trends**: Calculate CAGR, identify drivers
72
+ - **Margin progression**: Track gross margin, EBIT margin, FCF margin
73
+ - **Capital intensity**: D&A and CapEx as % of revenue
74
+ - **Working capital efficiency**: NWC changes as % of revenue growth
75
+ - **Return metrics**: ROIC, ROE trends
76
+
77
+ Create summary tables showing:
78
+ ```
79
+ Historical Metrics (LTM):
80
+ Revenue: $X million
81
+ Revenue growth: X% CAGR
82
+ Gross margin: X%
83
+ EBIT margin: X%
84
+ D&A % of revenue: X%
85
+ CapEx % of revenue: X%
86
+ FCF margin: X%
87
+ ```
88
+
89
+ ### Step 3: Build Revenue Projections
90
+
91
+ **Methodology:**
92
+ 1. Start with latest actual revenue (LTM or most recent fiscal year)
93
+ 2. Apply growth rates for each projection year
94
+ 3. Show both dollar amounts AND calculated growth %
95
+
96
+ **Growth Rate Framework:**
97
+ - Year 1-2: Higher growth reflecting near-term visibility
98
+ - Year 3-4: Gradual moderation toward industry average
99
+ - Year 5+: Approaching terminal growth rate
100
+
101
+ **Formula structure:**
102
+ - Revenue(Year N) = Revenue(Year N-1) × (1 + Growth Rate)
103
+ - Growth %(Year N) = Revenue(Year N) / Revenue(Year N-1) - 1
104
+
105
+ **Three-scenario approach:**
106
+ ```
107
+ Bear Case: Conservative growth (e.g., 8-12%)
108
+ Base Case: Most likely scenario (e.g., 12-16%)
109
+ Bull Case: Optimistic growth (e.g., 16-20%)
110
+ ```
111
+
112
+ ### Step 4: Operating Expense Modeling
113
+
114
+ **Fixed/Variable Cost Analysis:**
115
+
116
+ Operating expenses should model realistic operating leverage:
117
+ - **Sales & Marketing**: Typically 15-40% of revenue depending on business model
118
+ - **Research & Development**: Typically 10-30% for technology companies
119
+ - **General & Administrative**: Typically 8-15% of revenue, shows leverage as company scales
120
+
121
+ **Key principles:**
122
+ - ALL percentages based on REVENUE, not gross profit
123
+ - Model operating leverage: % should decline as revenue scales
124
+ - Maintain separate line items for S&M, R&D, G&A
125
+ - Calculate EBIT = Gross Profit - Total OpEx
126
+
127
+ **Margin expansion framework:**
128
+ ```
129
+ Current State → Target State (Year 5)
130
+ Gross Margin: X% → Y% (justify based on scale, efficiency)
131
+ EBIT Margin: X% → Y% (result of revenue growth + opex leverage)
132
+ ```
133
+
134
+ ### Step 5: Free Cash Flow Calculation
135
+
136
+ **Build FCF in proper sequence:**
137
+
138
+ ```
139
+ EBIT
140
+ (-) Taxes (EBIT × Tax Rate)
141
+ = NOPAT (Net Operating Profit After Tax)
142
+ (+) D&A (non-cash expense, % of revenue)
143
+ (-) CapEx (% of revenue, typically 4-8%)
144
+ (-) Δ NWC (change in working capital)
145
+ = Unlevered Free Cash Flow
146
+ ```
147
+
148
+ **Working Capital Modeling:**
149
+ - Calculate as % of revenue change (delta revenue)
150
+ - Typical range: -2% to +2% of revenue change
151
+ - Negative number = source of cash (working capital release)
152
+ - Positive number = use of cash (working capital build)
153
+
154
+ **Maintenance vs Growth CapEx:**
155
+ - Maintenance CapEx: Sustains current operations (~2-3% revenue)
156
+ - Growth CapEx: Supports expansion (additional 2-5% revenue)
157
+ - Total CapEx should align with company's growth strategy
158
+
159
+ ### Step 6: Cost of Capital (WACC) Research
160
+
161
+ **CAPM Methodology for Cost of Equity:**
162
+
163
+ ```
164
+ Cost of Equity = Risk-Free Rate + Beta × Equity Risk Premium
165
+
166
+ Where:
167
+ - Risk-Free Rate = Current 10-Year Treasury Yield
168
+ - Beta = 5-year monthly stock beta vs market index
169
+ - Equity Risk Premium = 5.0-6.0% (market standard)
170
+ ```
171
+
172
+ **Cost of Debt Calculation:**
173
+
174
+ ```
175
+ After-Tax Cost of Debt = Pre-Tax Cost of Debt × (1 - Tax Rate)
176
+
177
+ Determine Pre-Tax Cost of Debt from:
178
+ - Credit rating (if available)
179
+ - Current yield on company bonds
180
+ - Interest expense / Total Debt from financials
181
+ ```
182
+
183
+ **Capital Structure Weights:**
184
+
185
+ ```
186
+ Market Value Equity = Current Stock Price × Shares Outstanding
187
+ Net Debt = Total Debt - Cash & Equivalents
188
+ Enterprise Value = Market Cap + Net Debt
189
+
190
+ Equity Weight = Market Cap / Enterprise Value
191
+ Debt Weight = Net Debt / Enterprise Value
192
+
193
+ WACC = (Cost of Equity × Equity Weight) + (After-Tax Cost of Debt × Debt Weight)
194
+ ```
195
+
196
+ **Special Cases:**
197
+ - **Net Cash Position**: If Cash > Debt, Net Debt is NEGATIVE
198
+ - Debt Weight may be negative
199
+ - WACC calculation adjusts accordingly
200
+ - **No Debt**: WACC = Cost of Equity
201
+
202
+ **Typical WACC Ranges:**
203
+ - Large Cap, Stable: 7-9%
204
+ - Growth Companies: 9-12%
205
+ - High Growth/Risk: 12-15%
206
+
207
+ ### Step 7: Discount Rate Application (5-10 Year Forecast)
208
+
209
+ **Mid-Year Convention:**
210
+ - Cash flows assumed to occur mid-year
211
+ - Discount Period: 0.5, 1.5, 2.5, 3.5, 4.5, etc.
212
+ - Discount Factor = 1 / (1 + WACC)^Period
213
+
214
+ **Present Value Calculation:**
215
+ ```
216
+ For each projection year:
217
+ PV of FCF = Unlevered FCF × Discount Factor
218
+
219
+ Example (Year 1):
220
+ FCF = $1,000
221
+ WACC = 10%
222
+ Period = 0.5
223
+ Discount Factor = 1 / (1.10)^0.5 = 0.9535
224
+ PV = $1,000 × 0.9535 = $954
225
+ ```
226
+
227
+ **Projection Period Selection:**
228
+ - **5 years**: Standard for most analyses
229
+ - **7-10 years**: High growth companies with longer runway
230
+ - **3 years**: Mature, stable businesses
231
+
232
+ ### Step 8: Terminal Value Calculation
233
+
234
+ **Perpetuity Growth Method (Preferred):**
235
+
236
+ ```
237
+ Terminal FCF = Final Year FCF × (1 + Terminal Growth Rate)
238
+ Terminal Value = Terminal FCF / (WACC - Terminal Growth Rate)
239
+
240
+ Critical Constraint: Terminal Growth < WACC (otherwise infinite value)
241
+ ```
242
+
243
+ **Terminal Growth Rate Selection:**
244
+ - Conservative: 2.0-2.5% (GDP growth rate)
245
+ - Moderate: 2.5-3.5%
246
+ - Aggressive: 3.5-5.0% (only for market leaders)
247
+
248
+ **Do not exceed**: Risk-free rate or long-term GDP growth
249
+
250
+ **Exit Multiple Method (Alternative):**
251
+ ```
252
+ Terminal Value = Final Year EBITDA × Exit Multiple
253
+
254
+ Where Exit Multiple comes from:
255
+ - Industry comparable trading multiples
256
+ - Precedent transaction multiples
257
+ - Typical range: 8-15x EBITDA
258
+ ```
259
+
260
+ **Present Value of Terminal Value:**
261
+ ```
262
+ PV of Terminal Value = Terminal Value / (1 + WACC)^Final Period
263
+
264
+ Where Final Period accounts for timing:
265
+ 5-year model with mid-year convention: Period = 4.5
266
+ ```
267
+
268
+ **Terminal Value Sanity Check:**
269
+ - Should represent 50-70% of Enterprise Value
270
+ - If >75%, model may be over-reliant on terminal assumptions
271
+ - If <40%, check if terminal assumptions are too conservative
272
+
273
+ ### Step 9: Enterprise to Equity Value Bridge
274
+
275
+ **Valuation Summary Structure:**
276
+
277
+ ```
278
+ (+) Sum of PV of Projected FCFs = $X million
279
+ (+) PV of Terminal Value = $Y million
280
+ = Enterprise Value = $Z million
281
+
282
+ (-) Net Debt [or + Net Cash if negative] = $A million
283
+ = Equity Value = $B million
284
+
285
+ ÷ Diluted Shares Outstanding = C million shares
286
+ = Implied Price per Share = $XX.XX
287
+
288
+ Current Stock Price = $YY.YY
289
+ Implied Return = (Implied Price / Current Price) - 1 = XX%
290
+ ```
291
+
292
+ **Critical Adjustments:**
293
+ - **Net Debt = Total Debt - Cash & Equivalents**
294
+ - If positive: Subtract from EV (reduces equity value)
295
+ - If negative (Net Cash): Add to EV (increases equity value)
296
+ - **Use Diluted Shares**: Includes options, RSUs, convertible securities
297
+ - **Other adjustments** (if applicable):
298
+ - Minority interests
299
+ - Pension liabilities
300
+ - Operating lease obligations
301
+
302
+ **Valuation Output Format:**
303
+ ```csv
304
+ Valuation Component,Amount ($M)
305
+ PV Explicit FCFs,X.X
306
+ PV Terminal Value,Y.Y
307
+ Enterprise Value,Z.Z
308
+ (-) Net Debt,A.A
309
+ Equity Value,B.B
310
+ ,,
311
+ Shares Outstanding (M),C.C
312
+ Implied Price per Share,$XX.XX
313
+ Current Share Price,$YY.YY
314
+ Implied Upside/(Downside),+XX%
315
+ ```
316
+
317
+ ### Step 10: Sensitivity Analysis
318
+
319
+ Build **three sensitivity tables** at the bottom of the DCF sheet showing how valuation changes with different assumptions:
320
+
321
+ 1. **WACC vs Terminal Growth** - Shows enterprise value sensitivity to discount rate and perpetuity growth
322
+ 2. **Revenue Growth vs EBIT Margin** - Shows impact of top-line growth and operating leverage
323
+ 3. **Beta vs Risk-Free Rate** - Shows sensitivity to cost of equity components
324
+
325
+ **Implementation**: These are simple 2D grids (NOT Excel's "Data Table" feature) with formulas in each cell. Each cell must contain a full DCF recalculation for that specific assumption combination. See Critical Constraints section for detailed requirements on populating all 75 cells programmatically using openpyxl.
326
+
327
+ <correct_patterns>
328
+
329
+ This section contains all the CORRECT patterns to follow when building DCF models.
330
+
331
+ ### Scenario Block Selection Pattern - Follow This Approach
332
+
333
+ **Assumptions are organized in separate blocks for each scenario:**
334
+
335
+ **CRITICAL STRUCTURE - Three rows per section header:**
336
+
337
+ ```csv
338
+ BEAR CASE ASSUMPTIONS (section header, merge cells across)
339
+ Assumption,FY1,FY2,FY3,FY4,FY5
340
+ Revenue Growth (%),12%,10%,9%,8%,7%
341
+ EBIT Margin (%),45%,44%,43%,42%,41%
342
+
343
+ BASE CASE ASSUMPTIONS (section header, merge cells across)
344
+ Assumption,FY1,FY2,FY3,FY4,FY5
345
+ Revenue Growth (%),16%,14%,12%,10%,9%
346
+ EBIT Margin (%),48%,49%,50%,51%,52%
347
+
348
+ BULL CASE ASSUMPTIONS (section header, merge cells across)
349
+ Assumption,FY1,FY2,FY3,FY4,FY5
350
+ Revenue Growth (%),20%,18%,15%,13%,11%
351
+ EBIT Margin (%),50%,51%,52%,53%,54%
352
+ ```
353
+
354
+ **Each scenario block MUST have a column header row** showing the projection years (FY2025E, FY2026E, etc.) immediately below the section title. Without this, users cannot tell which assumption value corresponds to which year.
355
+
356
+ **How to reference assumptions - Create a consolidation column:**
357
+ 1. Case selector cell (e.g., B6) contains 1=Bear, 2=Base, or 3=Bull
358
+ 2. Create a consolidation column with INDEX or OFFSET formulas to pull from the correct scenario block
359
+ 3. Projection formulas reference the consolidation column (clean cell references)
360
+ 4. Each scenario block contains full set of DCF assumptions across projection years
361
+
362
+ **Recommended consolidation column pattern (using INDEX):**
363
+ `=INDEX(B10:D10, 1, $B$6)`
364
+
365
+ **NOT this - scattered IF statements throughout:**
366
+ `=IF($B$6=1,[Bear block cell],IF($B$6=2,[Base block cell],[Bull block cell]))`
367
+
368
+ The consolidation column approach centralizes logic and makes the model easier to audit.
369
+
370
+ ### Correct Revenue Projection Pattern
371
+
372
+ **Create a consolidation column with INDEX formulas, then reference it in projections:**
373
+
374
+ **Step 1 - Consolidation column for FY1 growth:**
375
+ `=INDEX([Bear FY1 growth]:[Bull FY1 growth], 1, $B$6)`
376
+
377
+ **Step 2 - Revenue projection references the consolidation column:**
378
+ `Revenue Year 1: =D29*(1+$E$10)`
379
+
380
+ Where:
381
+ - D29 = Prior year revenue
382
+ - $E$10 = Consolidation column cell for FY1 growth (contains INDEX formula)
383
+ - $B$6 = Case selector (1=Bear, 2=Base, 3=Bull)
384
+
385
+ **This approach is cleaner than embedding IF statements in every projection formula** and makes it much easier to audit which scenario assumptions are being used.
386
+
387
+ ### Correct FCF Formula Pattern
388
+
389
+ **Use consolidation columns with INDEX formulas, then reference them in FCF calculations:**
390
+
391
+ **Consolidation column approach:**
392
+ ```csv
393
+ Item,Formula,Reference
394
+ D&A,=E29*$E$21,$E$21 = consolidation column for D&A %
395
+ CapEx,=E29*$E$22,$E$22 = consolidation column for CapEx %
396
+ Δ NWC,=(E29-D29)*$E$23,$E$23 = consolidation column for NWC %
397
+ Unlevered FCF,=E57+E58-E60-E62,E57=NOPAT E58=D&A E60=CapEx E62=Δ NWC
398
+ ```
399
+
400
+ **Each consolidation column cell contains an INDEX formula** that pulls from the appropriate scenario block based on case selector. This keeps projection formulas clean and auditable.
401
+
402
+ Before writing formulas, confirm scenario block row locations and set up consolidation columns.
403
+
404
+ ### Correct Cell Comment Format
405
+
406
+ **Every hardcoded value needs this format:**
407
+
408
+ "Source: [System/Document], [Date], [Reference], [URL if applicable]"
409
+
410
+ **Examples:**
411
+ ```csv
412
+ Item,Source Comment
413
+ Stock price,Source: Market data script 2025-10-12 Close price
414
+ Shares outstanding,Source: 10-K FY2024 Page 45 Note 12
415
+ Historical revenue,Source: 10-K FY2024 Page 32 Consolidated Statements
416
+ Beta,Source: Market data script 2025-10-12 5-year monthly beta
417
+ Consensus estimates,Source: Management guidance Q3 2024 earnings call
418
+ ```
419
+
420
+ ### Correct Assumption Table Structure
421
+
422
+ **CRITICAL: Each scenario block requires THREE structural elements:**
423
+
424
+ 1. **Section header row** (merged cells): e.g., "BEAR CASE ASSUMPTIONS"
425
+ 2. **Column header row** showing years - THIS IS REQUIRED, DO NOT SKIP
426
+ 3. **Data rows** with assumption values
427
+
428
+ **Structure:**
429
+ ```csv
430
+ BEAR CASE ASSUMPTIONS (section header - merge across columns A:G)
431
+ Assumption,FY1,FY2,FY3,FY4,FY5
432
+ Revenue Growth (%),X%,X%,X%,X%,X%
433
+ EBIT Margin (%),X%,X%,X%,X%,X%
434
+ Terminal Growth,X%,,,,
435
+ WACC,X%,,,,
436
+
437
+ BASE CASE ASSUMPTIONS (section header - merge across columns A:G)
438
+ Assumption,FY1,FY2,FY3,FY4,FY5
439
+ Revenue Growth (%),X%,X%,X%,X%,X%
440
+ EBIT Margin (%),X%,X%,X%,X%,X%
441
+ Terminal Growth,X%,,,,
442
+ WACC,X%,,,,
443
+
444
+ BULL CASE ASSUMPTIONS (section header - merge across columns A:G)
445
+ Assumption,FY1,FY2,FY3,FY4,FY5
446
+ Revenue Growth (%),X%,X%,X%,X%,X%
447
+ EBIT Margin (%),X%,X%,X%,X%,X%
448
+ Terminal Growth,X%,,,,
449
+ WACC,X%,,,,
450
+ ```
451
+
452
+ **WITHOUT the column header row showing projection years (FY2025E, FY2026E, etc.), users cannot tell which assumption value corresponds to which year. This row is MANDATORY.**
453
+
454
+ **Then create a consolidation column** (typically the next column to the right) that uses INDEX formulas to pull from the selected scenario block based on the case selector. This consolidation column is what your projection formulas reference.
455
+
456
+ ### Correct Row Planning Process
457
+
458
+ **1. Write ALL headers and labels FIRST:**
459
+ ```csv
460
+ Row,Content
461
+ 1,[Company Name] DCF Model
462
+ 2,Ticker | Date | Year End
463
+ 4,Case Selector
464
+ 7,KEY ASSUMPTIONS
465
+ 26,Assumption headers
466
+ 27-31,Growth assumptions
467
+ ...,...
468
+ ```
469
+
470
+ **2. Write ALL section dividers and blank rows**
471
+
472
+ **3. THEN write formulas using the locked row positions**
473
+
474
+ **4. Test formulas immediately after creation**
475
+
476
+ **Think of it like construction:**
477
+ - Good: Pour foundation, then build walls (stable structure)
478
+ - Bad: Build walls, then pour foundation (walls collapse)
479
+
480
+ **Excel version:**
481
+ - Good: Add headers, then write formulas (formulas stable)
482
+ - Bad: Write formulas, then add headers (formulas break)
483
+
484
+ ### Correct Sensitivity Table Implementation
485
+
486
+ **IMPORTANT**: These are NOT Excel's "Data Table" feature. These are simple grids where you write regular formulas using openpyxl. Yes, this means ~75 formulas total (3 tables × 25 cells each), but this is straightforward and required.
487
+
488
+ **Programmatic Population with Formulas:**
489
+
490
+ Each sensitivity table must be fully populated with formulas that recalculate the implied share price for each combination of assumptions. **Do not use Excel's Data Table feature** (it requires manual intervention and cannot be automated via openpyxl).
491
+
492
+ **Implementation approach - CONCRETE EXAMPLE:**
493
+
494
+ **Table Structure (5x5 grid):**
495
+ ```csv
496
+ WACC vs Terminal Growth,2.0%,2.5%,3.0%,3.5%,4.0%
497
+ 8.0%,[B88 formula],[C88 formula],[D88 formula],[E88 formula],[F88 formula]
498
+ 9.0%,[B89 formula],[C89 formula],[D89 formula],[E89 formula],[F89 formula]
499
+ ...,...,...,...,...,...
500
+ ```
501
+
502
+ **Formula Pattern - Cell B88 (WACC=8.0%, Terminal Growth=2.0%):**
503
+
504
+ The formula in B88 should recalculate the implied price using:
505
+ - WACC from row header: `$A88` (8.0%)
506
+ - Terminal Growth from column header: `B$87` (2.0%)
507
+
508
+ **Recommended approach:** Reference the main DCF calculation but substitute these values.
509
+
510
+ **Example formula structure:**
511
+ `=([SUM of PV FCFs using $A88 as discount rate] + [Terminal Value using B$87 as growth rate and $A88 as WACC] - [Net Debt]) / [Shares]`
512
+
513
+ **CRITICAL - Write a formula for EVERY cell in the 5x5 grid (25 cells per table, 75 cells total).** Use openpyxl to write these formulas programmatically in a loop. Do NOT skip this step or leave placeholder text.
514
+
515
+ **Python implementation pattern:**
516
+ ```python
517
+ # Pseudocode for populating sensitivity table
518
+ for row_idx, wacc_value in enumerate(wacc_range):
519
+ for col_idx, term_growth_value in enumerate(term_growth_range):
520
+ # Build formula that uses wacc_value and term_growth_value
521
+ formula = f"=<DCF recalc using {wacc_value} and {term_growth_value}>"
522
+ ws.cell(row=start_row+row_idx, column=start_col+col_idx).value = formula
523
+ ```
524
+
525
+ **The sensitivity tables must work immediately when the model is opened, with no manual steps required from the user.**
526
+
527
+ </correct_patterns>
528
+
529
+ <common_mistakes>
530
+
531
+ This section contains all the WRONG patterns to avoid when building DCF models.
532
+
533
+ ### WRONG: Simplified Sensitivity Table Approximations or Placeholder Text
534
+
535
+ **Don't use linear approximations:**
536
+
537
+ ```
538
+ // WRONG - Linear approximation
539
+ B97: =B88*(1+(0.096-0.116)) // Assumes linear relationship
540
+
541
+ // WRONG - Division shortcut
542
+ B105: =B88/(1+(E48-0.07)) // Doesn't recalculate full DCF
543
+ ```
544
+
545
+ **Don't leave placeholder text:**
546
+ ```
547
+ // WRONG - Placeholder note
548
+ "Note: Use Excel Data Table feature (Data → What-If Analysis → Data Table) to populate sensitivity tables."
549
+
550
+ // WRONG - Empty cells
551
+ [leaving cells blank because "this is complex"]
552
+ ```
553
+
554
+ **Don't confuse terminology:**
555
+ - ❌ "Sensitivity tables need Excel's Data Table feature" (NO - that's a specific Excel tool we can't use)
556
+ - ✅ "Sensitivity tables are simple grids with formulas in each cell" (YES - this is what we build)
557
+
558
+ **Why these shortcuts are wrong:**
559
+ - Linear approximation formulas don't actually recalculate the DCF - they just apply simple math adjustments
560
+ - The relationships are not linear, so the results will be inaccurate
561
+ - Placeholder text requires manual user intervention
562
+ - Model is not immediately usable when delivered
563
+ - Not professional or client-ready
564
+ - Empty cells = incomplete deliverable
565
+
566
+ **Common rationalization to REJECT:**
567
+ "Writing 75+ formulas feels complex, so I'll leave a note for the user to complete it manually."
568
+
569
+ **Reality:** Writing 75 formulas is straightforward when you use a loop in Python with openpyxl. Each formula follows the same pattern - just substitute the row/column values. This is a required part of the deliverable.
570
+
571
+ **Instead:** Populate every sensitivity cell with formulas that recalculate the full DCF for that specific combination of assumptions
572
+
573
+ ### WRONG: Missing Cell Comments
574
+
575
+ **Don't do this:**
576
+ - Create all hardcoded inputs without comments
577
+ - Think "I'll add them later"
578
+ - Write "TODO: add source"
579
+ - Leave blue inputs without documentation
580
+
581
+ **Why it's wrong:**
582
+ - Can't verify where data came from
583
+ - Fails xlsx skill requirements
584
+ - Not audit-ready
585
+ - Wastes time fixing later
586
+
587
+ **Instead:** Add cell comment AS EACH hardcoded value is created
588
+
589
+ ### WRONG: Formula Row References Off
590
+
591
+ **Symptom:**
592
+ The FCF section references wrong assumption rows:
593
+ `D&A: =E29*$E$34 // Should be $E$21, but referencing wrong row`
594
+ `CapEx: =E29*$E$41 // Should be $E$22, but row shifted`
595
+
596
+ **Why this happens:**
597
+ 1. Formulas written first
598
+ 2. Then headers inserted
599
+ 3. All row references shifted
600
+ 4. Now formulas point to wrong cells → #REF! errors
601
+
602
+ **Instead:** Lock row layout FIRST, then write formulas
603
+
604
+ ### WRONG: Single Row for Each Assumption Across Scenarios
605
+
606
+ **Don't structure assumptions like this:**
607
+ ```csv
608
+ Assumption,Bear,Base,Bull
609
+ Revenue Growth FY1,10%,13%,16%
610
+ Revenue Growth FY2,9%,12%,15%
611
+ ```
612
+ This vertical layout makes it hard to see the progression across years within each scenario.
613
+
614
+ **Why it's wrong:**
615
+ - Makes it difficult to see assumptions evolving across years within each scenario
616
+ - Harder to compare scenario assumptions across full projection period
617
+ - Less intuitive for reviewing scenario logic
618
+
619
+ **Instead:**
620
+ - Create separate blocks for each scenario (Bear, Base, Bull)
621
+ - Within each block, show assumptions horizontally across projection years
622
+ - This makes each scenario's assumptions easier to review as a cohesive set
623
+
624
+ ### WRONG: No Borders
625
+
626
+ **Don't deliver a model without borders:**
627
+ - No section delineation
628
+ - All cells blend together
629
+ - Hard to read and unprofessional
630
+
631
+ **Why it's wrong:**
632
+ - Not client-ready
633
+ - Difficult to navigate
634
+ - Looks amateur
635
+
636
+ **Instead:** Add borders around all major sections
637
+
638
+ ### WRONG: Wrong Font Colors or No Font Color Distinction
639
+
640
+ **Don't do this:**
641
+ - All text is black
642
+ - Only use fill colors (no font color changes)
643
+ - Mix up which cells are blue vs black
644
+
645
+ **Why it's wrong:**
646
+ - Can't distinguish inputs from formulas
647
+ - Auditing becomes impossible
648
+ - Violates xlsx skill requirements
649
+
650
+ **Instead:** Blue text for ALL hardcoded inputs, black text for ALL formulas, green for sheet links
651
+
652
+ ### WRONG: Operating Expenses Based on Gross Profit
653
+
654
+ **Don't do this:**
655
+ `S&M: =E33*0.15 // E33 = Gross Profit (WRONG)`
656
+
657
+ **Why it's wrong:**
658
+ - Operating expenses scale with revenue, not gross profit
659
+ - Produces unrealistic margin progression
660
+ - Not how businesses actually operate
661
+
662
+ **Instead:**
663
+ `S&M: =E29*0.15 // E29 = Revenue (CORRECT)`
664
+
665
+ ### TOP 5 ERRORS SUMMARY
666
+
667
+ 1. **Formula row references off** → Define ALL row positions BEFORE writing formulas
668
+ 2. **Missing cell comments** → Add comments AS cells are created, not at end
669
+ 3. **Simplified sensitivity tables** → Populate all cells with full DCF recalc formulas, not approximations
670
+ 4. **Scenario block references wrong** → Ensure IF formulas pull from correct Bear/Base/Bull blocks
671
+ 5. **No borders** → Add professional section borders for client-ready appearance
672
+
673
+ In addition, be aware of these errors:
674
+
675
+ ### WACC Calculation Errors
676
+ - Mixing book and market values in capital structure
677
+ - Using equity beta instead of asset/unlevered beta incorrectly
678
+ - Wrong tax rate application to cost of debt
679
+ - Incorrect risk-free rate (must use current 10Y Treasury)
680
+ - Failure to adjust for net debt vs net cash position
681
+
682
+ ### Growth Assumption Flaws
683
+ - Terminal growth > WACC (creates infinite value)
684
+ - Projection growth rates inconsistent with historical performance
685
+ - Ignoring industry growth constraints
686
+ - Revenue growth not aligned with unit economics
687
+ - Margin expansion without operational justification
688
+
689
+ ### Terminal Value Mistakes
690
+ - Using wrong growth method (perpetuity vs exit multiple)
691
+ - Terminal value >80% of enterprise value (suggests over-reliance)
692
+ - Inconsistent terminal margins with steady state assumptions
693
+ - Wrong discount period for terminal value
694
+
695
+ ### Cash Flow Projection Errors
696
+ - Operating expenses based on gross profit instead of revenue
697
+ - D&A/CapEx percentages misaligned with business model
698
+ - Working capital changes not properly calculated
699
+ - Tax rate inconsistency between years
700
+ - NOPAT calculation errors
701
+
702
+ **These errors are the most common. Re-read this section before starting any DCF build.**
703
+
704
+ </common_mistakes>
705
+
706
+ ## Excel File Creation
707
+
708
+ **This skill uses the `xlsx` skill for all spreadsheet operations.** The xlsx skill provides:
709
+ - Standardized formula construction rules
710
+ - Number formatting conventions
711
+ - Automated formula recalculation via `recalc.py` script
712
+ - Comprehensive error checking and validation
713
+
714
+ All Excel files created by this skill must follow xlsx skill requirements, including zero formula errors and proper recalculation.
715
+
716
+ ## Quality Rubric
717
+
718
+ Every DCF model must maximize for:
719
+ 1. **Realistic revenue and margin assumptions** based on historical performance
720
+ 2. **Appropriate cost of capital calculation** with proper CAPM methodology
721
+ 3. **Comprehensive sensitivity analysis** showing valuation ranges
722
+ 4. **Clear terminal value calculation** with supporting rationale
723
+ 5. **Professional model structure** enabling scenario analysis
724
+ 6. **Transparent documentation** of all key assumptions
725
+
726
+ ## Input Requirements
727
+
728
+ ### Minimum Required Inputs
729
+ 1. **Company identifier**: Ticker symbol or company name
730
+ 2. **Growth assumptions**: Revenue growth rates for projection period (or "use consensus")
731
+ 3. **Optional parameters**:
732
+ - Projection period (default: 5 years)
733
+ - Scenario cases (Bear/Base/Bull growth and margin assumptions)
734
+ - Terminal growth rate (default: 2.5-3.0%)
735
+ - Specific WACC inputs if not using CAPM
736
+
737
+ ## Excel Model Structure
738
+
739
+ ### Sheet Architecture
740
+
741
+ Create **two sheets**:
742
+
743
+ 1. **DCF** - Main valuation model with sensitivity analysis at bottom
744
+ 2. **WACC** - Cost of capital calculation
745
+
746
+ **CRITICAL**: Sensitivity tables go at the BOTTOM of the DCF sheet (not on a separate sheet). This keeps all valuation outputs together.
747
+
748
+ ### Formula Recalculation (MANDATORY)
749
+
750
+ After creating or modifying the Excel model, **recalculate all formulas** using the recalc.py script from the xlsx skill:
751
+
752
+ ```bash
753
+ python recalc.py [path_to_excel_file] [timeout_seconds]
754
+ ```
755
+
756
+ Example:
757
+ ```bash
758
+ python recalc.py AAPL_DCF_Model_2025-10-12.xlsx 30
759
+ ```
760
+
761
+ The script will:
762
+ - Recalculate all formulas in all sheets using LibreOffice
763
+ - Scan ALL cells for Excel errors (#REF!, #DIV/0!, #VALUE!, #NAME?, #NULL!, #NUM!, #N/A)
764
+ - Return detailed JSON with error locations and counts
765
+
766
+ **Expected output format:**
767
+ ```json
768
+ {
769
+ "status": "success", // or "errors_found"
770
+ "total_errors": 0, // Total error count
771
+ "total_formulas": 42, // Number of formulas in file
772
+ "error_summary": {} // Only present if errors found
773
+ }
774
+ ```
775
+
776
+ **If errors are found**, the output will include details:
777
+ ```json
778
+ {
779
+ "status": "errors_found",
780
+ "total_errors": 2,
781
+ "total_formulas": 42,
782
+ "error_summary": {
783
+ "#REF!": {
784
+ "count": 2,
785
+ "locations": ["DCF!B25", "DCF!C25"]
786
+ }
787
+ }
788
+ }
789
+ ```
790
+
791
+ **Fix all errors** and re-run recalc.py until status is "success" before delivering the model.
792
+
793
+ ### Formatting Standards
794
+
795
+ **IMPORTANT**: Follow the xlsx skill for formula construction rules and number formatting conventions. The DCF skill adds specific visual presentation standards.
796
+
797
+ **Color Scheme - Two Layers**:
798
+
799
+ **Layer 1: Font Colors (MANDATORY from xlsx skill)**
800
+ - **Blue text (RGB: 0,0,255)**: ALL hardcoded inputs (stock price, shares, historical data, assumptions)
801
+ - **Black text (RGB: 0,0,0)**: ALL formulas and calculations
802
+ - **Green text (RGB: 0,128,0)**: Links to other sheets (WACC sheet references)
803
+
804
+ **Layer 2: Fill Colors (Optional for enhanced presentation)**
805
+ - Fill colors are optional and should only be applied if requested by the user or if enhancing presentation
806
+ - If the user requests colors or professional formatting, use this standard scheme:
807
+ - **Section headers**: Dark blue (RGB: 68,114,196) background with white text
808
+ - **Sub-headers/column headers**: Light blue (RGB: 217,225,242) background with black text
809
+ - **Input cells**: Light green/cream (RGB: 226,239,218) background with blue text
810
+ - **Calculated cells**: White background with black text
811
+ - Users can override with custom brand colors if specified
812
+
813
+ **How the layers work together (if fill colors are used):**
814
+ - Input cell: Blue text + light green fill = "Hardcoded input"
815
+ - Formula cell: Black text + white background = "Calculated value"
816
+ - Sheet link: Green text + white background = "Reference from WACC sheet"
817
+
818
+ **Font color tells you WHAT it is. Fill color tells you WHERE it is (if used).**
819
+
820
+ **IMPORTANT:** Font colors from xlsx skill are mandatory. Fill colors are optional - default is white/no fill unless the user requests enhanced formatting or colors.
821
+
822
+ ### Border Standards (REQUIRED for Professional Appearance)
823
+
824
+ **Thick borders** (1.5pt) around major sections:
825
+ - KEY INPUTS section
826
+ - PROJECTION ASSUMPTIONS section
827
+ - 5-YEAR CASH FLOW PROJECTION section
828
+ - TERMINAL VALUE section
829
+ - VALUATION SUMMARY section
830
+ - Each SENSITIVITY ANALYSIS table
831
+
832
+ **Medium borders** (1pt) between sub-sections:
833
+ - Company Details vs Historical Performance
834
+ - Growth Assumptions vs EBIT Margin vs FCF Parameters
835
+
836
+ **Thin borders** (0.5pt) around data tables:
837
+ - Scenario assumption tables (Bear | Base | Bull | Selected)
838
+ - Historical vs projected financials matrix
839
+
840
+ **No borders:** Individual cells within tables (keep clean, scannable)
841
+
842
+ **Borders are mandatory** - models without professional borders are not client-ready.
843
+
844
+ **Number Formats** (follows xlsx skill standards):
845
+ - **Years**: Format as text strings (e.g., "2024" not "2,024")
846
+ - **Percentages**: `0.0%` (one decimal place)
847
+ - **Currency**: `$#,##0` for millions; `$#,##0.00` for per-share - ALWAYS specify units in headers ("Revenue ($mm)")
848
+ - **Zeros**: Use number formatting to make all zeros "-" (e.g., `$#,##0;($#,##0);-`)
849
+ - **Large numbers**: `#,##0` with thousands separator
850
+ - **Negative numbers**: `(#,##0)` in parentheses (NOT minus sign)
851
+
852
+ **Cell Comments (MANDATORY for all hardcoded inputs)**:
853
+
854
+ Per the xlsx skill, ALL hardcoded values must have cell comments documenting the source. Format: "Source: [System/Document], [Date], [Reference], [URL if applicable]"
855
+
856
+ **CRITICAL**: Add comments AS CELLS ARE CREATED. Do not defer to the end.
857
+
858
+ ### DCF Sheet Detailed Structure
859
+
860
+ **Section 1: Header**
861
+ ```csv
862
+ Row,Content
863
+ 1,[Company Name] DCF Model
864
+ 2,Ticker: [XXX] | Date: [Date] | Year End: [FYE]
865
+ 3,Blank
866
+ 4,Case Selector Cell (1=Bear 2=Base 3=Bull)
867
+ 5,Case Name Display (formula: =IF([Selector]=1"Bear"IF([Selector]=2"Base""Bull")))
868
+ ```
869
+
870
+ **Section 2: Market Data (NOT case dependent)**
871
+ ```csv
872
+ Item,Value
873
+ Current Stock Price,$XX.XX
874
+ Shares Outstanding (M),XX.X
875
+ Market Cap ($M),[Formula]
876
+ Net Debt ($M),XXX [or Net Cash if negative]
877
+ ```
878
+
879
+ **Section 3: DCF Scenario Assumptions**
880
+
881
+ Create separate assumption blocks for each scenario (Bear, Base, Bull) with DCF-specific assumptions (Revenue Growth %, EBIT Margin %, Tax Rate %, D&A % of Revenue, CapEx % of Revenue, NWC Change % of ΔRev, Terminal Growth Rate, WACC) laid out horizontally across projection years. Each block must include section header, column header row showing the projection years (FY1, FY2, etc.), and data rows. See `<correct_patterns>` section "Correct Assumption Table Structure" for the exact layout.
882
+
883
+ **Section 4: Historical & Projected Financials**
884
+
885
+ **Reference a consolidation column (e.g., "Selected Case") that pulls from scenario blocks**, not scattered IF formulas in every projection row.
886
+
887
+ ```csv
888
+ Income Statement ($M),2020A,2021A,2022A,2023A,2024E,2025E,2026E
889
+ Revenue,XXX,XXX,XXX,XXX,[=E29*(1+$E$10)],[=F29*(1+$E$11)],[=G29*(1+$E$12)]
890
+ % growth,XX%,XX%,XX%,XX%,[=E29/D29-1],[=F29/E29-1],[=G29/F29-1]
891
+ ,,,,,,
892
+ Gross Profit,XXX,XXX,XXX,XXX,[=E29*E33],[=F29*F33],[=G29*G33]
893
+ % margin,XX%,XX%,XX%,XX%,[=E33/E29],[=F33/F29],[=G33/G29]
894
+ ,,,,,,
895
+ Operating Expenses:,,,,,,,
896
+ S&M,XXX,XXX,XXX,XXX,[=E29*0.15],[=F29*0.14],[=G29*0.13]
897
+ R&D,XXX,XXX,XXX,XXX,[=E29*0.12],[=F29*0.11],[=G29*0.10]
898
+ G&A,XXX,XXX,XXX,XXX,[=E29*0.08],[=F29*0.07],[=G29*0.07]
899
+ Total OpEx,XXX,XXX,XXX,XXX,[=E36+E37+E38],[=F36+F37+F38],[=G36+G37+G38]
900
+ ,,,,,,
901
+ EBIT,XXX,XXX,XXX,XXX,[=E33-E39],[=F33-F39],[=G33-G39]
902
+ % margin,XX%,XX%,XX%,XX%,[=E41/E29],[=F41/F29],[=G41/G29]
903
+ ,,,,,,
904
+ Taxes,(XX),(XX),(XX),(XX),[=E41*$E$24],[=F41*$E$24],[=G41*$E$24]
905
+ Tax rate,XX%,XX%,XX%,XX%,[=E43/E41],[=F43/F41],[=G43/G41]
906
+ ,,,,,,
907
+ NOPAT,XXX,XXX,XXX,XXX,[=E41-E43],[=F41-F43],[=G41-G43]
908
+ ```
909
+
910
+ **Key Formula Pattern**:
911
+ - Revenue growth: `=E29*(1+$E$10)` where $E$10 is consolidation column for Year 1 growth
912
+ - NOT: `=E29*(1+IF($B$6=1,$B$10,IF($B$6=2,$C$10,$D$10)))`
913
+
914
+ This approach is cleaner, easier to audit, and prevents formula errors by centralizing the scenario logic.
915
+
916
+ **Section 5: Free Cash Flow Build**
917
+
918
+ **CRITICAL**: Verify row references point to the CORRECT assumption rows. Test formulas immediately after creation.
919
+
920
+ ```csv
921
+ Cash Flow ($M),2020A,2021A,2022A,2023A,2024E,2025E,2026E
922
+ NOPAT,XXX,XXX,XXX,XXX,[=E45],[=F45],[=G45]
923
+ (+) D&A,XXX,XXX,XXX,XXX,[=E29*$E$21],[=F29*$E$21],[=G29*$E$21]
924
+ % of Rev,XX%,XX%,XX%,XX%,[=E58/E29],[=F58/F29],[=G58/G29]
925
+ (-) CapEx,(XX),(XX),(XX),(XX),[=E29*$E$22],[=F29*$E$22],[=G29*$E$22]
926
+ % of Rev,XX%,XX%,XX%,XX%,[=E60/E29],[=F60/F29],[=G60/G29]
927
+ (-) Δ NWC,(XX),(XX),(XX),(XX),[=(E29-D29)*$E$23],[=(F29-E29)*$E$23],[=(G29-F29)*$E$23]
928
+ % of Δ Rev,XX%,XX%,XX%,XX%,[=E62/(E29-D29)],[=F62/(F29-E29)],[=G62/(G29-F29)]
929
+ ,,,,,,
930
+ Unlevered FCF,XXX,XXX,XXX,XXX,[=E57+E58-E60-E62],[=F57+F58-F60-F62],[=G57+G58-G60-G62]
931
+ ```
932
+
933
+ **Row reference examples** (based on layout planning):
934
+ - $E$21 = D&A % assumption (consolidation column, row 21)
935
+ - $E$22 = CapEx % assumption (consolidation column, row 22)
936
+ - $E$23 = NWC % assumption (consolidation column, row 23)
937
+ - E29 = Revenue for year (row 29)
938
+ - E45 = NOPAT for year (row 45)
939
+
940
+ **Before writing formulas**: Confirm these row numbers match the actual layout. Test one column, then copy across.
941
+
942
+ **Section 6: Discounting & Valuation**
943
+ ```csv
944
+ DCF Valuation,2024E,2025E,2026E,2027E,2028E,Terminal
945
+ Unlevered FCF ($M),XXX,XXX,XXX,XXX,XXX,
946
+ Period,0.5,1.5,2.5,3.5,4.5,
947
+ Discount Factor,0.XX,0.XX,0.XX,0.XX,0.XX,
948
+ PV of FCF ($M),XXX,XXX,XXX,XXX,XXX,
949
+ ,,,,,,
950
+ Terminal FCF ($M),,,,,,,XXX
951
+ Terminal Value ($M),,,,,,,XXX
952
+ PV Terminal Value ($M),,,,,,,XXX
953
+ ,,,,,,
954
+ Valuation Summary ($M),,,,,,
955
+ Sum of PV FCFs,XXX,,,,,
956
+ PV Terminal Value,XXX,,,,,
957
+ Enterprise Value,XXX,,,,,
958
+ (-) Net Debt,(XX),,,,,
959
+ Equity Value,XXX,,,,,
960
+ ,,,,,,
961
+ Shares Outstanding (M),XX.X,,,,,
962
+ IMPLIED PRICE PER SHARE,$XX.XX,,,,,
963
+ Current Stock Price,$XX.XX,,,,,
964
+ Implied Upside/(Downside),XX%,,,,,
965
+ ```
966
+
967
+ ### WACC Sheet Structure
968
+
969
+ ```csv
970
+ COST OF EQUITY CALCULATION,,
971
+ Risk-Free Rate (10Y Treasury),X.XX%,[Yellow input]
972
+ Beta (5Y monthly),X.XX,[Yellow input]
973
+ Equity Risk Premium,X.XX%,[Yellow input]
974
+ Cost of Equity,X.XX%,[Calculated blue]
975
+ ,,
976
+ COST OF DEBT CALCULATION,,
977
+ Credit Rating,AA-,[Yellow input]
978
+ Pre-Tax Cost of Debt,X.XX%,[Yellow input]
979
+ Tax Rate,XX.X%,[Link to DCF sheet]
980
+ After-Tax Cost of Debt,X.XX%,[Calculated blue]
981
+ ,,
982
+ CAPITAL STRUCTURE,,
983
+ Current Stock Price,$XX.XX,[Link to DCF]
984
+ Shares Outstanding (M),XX.X,[Link to DCF]
985
+ Market Capitalization ($M),"X,XXX",[Calculated]
986
+ ,,
987
+ Total Debt ($M),XXX,[Yellow input]
988
+ Cash & Equivalents ($M),XXX,[Yellow input]
989
+ Net Debt ($M),XXX,[Calculated]
990
+ ,,
991
+ Enterprise Value ($M),"X,XXX",[Calculated]
992
+ ,,
993
+ WACC CALCULATION,Weight,Cost,Contribution
994
+ Equity,XX.X%,X.X%,X.XX%
995
+ Debt,XX.X%,X.X%,X.XX%
996
+ ,,
997
+ WEIGHTED AVERAGE COST OF CAPITAL,X.XX%,[Green output]
998
+ ```
999
+
1000
+ **Key WACC Formulas:**
1001
+ ```
1002
+ Market Cap = Price × Shares
1003
+ Net Debt = Total Debt - Cash
1004
+ Enterprise Value = Market Cap + Net Debt
1005
+ Equity Weight = Market Cap / EV
1006
+ Debt Weight = Net Debt / EV
1007
+ WACC = (Cost of Equity × Equity Weight) + (After-tax Cost of Debt × Debt Weight)
1008
+ ```
1009
+
1010
+ ### Sensitivity Analysis (Bottom of DCF Sheet)
1011
+
1012
+ **TERMINOLOGY REMINDER**: "Sensitivity tables" = simple 2D grids with row headers, column headers, and formulas in each data cell. NOT Excel's "Data Table" feature (Data → What-If Analysis → Data Table). You will use openpyxl to write regular Excel formulas into each cell.
1013
+
1014
+ **Location**: Rows 87+ on DCF sheet (NOT a separate sheet)
1015
+
1016
+ **Three sensitivity tables, vertically stacked:**
1017
+
1018
+ 1. **WACC vs Terminal Growth** (rows 87-100) - 5x5 grid = 25 cells with formulas
1019
+ 2. **Revenue Growth vs EBIT Margin** (rows 102-115) - 5x5 grid = 25 cells with formulas
1020
+ 3. **Beta vs Risk-Free Rate** (rows 117-130) - 5x5 grid = 25 cells with formulas
1021
+
1022
+ **Total formulas to write: 75** (this is required, not optional)
1023
+
1024
+ **CRITICAL**: All sensitivity table cells must be populated programmatically with formulas using openpyxl. DO NOT use linear approximation shortcuts. DO NOT leave placeholder text or notes about manual steps. DO NOT rationalize leaving cells empty because "it's complex" - use a Python loop to generate the formulas.
1025
+
1026
+ **Table Setup:**
1027
+ 1. Create table structure with row/column headers (the assumption values to test)
1028
+ 2. Populate EVERY data cell with a formula that:
1029
+ - Uses the row header value (e.g., WACC = 9.0%)
1030
+ - Uses the column header value (e.g., Terminal Growth = 3.0%)
1031
+ - Recalculates the full DCF with those specific assumptions
1032
+ - Returns the implied share price for that scenario
1033
+ 3. All cells must contain working formulas when delivered
1034
+ 4. Format cells with conditional formatting: Green scale for higher values, red scale for lower values
1035
+ 5. Bold the base case cell
1036
+ 6. Leave 1-2 blank rows between tables
1037
+
1038
+ **No manual intervention required** - the sensitivity tables must be fully functional when the user opens the file.
1039
+
1040
+ ## Case Selector Implementation
1041
+
1042
+ **Three-Case Framework:**
1043
+
1044
+ ### Bear Case
1045
+ - Conservative revenue growth (low end of historical range)
1046
+ - Margin compression or no expansion
1047
+ - Higher WACC (risk premium increase)
1048
+ - Lower terminal growth rate
1049
+ - Higher CapEx assumptions
1050
+
1051
+ ### Base Case
1052
+ - Consensus or management guidance revenue growth
1053
+ - Moderate margin expansion based on operating leverage
1054
+ - Current market-implied WACC
1055
+ - GDP-aligned terminal growth (2.5-3.0%)
1056
+ - Standard CapEx assumptions
1057
+
1058
+ ### Bull Case
1059
+ - Optimistic revenue growth (high end of projections)
1060
+ - Significant margin expansion
1061
+ - Lower WACC (reduced risk premium)
1062
+ - Higher terminal growth (3.5-5.0%)
1063
+ - Reduced CapEx intensity
1064
+
1065
+ **Formula Implementation:**
1066
+
1067
+ **DO NOT use nested IF formulas scattered throughout.** Instead, create a consolidation column that uses INDEX or OFFSET formulas to pull from the appropriate scenario block.
1068
+
1069
+ **Recommended pattern (using INDEX):**
1070
+ `=INDEX(B10:D10, 1, $B$6)` where `B10:D10` = Bear/Base/Bull values, `1` = row offset, `$B$6` = case selector cell (1, 2, or 3)
1071
+
1072
+ **Then reference the consolidation column** in all projections:
1073
+ `Revenue Year 1: =D29*(1+$E$10)` where $E$10 is the consolidation column value for Year 1 growth.
1074
+
1075
+ This approach centralizes scenario logic, making the model easier to audit and maintain.
1076
+
1077
+ ## Deliverables Structure
1078
+
1079
+ **File naming**: `[Ticker]_DCF_Model_[Date].xlsx`
1080
+
1081
+ **Two sheets**:
1082
+ 1. **DCF** - Complete model with Bear/Base/Bull cases + three sensitivity tables at bottom (WACC vs Terminal Growth, Revenue Growth vs EBIT Margin, Beta vs Risk-Free Rate)
1083
+ 2. **WACC** - Cost of capital calculation
1084
+
1085
+ **Key features**: Case selector (1/2/3), consolidation column with INDEX/OFFSET formulas, color-coded cells, cell comments on all inputs, professional borders
1086
+
1087
+ ## Best Practices
1088
+
1089
+ ### Model Construction
1090
+ 1. **Build incrementally**: Complete each section before moving to next
1091
+ 2. **Test as building**: Enter sample numbers to verify formulas
1092
+ 3. **Use consistent structure**: Similar calculations follow similar patterns
1093
+ 4. **Comment complex formulas**: Add notes for unusual calculations
1094
+ 5. **Build in checks**: Sum checks and balance checks where applicable
1095
+
1096
+ ### Documentation
1097
+ 1. **Document all assumptions**: Explain reasoning behind key inputs
1098
+ 2. **Cite data sources**: Note where each data point came from
1099
+ 3. **Explain methodology**: Describe any non-standard approaches
1100
+ 4. **Flag uncertainties**: Highlight areas with limited visibility
1101
+
1102
+ ### Quality Control
1103
+ 1. **Cross-check calculations**: Verify math in multiple ways
1104
+ 2. **Stress test assumptions**: Run sensitivity to ensure model is robust
1105
+ 3. **Peer review**: Have someone else check formulas
1106
+ 4. **Version control**: Save versions as work progresses
1107
+
1108
+ ## Common Variations
1109
+
1110
+ ### High-Growth Technology Companies
1111
+ - Longer projection period (7-10 years)
1112
+ - Higher initial growth rates (20-30%)
1113
+ - Significant margin expansion over time
1114
+ - Higher WACC (12-15%)
1115
+ - Model unit economics (users, ARPU, etc.)
1116
+
1117
+ ### Mature/Stable Companies
1118
+ - Shorter projection period (3-5 years)
1119
+ - Modest growth rates (GDP +1-3%)
1120
+ - Stable margins
1121
+ - Lower WACC (7-9%)
1122
+ - Focus on cash generation and capital allocation
1123
+
1124
+ ### Cyclical Companies
1125
+ - Model through economic cycle
1126
+ - Normalize margins at mid-cycle
1127
+ - Consider trough and peak scenarios
1128
+ - Adjust beta for cyclicality
1129
+
1130
+ ### Multi-Segment Companies
1131
+ - Separate DCFs for each business unit
1132
+ - Different growth rates and margins by segment
1133
+ - Sum-of-parts valuation
1134
+ - Consider synergies
1135
+
1136
+ ## Troubleshooting
1137
+
1138
+ **If you encounter errors or unreasonable results, read [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for detailed debugging guidance.**
1139
+
1140
+ ## Workflow Integration
1141
+
1142
+ ### At Start of DCF Build
1143
+
1144
+ 1. **Gather market data**:
1145
+ - Check for available MCP servers for current market data
1146
+ - Use web search/fetch for stock prices, beta, and other market metrics
1147
+ - Request from user if specific data is needed
1148
+
1149
+ 2. **Gather historical financials**:
1150
+ - Check for available MCP servers (Daloopa, etc.)
1151
+ - Request from user if not available via MCP
1152
+ - Manual extraction from 10-Ks if necessary
1153
+
1154
+ 3. **Begin model construction** using the DCF methodology detailed in this skill
1155
+
1156
+ ### During Model Construction
1157
+
1158
+ 1. **Build Excel model** using openpyxl with formulas (not hardcoded values)
1159
+ 2. **Follow xlsx skill conventions** for formula construction and formatting
1160
+ 3. **Apply fill colors only if requested** by user or if specific brand guidelines are provided
1161
+
1162
+ ### Before Delivering Model (MANDATORY)
1163
+
1164
+ 1. **Verify structure**:
1165
+ - Scenario blocks for Bear/Base/Bull with assumptions across projection years
1166
+ - Case selector functional with formulas referencing correct scenario blocks
1167
+ - Sensitivity tables at bottom of DCF sheet (not separate sheet)
1168
+ - Font colors: Blue inputs, black formulas, green sheet links
1169
+ - Cell comments on ALL hardcoded inputs
1170
+ - Professional borders around major sections
1171
+
1172
+ 2. **Recalculate formulas**: Run `python recalc.py model.xlsx 30`
1173
+
1174
+ 3. **Check output**:
1175
+ - If `status` is `"success"` → Continue to step 4
1176
+ - If `status` is `"errors_found"` → Check `error_summary` and read [TROUBLESHOOTING.md](./TROUBLESHOOTING.md) for debugging guidance
1177
+
1178
+ 4. **Fix errors and re-run recalc.py** until status is "success"
1179
+
1180
+ 5. **Spot-check formulas**:
1181
+ - Test one FCF formula - does it reference the correct assumption rows?
1182
+ - Change case selector - does the consolidation column update properly?
1183
+ - Verify revenue formulas reference consolidation column (not nested IF formulas)
1184
+
1185
+ 6. **Deliver model**
1186
+
1187
+ ### Available Data Sources
1188
+
1189
+ - **MCP servers**: If configured (Daloopa for historical financials)
1190
+ - **Web search/fetch**: For current stock prices, beta, and market data
1191
+ - **User-provided data**: Historical financials, consensus estimates
1192
+ - **Manual extraction**: SEC EDGAR filings as fallback
1193
+
1194
+ ## Final Output Checklist
1195
+
1196
+ Before delivering DCF model:
1197
+
1198
+ **Required:**
1199
+ - Run `python recalc.py model.xlsx 30` until status is "success" (zero formula errors)
1200
+ - Two sheets: DCF (with sensitivity at bottom), WACC
1201
+ - Font colors: Blue=inputs, Black=formulas, Green=sheet links
1202
+ - Cell comments on ALL hardcoded inputs
1203
+ - Sensitivity tables fully populated with formulas
1204
+ - Professional borders around major sections
1205
+
1206
+ **Validation:**
1207
+ - OpEx based on revenue (not gross profit)
1208
+ - Terminal value 50-70% of EV
1209
+ - Terminal growth < WACC
1210
+ - Tax rate 21-28%
1211
1211
  - File naming: `[Ticker]_DCF_Model_[Date].xlsx`