From 0fcc209020d50a9b003d7543a5b4d2ee46e6494b Mon Sep 17 00:00:00 2001 From: Manohar Date: Wed, 10 Jun 2026 14:59:41 +0000 Subject: [PATCH] feat(skills): spawn-delegate, angel-positions, inbox-manager, sys-health Four skills that wire Tiger into its own control plane (requires TIGER_BRIDGE_TOKEN in the container env): delegate work to specialists, read live P&L (read-only, never trades), manage the TASKS.md inbox, self-diagnose host RAM/gateway/bridge health. --- skills/angel-positions/SKILL.md | 25 +++++++++++++++++ skills/inbox-manager/SKILL.md | 39 ++++++++++++++++++++++++++ skills/spawn-delegate/SKILL.md | 49 +++++++++++++++++++++++++++++++++ skills/sys-health/SKILL.md | 41 +++++++++++++++++++++++++++ 4 files changed, 154 insertions(+) create mode 100644 skills/angel-positions/SKILL.md create mode 100644 skills/inbox-manager/SKILL.md create mode 100644 skills/spawn-delegate/SKILL.md create mode 100644 skills/sys-health/SKILL.md diff --git a/skills/angel-positions/SKILL.md b/skills/angel-positions/SKILL.md new file mode 100644 index 0000000..1b6db3a --- /dev/null +++ b/skills/angel-positions/SKILL.md @@ -0,0 +1,25 @@ +--- +name: angel-positions +description: Read Manohar's live Angel One trading positions and P&L from the standalone position-tracker. Use when asked about positions, profit/loss, exposure, or how the portfolio is doing right now. Read-only — this skill can never place, modify, or close trades. +--- + +# Angel One Positions (read-only) + +The standalone position-tracker (own repo/deploy) is the single source of +truth for live positions. Endpoint: + +```bash +curl -s https://angel.manohargupta.com/api/positions +``` + +Response: array of positions with `tradingsymbol`, `exchange`, `netqty`, +`ltp`, `avg_price`, `unrealised_pnl` (₹), `realised_pnl` (₹). + +## Reporting rules +- Always report P&L in ₹ with the sign, per position and total. +- Note market hours: NSE/BSE trade 09:15–15:30 IST Mon–Fri; outside those + hours, LTP is stale — say so. +- Alert threshold context: ₹5,000 absolute move is the alerting band the + tracker uses; reference it when relevant. +- NEVER suggest trades. Report and analyze only. If asked to execute + anything, decline — execution stays with Manohar. diff --git a/skills/inbox-manager/SKILL.md b/skills/inbox-manager/SKILL.md new file mode 100644 index 0000000..a022ec3 --- /dev/null +++ b/skills/inbox-manager/SKILL.md @@ -0,0 +1,39 @@ +--- +name: inbox-manager +description: Manage the TASKS.md INBOX — the queue the bridge drains every 30 minutes (9:00–20:00 IST), dispatching each item to the right specialist automatically. Use when Manohar says "add to my tasks/inbox/queue", wants something done later or recurring-ish, or asks what's pending. Also supports triggering an immediate drain. +metadata: + { + "moltbot": + { + "emoji": "📥", + "requires": { "env": ["TIGER_BRIDGE_TOKEN"] }, + "primaryEnv": "TIGER_BRIDGE_TOKEN", + }, + } +--- + +# INBOX Manager + +`~/.openclaw/workspace/TASKS.md` has a `## 📥 INBOX` section. Each +`- [ ] task` line gets auto-dispatched: the bridge classifies it, spawns the +right specialist, rewrites the line to `- [⏳ run-id → agent]`, and the +result lands on Telegram. + +## Add a task +Append ONE line under the `## 📥 INBOX` header (before the next `## `): +``` +- [ ] research upcoming SECI BESS tenders and summarize timelines +``` +Write tasks self-contained — the specialist gets no chat context. + +## List pending +Read TASKS.md and report the unchecked `- [ ]` lines under INBOX, in order +(top item dispatches first). + +## Drain now (don't wait for the 30-min cycle) +```bash +curl -s -X POST http://172.17.0.1:3456/tiger/inbox/drain \ + -H "Authorization: Bearer $TIGER_BRIDGE_TOKEN" +``` +Dispatches exactly ONE item (the top one). Outside 9:00–20:00 IST the +manual drain still works (force=true server-side). diff --git a/skills/spawn-delegate/SKILL.md b/skills/spawn-delegate/SKILL.md new file mode 100644 index 0000000..7a9b9b9 --- /dev/null +++ b/skills/spawn-delegate/SKILL.md @@ -0,0 +1,49 @@ +--- +name: spawn-delegate +description: Delegate work to Tiger's specialist sub-agents (Cody=code, Ethan=research, Cathy=writing, Elon=planning) and check on their runs. Use whenever a task is substantial enough to hand off — the specialist runs in its own session and reports to Telegram when done, so you stay free for the conversation. Also use to list recent runs or fetch a run's full result. +metadata: + { + "moltbot": + { + "emoji": "🤝", + "requires": { "env": ["TIGER_BRIDGE_TOKEN"] }, + "primaryEnv": "TIGER_BRIDGE_TOKEN", + }, + } +--- + +# Spawn / Delegate to Specialists + +The bridge (host) exposes real sub-agent execution. You hold the bearer +token in `$TIGER_BRIDGE_TOKEN`. Bridge base URL from inside this container: +`http://172.17.0.1:3456`. + +## Who does what +- **cody** — code, debugging, devops, scripts, infra +- **ethan** — research, market/policy analysis, due diligence +- **cathy** — writing, summaries, reports, drafts +- **elon** — planning, prioritization, breaking down projects + +## Delegate a task +```bash +curl -s -X POST http://172.17.0.1:3456/tiger/spawn \ + -H "Authorization: Bearer $TIGER_BRIDGE_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{"agentId":"ethan","task":"","context":""}' +``` +Returns `{runId, sessionId, queued}`. Runs execute one at a time +(RAM-constrained host) — `queued > 0` means it waits its turn. +Completion is announced on Telegram automatically; you do NOT need to poll. + +## Check runs +```bash +# recent runs + queue state +curl -s http://172.17.0.1:3456/tiger/spawn/runs -H "Authorization: Bearer $TIGER_BRIDGE_TOKEN" +# one run, full reply +curl -s http://172.17.0.1:3456/tiger/spawn/runs/ -H "Authorization: Bearer $TIGER_BRIDGE_TOKEN" +``` + +## Rules +- Write the task so it stands alone — the specialist has NO chat context. +- One task per spawn. Split compound requests. +- Don't spawn for things you can answer in one turn yourself. diff --git a/skills/sys-health/SKILL.md b/skills/sys-health/SKILL.md new file mode 100644 index 0000000..1b53462 --- /dev/null +++ b/skills/sys-health/SKILL.md @@ -0,0 +1,41 @@ +--- +name: sys-health +description: Check the health of the Tiger Command Center itself — RAM/swap pressure on the VPS, LLM gateway reachability, bridge status, recent audit events, cron run outcomes. Use when asked "is everything running", "why is it slow", after failures, or proactively when your own turns feel sluggish. +metadata: + { + "moltbot": + { + "emoji": "🩺", + "requires": { "env": ["TIGER_BRIDGE_TOKEN"] }, + "primaryEnv": "TIGER_BRIDGE_TOKEN", + }, + } +--- + +# System Health + +## Memory pressure (the #1 failure mode on this host) +/proc inside the container shows HOST memory: +```bash +grep -E 'MemTotal|MemAvailable|SwapTotal|SwapFree' /proc/meminfo +``` +Interpretation: MemAvailable under ~800MB or swap more than half used means +agent turns will crawl and cron jobs may hit their 300s timeouts. Say so +explicitly and recommend deferring heavy work. + +## LLM gateway (all models route through it) +```bash +curl -s -o /dev/null -w '%{http_code}' https://llm.manohargupta.com/health/liveliness +``` +Anything but 200 = every agent in the system is degraded. + +## Bridge + recent activity +```bash +curl -s http://172.17.0.1:3456/tiger/status -H "Authorization: Bearer $TIGER_BRIDGE_TOKEN" +# last 20 audited events (spawns, cron, tasks, outputs): +curl -s 'http://172.17.0.1:3456/tiger/activity/audit?limit=20' -H "Authorization: Bearer $TIGER_BRIDGE_TOKEN" +``` + +## Report format +Lead with a one-line verdict (healthy / degraded / critical), then only the +metrics that are off. Quantify with numbers and units.