An OpenCode plugin for Chinese A-share analysis with a single public entrypoint. Users provide a natural-language request like 分析 601688 or 分析 601688 技术面, and the plugin dynamically selects relevant analysis dimensions, incorporates target-price/probability analysis, then always generates an HTML report.
Only one public command is exposed:
@stock 分析 601688
@stock 分析 601688 一月
@stock 分析 601688 技术面
@stock 分析 601688 基本面+资金面
@stock 分析 601688 目标价和概率
@stock 分析 601688 短线
User input
↓
stock (single orchestrator)
↓
parse code / period / style / dimensions
↓
parallel subagents
├─ finance
├─ chart
├─ sector
├─ sentiment
├─ flow
└─ stock-investment-analyzer
↓
reporter
↓
.stock/reports/YYYY-MM-DD/<code>.html
| Agent | Role |
|---|---|
stock |
单入口总协调器 |
finance |
基本面分析 |
chart |
技术面分析 |
sector |
行业面分析 |
sentiment |
情绪/舆情分析 |
flow |
资金/筹码分析 |
stock-investment-analyzer |
目标价、上涨/下跌概率、盈亏比分析 |
reporter |
动态 HTML 报告生成 |
The orchestrator now computes:
baseScore: weighted score from enabled core dimensionsinvestmentAdjustment: target-price/probability adjustmentstyleAdjustment: style-based adjustment (short-term, long-term, value, conservative)conflictPenalty: penalty for conflicting signalsfinalScore: final 0-100 score used for recommendation level
Recommendation levels:
- 85-100: 强烈看多
- 75-84: 偏多
- 65-74: 中性偏多
- 55-64: 观望
- 40-54: 偏空
- 0-39: 回避
Every request produces an HTML report at:
.stock/reports/YYYY-MM-DD/<股票代码>.html
The report includes:
- 综合评分与结论等级
- 评分拆解(baseScore / investmentAdjustment / styleAdjustment / conflictPenalty / finalScore)
- 动态维度图表
- 各维度详细分析卡片
- 目标价与概率分析区块
- 关键利好、关键风险、当前分歧
- 操作建议与免责声明
git clone https://github.com/sjzsdu/tongstock.git
cd tongstock
go build -o tongstock-cli ./cmd/cli
sudo mv tongstock-cli /usr/local/bin/In .opencode/opencode.json:
{
"plugin": [
"./plugins/stock/index.ts"
]
}Create .opencode/stock.json:
{
"weights": "balanced",
"agents": {
"stock": { "model": "anthropic/claude-sonnet-4-20250514" },
"finance": { "model": "anthropic/claude-sonnet-4-20250514" },
"chart": { "model": "anthropic/claude-sonnet-4-20250514" }
}
}| Preset | Finance | Chart | Sector | Sentiment | Flow |
|---|---|---|---|---|---|
| conservative | 35% | 15% | 15% | 15% | 20% |
| balanced | 30% | 25% | 15% | 15% | 15% |
| aggressive | 25% | 35% | 15% | 15% | 10% |
The plugin auto-loads tongstock skills from ~/.tongstock/skills/ with bundled fallbacks.
- Runtime: Bun
- Language: TypeScript
- Data: tongstock-cli
- Output: HTML report
MIT