
stock-analyzer
Value-investing stock analysis tool combining the Warren Buffett and Duan Yongping frameworks. Automatically generates five-dimensional analysis, valuation, position-building, and options recommendations. Ideal for US/HK stock research, post-earnings reviews, annual monthly seasonality tracking, and scenarios requiring midterm election cycle/holiday effect integration to screen defensive stocks during downturns.
Related Skills
Value-investing stock analysis tool combining the Warren Buffett and Duan Yongping frameworks. Automatically generates five-dimensional analysis, valuation, position-building, and options recommendations. Ideal for US/HK stock research, post-earnings reviews, annual monthly seasonality tracking, and scenarios requiring midterm election cycle/holiday effect integration to screen defensive stocks during downturns.
Stock Analyzer Skill
A value-investing-oriented stock analysis tool integrating the investment philosophies of Warren Buffett and Duan Yongping.
✅ The current script built-in features: Buffett/Duan Yongping qualitative assessment + Five-Dimensional Value Investing Framework, generating output automatically following a unified template.
Core Philosophy
💡 Buy the company, not the stock. — Duan Yongping
💡 Be friends with time. — Hold quality companies for the long term
💡 Left-side trading. — Be greedy when others are fearful
📚 Analysis Methodology
For a detailed overview of the five-dimensional value investing methodology, see: METHODOLOGY.md
This methodology includes:
- 🧭 Buffett + Duan Yongping qualitative assessment of "good companies" (Business model / Profitability / Corporate culture)
- 📊 Market environment and event-driven analysis
- 🗓️ Market clock (Midterm election cycle / Holiday effects / Monthly seasonality)
- 🛡️ Downturn defensive stock watchlist (investable targets categorized by sector)
- 📞 Option cash flow rules: Staggered out-of-the-money (OTM) Long Call positions; trim positions in batches at +50%-100% unrealized gain and reinvest cash flows back into underlying stocks
- 🏰 Duan Yongping 5-Dimensional Economic Moat Scoring Model
- 💰 Deep analysis framework for Free Cash Flow / Operating Cash Flow per share (FCF/OCF)
- 📈 Forward P/E and multi-dimensional PEG valuation
- 🎯 Three-stage DCF model and sensitivity analysis
- 📝 Standardized analysis report template (covering company business, profit model, and corporate culture)
Two Analysis Tools
1. analyze-stock — Basic Analysis
# Quick analysis
analyze-stock AAPL
analyze-stock AMZN
# Save report
analyze-stock TSLA --save
# Output formats
analyze-stock NVDA --format json
2. analyze-value — Value Investing Analysis (Recommended)
# Deep value investing analysis
analyze-value AMZN
analyze-value AAPL
analyze-value 1810.HK
# Save detailed report
analyze-value TSLA --save
analyze-value META --format md
3. analyze-earnings — Earnings Review Workflow (Official Sources First)
# Generate reusable earnings analysis reports for any company
analyze-earnings COIN
analyze-earnings AAPL --out /tmp/aapl-earnings.md
# Output raw JSON simultaneously for easy automation
analyze-earnings MSFT --json
# Specify company name (used for candidate IR entry URLs)
analyze-earnings BRK.B --company "Berkshire Hathaway"
Key Features of analyze-value
0. Buffett + Duan Yongping "Good Company" Assessment (New)
- Company Business: Explains in one sentence what the company sells, who its customers are, and where growth comes from.
- Profit Model: Revenue structure, margin structure, cash flow sources, and CapEx characteristics.
- Corporate Culture: Management long-termism, capital allocation discipline, and organizational execution culture.
- 4 Questions & 4 Checks: Buffett's 4 Questions + Duan Yongping's 4 Checks to evaluate whether it is a "good company" first.
1. Forward P/E Detailed Analysis
- Current P/E: Specific value + industry comparison
- Historical P/E Range: TTM vs Forward
- Valuation Assessment: 6-level rating system (Significantly Undervalued → Severely Overvalued)
- Industry Benchmark: Percentage relative to industry median/average
2. Detailed Cash Flow Analysis
- FCF Calculation: OCF - CapEx = FCF
- FCF per Share: Specific metric + P/FCF ratio
- FCF Yield: Compared against Treasury yields
- Cash Flow Quality: 4-level evaluation system
3. Five-Dimensional Fundamentals Analysis
- ROE/ROA: Capital return efficiency
- Gross/Net Margins: Profitability metrics
- Debt-to-Assets Ratio: Financial health and balance sheet leverage
- Operating Cash Flow / Net Income: Cash conversion quality
4. FCF per Share Analysis
- Annual FCF: Aggregate amount + per-share calculation
- P/FCF Valuation: Benchmark against industry averages
- Historical Trend: 3-year trailing trajectory
- Dividend Coverage: FCF / Net Income ratio
5. Detailed PEG Valuation Analysis
- PEG Calculation: Forward P/E ÷ EPS Growth Rate
- Multiple Horizons: 1-year / 2-year PEG comparison
- Baseline Comparison: Standardized against PEG = 1.0
- Investment Rating: 5-level scoring system
6. Detailed DCF Valuation Analysis
- Three-Stage Model: High Growth (3 yrs) → Moderate Growth (2 yrs) → Terminal Growth
- Transparent Parameters: FCF baseline, growth rate, WACC, terminal growth rate
- Sensitivity Analysis: Matrix of 9 scenario combinations
- Valuation Range: Minimum - Maximum - Average Intrinsic Value
7. Future 1-5 Year Valuation Estimates
• 1 Year: $XXX (Annualized Return: +XX%) → Rating
• 3 Years: $XXX (Annualized Return: +XX%) → Rating
• 5 Years: $XXX (Annualized Return: +XX%) → Rating
8. Left-Side Trading Execution Plan
Target Allocation: 5-10%
• Tranche 1 (Starter 20%): $Price Range + Conditions
• Tranche 2 (Add 30%): $Price Range + Conditions
• Core Tranche (35%): $Price Range + Conditions
• Extreme Tranche (15%): <$Price + Conditions
9. "Time is Your Friend" Holding Rationale
Automatically generates Warren Buffett / Duan Yongping style investment theses:
- Economic moat protects long-term competitiveness
- ROE demonstrates high capital efficiency
- Free cash flow generates tangible value
- Ample margin of safety
- Compound long-term capital growth
10. Short-Term Options & Implied Volatility Analysis (New)
- Call/Put volume for nearest expiry options
- Put/Call Volume Ratio and Open Interest Ratio
- ATM Average Implied Volatility (IV)
- Used to assess short-term market sentiment and volatility risks
11. Options Cash Flow Strategy (User Rules)
- Layer positions via OTM Long Calls (default: 10% / 20% OTM tiers)
- Expiration structure: At least 6 months, ideally 12+ months (LEAPS preferred)
- Output requirement: Provide specific option strike prices and expiration dates, not just ranges
- At +50% unrealized gain on Long Calls: Trim partial position (~30%-50%) to lock in cash flow
- At +100% unrealized gain: Trim down to base position or exit entirely
- Prioritize recycling option gains back into left-side buy zones for underlying stock shares, closing the loop: "Options Cash Flow → Stock Reinvestment"
Sample Output
$ analyze-value AMZN
🔍 Running Value Investing Analysis: AMZN...
💡 Philosophy: Buy companies, not stocks | Be friends with time | Left-side trading
============================================================================
📊 Amazon.com Inc (AMZN) Value Investing Analysis Report
============================================================================
[Core Data]
• Stock Price: $205.5 | Market Cap: $2206.0B
• 52-Week Range: $164.4 - $246.6
• Forward P/E: 22.1x
[Buffett-Style Valuation]
• DCF Intrinsic Value: $280.5
• Margin of Safety: +36.5%
✅ Ample Margin of Safety (>20%), meets Buffett standard
[Economic Moat Analysis] (Duan Yongping 5-Dimensions)
• Network Effects: ⭐⭐⭐⭐⭐
• Brand Moat: ⭐⭐⭐⭐
• Tech Moat: ⭐⭐⭐⭐
• Cost Advantage: ⭐⭐⭐⭐⭐
• Switching Costs: ⭐⭐⭐⭐⭐
• Overall Moat Rating: Wide Moat (4.4/5.0)
[1-5 Year Value Estimates]
• 1 Year: $224.5 (Annualized Return: +9.2%)
• 3 Years: $290.3 (Annualized Return: +12.1%)
• 5 Years: $368.8 (Annualized Return: +12.4%)
[Five-Dimensional Scores]
1. Valuation / Margin of Safety: ⭐⭐⭐⭐⭐
2. Economic Moat: ⭐⭐⭐⭐⭐
3. Cash Flow: ⭐⭐⭐⭐
4. Profitability: ⭐⭐⭐⭐⭐
5. Growth Potential: ⭐⭐⭐⭐
Overall Score: 4.4/5.0
[Investment Rating]
🎯 BUY ⭐⭐⭐⭐⭐
[Left-Side Trading Execution Plan]
• Tranche 1 (Starter 20%): $195-$215
• Tranche 2 (Add 30%): $175-$195
• Core Tranche (35%): $165-$175
• Extreme Tranche (15%): <$165
["Time is Your Friend" Holding Rationale]
1. Wide economic moat protects long-term competitive advantage
2. ROE of 22.3% demonstrates excellent capital efficiency
3. $32.2B annual free cash flow creates sustainable shareholder value
4. Purchased at a 36% discount to intrinsic value, offering ample margin of safety
5. Hold for 3-5 years to allow corporate value to compound over time
Five-Dimensional Scoring Framework
| Dimension | Weight | Criteria |
|---|---|---|
| Valuation / Margin of Safety | 20% | DCF Intrinsic Value vs Current Price |
| Economic Moat | 20% | 5-Dimensional Moat Score |
| Cash Flow | 20% | FCF Health & Yield |
| Profitability | 20% | ROE, ROA, Net Margin |
| Growth Potential | 20% | EPS Growth Expectations |
Investment Rating Standards
| Overall Score | Margin of Safety | Rating | Actionable Guidance |
|---|---|---|---|
| ≥4.5 | >20% | STRONG BUY ⭐⭐⭐⭐⭐ | Accumulate Heavy Position |
| ≥4.0 | >10% | BUY ⭐⭐⭐⭐ | Build Position in Batches |
| ≥3.5 | - | HOLD ⭐⭐⭐ | Hold & Observe |
| <3.5 | - | AVOID ⭐⭐ | Avoid |
Installation
# Ensure dependencies are installed
pip install yahooquery
# Add to PATH
export PATH="$HOME/.openclaw/workspace/skills/stock-analyzer:$PATH"
Data Sources
- Yahoo Finance (via yahooquery)
- SEC EDGAR submissions API (for latest 8-K/10-Q/10-K filings; highlighted in report if rate-limited)
- Corporate Investor Relations portals (via candidate workflow entry points + browser verification)
- Real-time stock prices, financial statements, and consensus analyst forecasts
Disclaimer
This tool offers analytical frameworks based on value-investing principles for informational purposes only and does not constitute financial advice. Investing involves risk; exercise caution before entering the market.
Keep in mind:
- All valuation models have limitations
- DCF models rely heavily on future growth assumptions
- Make investment decisions aligned with your personal risk tolerance
- Long-term holding requires a fundamental understanding of the business
🕰️ "Time is the friend of the wonderful company, the enemy of the mediocre." — Warren Buffett





