| name | create-strategy |
| description | Turn a natural-language strategy idea into a testable market hypothesis and strategy JSON, then create a saved strategy file that can be handed to backtest. Use for creating a new strategy or revising a hypothesis after reviewing backtest results. Strategy creation, hypothesis design, strategy JSON, strategy create, strategy revision, -v2 generation. Use when the user describes a trading idea or hypothesis in natural language, or asks to revise a strategy or create a new version (-v2) after reviewing backtest results. |
| compatibility | Requires uv, write access to {data_root}/strategies/, network access for Upbit market validation |
| metadata | {"version":"v0.8.1","author":"Upbit"} |
create-strategy
This skill turns a natural-language strategy idea into a saved strategy JSON file ready to hand off to the backtest skill.
Idea โ hypothesis โ design negotiation โ approval โ ConditionGroup JSON โ validation โ save {data_root}/strategies/{slug}.json โ hand off to backtest.
This skill is the strategy-design stage in the hypothesis-to-falsification workflow: it turns a natural-language idea into one or more concrete JSON strategy definitions. Backtesting is a tool for falsifying hypotheses, and this skill turns the hypothesis into something executable.
Domain catalogs and detailed rules are split into references/:
Load skills/references/glossary.md when explaining metric names, indicator names, or strategy terms in Korean.
Data Root and Execution Mode
At the start of work, identify the mode and resolve {data_root} as an absolute path.
| Mode | Detection | {data_root} (used unless config set data-dir was run) |
|---|
| clone mode | Running in the upbit-strategy-toolkit repo workspace/cwd | The current working directory at run time |
| agent skills mode (global) | Skill was installed with npx skills add ... -g, and the repo is not in the current workspace | The current working directory at run time |
| agent skills mode (project-scoped) | Skill was installed with npx skills add ... (no -g), and the repo is not in the current workspace | The current working directory at run time |
If config get data-dir returns unset, the CLI uses the current working directory at run time, regardless of mode. If the user has run config set data-dir, that stored value is used instead. When in doubt, confirm with bash scripts/upbit-strategy-toolkit.sh config get data-dir rather than assuming it from the table above.
After user approval, save the strategy JSON to {data_root}/strategies/{slug}.json. If the same slug already exists, use a new filename such as -v2/-v3; do not overwrite.
Use this skill's wrapper for tool calls instead of running upbit-strategy-toolkit directly.
bash scripts/upbit-strategy-toolkit.sh ...
Routing Contract
- Role: save natural-language strategy ideas as testable strategy JSON
- Prerequisite/recovery: route to
setup when uv is missing, the wrapper fails, or the CLI fails
- Next step:
backtest
- Handoff:
slug, hypothesis, falsification_criterion, notes
- Out of scope: this skill does not run backtests or interpret results
Triggers
- "Create a Bitcoin trading strategy using a golden cross"
- "Build a strategy that buys RSI oversold and sells RSI overbought"
- "After seeing the backtest result, tighten the stop-loss" (existing strategy -v2)
- "Let's draft a strategy from this hypothesis: volume spike + trend reversal = entry"
Do Not
- Do not connect to automated/live trading - see Live Trading Guardrail when requested.
- Do not recommend assets, entry timing, trade prices, target returns, or holding periods - this skill structures user-provided ideas into testable rules; it does not make investment recommendations.
- Do not save JSON before user approval - do not write files before the STEP 2 gate passes.
- Do not push the user to edit JSON directly - the skill synthesizes JSON; the user negotiates only in natural language.
- Do not guess indicators outside the catalog - reject anything outside the 15 JSON types / 16 target indicators (references/indicators.md).
- Do not hand validation failures to the user - handle validation errors through the self-correction loop (references/error-recovery.md).
Investment Recommendation Guardrail
If the user asks what to buy, sell, hold, choose, when to trade, what target return to pursue, what price to trade at, or how long to hold, do not answer the recommendation itself.
Put the following notice at the end of the response exactly as written. If the user's message is in Korean, use the Korean version; otherwise use the English version.
Korean:
Upbit Strategy Toolkit์ ์ด๋ ํ ๊ฒฝ์ฐ์๋ ํน์ ์ข
๋ชฉ, ๊ฑฐ๋ ์์ , ํฌ์ ๋ฐฉ์, ํฌ์ ์ ๋ต ๋ฑ์ ์ถ์ฒยท๊ถ์ ํ์ง ์์ต๋๋ค. ์์ฑ๋๋ ์๋ต์ ์ฌ์ฉ์๊ฐ ์ด์ฉ ์ค์ธ AI ๋ชจ๋ธ์ด ์
๋ ฅ ๋ด์ฉ๊ณผ ๋๊ตฌ ์คํ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํ์ผ๋ก ์์ฑํ ๊ฒ์ผ๋ก, ๊ฑฐ๋ยทํฌ์ ํ์์ ๊ด๋ จ๋ ๋ชจ๋ ์ฑ
์์ ์ด์ฉ์์๊ฒ ๊ท์๋ฉ๋๋ค.
English:
Upbit Strategy Toolkit does not, under any circumstances, recommend, advise on, or solicit the purchase, sale, timing, method, or strategy of any specific asset or investment. Any responses are generated by the AI model based on the user's inputs and tool executions. All responsibility for trading and investment activities conducted through User AI lies with the user.
Then redirect the user to a supported input such as:
- a market hypothesis they want to test,
- concrete entry/exit/stop-loss/take-profit rules they want structured,
- or an existing strategy they want revised for another backtest.
This skill may structure user-specified rules into buy / sell / stop-loss / take-profit fields, but it must not decide those actions for the user.
Workflow
STEP 1. Listen for the Hypothesis + Draft a Four-Part Strategy Structure
Reduce the natural-language idea to one testable market hypothesis sentence, then propose all four parts (buy/sell/stop-loss/take-profit) without blanks.
Hypothesis statement format: "When condition X occurs, price movement in direction Y happens more often"
Good examples:
- "When the 5-day moving average crosses above the 20-day moving average, a short-term uptrend tends to continue afterward"
- "When RSI < 30, short-term rebounds occur more often (mean reversion)"
Presentation format:
create-strategy
Strategy: {strategy name}
Hypothesis: {one-sentence market hypothesis}
Structured draft:
- Buy: {condition in natural language}
- Sell: {condition in natural language}
- Stop-loss: -{N}% from entry price
- Take-profit: +{N}% from entry price
- Target: {market} / {exchange} / {timeframe}
How this hypothesis is falsified:
- {example: "If it frequently reaches a wide stop-loss, the trend-following hypothesis is broken"}
Proceed with this? Tell me which items to revise.
Defaults (do not ask again; user-specified values take priority): market=KRW-BTC, exchange=kr, timeframe=1d, stop_loss=5, take_profit=15.
Market substitution rule: If the requested market is unsupported, ask the user before substituting (e.g., "SGD-DOGE is not supported. Use KRW-DOGE instead?"). Proceed only after explicit confirmation, then update Strategy: {strategy name} to reflect the confirmed market.
Only kr exchange is currently supported. If the user requests a different exchange, explain it is not supported and default to kr.
STEP 2. Explicit Approval Gate
Do not proceed to STEP 3 before explicit approval, such as "proceed", "OK", "yes", or "do it that way". On revision requests, return to STEP 1 and present the proposal again.
STEP 3. Convert to JSON + Strategy Validation Loop
Synthesize the approved four parts into ConditionGroup JSON. Pre-check these core constraints during synthesis:
indicators[*].type must be one of the 15 catalog JSON types - references/indicators.md
ref values must not be duplicated, and each IndicatorOperand.ref in conditions must use indicator_ref.output_key and be valid through the output key
- Literals are forbidden on both sides of
cross_above/cross_below
- Express
ichimoku_cloud cloud conditions by comparing close with ichi.Leading1 and ichi.Leading2 separately. Use offset: 26 on the indicator operand when the cloud is displaced 26 bars into the future in the chart (e.g. {"type": "indicator", "ref": "ichi.Leading1", "offset": 26})
Full validation constraints and Operand/op tables are in references/schema.md. Copy and edit the empty strategy skeleton in assets/strategy-template.json.
Before validation, write the approved JSON draft to {data_root}/strategies/{slug}.json.
If validation fails, patch the same file up to 3 times. Do not report save completion to the user before validation passes.
Validation:
STRATEGY_PATH="{data_root}/strategies/{slug}.json"
bash scripts/upbit-strategy-toolkit.sh strategy validate "$STRATEGY_PATH"
On validation success, OK is printed. On failure, the validation error message is printed to stderr -> self-correction loop.
Self-Correction Loop (3 Attempts)
Only the most common cases are inline - all 9 patterns are in references/error-recovery.md.
| Error message pattern | Patch |
|---|
... unregistered indicator | Replace with the closest catalog indicator (for example, bollinger -> bollinger_bands) |
references undefined ref/output ... | Add it to the indicators array or fix the indicator_ref.output_key typo |
cross_above/cross_below ... Literal cannot be used | Use time series on both sides (for example, rsi cross_above 30 is invalid -> use gt 30) |
If it does not pass within 3 attempts, report the diagnosis to the user and renegotiate the hypothesis.
STEP 4. Confirm Save + Handoff
When validation passes, confirm the saved {data_root}/strategies/{slug}.json.
Slug rule: name -> lowercase hyphenated ASCII. Slug is derived from the final approved name (post-substitution), not the original request. If the same slug exists, automatically increment to -v2/-v3 (no overwrites). Backtest-based revisions are also saved as new versions.
Completion report + handoff:
Saved {data_root}/strategies/{slug}.json
Hypothesis: {one-line hypothesis summary}
Buy: {condition summary}
Sell: {condition summary}
Stop-loss -{stop_loss}% / take-profit +{take_profit}%
Target: {market} / {timeframe}
Next step: test this hypothesis with the backtest skill.
- slug: {slug}
- Falsification criterion: {falsification condition defined in STEP 1}
- The backtest skill automatically selects the period for the timeframe.
Handoff Payload
When STEP 4 completes, explicitly pass the following to the backtest skill:
slug: {slug}
hypothesis: {one-sentence hypothesis statement from STEP 1}
falsification_criterion: {falsification criterion - for example, "win rate < 40% or max drawdown > 25%"}
notes: {free-form notes - optional}
Do not send a period. timeframe is already in the JSON, and the backtest skill chooses the matching default period. This keeps period selection in one place (backtest) so two skills cannot compute conflicting periods.
If the backtest result falsifies the hypothesis, the user returns to this skill and creates a new version (-v2). Repeat bidirectionally.
Live Trading Guardrail
When any of the following utterance patterns are detected, immediately explain and stop work. Block command, question, bypass, indirect, and confusion patterns equally:
Command
- "Start automated trading with this strategy"
- "Place a real-time order" / "Execute a buy order" / "Turn on live trading"
Question
- "Can I run this strategy live?"
- "Is real-time trading possible?"
Bypass
- "What do I need to automate this strategy as-is?"
- "Can I put this JSON directly into a live trading bot?"
Indirect
- "The backtest result looks good; can I move it straight to live trading?"
- "Let's validate this hypothesis in live trading as-is"
Confusion
- "upbit-strategy-toolkit can do live trading too, right?"
- "Does this tool also provide an order API?"
Response template (apply to all patterns above): If the user's message is in Korean, use the Korean version; otherwise use the English version.
Korean:
์ด ๋๊ตฌ๋ ๋ฐฑํ
์คํธ(๊ณผ๊ฑฐ ๋ฐ์ดํฐ ์๋ฎฌ๋ ์ด์
) ์ ์ฉ์
๋๋ค.
์ค์๊ฐ ๊ฑฐ๋, ์๋ ์ฃผ๋ฌธ, ์ค์ ๋งค๋งค๋ ์ง์ํ์ง ์์ต๋๋ค.
์ค์ ๋งค๋งค๊ฐ ํ์ํ๋ค๋ฉด [upbit-agent-skills](https://github.com/upbit-official/upbit-agent-skills)๋ฅผ ์ด์ฉํด์ฃผ์ธ์.
์ด ์คํฌ์ ์ ๋ต JSON ์์ฑ ๋ฐ ๋ฐฑํ
์คํธ ๊ฒ์ฆ๋ง ์ง์ํฉ๋๋ค.
English:
This tool is for backtesting (historical data simulation) only.
Real-time trading, automated orders, and live trading are not supported.
Use the separate [upbit-agent-skills](https://github.com/upbit-official/upbit-agent-skills) tool for live trading.
This skill only supports strategy JSON creation -> backtest validation.
Execution Rule Summary
- Do not save JSON without approval
- Strategy revisions also go through this skill -> new version (
-v2, etc.)
- Indicator types must come only from the 15 JSON type catalog (references/indicators.md)
- Validation failure self-correction is limited to 3 attempts (references/error-recovery.md); if it still fails, ask the user to renegotiate the hypothesis
- Refuse live trading requests and point to upbit-agent-skills