akshare-stock▌
molezzz/openclaw-stock-skill · updated May 27, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Real-time and historical A-stock analysis with natural language routing across market, fundamental, sector, and derivatives data.
- ›Supports 11 analysis intents: real-time indices, K-line patterns, intraday moves, limit-up/down stats, money flow, fundamentals, margin/dragon-tiger boards, sector rotation, derivatives, funds, and cross-border markets
- ›Four-layer architecture (Router → Service → Analyzer → Formatter) isolates intent parsing, data fetching, metric calculation, and platform-spe
A股分析全能 Skill(AKShare)
目标:在 OpenClaw 中通过自然语言触发 A 股和相关市场分析,输出适配 QQ/Telegram 的紧凑文本。
- 运行环境:Mac + Python 3.9
- akshare 路径:
/Users/molezz/Library/Python/3.9/lib/python3.9/site-packages - Skill 入口建议:
python3 skills/akshare-stock/main.py --query "${USER_QUERY}"
1) 整体架构设计
采用 Router -> Service -> Analyzer -> Formatter 四层结构,便于扩展和维护。
A. 目录组织(建议)
skills/akshare-stock/
SKILL.md
main.py # OpenClaw 调用入口
router.py # 意图识别 + 参数解析
schemas.py # 数据结构定义(dataclass)
formatter.py # QQ/Telegram 输出模板
services/
market_service.py # 大盘/个股行情、K线、分时、涨跌停、资金流
fundamental_service.py# 财务指标、财报、融资融券、龙虎榜
sector_service.py # 行业/概念板块、轮动、板块资金流
cross_service.py # 期货/期权、基金、可转债、港股/美股
analyzers/
kline_analyzer.py # 均线、振幅、涨跌幅、量比等
flow_analyzer.py # 主力净流入、连续性、强弱排序
rotation_analyzer.py # 板块轮动强度、持续性
adapters/
akshare_adapter.py # 封装 akshare 接口,隔离 API 变化
utils/
trading_calendar.py # 交易日判断
symbols.py # 指数/股票/板块别名映射
cache.py # 短缓存(30~120 秒)
B. 核心流程
main.py接收自然语言 query。router.py输出结构化意图:intent + symbols + timeframe + metric + top_n。services/*拉取原始数据(只做数据获取和轻清洗)。analyzers/*做指标计算和结论生成。formatter.py按聊天平台压缩输出(短句、分段、emoji、重点数值)。
C. 关键设计点
- 意图优先级:先识别“任务类型”,再解析标的和参数,避免误判。
- 适配层隔离:akshare 接口若改名,只需改
adapters/akshare_adapter.py。 - 容错回退:实时接口失败时回退到最近交易日数据,并标注“非实时”。
- 缓存策略:
- 大盘/资金流:30~60 秒
- 板块排行:60~120 秒
- 财报/财务:当天缓存
- 消息长度控制:单条建议 <= 1000 字符;超长自动拆分 2~3 条。
2) 触发词设计(自然语言路由)
建议采用“关键词 + 正则 + 别名词典”混合方式。
A. 意图分类(Intent)
INDEX_REALTIME:实时大盘KLINE_ANALYSIS:历史 K 线INTRADAY_ANALYSIS:分时分析LIMIT_STATS:涨跌停统计MONEY_FLOW:资金流向FUNDAMENTAL:财务指标 / 财报MARGIN_LHB:融资融券 / 龙虎榜SECTOR_ANALYSIS:行业/概念/轮动/板块资金DERIVATIVES:期货/期权FUND_BOND:基金净值 / 可转债HK_US_MARKET:港股 / 美股
B. 触发词样例
- 实时大盘:
A股大盘上证现在多少沪深300实时 - K线:
贵州茅台近60日K线宁德时代周线比亚迪月线复权 - 分时:
看下000001分时平安银行今天分时走势 - 涨跌停:
今日涨停统计跌停家数连板梯队 - 资金流:
主力资金流入前十北向资金行业资金净流入 - 基本面:
茅台财务指标宁德时代最新季报ROE和毛利率 - 融资融券/龙虎榜:
中兴通讯融资融券今日龙虎榜 - 板块:
行业板块涨幅榜概念轮动AI板块资金流 - 其他市场:
IF主力合约300ETF期权基金净值可转债行情腾讯港股英伟达美股
C. 参数抽取规则
- 股票代码:
\b\d{6}\b(如600519) - 日期:
YYYYMMDD/YYYY-MM-DD/今天/昨日/近N日 - 周期:
1m/5m/15m/30m/60m/day/week/month - 排名:
前N(默认 10) - 复权:
前复权/后复权/不复权
3) 各功能实现思路
下面是“功能 -> 推荐数据 -> 分析输出”的落地框架(接口以 akshare 当前版本为准,实际以 adapter 层统一封装)。
3.1 实时大盘行情(已有基础版,升级点)
- 数据:上证、深成指、创业板、沪深300、上证50、科创50。
- 增强:加入成交额、振幅、领涨板块、北向资金当日净流入。
- 输出:
指数点位 + 涨跌幅 + 市场情绪一句话。
3.2 行情分析
- 历史K线:
- 数据:日/周/月 K 线(复权可选)。
- 指标:近 N 日涨跌幅、5/10/20 日均线、量能变化、波动率。
- 输出:趋势判断(多头/震荡/走弱)+ 关键位(支撑/压力)。
- 分时数据:
- 数据:分钟级行情。
- 指标:VWAP 偏离、盘中高低点、午后资金回流。
- 涨跌停统计:
- 数据:涨停池、跌停池、连板梯队。
- 指标:涨停家数、炸板率、最高连板、情绪评分。
- 资金流向:
- 数据:个股/行业/市场资金流。
- 指标:主力净流入 TopN、连续净流入天数、资金集中度。
3.3 基本面分析
- 个股财务指标:ROE、毛利率、净利率、资产负债率、经营现金流。
- 财报数据:营收同比、净利润同比、扣非净利润同比、EPS。
- 融资融券:融资余额、融券余额、日变动,识别杠杆偏好。
- 龙虎榜:上榜原因、买卖前五席位净额、游资活跃度。
- 输出风格:
核心指标摘要 + 同比/环比 + 风险提示。
3.4 板块分析
- 行业板块涨跌:行业涨跌幅榜、成交额、上涨家数。
- 概念板块轮动:近 5 日强度、持续性、日内切换速度。
- 板块资金流向:行业/概念净流入排行 + 领涨龙头。
- 输出:
强势板块Top3 + 轮动结论 + 次日观察点。
3.5 其他(跨市场)
- 期货/期权:主力合约价格、涨跌、持仓变化;期权 PCR(若可得)。
- 基金净值:开放式基金净值、估值偏离、近一周收益。
- 可转债:价格、溢价率、正股联动、成交额。
- 港股/美股:实时行情、近5日表现、与A股联动提示。
4) 代码示例框架(骨架)
说明:以下为可直接落地的最小框架,不含完整业务细节。
main.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
from router import parse_query
from services.market_service import MarketService
from services.fundamental_service import FundamentalService
from services.sector_service import SectorService
from services.cross_service import CrossService
from formatter import render_output
def dispatch(intent_obj):
intent = intent_obj.intent
if intent in {"INDEX_REALTIME", "KLINE_ANALYSIS", "INTRADAY_ANALYSIS", "LIMIT_STATS", "MONEY_FLOW"}:
data = MarketService().handle(intent_obj)
elif intent in {"FUNDAMENTAL", "MARGIN_LHB"}:
data = FundamentalService().handle(intent_obj)
elif intent == "SECTOR_ANALYSIS":
data = SectorService().handle(intent_obj)
elif intent in {"DERIVATIVES", "FUND_BOND", "HK_US_MARKET"}:
data = CrossService().handle(intent_obj)
else:
data = {"ok": False, "error": "未识别请求,请补充标的或时间范围"}
return data
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--query", required=True, help="自然语言请求")
parser.add_argument("--platform", default="qq", choices=["qq", "telegram"])
args = parser.parse_args()
intent_obj = parse_query(args.query)
result = dispatch(intent_obj)
text = render_output(intent_obj, result, platform=args.platform)
print(text)
if __name__ == "__main__":
main()
router.py
from dataclasses import dataclass, field
import re
@dataclass
class IntentObj:
intent: str
symbols: list = field(default_factory=list)
timeframe: str = "day"
days: int = 60
top_n: int = 10
date: str = ""
raw_query: str = ""
def parse_query(query: str) -> IntentObj:
q = query.strip()
obj = IntentObj(intent="INDEX_REALTIME", raw_query=q)
# 1) intent
if any(k in q for k in ["K线", "日线", "周线", "月线"]):
obj.intent = "KLINE_ANALYSIS"
elif "分时" in q:
obj.intent = "INTRADAY_ANALYSIS"
elif any(k in q for k in ["涨停", "跌停", "连板"]):
obj.intent = "LIMIT_STATS"
elif "资金" in q:
obj.intent = "MONEY_FLOW"
elif any(k in q for k in ["财务", "财报", "ROE", "毛利率"]):
obj.intent = "FUNDAMENTAL"
elif any(k in q for k in ["融资融券", "龙虎榜"]):
obj.intent = "MARGIN_LHB"
elif any(k in q for k in ["板块", "行业", "概念", "轮动"]):
obj.intent = "SECTOR_ANALYSIS"
elif any(k in q for k in ["期货", "期权"]):
obj.intent = "DERIVATIVES"
elif any(k in q for k in ["基金", "净值",How to use akshare-stock 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 akshare-stock
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches akshare-stock from GitHub repository molezzz/openclaw-stock-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 akshare-stock. Access the skill through slash commands (e.g., /akshare-stock) 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★★★★★58 reviews- ★★★★★Luis Brown· Dec 28, 2024
Keeps context tight: akshare-stock is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Alexander Iyer· Dec 24, 2024
akshare-stock is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Benjamin Chawla· Dec 16, 2024
akshare-stock fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Isabella Torres· Dec 8, 2024
I recommend akshare-stock for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Hiroshi Patel· Dec 4, 2024
We added akshare-stock from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Sakura Shah· Nov 27, 2024
akshare-stock reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Benjamin Nasser· Nov 19, 2024
akshare-stock has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Ishan Choi· Nov 15, 2024
Solid pick for teams standardizing on skills: akshare-stock is focused, and the summary matches what you get after install.
- ★★★★★Isabella Desai· Nov 7, 2024
akshare-stock fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Ishan Ghosh· Oct 26, 2024
We added akshare-stock from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 58