dcf-valuation-engine
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "dcf-valuation-engine" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-e6735464ea7dad1f9a2fcbf1ec225d52b9e75546cbcb955e2d2f6804b681d0f8. Verify the upstream source and version against https://github.com/lyndonkl/claude before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Performs intrinsic (discounted cash flow) valuation based on value drivers: forecasts cash flows year by year, models gradual decay in growth, margins, and reinvestment rates, concludes with a terminal value, and adjusts for failure risk; derives operating asset value to per-share equity value and runs a sensitivity-analysis grid. Can also back out market-implied growth or margins. Intended for building DCF/FCFF/FCFE models, computing terminal or per-share values, and conducting valuation sensitivity analysis.
Introduction source: third_party · lyndonkl · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Runs an intrinsic (discounted cash flow) valuation from value drivers — builds the year-by-year forecast with fading growth, margins and reinvestment, closes it with a terminal value, adjusts for failure risk, walks the bridge from operating assets to equity value per share, and runs sensitivity grids. Also reverse-engineers the market price into the growth or margin it already assumes. Use when valuing a company intrinsically, building a DCF or FCFF/FCFE model, computing terminal value or value per share, running valuation sensitivity, or asking what the market is pricing in.
- Inputs and outputs
- Three ways to state a driver, so a fading assumption stays one line: a number — constant every year: `"tax_rate": 0.25` a list — one entry per year: `"revenue_growth": [0.4, 0.3, 0.2, 0.1, 0.05]` a glide — `{"start": 0.40, "end": 0.03, "converge_by": 8}` moves linearly from start to end by year 8, then holds A glide is usually what you want for growth, margin and cost of capital. Real companies converge toward their industry; a company growing 40% in year 1 and 40% in year 10 is almost always a modelling error rather than a forecast. Set `currency` to the same currency as the cost of capital. The consistency validator checks this and it is the single most common silent error in DCF work.
- Testing
- Not tested
Browse files
Frontmatter
name: dcf-valuation-engine
description: Runs an intrinsic (discounted cash flow) valuation from value drivers — builds the year-by-year forecast with fading growth, margins and reinvestment, closes it with a terminal value, adjusts for failure risk, walks the bridge from operating assets to equity value per share, and runs sensitivity grids. Also reverse-engineers the market price into the growth or margin it already assumes. Use when valuing a company intrinsically, building a DCF or FCFF/FCFE model, computing terminal value or value per share, running valuation sensitivity, or asking what the market is pricing in.DCF valuation engine
A discounted cash flow valuation is four judgments and a lot of arithmetic. The judgments are how fast revenue grows, what margin it eventually earns, how much capital that growth costs, and how risky the whole thing is. The arithmetic is here, so you can spend your effort on the four numbers that actually decide the answer.
The engine never invents a driver. Every growth rate, margin and reinvestment assumption arrives as an input you chose and can defend.
The script
resources/dcf.py — pure standard library, no installation needed. JSON on stdin (or
--in FILE), JSON out.
python3 resources/dcf.py value --example # show the input shape
python3 resources/dcf.py value --in drivers.json
python3 resources/dcf.py selftest # verify the engine
| Subcommand | Purpose |
|---|---|
value |
drivers → forecast, terminal value, equity bridge, value per share |
sensitivity |
re-run across a grid of one or two drivers |
implied |
solve for the driver that makes the DCF equal the market price |
The input
Three ways to state a driver, so a fading assumption stays one line:
- a number — constant every year:
"tax_rate": 0.25 - a list — one entry per year:
"revenue_growth": [0.4, 0.3, 0.2, 0.1, 0.05] - a glide —
{"start": 0.40, "end": 0.03, "converge_by": 8}moves linearly from start to end by year 8, then holds
A glide is usually what you want for growth, margin and cost of capital. Real companies converge toward their industry; a company growing 40% in year 1 and 40% in year 10 is almost always a modelling error rather than a forecast.
{
"base_revenue": 10000, "base_ebit": 800, "base_invested_capital": 6000,
"forecast_years": 10,
"revenue_growth": {"start": 0.25, "end": 0.03, "converge_by": 10},
"operating_margin": {"start": 0.08, "end": 0.15, "converge_by": 7},
"sales_to_capital": 2.0,
"tax_rate": {"start": 0.15, "end": 0.25, "converge_by": 10},
"cost_of_capital": {"start": 0.09, "end": 0.075, "converge_by": 10},
"terminal": {"growth_rate": 0.025, "cost_of_capital": 0.075, "return_on_capital": 0.10},
"bridge": {"debt": 3000, "cash": 1200, "minority_interests": 0,
"non_operating_assets": 0, "employee_options_value": 0,
"shares_outstanding": 500, "current_price": 42.00},
"currency": "USD"
}
Set currency to the same currency as the cost of capital. The consistency validator
checks this and it is the single most common silent error in DCF work.
How the engine computes each year
Revenue grows at the stated rate. Operating income is revenue times the margin. Tax applies to operating income, with any loss carryforward absorbing income first. Then the part people skip:
reinvestment = (this year's revenue − last year's revenue) / sales-to-capital
FCFF = after-tax operating income − reinvestment
Growth is not free. The sales-to-capital ratio says how many dollars of revenue each dollar of capital buys, so it converts a growth assumption into the investment that growth requires. A model that grows revenue without reinvesting is manufacturing value out of nothing, and it is the most common way a DCF ends up too high.
Set net_operating_loss_carryforward when the company has accumulated losses. The engine
shelters income until the carryforward is used up.
Terminal value
Beyond the forecast horizon the company becomes a perpetuity:
terminal value = terminal FCFF / (terminal cost of capital − terminal growth)
Three rules the engine enforces by refusing to run:
- Terminal growth cannot exceed the riskfree rate. A company growing faster than the economy forever eventually becomes the economy. The riskfree rate is the practical ceiling because it already contains expected inflation plus real growth.
- Terminal cost of capital must exceed terminal growth, or the formula does not produce a finite number.
- Terminal growth must be paid for:
reinvestment rate = growth / return on capital. The engine computes this rather than accepting it, and refuses a combination that would require reinvesting more than 100% of income.
Set terminal.return_on_capital deliberately. Setting it equal to the cost of capital says
competition eventually arrives — the honest default. Setting it higher says this company
holds a barrier to entry forever, which needs naming.
Failure risk
A going-concern DCF prices only the branch where the company survives. For a young company or a distressed one, that overstates value:
"failure": {"probability": 0.20, "proceeds_basis": "book_value",
"book_value_of_capital": 4000, "proceeds_percent": 0.5}
value = going-concern value × (1 − p) + distress proceeds × p
Use book_value as the basis when a failed firm would be liquidated piecemeal, and
going_concern when it would be sold intact at a discount.
The bridge
Operating assets are not equity. The walk:
equity value = operating assets − debt − minority interests + cash + non-operating assets
equity in common = equity value − value of employee options
value per share = equity in common / shares outstanding
Value employee options properly with option-valuation-toolkit and pass the result in.
Inflating the share count instead understates the cost of options; ignoring them
overstates value per share.
Do not add a control premium here and do not divide by diluted shares if you already subtracted option value — that double-counts.
Sensitivity and reverse engineering
A point estimate implies a false precision. Show a range.
python3 resources/dcf.py sensitivity --in grid.json
Point axes at any leaf with a dotted path — terminal.growth_rate,
operating_margin.end, cost_of_capital — and give the values to sweep. Sweep the drivers
that actually move the answer, which for most companies are the target margin and the
terminal assumptions rather than near-term growth.
The implied subcommand runs the valuation backwards: given the market price, what must be
true for that price to be right?
echo '{"base_case": {...}, "path": "operating_margin.end",
"target_value_per_share": 42.00, "low": 0.01, "high": 0.40}' \
| python3 resources/dcf.py implied
This is often the most useful output in the whole analysis. "The stock is worth $31 and trades at $42" invites an argument about your assumptions. "At $42 the market assumes this company reaches a 22% operating margin, which no firm in the industry has ever sustained" is a claim about the world, and it is checkable.
Choosing the model
This engine values the firm from operating cash flows (FCFF), discounted at the cost of capital. That is the right default for most non-financial companies, and the only sensible choice when leverage is changing.
Use something else when:
| Situation | Use instead |
|---|---|
| Financial service firm | Dividends or excess return, valuing equity directly — debt is raw material for a bank, so there is no meaningful cost of capital. Use special-situation-models |
| Stable leverage, equity question | FCFE discounted at the cost of equity |
| Mature dividend payer that pays out what it can | Dividend discount model |
| Negative earnings, no path to profit modelled | Revenue-driven build with failure probability. Use special-situation-models |
| Deeply distressed, equity is an option | Equity as a call. Use option-valuation-toolkit |
Before accepting the answer
Run the validator in valuation-consistency-checks. Then read the output for these
tells:
- Terminal value above 90% of total value. The forecast horizon is too short, or the company is genuinely all-option and a DCF is the wrong tool.
- ROIC climbing every year with no explanation. Check that reinvestment is keeping up.
- Value per share wildly different from price. Usually the model, not the market. Run
impliedand see whether the market's assumption is defensible before concluding the market is wrong. - Margins that never converge. Very few businesses out-earn their industry forever.
Common failures
| Symptom | Cause |
|---|---|
| Value far too high | Growth without matching reinvestment; sales-to-capital set too high |
| Terminal value is most of the answer | Forecast horizon too short for a company still growing fast |
| Value changes when currency changes | Cash flows and discount rate in different currencies |
| Engine refuses to run | Terminal growth above the discount rate, or reinvestment above 100% — both are real errors, not obstacles |
| Value per share negative | Debt exceeds operating asset value; the company may be a distress case needing the option approach |
| Young company looks worth billions | No failure probability applied |
Version history
-
0.1
GitHub ↗
Original release notes
## What's Changed * Improve writer skill navigation and structure by @lyndonkl in https://github.com/lyndonkl/claude/pull/1 * Consolidate stickiness content and reduce revision to 3 passes by @lyndonkl in https://github.com/lyndonkl/claude/pull/2 * Update README.md to reflect current writer skill structure by @lyndonkl in https://github.com/lyndonkl/claude/pull/3 * Add explicit instructions for AI agents to follow resource file workf… by @lyndonkl in https://github.com/lyndonkl/claude/pull/4 * Change analysis files from /tmp/ to project directory by @lyndonkl in https://github.com/lyndonkl/claude/pull/5 * Add five refined skills to production by @lyndonkl in https://github.com/lyndonkl/claude/pull/6 * Add causal-inference-root-cause skill and fix missing methodology files by @lyndonkl in https://github.com/lyndonkl/claude/pull/7 * Add workflow pattern to 6 completed skills by @lyndonkl in https://github.com/lyndonkl/claude/pull/8 * Add chain-estimation and roleplay-debate skills with optimizations by @lyndonkl in https://github.com/lyndonkl/claude/pull/9 * Add 3 new skills and update writer skill workflow pattern by @lyndonkl in https://github.com/lyndonkl/claude/pull/10 * Add skills #12-13: constraint-based-creativity and data-schema-knowle… by @lyndonkl in https://github.com/lyndonkl/claude/pull/11 * Add skills #14-16: decision-matrix, decomposition-reconstruction, deliberation-debate-red-teaming by @lyndonkl in https://github.com/lyndonkl/claude/pull/12 * Add skills #17-19: design-of-experiments, dialectical-mapping-steelmanning, discovery-interviews-surveys by @lyndonkl in https://github.com/lyndonkl/claude/pull/13 * Add chef-assistant skill and update README by @lyndonkl in https://github.com/lyndonkl/claude/pull/14 * Fix README: Remove links to gitignored scratchpad files by @lyndonkl in https://github.com/lyndonkl/claude/pull/15 * Add skills #14-22: 9 new production-ready skills by @lyndonkl in https://github.com/lyndonkl/claude/pull/16 * Add skills #20-24 and workflow pattern updates by @lyndonkl in https://github.com/lyndonkl/claude/pull/17 * Add skill #25: expected-value by @lyndonkl in https://github.com/lyndonkl/claude/pull/18 * Add skills #26-28: facilitation-patterns, financial-unit-economics, focus-timeboxing-8020 by @lyndonkl in https://github.com/lyndonkl/claude/pull/19 * Add skills #29-30: heuristics-and-checklists, hypotheticals-counterfactuals by @lyndonkl in https://github.com/lyndonkl/claude/pull/20 * Add skills #31-33: information-architecture, kill-criteria-exit-ramps, layered-reasoning by @lyndonkl in https://github.com/lyndonkl/claude/pull/21 * Add Claude Code plugin support by @lyndonkl in https://github.com/lyndonkl/claude/pull/22 * Fix plugin marketplace source path by @lyndonkl in https://github.com/lyndonkl/claude/pull/23 * Add skill #34: mapping-visualization-scaffolds by @lyndonkl in https://github.com/lyndonkl/claude/pull/24 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/25 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/26 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/27 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/28 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/29 * Add skill #59: skill-extraction by @lyndonkl in https://github.com/lyndonkl/claude/pull/30 * Add skill-creator: Transform documents into actionable skills by @lyndonkl in https://github.com/lyndonkl/claude/pull/31 * Update skill count from 58 to 61 in README by @lyndonkl in https://github.com/lyndonkl/claude/pull/32 * Skill refinement by @lyndonkl in https://github.com/lyndonkl/claude/pull/33 * Add d3-visualization skill: comprehensive D3.js implementation guide by @lyndonkl in https://github.com/lyndonkl/claude/pull/34 * Add comprehensive Superforecasting Toolkit with 4 skills and orchestr… by @lyndonkl in https://github.com/lyndonkl/claude/pull/35 * Add "Run in Smithery" badge by @gurdasnijor in https://github.com/lyndonkl/claude/pull/36 * Add Scientific Writing Toolkit with 6 skills and orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/37 * Improve skill invocation rules and update README by @lyndonkl in https://github.com/lyndonkl/claude/pull/38 * Add Geometric Deep Learning skill suite and orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/39 * Decompose writer skill into 4 focused skills + orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/40 * Add GraphRAG skill suite with 5 skills + orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/41 * Decompose cognitive-design skill into 3 focused skills + orchestrating agent by @lyndonkl in https://github.com/lyndonkl/claude/pull/42 ## New Contributors * @lyndonkl made their first contribution in https://github.com/lyndonkl/claude/pull/1 * @gurdasnijor made their first contribution in https://github.com/lyndonkl/claude/pull/36 **Full Changelog**: https://github.com/lyndonkl/claude/commits/0.1
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供完整的 DCF 估值功能,包括逐年预测、终值计算、失败风险调整和敏感性分析
- 支持反向推导市场隐含预期,具有高度实用价值
- 适用于专业金融分析和投资决策场景
Highlights
- 触发描述清晰完整,覆盖内在估值、DCF模型构建、终值计算等多种使用场景
- 边界定义明确,不易与其他Skill混淆
Areas to improve
-
缺少 When to Use 章节 Reported severity: Minor
文档中提到了使用场景但未以明确章节标题组织
Recommendation: 建议添加明确的 When to Use 章节以提升可读性
-
文档过长 Reported severity: Minor
主文档超过500行,影响阅读体验
Recommendation: 考虑将部分详细说明移至独立文档或使用折叠结构
Highlights
- 文档结构完整,包含清晰的计算逻辑和输入输出说明
- 提供了详细的命令行用法和JSON输入示例
Highlights
- 工具来源明确,使用Python标准库无需额外安装
- 内置参数验证机制,能主动拒绝不合理输入
- 提供自检功能确保引擎正确性
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.