refactor: align agent skills with mainstream skill bundles (#780)

* refactor: align agent skills with mainstream skill bundles

* refactor: derive default agent skills from metadata

* fix: harden skill-first compatibility

* docs: clarify strategy-facing skill terminology

* fix: stop implicit bull-trend skill layering

* fix: use bull-trend as the single implicit default skill

* fix: preserve legacy skill config compatibility

* fix: harden skill metadata compatibility
This commit is contained in:
mumu
2026-03-20 15:48:31 +08:00
committed by GitHub
parent db6a2a7676
commit 6bef880465
56 changed files with 2291 additions and 1022 deletions

View File

@@ -1,8 +1,10 @@
# 交易策略目录 / Trading Strategies
本目录存放 **自然语言策略文件**YAML 格式)。系统启动时自动加载此目录下所有 `.yaml` 文件。
本目录存放 **自然语言交易策略文件**YAML 格式)。系统启动时自动加载此目录下所有 `.yaml` 文件。
## 如何编写自定义策略
对用户和文档,我们继续把这些能力称为“策略”;在代码、配置和 API 字段里,它们统一命名为 `skill`,你可以把它理解为“可复用的策略能力包”。
## 如何编写自定义策略Strategy Skill
只需创建一个 `.yaml` 文件,用中文(或任意语言)描述你的交易策略即可,**无需编写任何代码**。
@@ -39,6 +41,19 @@ required_tools:
- get_daily_history
- analyze_trend
# 可选别名(用于 /ask 等自然语言技能选择)
aliases: [我的战法, 我的模型]
# 以下元数据用于驱动默认行为(可选)
# default_active: 是否属于默认激活技能集
# default_router: 是否属于路由 fallback 技能集
# default_priority: 默认展示/排序优先级,数值越小越靠前
# market_regimes: 该技能优先适配的市场状态标签
default_active: true
default_router: false
default_priority: 100
market_regimes: [trending_up]
# 策略详细说明(自然语言,支持 Markdown 格式)
instructions: |
**我的策略名称**
@@ -74,7 +89,9 @@ instructions: |
除了本目录(内置策略),你还可以通过环境变量指定额外的自定义策略目录:
```env
AGENT_STRATEGY_DIR=./my_strategies
AGENT_SKILL_DIR=./my_skills
```
系统会同时加载内置策略和自定义策略。如果名称冲突,自定义策略覆盖内置策略。
环境变量名仍然是 `AGENT_SKILL_DIR`,这是内部统一命名后的配置入口;在产品语义上,它依然表示“自定义策略目录”。

View File

@@ -9,6 +9,9 @@ core_rules: [2, 5]
required_tools:
- get_daily_history
- analyze_trend
aliases: [地量见底, 底部放量]
default_priority: 60
market_regimes: [trending_down]
instructions: |
**底部放量Bottom Volume Surge Strategy**

View File

@@ -10,6 +10,9 @@ required_tools:
- get_daily_history
- analyze_trend
- get_realtime_quote
aliases: [箱体, 箱体震荡]
default_priority: 50
market_regimes: [sideways]
instructions: |
**箱体震荡战法Box Range Trading Strategy**

View File

@@ -8,6 +8,11 @@ core_rules: [1, 2, 3]
required_tools:
- get_daily_history
- analyze_trend
aliases: [趋势, 趋势分析, 多头趋势]
default_active: true
default_router: true
default_priority: 10
market_regimes: [trending_up]
instructions: |
**默认多头趋势Default Bull Trend Strategy**
@@ -41,4 +46,4 @@ instructions: |
- 多头排列 + 趋势强度良好:`sentiment_score +12`
- 回踩关键均线后企稳:`sentiment_score +8`
- 放量突破关键阻力:`sentiment_score +10`
- 跌破 MA20 或趋势转弱:`sentiment_score -12`
- 跌破 MA20 或趋势转弱:`sentiment_score -12`

View File

@@ -10,6 +10,9 @@ required_tools:
- get_daily_history
- analyze_trend
- get_realtime_quote
aliases: [缠论, 缠论分析]
default_priority: 70
market_regimes: [volatile]
instructions: |
**缠论Chan Theory / Zen Channel Theory**

View File

@@ -10,6 +10,9 @@ required_tools:
- get_realtime_quote
- get_sector_rankings
- search_stock_news
aliases: [龙头, 龙头战法]
default_priority: 90
market_regimes: [sector_hot]
instructions: |
**龙头策略Dragon Head Strategy**

View File

@@ -11,6 +11,9 @@ required_tools:
- get_realtime_quote
- analyze_trend
- search_stock_news
aliases: [情绪, 情绪周期]
default_priority: 100
market_regimes: [sector_hot]
instructions: |
**情绪周期策略Sentiment Cycle Strategy**

View File

@@ -9,6 +9,9 @@ core_rules: [1, 2, 3]
required_tools:
- get_daily_history
- analyze_trend
aliases: [均线金叉, 金叉]
default_priority: 20
market_regimes: [trending_up]
instructions: |
**均线金叉MA Golden Cross Strategy**

View File

@@ -9,6 +9,8 @@ core_rules: [2, 4]
required_tools:
- get_daily_history
- analyze_trend
aliases: [一阳穿三阴, 一阳夹三阴]
default_priority: 110
instructions: |
**一阳夹三阴One Yang Three Yin Strategy**

View File

@@ -10,6 +10,10 @@ required_tools:
- get_daily_history
- analyze_trend
- get_realtime_quote
aliases: [缩量回踩, 回踩]
default_router: true
default_priority: 40
market_regimes: [trending_down, sideways]
instructions: |
**缩量回踩Shrink Volume Pullback Strategy**

View File

@@ -10,6 +10,9 @@ required_tools:
- get_daily_history
- analyze_trend
- get_realtime_quote
aliases: [放量突破, 突破]
default_priority: 30
market_regimes: [trending_up]
instructions: |
**放量突破Volume Breakout Strategy**

View File

@@ -10,6 +10,9 @@ required_tools:
- get_daily_history
- analyze_trend
- get_realtime_quote
aliases: [波浪, 波浪理论, 艾略特]
default_priority: 80
market_regimes: [volatile]
instructions: |
**波浪理论Elliott Wave Theory**