feat: enhanced fundamentals, sector browsing, batch support, peer comparison & report checklist#8
Merged
ShuhaoQing merged 8 commits intomainfrom Apr 2, 2026
Merged
Conversation
Extend BasicInfo with ROE, ROA, debt-to-equity, revenue growth, margins, current ratio, cash flow, and PEG ratio. Add FinancialHealthAssessment model with multi-dimensional Chinese-labeled scoring (profitability, growth, leverage, cash flow). USProvider extracts from yfinance ticker.info; AKShareProvider fetches via stock_financial_analysis_indicator with graceful fallback. CLI `analyze fundamental` now shows all metrics, with --verbose for health assessment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add get_sector_list() and get_sector_constituents() to AKShareProvider using AKShare's stock_board_industry_spot_em and stock_board_industry_cons_em APIs. New CLI commands: `market sector-list` for industry board ranking, `market sector <name>` for constituents with PE/PB/market cap. Enables users to discover investment opportunities by sector. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mmands All three commands now accept comma-separated symbols for side-by-side comparison via TSV output. Single-symbol input retains original kv_output behavior. Follows existing correlation command pattern for multi-symbol parsing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New `analyze peer <symbol>` command finds same-sector stocks via AKShareProvider.get_sector_constituents() and presents a TSV comparison table sorted by market cap. Uses sector constituent data directly to avoid excessive API calls. US stocks return a 'not yet supported' message. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New `analyze report` command generates a full multi-section analysis: basic info, valuation, financial health, risk metrics, technical signals, and a 5-dimension buy-readiness checklist (1-5 scoring per dimension). Checklist covers: valuation, profitability, growth, risk, and technicals. Produces recommendation: 建议关注/谨慎观望/建议回避. Added ChecklistItem and BuyReadinessChecklist models. Enhanced StockReport with all Phase 1 financial metrics and checklist field. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…flows Rewrite SKILL.md from command reference to agent orchestration guide. Six workflows: stock analysis, investment direction, buy decision, stock comparison, portfolio checkup, and decision review. Each workflow defines step-by-step CLI commands + agent interpretation guidelines. Added teaching mode section for beginner-friendly explanations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tests - Add _ratio_to_pct() in us_provider to normalize ratios at provider level - Remove flawed ratio/pct heuristic from _assess_growth and _score_growth - Add _bypass_proxy() around _akshare_financial_indicators API call - Add operating_cash_flow to StockReport model and report passthrough - Add batch CLI tests for market quote, analyze fundamental, analyze technical - Fix test data to use percentage format (25.0 instead of 0.25) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AKShare sector APIs use eastmoney push2 endpoints which are frequently unreachable (IP bans, CDN issues). Add Sina Finance API as fallback: - _sina_sector_list(): fetches industry board ranking from Sina - _sina_sector_constituents(): fetches sector stocks with PE/PB/market cap - Both sector methods now use _with_fallback() pattern Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ShuhaoQing
pushed a commit
that referenced
this pull request
Apr 2, 2026
Add documentation for peer comparison, sector browsing, batch fundamental analysis, and comprehensive report with buy-readiness checklist. Expand analysis/ directory listing in CLAUDE.md project structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ShuhaoQing
added a commit
that referenced
this pull request
Apr 2, 2026
## Summary - Add peer comparison, sector browsing, batch fundamental, and comprehensive report to README features list - Add CLI examples for `analyze peer`, `analyze report`, `market sector-list`, `market sector`, and batch `fundamental` - Expand `analysis/` directory listing in CLAUDE.md project structure with all module descriptions ## Test plan - [x] Verify README CLI examples match actual command signatures - [x] Verify CLAUDE.md project structure matches filesystem 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FinancialHealthAssessmentwith Chinese-language profitability/growth/leverage/cash flow ratings. Providers (AKShare + yfinance) extract new fields with proper normalization (ratios → percentages at provider level).market sector-listandmarket sector <name>commands for A-share industry board browsing via AKShare.market quote,analyze fundamental, andanalyze technical— single symbol uses kv_output, multi uses tsv_output comparison table.analyze peer <symbol>for same-sector peer comparison (A-shares, uses sector constituent data directly without per-peer API calls).analyze reportwith 5-dimension buy-readiness checklist (估值/盈利能力/成长性/风险/技术面, 1-5 scale each). Sectioned Chinese output._bypass_proxy()to financial indicators API, addedoperating_cash_flowto StockReport, added batch CLI tests.Test plan
pytest— 243 tests pass (non-integration)ruff check .— all checks passruff format --check .— all files formatteduv run haoinvest analyze fundamental 600519(A-share with new metrics)uv run haoinvest analyze fundamental AAPL -m us(US stock)uv run haoinvest market sector-list(sector browsing)uv run haoinvest analyze report 600519(full report + checklist)🤖 Generated with Claude Code