Skill: huangrichao2020/a-share-decision-desk (version 0.1.12)

--- name: uwillberich description: Build next-session A-share game plans from market structure, overnight macro shocks, policy timing, and watchlist leadership. Use when the user asks what A-shares may do tomorrow, which sectors may repair first, how to read the open, or wants a reusable pre-open discretionary decision workflow. metadata: {"openclaw":{"emoji":"📈","homepage":"https://github.com/huangrichao2020/uwillberich","requires":{"bins":["python3"]}}} --- # uwillberich Author: 超超 Contact: `[REDACTED_SECRET]` ## Overview Use this skill for decision-oriented A-share analysis. The goal is not to explain the market mechanically, but to convert today’s tape and overnight developments into a concrete next-session plan. Best fit: - next-session A-share outlook - likely repair sectors after a selloff - opening checklist for `09:00`, `09:25`, and `09:30-10:00` - first-30-minute observation template for distinguishing true repair from defensive concentration - watchlist-based decision notes - distinguishing defensive leadership from true market repair - persistent message iteration that maps high-attention news into watchlist overlays - automatic event-driven stock pools that feed directly into desk reports - main-force capital-flow confirmation for watchlists and market-wide risk tone - industry-chain expansion that turns event themes into fresh stock pools - sentiment scoring built from breadth, sector dispersion, and capital flow ## Core Workflow 1. Gather market structure first. - Confirm `EM_API_KEY` is configured before running any script. - Run `scripts/fetch_market_snapshot.py` for indices, breadth, and sector leaders/laggards. - Run `scripts/fetch_quotes.py` or `scripts/morning_brief.py` for the watchlist. 2. Confirm the overnight and policy layer. - Use primary sources first for `PBOC`, `Federal Reserve`, and other central-bank decisions. - Use high-quality news sources for geopolitics, oil, and global risk sentiment. 3. Classify the market through three layers. - External shock: oil, rates, U.S. equities, geopolitics - Domestic policy/liquidity: `LPR`, PBOC posture, macro support - Internal structure: breadth, leadership, relative strength, style rotation 4. Build a scenario tree. - Provide `Base / Bull / Bear` paths with explicit triggers and invalidations. 5. Turn the view into an execution checklist. - Include `09:00`, `09:20-09:25`, `09:30-10:00`, and `14:00-14:30`. ## Workflow Shortcuts - `Step 1: overnight and policy` - `scripts/mx_toolkit.py preset --name preopen_policy` - `scripts/mx_toolkit.py preset --name preopen_global_risk` - `Step 2: board resonance` - `scripts/fetch_market_snapshot.py` - `scripts/capital_flow.py` - `scripts/market_sentiment.py` - `scripts/mx_toolkit.py preset --name board_optical_module` - `scripts/mx_toolkit.py preset --name board_compute_power` - `Step 3: single-name validation` - `scripts/fetch_quotes.py` - `scripts/mx_toolkit.py preset --name validate_inspur` - `scripts/mx_toolkit.py preset --name validate_luxshare` - `Step 4: event-to-chain expansion` - `scripts/industry_chain.py` - `scripts/news_iterator.py` - `Source benchmark` - `scripts/benchmark_sources.py` ## Decision Heuristics - Prefer sectors that resisted best in a weak tape over sectors that merely fell the most. - Treat defensive leadership as separate from broad market repair. - On monthly `LPR` days, use the `09:00` release as a hard branch in the plan. - A repair thesis is stronger when leadership broadens from core growth names into secondary names and brokers. - A rebound without breadth is usually just a technical bounce. ## Scripts Use these scripts before writing the decision note: - `scripts/fetch_market_snapshot.py` - Pulls Eastmoney index and sector breadth data. - `scripts/fetch_quotes.py` - Pulls Tencent quote snapshots for user-specified names. - `scripts/morning_brief.py` - Builds a markdown brief from the default watchlists in `assets/default_watchlists.json`. - `scripts/capital_flow.py` - Pulls the whole-market main-force snapshot plus top inflow/outflow names and intersects them with watchlists. - `scripts/market_sentiment.py` - Scores the tape as `抱团行情`, `科技修复`, `修复扩散`, or `分化偏弱` using breadth, sector dispersion, and capital flow. - `scripts/opening_window_checklist.py` - Builds a first-30-minute observation sheet with time gates, group scoreboards, and watchlist signal tables. - `scripts/industry_chain.py` - Uses event summaries and desk groups to expand into industry-chain stock pools through live MX stock screens. - `scripts/news_iterator.py` - Continuously polls public RSS feeds, classifies high-attention events, maps them into watchlist overlays, and writes dynamic event-driven stock pools. - `scripts/runtime_config.py` - Loads local runtime credentials, enforces the required `EM_API_KEY`, and prints the Eastmoney application URL when it is missing. - `scripts/mx_toolkit.py` - Calls the live Meixiang / Eastmoney APIs for news search, stock screening, structured data queries, and preset desk workflows. - `scripts/benchmark_sources.py` - Benchmarks public and MX-enhanced sources before you decide what to trust as the primary feed. - `scripts/install_news_iterator_launchd.py` - Installs the news iterator as a `launchd` job on macOS for long-running local polling. - `scripts/smoke_test.py` - Verifies that the bundled scripts and public endpoints are working. ## References Read only what you need: - `references/methodology.md` - Trading philosophy, decision tree, and timing gates. - `references/data-sources.md` - Source map for official and market data endpoints. - `references/persona-prompt.md` - Decision-maker persona for desk-style answers. - `references/trading-mode-prompt.md` - Time-boxed opening workflow for the next A-share session. - `references/opening-window-template.md` - A reusable first-30-minute decision template. - `references/cross-cycle-watchlist.md` - How to use the cross-cycle core stock pool without turning it into an unfocused mega-list. - `references/event-regime-watchlists.md` - How to use war-shock and energy-spike watchlists as temporary overlays. - `references/message-iterator.md` - How to run the persistent RSS iterator, generate event-driven stock pools, and feed them into the desk workflow. - `assets/mx_presets.json` - Preset MX workflows for policy scan, global-risk scan, board resonance, and single-name validation. - `assets/industry_chains.json` - Theme-to-chain map for optical module, compute power, semiconductors, robotics, oil and coal, and IDC/power-cost overlays. ## Output Standard Default to a compact desk-style answer: - one-paragraph decision summary - `Base / Bull / Bear` path - most likely repair sectors - defensive-only sectors - opening checklist - `do / avoid` ## Required Credential - `EM_API_KEY` is mandatory for this skill. - Apply here: `https://ai.eastmoney.com/mxClaw` - After opening the link, click download and you will see the key. - Official site: `https://ai.eastmoney.com/nlink/` - Store it in `~/.uwillberich/runtime.env`

path: README.md
content: # uwillberich

A ClawHub/OpenClaw-ready skill for next-session A-share discretionary planning.

It is designed for one job: turn today’s tape and overnight developments into a concrete game plan for tomorrow’s open.

Author: 超超
Contact: `[REDACTED_SECRET]`

GitHub is the main source of truth for installation and updates:

```text
https://github.com/huangrichao2020/uwillberich
```

## Good Use Cases

- "What is the most likely A-share path tomorrow?"
- "Which sectors are most likely to repair first after today’s selloff?"
- "Give me a `09:00 / 09:25 / 09:30-10:00` opening checklist."
- "Build a watchlist-driven pre-open note for A-shares."
- "Tell me whether this is real repair or just defensive concentration."
- "Use the cross-cycle core stock pool to narrow tomorrow's key observation list."
- "In a war-oil shock regime, tell me which A-share groups benefit and which ones get hurt."
- "Continuously watch public news and map major events into A-share watchlists."
- "Run a preset `Step 1 / Step 2 / Step 3` desk workflow and save all artifacts."
- "Benchmark which public and MX data sources are healthy before the open."

## Workflow Map

1. `Step 1: overnight and policy`
   - `scripts/news_iterator.py`
   - `scripts/mx_toolkit.py preset --name preopen_policy`
   - `scripts/mx_toolkit.py preset --name preopen_global_risk`
2. `Step 2: board resonance`
   - `scripts/fetch_market_snapshot.py`
   - `scripts/morning_brief.py`
   - `scripts/capital_flow.py`
   - `scripts/market_sentiment.py`
   - `scripts/mx_toolkit.py preset --name board_optical_module`
   - `scripts/mx_toolkit.py preset --name board_compute_power`
3. `Step 3: single-name validation`
   - `scripts/fetch_quotes.py`
   - `scripts/mx_toolkit.py preset --name validate_inspur`
   - `scripts/mx_toolkit.py preset --name validate_luxshare`
4. `Step 4: chain expansion`
   - `scripts/industry_chain.py`
   - `scripts/news_iterator.py`
   - `scripts/opening_window_checklist.py`
5. `Source benchmark`
   - `scripts/benchmark_sources.py`

## What This Skill Contains

- `SKILL.md`: main instructions and trigger description
- `references/methodology.md`: decision framework
- `references/data-sources.md`: primary and market data sources
- `references/persona-prompt.md`: decision-maker persona prompt
- `references/trading-mode-prompt.md`: time-based pre-open trading mode prompt
- `references/cross-cycle-watchlist.md`: how to use the cross-cycle core stock pool
- `references/event-regime-watchlists.md`: war-shock overlay watchlists
- `references/message-iterator.md`: persistent message iterator for high-attention news
- `assets/mx_presets.json`: preset `Step 1 / Step 2 / Step 3` MX workflows
- `scripts/fetch_market_snapshot.py`: index and sector breadth snapshot
- `scripts/fetch_quotes.py`: Tencent quote watchlist snapshot
- `scripts/morning_brief.py`: one-command markdown morning brief
- `scripts/capital_flow.py`: main-force capital-flow overlay for the market and watchlists
- `scripts/market_sentiment.py`: breadth + board-dispersion + capital-flow sentiment classifier
- `scripts/opening_window_checklist.py`: first-30-minute decision sheet
- `scripts/industry_chain.py`: event-to-industry-chain expansion for fresh stock pools
- `scripts/news_iterator.py`: RSS polling, classification, SQLite state, markdown/jsonl outputs, and automatic event stock pools
- `scripts/runtime_config.py`: local credential helper for the required `EM_API_KEY`
- `scripts/mx_api.py`: Meixiang / Eastmoney API wrapper for live finance queries
- `scripts/mx_toolkit.py`: CLI wrapper for real news search, stock screen, structured data queries, and desk presets
- `scripts/benchmark_sources.py`: source latency / availability benchmark
- `scripts/install_news_iterator_launchd.py`: macOS launchd installer for scheduled polling
- `scripts/smoke_test.py`: local smoke test for the bundled scripts

## Agent Install

Install this folder into:

- `~/.codex/skills/uwillberich`
- `~/.openclaw/skills/uwillberich`

Example:

```bash
git clone https://github.com/huangrichao2020/uwillberich.git
mkdir -p ~/.codex/skills
cp -R uwillberich/skill/uwillberich ~/.codex/skills/uwillberich
```

One-line install for Codex:

```bash
git clone https://github.com/huangrichao2020/uwillberich.git && cd uwillberich && ./install_skill.sh
```

One-line install for OpenClaw:

```bash
git clone https://github.com/huangrichao2020/uwillberich.git && cd uwillberich && ./install_skill.sh openclaw
```

## Keys And Credentials

This skill hard-requires `EM_API_KEY`.

- Apply here:
  `https://ai.eastmoney.com/mxClaw`
- After opening the link, click download and you will see the key.
- Official site:
  `https://ai.eastmoney.com/nlink/`
- Store it locally in `~/.uwillberich/runtime.env`.
- Check or set it with:

```bash
python3 scripts/runtime_config.py status
printf '%s' 'your_em_api_key' | python3 scripts/runtime_config.py set-em-key --stdin
```

Without `EM_API_KEY`, the scripts will exit and print the application URL plus setup command.

- GitHub read access: only if the repo is private and an agent must clone it
- GitHub write access: only if an agent should push changes back
- Model-provider API keys: may be required by the host agent environment, but not by this skill itself

## Local Smoke Test

```bash
python3 scripts/smoke_test.py
python3 scripts/runtime_config.py status
python3 scripts/mx_toolkit.py list-presets
python3 scripts/mx_toolkit.py preset --name preopen_repair_chain
python3 scripts/mx_toolkit.py preset --name flow_main_force
python3 scripts/mx_toolkit.py news-search --query '立讯精密 最新资讯'
python3 scripts/mx_toolkit.py stock-screen --keyword 'A股 光模块概念股' --page-size 10 --csv-out /tmp/cpo.csv --desc-out /tmp/cpo-columns.md
python3 scripts/mx_toolkit.py query --tool-query '浪潮信息 最新价 市值'
python3 scripts/capital_flow.py --groups tech_repair defensive_gauge
python3 scripts/market_sentiment.py
python3 scripts/industry_chain.py --groups tech_repair defensive_gauge
python3 scripts/benchmark_sources.py
python3 scripts/fetch_market_snapshot.py --format markdown
python3 scripts/fetch_quotes.py sz300502 sh688981 sh600938
python3 scripts/morning_brief.py --groups core10 tech_repair
python3 scripts/morning_brief.py --groups cross_cycle_anchor12
python3 scripts/morning_brief.py --groups cross_cycle_ai_hardware cross_cycle_semis cross_cycle_software_platforms cross_cycle_defense_industrial
python3 scripts/morning_brief.py --groups war_shock_core12
python3 scripts/morning_brief.py --groups war_benefit_oil_coal war_headwind_compute_power
python3 scripts/opening_window_checklist.py --groups tech_repair defensive_gauge policy_beta
python3 scripts/news_iterator.py poll
python3 scripts/news_iterator.py report --hours 12
python3 scripts/install_news_iterator_launchd.py install --interval-seconds 300
python3 scripts/morning_brief.py
python3 scripts/opening_window_checklist.py
```

## Optional ClawHub Publish

From this folder:

```bash
clawhub login
clawhub publish /absolute/path/to/uwillberich --slug uwillberich --name "uwillberich" --version 0.1.7 --tags latest,finance,a-share,china,markets
```

## Notes

- ClawHub publishes a skill folder with `SKILL.md` plus supporting text files.
- This skill uses only text-based resources and Python standard library scripts.
- `EM_API_KEY` is mandatory for this skill.
- The runtime helper automatically maps `EM_API_KEY` to the `MX_APIKEY` convention used by the public MX skills.
- Preset and benchmark outputs default to `~/.uwillberich/data/`.
- If `clawhub publish .` misreads the folder, use an absolute path or pass `--workdir` explicitly.
- The opening-window script is intended for `09:00-10:00` use, especially the first 30 minutes after the A-share cash open.
- For the larger quality pool, use `cross_cycle_anchor12` daily and reserve `cross_cycle_core` for weekly or phase-rotation review.
- For geopolitical shocks, treat `war_benefit_oil_coal` and `war_headwind_compute_power` as temporary regime overlays, not permanent core watchlists.
- If you only want one wartime overlay, start with `war_shock_core12`.
- For continuous event intake, run `news_iterator.py` as a local service and treat the alert stream as an overlay, not a replacement for tape and breadth.
- The morning brief and opening checklist can automatically append event-driven stock pools when `event_watchlists.json` exists in the default state directory.


path: agents/openai.yaml
content: # Author: 超超
# Contact: [REDACTED_SECRET]

interface:
  display_name: "uwillberich"
  short_description: "A-share pre-open and opening workflow"
  brand_color: "#C1272D"
  default_prompt: "Use $uwillberich to build tomorrow's A-share game plan, likely repair sectors, and a first-30-minute opening checklist from overnight events and watchlists."

policy:
  allow_implicit_invocation: true


path: assets/industry_chains.json
content: {
  "themes": [
    {
      "id": "optical_module_chain",
      "label": "光模块产业链",
      "query": "A股 光模块产业链股票",
      "categories": ["huge_future", "huge_name_release"],
      "triggers": ["光模块", "cpo", "光通信", "光芯片", "铜缆", "光器件", "datacenter", "data center"],
      "preferred_groups": ["tech_repair", "cross_cycle_ai_hardware", "cross_cycle_anchor12"],
      "strong_signal": "产业链核心票同步转强，说明最强科技主线正在扩散。",
      "weak_signal": "只有单一龙头强，链条中军和二线不跟，说明产业链扩散不足。"
    },
    {
      "id": "compute_power_chain",
      "label": "算力产业链",
      "query": "A股 算力产业链股票",
      "categories": ["huge_future", "huge_name_release"],
      "triggers": ["算力", "服务器", "液冷", "数据中心", "idc", "server", "compute", "cooling"],
      "preferred_groups": ["tech_repair", "cross_cycle_ai_hardware", "war_headwind_compute_power"],
      "strong_signal": "服务器、液冷、IDC 同步改善，说明算力链从点状修复转向面状修复。",
      "weak_signal": "只有少数硬件股强，平台链和IDC仍弱，说明算力修复不完整。"
    },
    {
      "id": "semiconductor_chain",
      "label": "半导体产业链",
      "query": "A股 半导体产业链股票",
      "categories": ["huge_future", "huge_name_release"],
      "triggers": ["芯片", "半导体", "gpu", "gpus", "存储", "semiconductor", "chip", "chips"],
      "preferred_groups": ["cross_cycle_semis", "cross_cycle_anchor12", "tech_repair"],
      "strong_signal": "芯片、设备、封测同步企稳，说明科技修复有深度。",
      "weak_signal": "高弹性芯片继续被压制，说明半导体只是跟随反弹。"
    },
    {
      "id": "robotics_chain",
      "label": "机器人与低空链",
      "query": "A股 机器人产业链股票",
      "categories": ["huge_future", "huge_name_release"],
      "triggers": ["机器人", "humanoid", "robot", "drone", "无人机", "商业航天", "低空"],
      "preferred_groups": ["cross_cycle_defense_industrial", "cross_cycle_anchor12"],
      "strong_signal": "机器人与控制零部件同步走强，说明未来叙事开始向制造端扩散。",
      "weak_signal": "题材热但中军不跟，说明仍停留在消息脉冲。"
    },
    {
      "id": "oil_gas_chain",
      "label": "油气受益链",
      "query": "A股 石油天然气概念股",
      "categories": ["huge_conflict"],
      "triggers": ["oil", "crude", "brent", "wti", "lng", "gas", "shipping", "hormuz", "gulf", "iran", "israel"],
      "preferred_groups": ["war_benefit_oil_coal", "war_shock_core12", "defensive_gauge"],
      "strong_signal": "上游油气和综合能源央企共振走强，说明战争溢价仍在强化。",
      "weak_signal": "只有最纯上游强，综合能源和煤炭不跟，说明受益扩散不足。"
    },
    {
      "id": "coal_chain",
      "label": "煤炭防御链",
      "query": "A股 煤炭概念股",
      "categories": ["huge_conflict"],
      "triggers": ["coal", "energy", "动力煤", "煤炭", "神华", "coal mine"],
      "preferred_groups": ["war_benefit_oil_coal", "defensive_gauge", "war_shock_core12"],
      "strong_signal": "神华与弹性煤企一起走强，说明防御抱团正在向煤链扩散。",
      "weak_signal": "只有红利煤强，弹性煤企不跟，说明只是稳健避险。"
    },
    {
      "id": "idc_power_chain",
      "label": "IDC与电力成本链",
      "query": "A股 数据中心概念股",
      "categories": ["huge_conflict", "huge_future"],
      "triggers": ["electricity", "power", "data center", "datacenter", "idc", "电力", "电价"],
      "preferred_groups": ["war_headwind_compute_power", "cross_cycle_ai_hardware"],
      "strong_signal": "IDC 与温控链稳住，说明市场未继续惩罚高电耗资产。",
      "weak_signal": "IDC 和火电同步走弱，说明成本冲击仍在压制估值。"
    }
  ],
  "group_theme_hints": {
    "core10": ["optical_module_chain", "compute_power_chain", "oil_gas_chain"],
    "tech_repair": ["optical_module_chain", "compute_power_chain", "semiconductor_chain"],
    "policy_beta": ["compute_power_chain"],
    "defensive_gauge": ["oil_gas_chain", "coal_chain"],
    "cross_cycle_anchor12": ["optical_module_chain", "compute_power_chain", "semiconductor_chain"],
    "cross_cycle_ai_hardware": ["optical_module_chain", "compute_power_chain"],
    "cross_cycle_semis": ["semiconductor_chain"],
    "cross_cycle_software_platforms": ["compute_power_chain"],
    "cross_cycle_defense_industrial": ["robotics_chain"],
    "war_benefit_oil_coal": ["oil_gas_chain", "coal_chain"],
    "war_headwind_compute_power": ["compute_power_chain", "idc_power_chain"],
    "war_shock_core12": ["oil_gas_chain", "coal_chain", "idc_power_chain"]
  }
}


path: references/cross-cycle-watchlist.md
content: # Cross-Cycle Watchlist

This skill now includes a larger cross-cycle A-share quality pool built from names that tend to survive multiple bull-bear cycles and repeatedly re-emerge as leaders when a new risk-on phase starts.

## The Problem

A good watchlist becomes useless if it is too large to act on.

Do not treat the full pool as a buy list.
Treat it as a priority universe.

## Built-In Groups

- `cross_cycle_anchor12`
  - Daily-use anchor list. Start here every morning.
- `cross_cycle_ai_hardware`
  - PCB, optical, AI server, manufacturing, thermal, and hardware supply-chain names.
- `cross_cycle_semis`
  - Chips, packaging, testing, storage, and materials.
- `cross_cycle_software_platforms`
  - AI software, data/platform, and domestic software names.
- `cross_cycle_defense_industrial`
  - Defense, industrial automation, and related advanced manufacturing.
- `cross_cycle_core`
  - Full pool. Best used for weekly review or major phase-rotation scans.

## How To Use The Pool

### 1. Daily Pre-Open

Use:

- `cross_cycle_anchor12`
- one or two theme buckets relevant to the current tape

Goal:

- reduce the market to a small set of high-quality leaders before the open

### 2. First 30 Minutes

If the market is trying to repair:

- check which names from `cross_cycle_anchor12` reclaim prior close first
- prefer the names that are both liquid and early
- do not prioritize the biggest loser in the full pool

### 3. Pullback Days

Use the pool to find resilience, not cheapness.

Look for:

- names down less than their theme peers
- names that do not lose the prior swing low
- names that keep turnover and institutional sponsorship

### 4. Rotation Days

Use the theme groups to identify where the market is paying up:

- `cross_cycle_ai_hardware`: hardware, optics, PCB, AI infrastructure
- `cross_cycle_semis`: chips, packaging, testing, storage, materials
- `cross_cycle_software_platforms`: software and application-side risk appetite
- `cross_cycle_defense_industrial`: defense and hard-tech manufacturing rotation

## Practical Workflow

1. Start with `cross_cycle_anchor12`.
2. If leadership is obvious, zoom into the matching theme bucket.
3. If the market is broad and strong, widen to `cross_cycle_core`.
4. If the tape is weak, narrow back down to the earliest reclaimers only.

## What Not To Do

- Do not watch all names equally every day.
- Do not bottom-fish the weakest subgroup just because it fell the most.
- Do not treat every name here as a simultaneous candidate.
- Do not confuse long-term quality with short-term timing.

## Recommended Defaults

- Daily: `cross_cycle_anchor12`
- Theme check: one or two matching buckets
- Weekly review: `cross_cycle_core`


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)