name: stock_event_driven_analysis
description: Use this standalone stock strategy skill for 事件驱动 (event_driven) analysis. Accept one or more A-share stock codes, Chinese stock names, US stock tickers, or Hong Kong stock codes, collect market/news data, and produce a Codex-readable Markdown report focused on the 事件驱动 strategy. Source strategy: ~/daily_stock_analysis/strategies/event_driven.yaml.
事件驱动 Stock Analysis Skill
This skill is a strategy-specific variant of stock_ai_analysis. It uses the same bundled analyzer structure. User config, generated prompts, reports, and final reports for this strategy live under:
~/.stock_analysis/event_driven/
Downloaded market-data caches are shared across strategies under ~/.stock_analysis/cache/ so users do not need to fetch the same data repeatedly.
Strategy Source
- Source file:
~/daily_stock_analysis/strategies/event_driven.yaml
- Strategy id:
event_driven
- Display name: 事件驱动
- Category: framework
- Aliases: 事件驱动, 催化, 催化事件
- Required source tools: search_stock_news, get_realtime_quote, analyze_trend
- Summary: 围绕业绩、政策、并购、订单、产品发布等事件,评估催化强度、兑现概率和风险边界。
Workflow
- Work only inside this skill directory. Do not import, inspect, or depend on files outside it during normal analysis.
- The script creates and reads user config at
~/.stock_analysis/event_driven/.env. Always run config check first:
python scripts/analyze.py --check-config
- First-run hard rule: if
--check-config shows CONFIG_CREATED: yes, explicitly tell the user initialization config is required before any analysis. Do not run --stocks in the same turn.
- Incomplete-config hard rule: if required capability keys are missing for the user request, stop and ask the user to complete configuration using
references/configuration.md before running analysis. Never run partial/incomplete analysis.
- Ask for stock codes, names, or tickers if not supplied. Accept
600487, 北方华创, AAPL, 00700.HK, or mixed input like 北方华创,600487,AAPL,00700.HK.
- Only after configuration is complete, run analysis:
python scripts/analyze.py --stocks <codes>
Use --no-llm for data-only smoke runs.
Use --send-email only after the user confirms email delivery.
Use --no-email for validation runs when EMAIL_ENABLED=true.
- Open the latest prompt files under
~/.stock_analysis/event_driven/prompts/, use the current Codex agent to generate the final analysis, and write that analysis to a Markdown file under ~/.stock_analysis/event_driven/final_reports/.
- The final analysis must apply the strategy rules below. Do not return a generic stock report when this skill is invoked.
- Send email only from a finalized current-agent report:
python scripts/analyze.py --send-final-report ~/.stock_analysis/event_driven/final_reports/<report>.md
If a generated base report exists, merge the final analysis back into the original report before sending:
python scripts/analyze.py --send-final-report ~/.stock_analysis/event_driven/final_reports/<report>.md --base-report ~/.stock_analysis/event_driven/reports/<base_report>.md
Strategy Rules
事件驱动策略(Event Driven Strategy)
适用场景:
- 公司或行业出现明确事件催化,如业绩预告、订单中标、并购重组、政策落地、产品发布、监管处罚、诉讼等。
- 需要判断事件是短期交易催化、长期基本面改善,还是利好兑现。
分析框架:
-
事件分类
- 使用
search_stock_news 梳理近期关键事件。
- 将事件分为:业绩类、政策类、订单/产品类、资本运作类、监管/风险类。
- 明确事件发生时间,过期或时间未知的信息不能作为主要依据。
-
影响路径
- 判断事件影响的是收入、利润率、估值、融资能力、市场份额,还是仅影响情绪。
- 对重大订单或政策利好,要说明兑现周期和不确定性。
- 对监管、减持、处罚、诉讼等事件,风险优先。
-
市场反应
- 使用
get_realtime_quote 和 analyze_trend 判断事件是否已被价格充分反映。
- 放量上涨但未过关键阻力,可等待确认。
- 高位放量滞涨或利好后冲高回落,应警惕兑现压力。
-
交易计划
- 事件未兑现前,强调仓位控制和时间窗口。
- 事件兑现后,重新评估是否从“预期交易”切换为“业绩验证”。
- 对负面事件,先看风险释放是否充分,再考虑反弹。
输出要求:
- 明确事件性质:利好 / 利空 / 中性 / 不确定。
- 给出事件可信度、兑现周期、已反映程度。
- 操作建议必须包含失效条件,如公告不及预期、跌破关键支撑或事件热度消退。
评分调整建议:
- 高可信正向事件且价格尚未充分反映:
sentiment_score +14
- 正向事件已大幅兑现:
sentiment_score -6
- 负面事件仍在发酵:
sentiment_score -15
- 事件影响不清晰或信息冲突:维持中性并降低置信度
Guardrails
- Never print real API keys, passwords, webhook URLs, or tokens.
- Ask before overwriting an existing
~/.stock_analysis/event_driven/.env value.
- Ask before sending email. Do not enable
EMAIL_ENABLED=true unless the user explicitly wants automatic delivery.
- Do not block the user on optional keys. Offer a skip path and explain the consequence.
- Required-capability keys are not optional. If missing, stop and ask for config instead of running degraded analysis.
- First run always requires an explicit initialization prompt to the user before analysis.
- Never run partial or incomplete functionality; this is mandatory.
- Explain failures by impact: blocking, fallback succeeded, or data-quality degradation.
- Do not call local Hermes or other local agent CLIs from this skill. The current Codex agent is responsible for reading generated prompt files and writing the final analysis.
- Reports and emails must contain the strategy analysis result, not raw prompt context.
Bundled Resources
scripts/analyze.py: deterministic entry point.
scripts/stock_agent/: self-contained helper functions for config, data, search, LLM, and report rendering.
scripts/stock_agent/data.py: strategy-local data extraction code that reuses the shared ~/.stock_analysis/cache/ directory to avoid duplicate downloads across strategies.
assets/env.example: template copied to ~/.stock_analysis/event_driven/.env on first run.
requirements.txt: Python dependency list.
references/configuration.md: API-key setup details for this strategy folder.
references/reporting.md: report and interface-status interpretation.