[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77W1Y1VNT058ATVG1MFANR6":3,"skill-same:01M77W1Y1VNT058ATVG1MFANR6":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":50,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M77W1Y1VNT058ATVG1MFANR6","tbot-controller",null,"Operate TradingBoat\u002FTBOT (TBOT runtime stack) via a controlled automation interface (DB-first queries; lifecycle control on explicit request).","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Ft\u002Ftbot-controller\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tbot-controller\nversion: 1.0.0\nauthor: PlusGenie\ntags: [openclaw, tbot, tradingboat, trading, docker, ibkr]\ndescription: Operate TradingBoat\u002FTBOT (TBOT runtime stack) via a controlled automation interface (DB-first queries; lifecycle control on explicit request).\nmetadata: {\"openclaw\":{\"emoji\":\"🛥️\",\"requires\":{\"bins\":[\"uv\"]},\"install\":[{\"id\":\"uv-brew\",\"kind\":\"brew\",\"formula\":\"uv\",\"bins\":[\"uv\"],\"label\":\"Install uv (brew)\"}]}}\n---\n\n## What this skill does\n- Query TBOT sqlite DB for alerts\u002Forders\u002Ferrors\u002Fportfolio (DB-first)\n- Start\u002Fstop TradingBoat\u002FTBOT (docker compose or systemd)\n- Fetch health\u002Fstatus (containers, ports, basic checks) only when explicitly requested\n- Read recent logs only when explicitly requested\n\n## Safety rules\n- Default to **read-only** operations (status\u002Flogs) unless user explicitly requests a control action.\n- For any state-changing action (start\u002Fstop\u002Frestart\u002Fsend), require explicit confirmation via the flag **--run-it** or environment variable **RUN_IT=1**. The controller will refuse execution otherwise.\n- Never print secrets (webhook keys, tokens). Redact them.\n\n## Refusal criteria (must-stop conditions)\nThe agent MUST stop and ask for user action if any of the following is true:\n- Runtime location is unknown and discovery cannot uniquely resolve it.\n- The TBOT database path cannot be found or opened read-only.\n- A request would start\u002Fstop\u002Frestart services or send signals **without** `--run-it` \u002F `RUN_IT=1`.\n- A request implies destructive DB changes (DROP\u002FTRUNCATE\u002FALTER) or “run arbitrary SQL”.\n\n## Prerequisites (first-time users)\nThis skill controls a **separate** TBOT runtime stack. The reference\u002Fruntime implementation is:\n\n- **openclaw-on-tradingboat (TBOT runtime stack)**: https:\u002F\u002Fgithub.com\u002FPlusGenie\u002Fopenclaw-on-tradingboat\n\nThis `tbot-controller` skill **does not** download or install the runtime for you. If the runtime is missing, the skill will run **read-only** DB helpers where possible, but status\u002Flogs\u002Fcontrol actions will fail until the runtime exists.\n\n### Install the runtime (recommended)\n1) Clone the runtime repo:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FPlusGenie\u002Fopenclaw-on-tradingboat.git\ncd openclaw-on-tradingboat\n```\n\n2) Ensure you can start it manually (outside this skill). For Docker Compose based installs, this typically means:\n\n```bash\ndocker compose up -d\n```\n\n3) Tell this skill where the runtime lives (recommended):\n\n- Set `TBOT_COMPOSE_DIR` to the folder that contains `docker-compose.yml` or `compose.yaml`.\n\nExamples:\n\n```bash\nexport TBOT_COMPOSE_DIR=\"$HOME\u002Fdevelop\u002Fgithub\u002Fopenclaw-on-tradingboat\"\n```\n\nOr add it to `~\u002F.openclaw\u002F.env` \u002F your skill `env` block in `openclaw.json`.\n\n### Configure runtime secrets (outside this skill)\n- TBOT typically uses a `.env` file for broker credentials and webhook keys.\n- **Do not** commit secrets to git.\n- If you are unsure whether the runtime is set to **paper** or **live**, this skill must **refuse** to execute any trade\u002Faction until you confirm which it is.\n\n## Install \u002F script permissions\nThis skill is invoked via a bash entrypoint script. Ensure it is executable:\n\n```bash\nchmod +x scripts\u002Ftbot.sh\n```\n\n### Python deps (OpenClaw-native)\nThis skill uses **uv** to run Python scripts in an isolated environment and auto-install dependencies from:\n- `{baseDir}\u002Fscripts\u002Frequirements.txt`\n\nInstall uv (macOS):\n```bash\nbrew install uv\n```\n\nClawHub packaging note: if you publish this skill, ensure `scripts\u002F` (including `requirements.txt`) is included at the **root** of the repo.\n\n## IMPORTANT: DB-first, discovery only for status\u002Fcontrol\n\nDB queries do **NOT** require discovery.\nDiscovery is required **only** before status\u002Flogs\u002Fcontrol actions.\n\nOpenClaw must **NOT** hardcode old paths like `~\u002Fib-gateway-docker`.\n\nAlways prefer discovery output (usually pointing to `openclaw-on-tradingboat`).\n\n## Commands\n\n### Entry point (required)\nOpenClaw MUST invoke this skill via:\n\n```bash\nbash scripts\u002Ftbot.sh \u003Cmode> \u003Cargs...>\n```\n\nValid modes:\n- `ctl` — operations control (docker\u002Fsystemd)\n- `json` — JSON signal generation (schema-validated) and send to TBOT webhook (non-interactive)\n- `status` — read-only inspection (probe & discovery)\n\nOpenClaw must never call `python tbot*.py` directly.\n\n### Probe & Discovery (read-only, only for status\u002Fcontrol)\nWhen the user says “open TBOT”, “start TBOT”, “TBOT status”, etc., OpenClaw should:\n\n1) **Try discovery first (read-only)**:\n```bash\nbash scripts\u002Ftbot.sh status discover\n```\n\nThis step is mandatory because the compose folder may change over time\n(for example migrating from `ib-gateway-docker` to `openclaw-on-tradingboat`).\n\n2) If discovery returns a resolved runtime, run `ctl` commands by **injecting env vars**:\n\n- Docker example:\n```bash\nMODE=docker COMPOSE_DIR=\"\u003Ccompose_dir>\" bash scripts\u002Ftbot.sh ctl status\n```\n\nExample expected compose folder:\n\n```text\n~\u002Fdevelop\u002Fgithub\u002Fopenclaw-on-tradingboat> \n```\n\n- systemd example:\n```bash\nMODE=systemd SERVICE_NAME=\"\u003Cservice_name>\" SYSTEMD_USER=\"\u003C0|1>\" bash scripts\u002Ftbot.sh ctl status\n```\n\n3) Only if discovery cannot resolve a single runtime, ask **one precise question**:\n- Docker Compose: “What is the folder containing docker-compose.yml\u002Fcompose.yaml? (Usually this is the tbot-runtime (example) folder.)”\n- systemd: “What is the service name (and is it --user)?”\n\nNotes:\n- Discovery must remain **read-only** (no starting\u002Fstopping).\n- Use discovery output as the authoritative suggestion for MODE\u002FCOMPOSE_DIR\u002FSERVICE_NAME.\n\n### Why this matters\nIf OpenClaw skips discovery, it may incorrectly report TBOT as DOWN\nbecause it is checking an obsolete compose folder.\n\n### Status (read-only, only if requested)\n\n```bash\nbash scripts\u002Ftbot.sh ctl status\nbash scripts\u002Ftbot.sh ctl logs --tail 200\n```\n\nNote: With tbot-runtime (example), docker compose typically brings up three containers: ib-gateway-on-tradingboat (gnzsnz\u002Fib-gateway), redis-on-tradingboat, and tbot-on-tradingboat.\n\nInternally:\n- Docker: `docker compose ps`, `docker compose logs --tail=200`\n- systemd: `systemctl --user status \u003Cservice>`, `journalctl --user -u \u003Cservice> -n 200`\n\n### Control (explicit confirmation required)\n\n```bash\nbash scripts\u002Ftbot.sh ctl start --run-it\nbash scripts\u002Ftbot.sh ctl stop --run-it\nbash scripts\u002Ftbot.sh ctl restart --run-it\n```\n\nTip: Use MODE=docker + COMPOSE_DIR pointed at tbot-runtime (example) to control the stack via docker compose.\n\nInternally:\n- Docker: `docker compose up -d`, `docker compose down`\n- systemd: `systemctl --user start \u003Cservice>`, `systemctl --user stop \u003Cservice>`\n\n### JSON signal generation (generate + send)\n\n`json` mode is **non-interactive by design**.\nOpenClaw MUST NOT ask the user for webhook details or trading intent if they can be inferred.\n\nInference rules:\n- Webhook URL default: `http:\u002F\u002F127.0.0.1:5001\u002Fwebhook` (override with `TBOT_WEBHOOK_URL`)\n- Webhook key is read from the TBOT runtime `.env` by default (override with `WEBHOOK_KEY`)\n- `orderRef` is auto-generated when omitted\n- Natural language like `close 50 NFLX` implies `strategy.close`, `contract=stock`, `qty=50`\n\n`json` mode generates a schema-valid TradingView-style payload and **sends it** to TBOT via webhook.\n\nDefaults \u002F inference rules (do not ask the user):\n- **Webhook URL**: default `http:\u002F\u002F127.0.0.1:5001\u002Fwebhook` (override with `TBOT_WEBHOOK_URL`).\n- **Webhook key**: read from runtime `.env` (override with `WEBHOOK_KEY`).\n- **orderRef**: if not provided, auto-generate `Close_\u003CTICKER>_\u003CQTY>_\u003Cepoch_ms>`.\n- **Close intent**: inferred automatically; do not prompt the user.\n\n```bash\n# Example (user: “close 50 NFLX now”)\nTBOT_WEBHOOK_URL=\"http:\u002F\u002F127.0.0.1:5001\u002Fwebhook\" \\\nWEBHOOK_KEY=\"WebhookReceived:123456\" \\\nbash scripts\u002Ftbot.sh json \\\n  --ticker NFLX \\\n  --direction strategy.close \\\n  --contract stock \\\n  --metric qty=50\n```\n\nGuarantees:\n- Output is validated against `alert_webhook_schema.json`\n- Unsupported directions or metrics fail fast\n- No network calls or broker actions are performed\n- This generator is independent of the gateway container image (e.g., gnzsnz\u002Fib-gateway).\n\n#### Copy-paste JSON output (expected schema shape)\nWhen asked to “generate a TradingView webhook JSON”, OpenClaw should output JSON **exactly like this shape**:\n\n```json\n{\n  \"timestamp\": 1710000000000,\n  \"ticker\": \"ES1!\",\n  \"currency\": \"USD\",\n  \"timeframe\": \"5\",\n  \"clientId\": 1,\n  \"key\": \"WebhookReceived:123456\",\n  \"contract\": \"future\",\n  \"orderRef\": \"Long#1\",\n  \"direction\": \"strategy.entrylong\",\n  \"exchange\": \"CME\",\n  \"lastTradeDateOrContractMonth\": \"202603\",\n  \"multiplier\": \"50\",\n  \"metrics\": [\n    {\"name\": \"entry.limit\", \"value\": 0},\n    {\"name\": \"entry.stop\", \"value\": 0},\n    {\"name\": \"exit.limit\", \"value\": 0},\n    {\"name\": \"exit.stop\", \"value\": 0},\n    {\"name\": \"qty\", \"value\": 1},\n    {\"name\": \"price\", \"value\": 5032.25}\n  ]\n}\n```\n\nTip (local-first \u002F zero-config examples): it’s OK to use a placeholder `key` value in docs.\nFor real TradingView → TBOT delivery, set it to your actual shared secret (TVWB key).\n\n### DB inspection (read-only, primary)\n- Preferred (via this skill, DB-first):\n  - `bash scripts\u002Ftbot.sh status db --table orders --format summary --limit 100`\n  - `bash scripts\u002Ftbot.sh status db --table alerts --format summary --limit 100`\n  - `bash scripts\u002Ftbot.sh status db --table errors --format summary --limit 100`\n  - `bash scripts\u002Ftbot.sh status db --table tbot --format summary --limit 100`\n  - Use `--format json` to return raw JSON.\n- Portfolio\u002Fpositions are derived from `TBOTORDERS` (same as `\u002Forders\u002Fdata` in UI).\n\n### Read-only helpers (DB-first)\n- Portfolio snapshot:\n  - `bash scripts\u002Ftbot.sh status portfolio --format summary`\n- Errors tail (with grouping):\n  - `bash scripts\u002Ftbot.sh status errors --format summary --limit 200`\n  - `bash scripts\u002Ftbot.sh status errors --group --limit 200`\n- Health checks (HTTP):\n  - `bash scripts\u002Ftbot.sh status health --base-url http:\u002F\u002F127.0.0.1:5001`\n\nExample output (`--format summary`, orders):\n\n```\nTotals:\n- Market value: 284,103.16\n- Unrealized PnL: 134,585.15\n- Realized PnL: 0.00\n\nTBOT_TIME        | ORD_TIME                | TICKER | TV_Close | ACTION | TYPE | QTY | LIMIT | STOP | ORDERID | ORDERREF  | STATUS    | POS | MRKVAL     | AVGF     | UnrealPnL  | RealPnL\n----------------+-------------------------+--------+----------+--------+------+-----+-------+------+---------+-----------+-----------+-----+------------+----------+------------+--------\n2026-02-05 20:06 | 2026-02-05 20:06:12.345 | TSLA   | 399.4796 | BUY    | LMT  | 455 | 0     | 0    | 12345   | Ptf_TSLA  | Portfolio | 455 | 181,763.22 | 187.9038 | 96,266.98  | 0\n```\n\n- DB path resolution (first match wins):\n  - `--db-path \u002Fpath\u002Fto\u002Ftbot_sqlite3`\n  - `TBOT_DB_PATH=\u002Fpath\u002Fto\u002Ftbot_sqlite3`\n  - `TBOT_DB_OFFICE=\u002Fpath\u002Fto\u002Ftbot_sqlite3`\n- DB location notes:\n  - Inside the container, TBOT may create the DB at `\u002Fhome\u002Ftbot\u002Ftbot_sqlite3` if no volume is set.\n  - Recommended: bind-mount `.\u002Fruntime\u002Fdatabase` to `\u002Fhome\u002Ftbot\u002Fdatabase` and set `TBOT_DB_OFFICE=\u002Fhome\u002Ftbot\u002Fdatabase\u002Ftbot_sqlite3`.\n  - With the bind-mount, the host path is:\n    - `tbot-runtime (example)\u002Fruntime\u002Fdatabase\u002Ftbot_sqlite3`\n- After updating `tbot-runtime (example)\u002Fdocker-compose.yml`, restart TBOT:\n  - `MODE=docker COMPOSE_DIR=\"\u002Fpath\u002Fto\u002Fyour\u002Ftbot-runtime\" bash scripts\u002Ftbot.sh ctl restart --run-it`\n- Container note:\n  - The `tbot` container may not include `sqlite3` CLI; read the DB on the host (preferred) via bind-mount.\n- Fallback (manual):\n  - `sqlite3 \u003Cpath> \"SELECT ...\"`\n\n### Known gaps & intended fixes (tracked)\n- Discovery can miss running docker compose stacks; use DB-first commands for portfolio instead of discovery.\n- Add explicit subcommands (planned): `errors --tail` (limit), `health` (HTTP checks for `\u002Forders\u002Fdata` + `\u002Ftbot\u002Fdata`).\n- Add a single-line summary mode (planned): totals + top 3 positions + biggest losing position.\n\n## Data signal: TradingView-style webhook JSON generator\n\n### Required fields\nThis skill generates JSON with fields used by TBOT\u002FTradingBoat style alerts:\n- `timestamp` (ms since epoch)\n- `ticker` (e.g., `AAPL`, `ES1!`)\n- `currency` (e.g., `USD`)\n- `timeframe` (e.g., `1`, `5`, `1D`)\n- `clientId` (integer; IBKR client ID)\n- `key` (TVWB shared key)\n- `contract` (e.g., `stock`, `forex`, `crypto`, `future`)\n- `orderRef` (string identifier)\n- `direction` (e.g., `strategy.entrylong`, `strategy.entryshort`, `strategy.exitlong`, `strategy.exitshort`, `strategy.close`, `strategy.close_all`)\n- `exchange`, `lastTradeDateOrContractMonth`, `multiplier` (mostly for futures)\n- `metrics` (array of `{name, value}`)\n\n### Example payload\n(Uses a placeholder `key` value for copy-paste. Replace with your real TVWB shared key in production.)\n```json\n{\n  \"timestamp\": 1710000000000,\n  \"ticker\": \"ES1!\",\n  \"currency\": \"USD\",\n  \"timeframe\": \"5\",\n  \"clientId\": 1,\n  \"key\": \"WebhookReceived:123456\",\n  \"contract\": \"future\",\n  \"orderRef\": \"Long#1\",\n  \"direction\": \"strategy.entrylong\",\n  \"exchange\": \"CME\",\n  \"lastTradeDateOrContractMonth\": \"202603\",\n  \"multiplier\": \"50\",\n  \"metrics\": [\n    {\"name\": \"entry.limit\", \"value\": 0},\n    {\"name\": \"entry.stop\", \"value\": 0},\n    {\"name\": \"exit.limit\", \"value\": 0},\n    {\"name\": \"exit.stop\", \"value\": 0},\n    {\"name\": \"qty\", \"value\": 1},\n    {\"name\": \"price\", \"value\": 5032.25}\n  ]\n}\n```\n","## What this skill does\n- Query TBOT sqlite DB for alerts\u002Forders\u002Ferrors\u002Fportfolio (DB-first)\n- Start\u002Fstop TradingBoat\u002FTBOT (docker compose or systemd)\n- Fetch health\u002Fstatus (containers, ports, basic checks) only when explicitly requested\n- Read recent logs only when explicitly requested\n\n## Safety rules\n- Default to **read-only** operations (status\u002Flogs) unless user explicitly requests a control action.\n- For any state-changing action (start\u002Fstop\u002Frestart\u002Fsend), require explicit confirmation via the flag **--run-it** or environment variable **RUN_IT=1**. The controller will refuse execution otherwise.\n- Never print secrets (webhook keys, tokens). Redact them.\n\n## Refusal criteria (must-stop conditions)\nThe agent MUST stop and ask for user action if any of the following is true:\n- Runtime location is unknown and discovery cannot uniquely resolve it.\n- The TBOT database path cannot be found or opened read-only.\n- A request would start\u002Fstop\u002Frestart services or send signals **without** `--run-it` \u002F `RUN_IT=1`.\n- A request implies destructive DB changes (DROP\u002FTRUNCATE\u002FALTER) or “run arbitrary SQL”.\n\n## Prerequisites (first-time users)\nThis skill controls a **separate** TBOT runtime stack. The reference\u002Fruntime implementation is:\n\n- **openclaw-on-tradingboat (TBOT runtime stack)**: https:\u002F\u002Fgithub.com\u002FPlusGenie\u002Fopenclaw-on-tradingboat\n\nThis `tbot-controller` skill **does not** download or install the runtime for you. If the runtime is missing, the skill will run **read-only** DB helpers where possible, but status\u002Flogs\u002Fcontrol actions will fail until the runtime exists.\n\n### Install the runtime (recommended)\n1) Clone the runtime repo:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FPlusGenie\u002Fopenclaw-on-tradingboat.git\ncd openclaw-on-tradingboat\n```\n\n2) Ensure you can start it manually (outside this skill). For Docker Compose based installs, this typically means:\n\n```bash\ndocker compose up -d\n```\n\n3) Tell this skill where the runtime lives (recommended):\n\n- Set `TBOT_COMPOSE_DIR` to the folder that contains `docker-compose.yml` or `compose.yaml`.\n\nExamples:\n\n```bash\nexport TBOT_COMPOSE_DIR=\"$HOME\u002Fdevelop\u002Fgithub\u002Fopenclaw-on-tradingboat\"\n```\n\nOr add it to `~\u002F.openclaw\u002F.env` \u002F your skill `env` block in `openclaw.json`.\n\n### Configure runtime secrets (outside this skill)\n- TBOT typically uses a `.env` file for broker credentials and webhook keys.\n- **Do not** commit secrets to git.\n- If you are unsure whether the runtime is set to **paper** or **live**, this skill must **refuse** to execute any trade\u002Faction until you confirm which it is.\n\n## Install \u002F script permissions\nThis skill is invoked via a bash entrypoint script. Ensure it is executable:\n\n```bash\nchmod +x scripts\u002Ftbot.sh\n```\n\n### Python deps (OpenClaw-native)\nThis skill uses **uv** to run Python scripts in an isolated environment and auto-install dependencies from:\n- `{baseDir}\u002Fscripts\u002Frequirements.txt`\n\nInstall uv (macOS):\n```bash\nbrew install uv\n```\n\nClawHub packaging note: if you publish this skill, ensure `scripts\u002F` (including `requirements.txt`) is included at the **root** of the repo.\n\n## IMPORTANT: DB-first, discovery only for status\u002Fcontrol\n\nDB queries do **NOT** require discovery.\nDiscovery is required **only** before status\u002Flogs\u002Fcontrol actions.\n\nOpenClaw must **NOT** hardcode old paths like `~\u002Fib-gateway-docker`.\n\nAlways prefer discovery output (usually pointing to `openclaw-on-tradingboat`).\n\n## Commands\n\n### Entry point (required)\nOpenClaw MUST invoke this skill via:\n\n```bash\nbash scripts\u002Ftbot.sh \u003Cmode> \u003Cargs...>\n```\n\nValid modes:\n- `ctl` — operations control (docker\u002Fsystemd)\n- `json` — JSON signal generation (schema-validated) and send to TBOT webhook (non-interactive)\n- `status` — read-only inspection (probe & discovery)\n\nOpenClaw must never call `python tbot*.py` directly.\n\n### Probe & Discovery (read-only, only for status\u002Fcontrol)\nWhen the user says “open TBOT”, “start TBOT”, “TBOT status”, etc., OpenClaw should:\n\n1) **Try discovery first (read-only)**:\n```bash\nbash scripts\u002Ftbot.sh status discover\n```\n\nThis step is mandatory because the compose folder may change over time\n(for example migrating from `ib-gateway-docker` to `openclaw-on-tradingboat`).\n\n2) If discovery returns a resolved runtime, run `ctl` commands by **injecting env vars**:\n\n- Docker example:\n```bash\nMODE=docker COMPOSE_DIR=\"\u003Ccompose_dir>\" bash scripts\u002Ftbot.sh ctl status\n```\n\nExample expected compose folder:\n\n```text\n~\u002Fdevelop\u002Fgithub\u002Fopenclaw-on-tradingboat> \n```\n\n- systemd example:\n```bash\nMODE=systemd SERVICE_NAME=\"\u003Cservice_name>\" SYSTEMD_USER=\"\u003C0|1>\" bash scripts\u002Ftbot.sh ctl status\n```\n\n3) Only if discovery cannot resolve a single runtime, ask **one precise question**:\n- Docker Compose: “What is the folder containing docker-compose.yml\u002Fcompose.yaml? (Usually this is the tbot-runtime (example) folder.)”\n- systemd: “What is the service name (and is it --user)?”\n\nNotes:\n- Discovery must remain **read-only** (no starting\u002Fstopping).\n- Use discovery output as the authoritative suggestion for MODE\u002FCOMPOSE_DIR\u002FSERVICE_NAME.\n\n### Why this matters\nIf OpenClaw skips discovery, it may incorrectly report TBOT as DOWN\nbecause it is checking an obsolete compose folder.\n\n### Status (read-only, only if requested)\n\n```bash\nbash scripts\u002Ftbot.sh ctl status\nbash scripts\u002Ftbot.sh ctl logs --tail 200\n```\n\nNote: With tbot-runtime (example), docker compose typically brings up three containers: ib-gateway-on-tradingboat (gnzsnz\u002Fib-gateway), redis-on-tradingboat, and tbot-on-tradingboat.\n\nInternally:\n- Docker: `docker compose ps`, `docker compose logs --tail=200`\n- systemd: `systemctl --user status \u003Cservice>`, `journalctl --user -u \u003Cservice> -n 200`\n\n### Control (explicit confirmation required)\n\n```bash\nbash scripts\u002Ftbot.sh ctl start --run-it\nbash scripts\u002Ftbot.sh ctl stop --run-it\nbash scripts\u002Ftbot.sh ctl restart --run-it\n```\n\nTip: Use MODE=docker + COMPOSE_DIR pointed at tbot-runtime (example) to control the stack via docker compose.\n\nInternally:\n- Docker: `docker compose up -d`, `docker compose down`\n- systemd: `systemctl --user start \u003Cservice>`, `systemctl --user stop \u003Cservice>`\n\n### JSON signal generation (generate + send)\n\n`json` mode is **non-interactive by design**.\nOpenClaw MUST NOT ask the user for webhook details or trading intent if they can be inferred.\n\nInference rules:\n- Webhook URL default: `http:\u002F\u002F127.0.0.1:5001\u002Fwebhook` (override with `TBOT_WEBHOOK_URL`)\n- Webhook key is read from the TBOT runtime `.env` by default (override with `WEBHOOK_KEY`)\n- `orderRef` is auto-generated when omitted\n- Natural language like `close 50 NFLX` implies `strategy.close`, `contract=stock`, `qty=50`\n\n`json` mode generates a schema-valid TradingView-style payload and **sends it** to TBOT via webhook.\n\nDefaults \u002F inference rules (do not ask the user):\n- **Webhook URL**: default `http:\u002F\u002F127.0.0.1:5001\u002Fwebhook` (override with `TBOT_WEBHOOK_URL`).\n- **Webhook key**: read from runtime `.env` (override with `WEBHOOK_KEY`).\n- **orderRef**: if not provided, auto-generate `Close_\u003CTICKER>_\u003CQTY>_\u003Cepoch_ms>`.\n- **Close intent**: inferred automatically; do not prompt the user.\n\n```bash\n# Example (user: “close 50 NFLX now”)\nTBOT_WEBHOOK_URL=\"http:\u002F\u002F127.0.0.1:5001\u002Fwebhook\" \\\nWEBHOOK_KEY=\"WebhookReceived:123456\" \\\nbash scripts\u002Ftbot.sh json \\\n  --ticker NFLX \\\n  --direction strategy.close \\\n  --contract stock \\\n  --metric qty=50\n```\n\nGuarantees:\n- Output is validated against `alert_webhook_schema.json`\n- Unsupported directions or metrics fail fast\n- No network calls or broker actions are performed\n- This generator is independent of the gateway container image (e.g., gnzsnz\u002Fib-gateway).\n\n#### Copy-paste JSON output (expected schema shape)\nWhen asked to “generate a TradingView webhook JSON”, OpenClaw should output JSON **exactly like this shape**:\n\n```json\n{\n  \"timestamp\": 1710000000000,\n  \"ticker\": \"ES1!\",\n  \"currency\": \"USD\",\n  \"timeframe\": \"5\",\n  \"clientId\": 1,\n  \"key\": \"WebhookReceived:123456\",\n  \"contract\": \"future\",\n  \"orderRef\": \"Long#1\",\n  \"direction\": \"strategy.entrylong\",\n  \"exchange\": \"CME\",\n  \"lastTradeDateOrContractMonth\": \"202603\",\n  \"multiplier\": \"50\",\n  \"metrics\": [\n    {\"name\": \"entry.limit\", \"value\": 0},\n    {\"name\": \"entry.stop\", \"value\": 0},\n    {\"name\": \"exit.limit\", \"value\": 0},\n    {\"name\": \"exit.stop\", \"value\": 0},\n    {\"name\": \"qty\", \"value\": 1},\n    {\"name\": \"price\", \"value\": 5032.25}\n  ]\n}\n```\n\nTip (local-first \u002F zero-config examples): it’s OK to use a placeholder `key` value in docs.\nFor real TradingView → TBOT delivery, set it to your actual shared secret (TVWB key).\n\n### DB inspection (read-only, primary)\n- Preferred (via this skill, DB-first):\n  - `bash scripts\u002Ftbot.sh status db --table orders --format summary --limit 100`\n  - `bash scripts\u002Ftbot.sh status db --table alerts --format summary --limit 100`\n  - `bash scripts\u002Ftbot.sh status db --table errors --format summary --limit 100`\n  - `bash scripts\u002Ftbot.sh status db --table tbot --format summary --limit 100`\n  - Use `--format json` to return raw JSON.\n- Portfolio\u002Fpositions are derived from `TBOTORDERS` (same as `\u002Forders\u002Fdata` in UI).\n\n### Read-only helpers (DB-first)\n- Portfolio snapshot:\n  - `bash scripts\u002Ftbot.sh status portfolio --format summary`\n- Errors tail (with grouping):\n  - `bash scripts\u002Ftbot.sh status errors --format summary --limit 200`\n  - `bash scripts\u002Ftbot.sh status errors --group --limit 200`\n- Health checks (HTTP):\n  - `bash scripts\u002Ftbot.sh status health --base-url http:\u002F\u002F127.0.0.1:5001`\n\nExample output (`--format summary`, orders):\n\n```\nTotals:\n- Market value: 284,103.16\n- Unrealized PnL: 134,585.15\n- Realized PnL: 0.00\n\nTBOT_TIME        | ORD_TIME                | TICKER | TV_Close | ACTION | TYPE | QTY | LIMIT | STOP | ORDERID | ORDERREF  | STATUS    | POS | MRKVAL     | AVGF     | UnrealPnL  | RealPnL\n----------------+-------------------------+--------+----------+--------+------+-----+-------+------+---------+-----------+-----------+-----+------------+----------+------------+--------\n2026-02-05 20:06 | 2026-02-05 20:06:12.345 | TSLA   | 399.4796 | BUY    | LMT  | 455 | 0     | 0    | 12345   | Ptf_TSLA  | Portfolio | 455 | 181,763.22 | 187.9038 | 96,266.98  | 0\n```\n\n- DB path resolution (first match wins):\n  - `--db-path \u002Fpath\u002Fto\u002Ftbot_sqlite3`\n  - `TBOT_DB_PATH=\u002Fpath\u002Fto\u002Ftbot_sqlite3`\n  - `TBOT_DB_OFFICE=\u002Fpath\u002Fto\u002Ftbot_sqlite3`\n- DB location notes:\n  - Inside the container, TBOT may create the DB at `\u002Fhome\u002Ftbot\u002Ftbot_sqlite3` if no volume is set.\n  - Recommended: bind-mount `.\u002Fruntime\u002Fdatabase` to `\u002Fhome\u002Ftbot\u002Fdatabase` and set `TBOT_DB_OFFICE=\u002Fhome\u002Ftbot\u002Fdatabase\u002Ftbot_sqlite3`.\n  - With the bind-mount, the host path is:\n    - `tbot-runtime (example)\u002Fruntime\u002Fdatabase\u002Ftbot_sqlite3`\n- After updating `tbot-runtime (example)\u002Fdocker-compose.yml`, restart TBOT:\n  - `MODE=docker COMPOSE_DIR=\"\u002Fpath\u002Fto\u002Fyour\u002Ftbot-runtime\" bash scripts\u002Ftbot.sh ctl restart --run-it`\n- Container note:\n  - The `tbot` container may not include `sqlite3` CLI; read the DB on the host (preferred) via bind-mount.\n- Fallback (manual):\n  - `sqlite3 \u003Cpath> \"SELECT ...\"`\n\n### Known gaps & intended fixes (tracked)\n- Discovery can miss running docker compose stacks; use DB-first commands for portfolio instead of discovery.\n- Add explicit subcommands (planned): `errors --tail` (limit), `health` (HTTP checks for `\u002Forders\u002Fdata` + `\u002Ftbot\u002Fdata`).\n- Add a single-line summary mode (planned): totals + top 3 positions + biggest losing position.\n\n## Data signal: TradingView-style webhook JSON generator\n\n### Required fields\nThis skill generates JSON with fields used by TBOT\u002FTradingBoat style alerts:\n- `timestamp` (ms since epoch)\n- `ticker` (e.g., `AAPL`, `ES1!`)\n- `currency` (e.g., `USD`)\n- `timeframe` (e.g., `1`, `5`, `1D`)\n- `clientId` (integer; IBKR client ID)\n- `key` (TVWB shared key)\n- `contract` (e.g., `stock`, `forex`, `crypto`, `future`)\n- `orderRef` (string identifier)\n- `direction` (e.g., `strategy.entrylong`, `strategy.entryshort`, `strategy.exitlong`, `strategy.exitshort`, `strategy.close`, `strategy.close_all`)\n- `exchange`, `lastTradeDateOrContractMonth`, `multiplier` (mostly for futures)\n- `metrics` (array of `{name, value}`)\n\n### Example payload\n(Uses a placeholder `key` value for copy-paste. Replace with your real TVWB shared key in production.)\n```json\n{\n  \"timestamp\": 1710000000000,\n  \"ticker\": \"ES1!\",\n  \"currency\": \"USD\",\n  \"timeframe\": \"5\",\n  \"clientId\": 1,\n  \"key\": \"WebhookReceived:123456\",\n  \"contract\": \"future\",\n  \"orderRef\": \"Long#1\",\n  \"direction\": \"strategy.entrylong\",\n  \"exchange\": \"CME\",\n  \"lastTradeDateOrContractMonth\": \"202603\",\n  \"multiplier\": \"50\",\n  \"metrics\": [\n    {\"name\": \"entry.limit\", \"value\": 0},\n    {\"name\": \"entry.stop\", \"value\": 0},\n    {\"name\": \"exit.limit\", \"value\": 0},\n    {\"name\": \"exit.stop\", \"value\": 0},\n    {\"name\": \"qty\", \"value\": 1},\n    {\"name\": \"price\", \"value\": 5032.25}\n  ]\n}\n```\n",{"name":5,"tags":24,"author":31,"version":32,"metadata":33,"description":7},[25,26,27,28,29,30],"openclaw","tbot","tradingboat","trading","docker","ibkr","PlusGenie","1.0.0",{"openclaw":34},{"emoji":35,"install":36,"requires":43},"🛥️",[37],{"id":38,"bins":39,"kind":41,"label":42,"formula":40},"uv-brew",[40],"uv","brew","Install uv (brew)",{"bins":44},[40],"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Ft\u002Ftbot-controller",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill tbot-controller",{"tool":60,"command":61},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill tbot-controller",{"tool":63,"command":64},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill tbot-controller","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Ft\u002Ftbot-controller\u002FSKILL.md",true,[],[69,76,83,90,97,104],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]