jamesxxx-ai/ashare-agent

基于 DeepSeek Harness + AKShare 的本地 A 股 AI Agent 工作台:数据获取 / 每日晨报 / 交易复盘三大技能,只做分析、不做交易。

Project Overview项目介绍

ashare-agent is a local AI Agent workbench for A-share research, purpose-built around DeepSeek Harness (dsh) and tightly coupled with the akshare Python data stack plus pandas, backtrader, matplotlib, and tabulate. It exposes three SKILL.md skills that dsh discovers natively: ashare-data pulls quotes, fundamentals, northbound flow, and news; ashare-report produces the daily morning briefing; ashare-review runs after-action reviews on past trade settlements.

Typical workflow begins with git clone followed by ./setup.sh, which creates a venv, installs pinned dependencies from requirements.txt, seeds example watchlist/positions templates, and links skills/ into .dsh/skills so dsh's fixed scanner picks them up; a global symlink under ~/.dsh/skills extends availability to every workspace. From inside dsh, users fire one-line intents like 执行 ashare-report, drop annual-report PDFs into data/reports/ for cross-validated financial flagging, describe a screening rule in natural language to emit scripts/screener.py, or feed backtrader a habit to backtest. The project is aimed at individual investors who want disciplined, read-only analysis: AGENTS.md hard-codes the rule that the agent never trades and must surface every number from real API output or openly admit failure.

Dependencies are Python 3.11 (chosen for backtrader compatibility over 3.13/3.14), the dsh CLI, and git, with all Python packages version-locked in requirements.txt. Known limits include eastmoney K-line hosts being unreachable on some networks (the script hard-codes sina instead) and northbound real-time net buy data being discontinued since August 2024, so the interface returns 0. Setup defaults to workspace-write permission rather than danger-full-access, easytrader is deliberately excluded to physically isolate order routing, and watchlist/positions/trade CSVs are gitignored. License is MIT; first-run users should copy the *.example templates in data/, then trigger a dry run via .venv/bin/python scripts/morning_report.py --save.

ashare-agent 是一个面向 A 股研究的本地 AI Agent 工作台,专门为 DeepSeek Harness(dsh)打造,深度集成 akshare、pandas、backtrader、matplotlib 等 Python 3.11 数据栈。它通过三个 SKILL.md 技能被 dsh 原生识别:ashare-data 负责行情与新闻抓取,ashare-report 生成每日晨报,ashare-review 完成交易复盘。

典型流程为:用户克隆仓库后运行 setup.sh 自动建 venv、装依赖、建立 .dsh/skills 软链;随后在 dsh 中通过"执行 ashare-report"等一句话触发晨报生成,或把年报 PDF 放入 data/reports/ 让 Agent 做财务排雷,亦可让 Agent 据自然语言条件生成选股脚本。该工具适合追求严谨纪律的个人投资者,但明确不做实盘交易,所有操作清单由人手动执行。

依赖包括 Python 3.11、dsh CLI、git,锁定的 akshare/backtrader 等版本写在 requirements.txt;已知限制为 eastmoney K 线在部分网络下不可用、北向实时净买额自 2024 年 8 月起停披露。许可证为 MIT,watchlist/持仓/交割单等敏感数据已被 .gitignore 脱敏。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • Only 5 stars - very few users, little community feedback星标只有 5,几乎没人在用,遇到问题缺少社区反馈
  • No DSH plugin manifest detected - it may only carry the dsh-plugin topic, so the install method must be confirmed on the spot未检测到 DSH 插件清单:可能只是打了 dsh-plugin 话题,安装方式要现场确认
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:jamesxxx-ai/ashare-agent

把 jamesxxx-ai/ashare-agent 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

ashare-agent

基于 DeepSeek Harness(dsh)+ AKShare 的本地 A 股 AI Agent 工作台

License: MIT Python Awesome

A 股研究与复盘工作台:数据获取 / 每日晨报 / 交易复盘三大技能,外加回测、选股、监控的脚本骨架。Agent 只做分析、不做交易;所有数字来自数据接口实际输出,拿不到就明说,绝不估算编造。

⚠️ 免责声明:本项目不含任何实盘下单能力,不构成投资建议。数据来自公开接口,可能存在延迟、缺失或错误,请自行核对。

目录

特性

  • 🧭 3 个 dsh 技能:ashare-data(数据获取)、ashare-report(每日晨报)、ashare-review(交易复盘),SKILL.md 格式,dsh 原生识别
  • 📜 AGENTS.md 投资准则:铁律约束——不做买卖决策、禁用「目标价/必涨」措辞、数字必须来自脚本、数据拿不到就明说
  • 🐍 Python 3.11 数据环境:akshare + pandas + backtrader + matplotlib + tabulate,版本锁定在 requirements.txt
  • 📈 可复用脚本 scripts/morning_report.py:一条命令生成晨报,已处理数据源切换与代理绕过
  • 🔒 默认脱敏:自选股 / 持仓 / 交割单等个人金融数据被 .gitignore,只提交 *.example 模板

快速开始

前置要求

  • Python 3.11+(推荐 3.11,兼容老牌 backtrader)
  • dsh(DeepSeek Harness CLI)
  • git

安装

git clone https://github.com/sfeng49/ashare-agent.git
cd ashare-agent

# 一键初始化:建 venv、装依赖、生成数据文件、接好技能发现链接
./setup.sh

等价手动步骤:

python3.11 -m venv .venv
.venv/bin/pip install -r requirements.txt
cp data/watchlist.example.txt data/watchlist.txt   # 换成你的自选股
cp data/positions.example.csv data/positions.csv
mkdir -p .dsh && ln -sfn ../skills .dsh/skills

让 dsh 识别技能

dsh 只扫描固定技能根目录(.dsh/skills、.agents/skills、~/.dsh/skills、~/.agents/skills),并不默认识别工作区顶层的 skills/。setup.sh 已创建项目级链接 .dsh/skills -> ../skills。

如需让技能在任意工作区可用,再执行:

ln -sfn "$(pwd)/skills" ~/.dsh/skills

跑第一个晨报

# 直接用脚本(不依赖 dsh)
.venv/bin/python scripts/morning_report.py --save

# 或在 dsh 中把工作区指向本目录后
执行 ashare-report

六个任务

这是工作台的完整玩法,每个任务都可用一句话在 dsh 里发起。

# 任务 一句话触发 产出
1 每日晨报 执行 ashare-report output/daily/YYYY-MM-DD-morning.md
2 年报速读 + 财务排雷 把 PDF 放进 data/reports/ 后让 Agent 分析 提取 + 横向对比 + 矛盾清单 + 风险清单
3 自然语言选股 描述条件让 Agent 生成脚本 参数化的 scripts/screener.py
4 回测「盘感」 用 backtrader 回测你的交易习惯 年化/回撤/夏普 + 参数敏感性测试
5 盯盘监控 写 scripts/monitor.py webhook 推送异动(去重)
6 交易复盘 交割单放 data/trades/ 后 执行 ashare-review 胜率/盈亏比/行为模式/相对沪深300 的 alpha

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-meter 下一个 Next harness-session-delete →