Portfolio Diagnosis logo

Portfolio Diagnosis

Community
huangrichao2020
portfolio-diagnosis

A股持仓诊断——通过截图或文本输入持仓信息,获取实时行情,用四层融合框架(L0人性层/L1情绪层/L2产业层/L3证据层)逐只诊断,分级评级(A/B/C/D),给出短期(下周)和中期(下月)操作建议。当用户要求"分析持仓""诊断持仓""看看我的股票""持仓复盘""我的股票有没有行情"等话题时使用。

Overview

Publisherhuangrichao2020
Repositorypretty-skills
Skill nameportfolio-diagnosis
Stars
54
Forks
4
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by huangrichao2020 on GitHub. Read the source before you install it.

Installation

Install the Portfolio Diagnosis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/huangrichao2020/pretty-skills/tree/main/金融投资/portfolio-diagnosis-持仓诊断
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Portfolio Diagnosis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Portfolio Diagnosis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Portfolio Diagnosis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

持仓诊断

核心理念

持仓诊断不是逐只点评,而是用四层融合框架对整个组合做一次"体检":

text
L0 人性层(最高否决权):群体信念在形成还是在崩塌?住相信号亮了几灯?
L1 情绪层:市场表面温度适合交易吗?情绪周期在哪个阶段?
L2 产业层:持仓标的所在行业有真实逻辑吗?催化剂是什么?
L3 证据层:证据够硬吗?是 Tier A(趋势确认)还是 Tier C(情绪修复)?

否决权层级:L0 > L1 > L3 > L2。当群体信念崩塌时,再好的产业逻辑都会被恐惧碾压。

使用流程

1. 接收持仓

用户可能提供:

  • 截图(券商App持仓页面):从图片中提取股票名称、市值、成本、现价、盈亏、持股数量
  • 文本列表:直接列出持仓标的
  • 口头描述:提到几只股票名称

如果信息不完整,主动询问:成本价、持股数量、是否两融账户。

2. 获取实时行情

用腾讯行情 API 批量获取持仓标的的最新数据:

bash
curl -s "https://qt.gtimg.cn/q=<股票代码列表>" | iconv -f GBK -t UTF-8

股票代码映射规则:

  • 沪市主板:sh + 6位代码(如 sh600326)
  • 深市主板/中小板:sz + 6位代码(如 sz000917)
  • 创业板:sz + 300xxx
  • 科创板:sh + 688xxx

如果用户只给了股票名称,需要先搜索对应代码。

同时获取大盘指数:sh000001,sz399001,sz399006,sh000688,sh000300

3. 搜索板块与催化剂

对每只持仓股票,搜索:

  • 所属板块/概念(军工、半导体、新能源等)
  • 近期是否有独立催化剂(政策、业绩、事件)
  • 近期主力资金流向
  • 板块整体热度

4. 四层融合逐只诊断

对每只持仓标的进行四层评估:

L0 人性层检查(对整体持仓):

  • 住相信号链五维检测:龙头乏力?跟风先跑?扩散停止?情绪背离?资金转向?
  • 当前执念阶段:确认→发酵→分歧→高潮→衰退→退潮
  • 住相信号 ≥ 3 = 减仓信号生效

L1 情绪层:

  • 当前市场情绪周期:冰点→复苏→高潮→退潮
  • 持仓标的所在板块的情绪温度

L2 产业层(逐只):

  • 行业有真实因果逻辑吗?(政策催化/业绩兑现/供需拐点)
  • 还是只有相关性/题材炒作?

L3 证据层(逐只):

  • 技术面:趋势、支撑位、压力位
  • 资金面:主力资金流向、北向资金
  • 证据等级:Tier A(趋势确认)/ B(有逻辑待验证)/ C(情绪修复)/ D(高风险)

5. 分级评级

按机会大小将持仓分为四级:

评级含义操作建议
A有题材+有逻辑+有催化持有,关注催化兑现
B有逻辑但短期降温观察,等二次启动信号
C无独立催化,随大盘波动考虑趁反弹减仓
D高风险(ST/立案/退市)优先处理,止损或观望

6. 输出诊断

使用 widget 渲染诊断结果(qoder_show_widget),包含:

Widget 结构:

标题:持仓诊断 · 四层融合分析
├── 汇总区:总市值 / 总浮亏 / 总亏损率 / 今日变动
├── 持仓全景表:按A/B/C/D分级排列
│   ├── 每只:股票名 / 市值 / 亏损% / 成本→现价 / 今日涨跌 / 板块 / 评级
│   └── 分类标题行(有题材 / 无催化 / 高风险)
├── 逐只诊断卡片:
│   ├── 短期(下周)判断 + 逻辑
│   └── 中期(下月)判断 + 风险
├── 操作建议:下周策略 + 下月策略
├── 特别警示(两融账户/高风险标的)
└── 免责声明

Widget 设计规范:

  • 暗色主题(--bg:#0f1117)
  • 涨跌用红/绿色标识
  • 评级用 tag 样式(tier-a=绿, tier-b=黄, tier-c=红, tier-d=灰)
  • 分类行用蓝色背景突出

文字总结(widget 之外):

  • 用大白话讲清楚核心问题
  • 指出组合最大的结构性缺陷
  • 给出最优先的1-2个操作建议
  • 结尾加免责声明

7. 回应风格

  • 说人话,不说空话——每条判断都要有"因为什么"的逻辑
  • 不回避坏消息——深套就说深套,高风险就说高风险
  • 用交易宪法的语言:执念阶段、住相信号、否决权、确信度
  • 不荐股、不指导买卖,只做诊断和建议
  • 结尾必须加:以上仅为复盘交流,不构成投资建议

特别场景

两融账户

两融账户的持仓诊断必须额外警示:

  • 融资利息在持续侵蚀
  • 杠杆放大涨跌
  • 分散持仓在两融里代价更高

ST 股票

ST 股票单独标注风险:

  • 5%涨跌停限制
  • 流动性差
  • 退市风险不为零

全线亏损

如果持仓全线亏损,先做组合层面的诊断(分散度、主线缺失、杠杆风险),再逐只分析。

深度参考

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Portfolio Diagnosis AI skill do?

A股持仓诊断——通过截图或文本输入持仓信息,获取实时行情,用四层融合框架(L0人性层/L1情绪层/L2产业层/L3证据层)逐只诊断,分级评级(A/B/C/D),给出短期(下周)和中期(下月)操作建议。当用户要求"分析持仓""诊断持仓""看看我的股票""持仓复盘""我的股票有没有行情"等话题时使用。

Why use Portfolio Diagnosis on TypingMind?

Because you install it once and use it with any model. Portfolio Diagnosis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Portfolio Diagnosis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/huangrichao2020/pretty-skills/tree/main/金融投资/portfolio-diagnosis-持仓诊断. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Portfolio Diagnosis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Portfolio Diagnosis?

As many as you like. As long as a model supports skills, you can use Portfolio Diagnosis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Portfolio Diagnosis AI skill free?

Yes. It is published on GitHub by huangrichao2020 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇