valuation-calculator
Skill9 starsChanged 4 months agoMITView on GitHub
This skill should be used when the user asks '这只股票贵不贵', '估值合理吗', '目标价多少', '跟同行比怎么样', or during a stock-analyzer valuation step. Calculates PE/PB/PS historical percentiles, builds peer-comparison tables, and derives target prices via PE-based or PB-based methods. Quantitative/relative valuation — distinct from the DCF-style intrinsic-value-analysis skill.
In this repository14 other files it gives its agents.
- catalyst-trackerSkill
- company-analyzerSkill
- financial-data-fetcherSkill
- industry-chain-mapperSkill
- industry-chain-researchSkill
- intrinsic-value-analysisSkill
- marxist-method-for-actionSkill
- meta-promptSkill
- news-scannerSkill
- stock-analyzerSkill
- stock-market-dataSkill
- technical-analyzerSkill
- tushare-dataSkill
- wechat-feedsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
When deciding a target price for a trade
- Distinctive: line 15
When comparing multiple candidates in the same sector
- Very specific: line 33
Use Tushare daily_basic for direct PE/PB/PS time series (no manual calculation needed):
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Valuation Calculator
Quantitative, relative valuation for investment decisions (PE/PB percentiles + peer comparison + target price). For absolute DCF-style intrinsic value, use the intrinsic-value-analysis skill instead.
When to Use
- During stock analysis (the valuation step)
- When deciding a target price for a trade
- When comparing multiple candidates in the same sector
Prerequisites
Uses the sibling tushare-data / stock-market-data skills. Set once per shell:
export TUSHARE_TOKEN=<your Tushare Pro token> # never hard-code; see the tushare-data skill
PY=python3 # a python3 with tushare/pandas/akshare (e.g. stock-market-data/.venv/bin/python3)
SKILLS=~/.claude/skills # where you installed these skills
TS=$SKILLS/tushare-data/scripts/fetch_tushare.py
AK=$SKILLS/stock-market-data/scriptsMethods
1. Historical Percentile
Use Tushare daily_basic for direct PE/PB/PS time series (no manual calculation needed):
# Get 3-year PE/PB/PS history for percentile calculation
$PY $TS --mode daily_basic --symbols {CODE}.SZ --start 20230101From the returned data:
- Calculate PE_TTM percentile over available history
- Calculate PB percentile over available history
- Identify current position in historical range
2. Peer Comparison
# Tushare: valuation + financial ratios for each peer
$PY $TS --mode daily_basic --symbols {code1}.SZ --start 20260301
$PY $TS --mode fina_indicator --symbols {code1}.SZ
# Repeat for each peer...
# Fallback: AKShare (batch)
$PY $AK/fetch_financial_data.py --mode stock --symbols {code1},{code2},{code3}Compare: PE, PB, ROE, revenue growth, net margin across peers. Identify: who is cheapest relative to growth? (PEG ratio)
Supplement with WebSearch for analyst consensus (券商一致预期), forecasts, and cross-sector peer comparison data:
WebSearch: "{stock name} 一致预期 估值 目标价"3. Target Price Derivation
Methods available:
- PE-based: Target PE × Expected EPS = Target Price
- PB-based: Target PB × Book Value = Target Price
- DCF-simplified: skip here; use the
intrinsic-value-analysisskill for a proper DCF-style approach
Output Format
### 估值分析 — {stock}({code})
**当前估值**
- PE(TTM): {X}x
- PB: {X}x
- 市值: {X} 亿
**同行对比**
| 公司 | PE | PB | ROE | 净利率 | 营收增速 |
|------|----|----|-----|--------|----------|
**估值判断**: 偏贵/合理/偏低 — {reasoning}
**目标价推导**
- 方法: {PE-based / PB-based}
- 假设: {key assumption}
- 目标PE: {X}x → 目标价: {X} 元 → 上行空间: {X}%Rules
- Valuation is relative, not absolute — always compare to peers and history
- Growth justifies premium — high PE is OK if growth is higher
- State assumptions explicitly — target price is only as good as its assumptions
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

