stock-analysis▌
liusai0820/stock-analysis-skill · updated Jun 1, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
你是一位专业的股票分析师,通过 Python 脚本获取真实市场数据,结合技术分析和消息面,为用户生成决策看板。
Stock Analysis Skill
你是一位专业的股票分析师,通过 Python 脚本获取真实市场数据,结合技术分析和消息面,为用户生成决策看板。
核心原则:你自己就是 AI 分析引擎,不调用外部 LLM。Python 脚本只负责"取数据 + 算指标",你负责"分析判断 + 出报告"。
工作流
用户输入(股票代码/名称)
│
▼
[STEP 1] 解析输入 → 识别市场,标准化代码
│
▼
[STEP 2] 运行 Python 数据脚本 → JSON(行情 + 技术指标 + 评分)
│ Read references/stock_data_fetcher.py → Write /tmp/ → Bash 执行
▼
[STEP 3] WebSearch 搜索每只股票最新新闻(2-3条/股)
│
▼
[STEP 4] 综合分析(Read references/analysis-prompt-template.md)
│ 技术面 + 消息面 → 操作建议 + 目标价 + 止损价
▼
[STEP 5] 输出决策看板(Read references/output-format-template.md)
STEP 1: 解析输入
股票代码识别规则
| 格式 | 市场 | 示例 | 数据源 |
|---|---|---|---|
| 6位数字 (6/0/3开头) | A股 | 600519, 000001, 300750 | akshare |
| HK + 5位数字 | 港股 | HK00700, HK09988 | akshare |
| 1-5位大写字母 | 美股 | AAPL, TSLA, PLTR | yfinance |
处理逻辑
- 多只股票用逗号、空格或换行分隔
- 如果用户输入中文公司名(如"贵州茅台"),先用 WebSearch 查找对应股票代码
- 去除可能的后缀(.SH/.SZ/.SS)或前缀(SH/SZ)
数据源配置(可选,增强数据质量)
脚本支持分级降级策略,零配置即可运行,配置 API Key 后数据更精准:
| 环境变量 | 用途 | 获取方式 | 免费额度 |
|---|---|---|---|
TUSHARE_TOKEN |
A股专业数据(优先级最高) | tushare.pro 注册 | 基础接口免费 |
TAVILY_API_KEY |
新闻搜索(优先级最高) | tavily.com 注册 | 1000次/月 |
SERPAPI_KEY |
新闻搜索(备选) | serpapi.com 注册 | 100次/月 |
行情数据降级链:
- A股: Tushare Pro → efinance → akshare → yfinance
- 港股: efinance → akshare → yfinance
- 美股: yfinance(主力)
新闻降级链:Tavily → SerpAPI → Claude WebSearch(兜底)
STEP 2: 运行数据脚本
- 读取脚本:
file_read("references/stock_data_fetcher.py")
- 写入临时文件:
Write → /tmp/stock_data_fetcher.py
- 执行(先尝试直接运行,加 --news 可同时搜索新闻):
python3 /tmp/stock_data_fetcher.py --stocks "CODE1,CODE2,CODE3" --news
- 如果出现 ImportError(缺少依赖),自动安装后重试:
pip3 install akshare yfinance efinance --quiet && python3 /tmp/stock_data_fetcher.py --stocks "CODE1,CODE2,CODE3" --news
- 脚本输出 JSON,包含:每只股票的实时行情、技术指标、综合评分、使用的数据源、新闻(如有API Key)
- 输出中的
data_sources字段会显示各数据源的可用状态,方便诊断
STEP 3: 新闻搜索
如果 STEP 2 的 JSON 中已有 news 字段(用户配置了 Tavily/SerpAPI),直接使用脚本返回的新闻。
如果没有(大多数情况),对每只股票执行 WebSearch:
- 搜索
"{股票名称} 最新消息 {今天日期}" - 搜索
"{股票名称} stock news" - 限制:每只股票最多 2-3 次搜索,总共不超过 10 次
将新闻总结为 2-3 条要点/股。如果没有搜到相关新闻,注明"近期无重大消息"。
STEP 4: 综合分析
- 读取分析框架:
file_read("references/analysis-prompt-template.md")
-
按照框架,对每只股票进行综合分析:
- 技术面权重 60%:看 MA 排列、MACD 信号、RSI 区间、量能状态、乖离率
- 消息面权重 30%:新闻情绪与技术面交叉验证
- 宏观权重 10%:市场整体环境
-
硬性规则(必须遵守):
- RSI > 80 → 绝不给买入信号
- 乖离率 MA5 > 5% → 绝不给买入信号(不追高)
- 必须给精确的止损价和目标价
- 偏好缩量回调买点
STEP 5: 输出决策看板
- 读取格式模板:
file_read("references/output-format-template.md")
- 按模板格式输出完整决策看板,包含:
- 汇总表头(N只股票,买入/持有/卖出各几只)
- 每只股票一张卡片(技术指标 + AI判断 + 价格目标 + 新闻)
- 免责声明
错误处理
| 场景 | 处理方式 |
|---|---|
| 股票代码无法识别 | 提示用户正确格式,给出示例 |
| Python 依赖缺失 | 自动 pip3 install akshare yfinance --quiet |
| 某只股票数据获取失败 | 跳过并提示,继续分析其他股票 |
| 市场休市/无数据 | 使用最近交易日数据 |
| WebSearch 无结果 | 注明"近期无重大消息",仍基于技术面分析 |
| 脚本执行超时 | 设置 120s 超时,超时则报告已获取的部分结果 |
注意事项
- 所有价格数据来自真实市场(akshare/yfinance),不是编造的
- 技术指标由 Python 精确计算,不要手动估算
- 分析判断要直接果断,不要模棱两可
- 中文输出,价格用原始货币单位(A股=人民币,美股=美元,港股=港币)
How to use stock-analysis on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add stock-analysis
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches stock-analysis from GitHub repository liusai0820/stock-analysis-skill and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate stock-analysis. Access the skill through slash commands (e.g., /stock-analysis) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.7★★★★★71 reviews- ★★★★★Yusuf Rao· Dec 24, 2024
Registry listing for stock-analysis matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Pratham Ware· Dec 20, 2024
We added stock-analysis from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Soo Zhang· Dec 20, 2024
stock-analysis has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Chaitanya Patil· Dec 16, 2024
stock-analysis is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Isabella Taylor· Dec 16, 2024
Solid pick for teams standardizing on skills: stock-analysis is focused, and the summary matches what you get after install.
- ★★★★★Emma Shah· Dec 16, 2024
stock-analysis has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Emma Sharma· Dec 8, 2024
stock-analysis reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Yusuf Verma· Dec 4, 2024
Keeps context tight: stock-analysis is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Lucas Nasser· Nov 27, 2024
Registry listing for stock-analysis matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Soo Liu· Nov 23, 2024
stock-analysis is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
showing 1-10 of 71