Give this skill to your agent

Copy the prompt and paste it into Claude Code, Codex or any agent that can read a web page. It installs the skill and tells you what it does.

Install this skill for me.

Read https://cwyz.com/skills/kline-structure-chart-en
The raw SKILL.md is at https://cwyz.com/api/skills/kline-structure-chart-en/raw

Save it as kline-structure-chart/SKILL.md in my skills folder (Claude Code: ~/.claude/skills/ for every project, or .claude/skills/ for this project only).

Then tell me in two sentences what it does and when it applies. Do not run anything it describes until I say so.

Or unzip the download into ~/.claude/skills/ (every project) or .claude/skills/ in your project. A skill tells an agent what to do. Read it before you install it, especially one you did not write.

K-Line Structure Computes Support and Stops From Real Market Data

Use when a user wants the K-line structure, support and resistance, risk control plan, future volatility range, or backtest of an A-share, Hong Kong, or US stock, ETF, or index. Based on the open-source stock-skill (Apache-2.0): real daily market data, deterministic calculation, look-ahead-free backtesting, output as JSON, PNG, offline dashboard and Chinese report; only relays script numbers, outputs no probabilities, and stops if market data is unavailable. No fundamental analysis or investment advice.

Use caseHave the Agent use real market data to compute a stock's K-line structure, support and resistance, and risk control levels, generate charts and reports, without fabricating numbers or stating probabilities.

Machine translation. Read the original

K-Line Structure Computes Support and Stops From Real Market Data

When a user wants to see the K-line structure of an A-share, Hong Kong or US stock, or an ETF or index, run the Python script bundled with this skill. It computes indicators, patterns, wave structure, support and resistance, a risk control plan, the normal price range for the next 15 trading days, and a look-ahead-free backtest directly from real daily market data, and outputs the same results as JSON, a PNG structure chart, an offline interactive dashboard and a Chinese report. The underlying tool is the open-source stock-skill (Apache-2.0, skill name kline-structure-chart, currently 6.0.0). You only relay the numbers the script computes. Do not do mental arithmetic, do not estimate prices from charts, and do not predict rises or falls.

Triggers

User says things like "analyze the K-line of Moutai / 600519.SH / Tencent / 00700.HK / NVDA", "where are the support and resistance", "where should the stop-loss go", "can this be bought", "how large will the fluctuation be over the next two weeks", "include a backtest", "look at the structure of the Shanghai Composite and ChiNext indices".

Not for: fundamentals, financial reports, news, capital flows; placing orders for the user; personalized investment advice. Such content must be marked "not reviewed" in the answer or explicitly declined.

Hard Rules

  1. Numbers come only from script output. Prices, levels and scores are copied exactly from *_report.md or *_result.json, with no rounding or rewording, and no price levels added that are not in the report.
  2. Never output any probability, win rate or frequency. The rule score (rule_score) is a deterministic weighted score and must not be described as a win rate. The only exception is the backtest trade win rate, which must be given together with the sample size and a 95% interval, and must be explained as not being a future probability of rising. Phrases like "high chance of breaking out" or "seven in ten odds" are also not allowed.
  3. If real market data cannot be obtained, stop. When the script exits with [DATA_UNAVAILABLE], tell the user honestly; do not estimate, fabricate data, or switch to other sources to fill the gap.
  4. Check the code first; do not guess suffixes from memory. If the user gives only a name or a code without a suffix, run scripts/resolve_symbol.py first; when there are multiple candidates, list them for the user to choose and do not pick for them.
  5. Risk veto goes first. When verdict.risk_veto is true, the first paragraph of the answer states the reason for the veto and gives no long-side buying suggestion.
  6. Calculate share counts only when the user provides account equity, and relay only the share count the script computes; do not divide the risk budget by the stop-loss distance yourself.
  7. Before answering, run scripts/lint_response.py to check the draft; send only when the output is "status": "OK".
  8. End with a disclaimer: "The above is rule-based technical analysis for research reference only and does not constitute investment advice."

Installation

Check first:

ls ~/.claude/skills/kline-structure-chart/SKILL.md 2>/dev/null && echo "installed" || echo "not installed"

Requires git, Python 3.12 or above, and Pillow; analysis needs access to the Sina, Yahoo and Tencent market data interfaces; Linux chart rendering also needs a Chinese font. uv is recommended (it provisions Python 3.12 automatically and does not need sudo). If not installed, first tell the user what will be installed and where, and after they agree:

# macOS / Linux: clone to ~/.local/share/stock-skill and symlink into installed Claude Code, Codex, etc.
curl -fsSL https://raw.githubusercontent.com/xiongcp/stock-skill/main/install.sh | bash
# Windows (the author notes the install script has not yet been tested)
irm https://raw.githubusercontent.com/xiongcp/stock-skill/main/install.ps1 | iex
  • If uv is missing, the script asks whether to install it; if the user declines, create a .venv with a local Python 3.12+ instead. Do not use sudo, and do not install dependencies into the system Python.
  • Other methods: npx skills add xiongcp/stock-skill, or in Claude Code /plugin marketplace add xiongcp/stock-skill followed by /plugin install kline-structure-chart@stock-skill.
  • Re-running the install command is the update; uninstall with bash ~/.local/share/stock-skill/install.sh --uninstall.
  • After installation, ask the user to open a new session and run the environment self-check once more: uv run --directory <skill directory> python scripts/doctor.py.

Without uv, replace every uv run python below with the .venv/bin/python in the skill directory (Windows: .venv\Scripts\python). When the current directory is not the skill directory, use uv run --directory <skill directory>, and write --output-dir as an absolute path.

Process

  1. Look up the code (skip when the user has already given a code with .SH / .SZ / .BJ / .HK / .US):

    uv run python scripts/resolve_symbol.py 茅台   # a Chinese name, pinyin or partial code
    uv run python scripts/resolve_symbol.py 腾讯 --market HK
    

    Use RESOLVED directly; for AMBIGUOUS, list the candidates to the user; if a Beijing Stock Exchange stock cannot be found, ask the user for its .BJ code.

  2. Run the main script:

    uv run python scripts/analyze_and_forecast.py --market CN --symbol 600519.SH --asset-type equity --output-dir artifacts/cn_stock
    
  3. Check the result. If any condition is not met, stop interpreting: a non-zero exit code means no price levels at all; if quality.status is UNAVAILABLE, give no conclusion; if it is PARTIAL, first list every warning one by one. Relay each item in quality.notes.

  4. Answer following the report skeleton (see "Reply Order" below), save the draft as a file, then run lint:

    uv run python scripts/lint_response.py --result artifacts/cn_stock/600519.SH_result.json --response artifacts/cn_stock/reply_draft.md
    

Adding Parameters by Question

What the user asks Parameter to add
Structure, patterns, support and resistance, whether it can be bought, stop-loss and take-profit None; read the risk control section of the report
How many shares to buy --account-equity <equity>, optionally --max-risk-pct 0.01 (a ratio, not a percentage; value between 0 and 0.05)
Backtest, whether this rule set is reliable --backtest (if slow, add --backtest-step 5)
Fluctuation range for the coming days --horizon-bars <1~60>, default 15; describes magnitude only, not direction
A longer or shorter chart --days <60~500>; changes display only, not any conclusion
Review a historical date --as-of YYYY-MM-DD
Index or ETF --asset-type index or etf
Unadjusted prices --adjustment raw
Change the comparison benchmark --benchmark <code> (default CSI 300, Hang Seng Index, SPY)
User provided a local real market data file --input <file> --offline
Several instruments at once Run each instrument separately and present each in its own section; never mix price levels

Exit Codes

Exit code Meaning What to do
0 Success Interpret normally
1 Internal skill error Tell the user honestly; do not retry with changed parameters
2 Wrong code or parameters Look up the code with resolve_symbol.py, or correct the parameters
3 Real market data unavailable Explain the cause and ask the user to retry later; can run doctor.py to see which data source is unreachable
4 Not enough closed K-lines Listed too recently, --as-of too early, or the data source returned only partial history; may retry once later

Reply Order

*_report.md is already written in this order; relay it accordingly:

  1. Answer the question first: one or two sentences, using only numbers from the report.
  2. Data notes: data source, cutoff date, adjustment basis and warnings.
  3. Market first: the benchmark's market state score, and the stock's strength relative to the market.
  4. Structure: rule score (noting it is not a win rate), the three main paths written as "trigger condition → target level → invalidation condition", the main wave count and alternatives, and pattern names.
  5. Risk control: if vetoed, put the reason at the top; otherwise give the entry zone, stop-loss, two-tier take-profit, time limit and the trailing break-even rule; for ChiNext and STAR Market stocks with 20% daily limits, remind not to chase highs; for Hong Kong and US short-selling plans, state both short-selling restrictions and the unaccounted securities lending fees.
  6. Normal 15-day fluctuation range: the 50% and 80% intervals, together with the measured coverage rate and the number of independent samples; if in the calibration observation period, state so.
  7. Backtest (when present): number of trades, win rate with 95% interval, cumulative return versus buy-and-hold, and the sample size warning relayed verbatim.
  8. Files: paths to result.json and dashboard.html; attach preview.png when images can be displayed.
  9. Disclaimer.

Output Format

A Chinese answer organized in the reply order above, plus artifact file paths: *_report.md, *_result.json, *_preview.png, *_dashboard.html, and *_backtest.json when there is a backtest. *_chart_data.json is only for charts; do not reference it.

One Sentence

The script computes the price levels from real market data; you only verify the code, copy the numbers exactly, put risks first, and never state probabilities.

Done with this one? Mark it to track your path.Sign in
Save it for laterSign in
Questions about this piece?Ask AI about this

Comments (0)

No comments yet. Start the conversation.

Sign in to join the discussion.Sign in