| name | dcf-valuation |
| description | 当用户需要计算公司内在价值的时候,使用该DCF(折现现金流)内在价值估算工具。触发词:DCF、折现现金流、内在价值、估值、自由现金流折现、intrinsic value、discounted cash flow、合理股价。触发后自动在浏览器中打开网页计算器。 |
DCF Intrinsic Valuation
Purpose
Open a web-based two-stage DCF (Discounted Cash Flow) calculator in the user's browser for estimating intrinsic equity value (comparable to market cap).
When to Use
Trigger when the user wants to estimate intrinsic value or fair value using DCF / discounted cash flow methodology.
Workflow
1. Start the Local Server & Open Calculator
When the skill is triggered, IMMEDIATELY start the local HTTP server which auto-opens the calculator in the browser. Do NOT ask questions, do NOT present a text form, do NOT wait for input. Run this command directly in the background:
python3 SKILL_DIR/scripts/server.py
Replace SKILL_DIR with the actual absolute path to this skill's directory.
IMPORTANT:
- Run the server command in the background so Claude remains responsive. The server auto-opens the browser.
- The server serves the calculator page and provides API endpoints for saving/loading valuation data directly to
data/valuations.json.
- The server finds a free port starting from 9527 and prints the URL.
- When the user is done with the calculator, stop the background server process.
2. Brief the User
After starting the server, tell the user the calculator is now open in their browser. Mention these key points:
- FCF (自由现金流) and net cash (净现金) are required fields highlighted in orange
- Other parameters have sensible defaults pre-filled (growth rate 10%, 10 years, terminal rate 3%, discount rate 10%)
- The calculator computes equity value (comparable to market cap) and includes a reverse calculator to find the required growth rate for a target return
- Clicking "保存估值" saves data directly to the local
data/valuations.json file (syncs via git)
- All computation happens client-side in the browser
3. Follow-Up (Optional)
If the user wants to discuss results, run sensitivity analysis, or use the CLI script for programmatic calculations, the Python script is available at:
python3 SKILL_DIR/scripts/dcf.py \
--fcf FCF \
--growth-rate GROWTH_RATE \
--growth-years GROWTH_YEARS \
--terminal-growth-rate TERMINAL_RATE \
--discount-rate DISCOUNT_RATE \
--net-cash NET_CASH \
--currency 'SYMBOL'
Do NOT pass --shares parameter. Output focuses on total equity value (market cap level), not per-share price.
Archive & Comparison
Valuation records are stored in SKILL_DIR/data/valuations.json — a JSON array of valuation entries. This file lives in the git repo so it syncs across devices.
Saving a Valuation
The web calculator's "保存估值" button automatically saves records to data/valuations.json via the local server's API. No manual steps needed.
If the server is not running and the user wants to save, either:
- Ask the user to click "复制估值数据" on the web page and paste the JSON, OR
- Construct the JSON entry from conversation context if the user already shared the numbers
Then read SKILL_DIR/data/valuations.json, append the new entry to the array, and write the file back. Each entry has this structure:
{
"company": "Company Name",
"date": "YYYY-MM-DD",
"currency": "¥",
"inputs": {
"fcf": 993,
"growth_rate": 10,
"growth_years": 10,
"terminal_growth_rate": 3,
"discount_rate": 10,
"net_cash": 1999.8,
"market_cap": 9500
},
"results": {
"equity_value": 12345,
"pv_stage1": 5000,
"pv_terminal": 5345,
"enterprise_value": 10345
}
}
Cross-Company Comparison
When the user asks to compare companies (e.g., "对比一下腾讯和阿里"), read the JSON file and present the latest valuation for each company in a side-by-side table: company name, FCF, equity value, market cap, overvalued/undervalued percentage.
Historical Tracking
When the user asks about history for a company (e.g., "腾讯之前估值是多少"), filter entries by company name and show them as a timeline: date, FCF, equity value, and what changed between entries.