longsizhuo/openinvest/invest

Claude Code and agent skill by longsizhuo/openinvest

Trust tier 2
  • community
  • ext:[{"type":"plugin","description":"Custom plugin integration"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

openInvest multi-asset AI investment committee — **daily use**. Read portfolio / live prices / strategy / decision history / adjust positions / run a 4-role LLM committee for an investment verdict. Supports any yfinance symbol (A-share `.SS`/`.SZ` / HK / US / ETF / crypto / commodities), China off-exchange funds (`FUND:<code>`) and any currency. **Two paths** — (1) Coordinator, Claude Code spawns 4 subagents, saves DeepSeek tokens; (2) Direct, any agent (Codex / Hermes / OpenClaw / Cursor / Cli…

Install

npx vskill@latest install longsizhuo/openinvest/invest

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Invest Skill

<skill-dir> is this skill's own directory — the folder that holds this SKILL.md (Claude Code
shows it as the skill's base directory; Hermes / Codex / OpenClaw install it inside the plugin).
run.sh below always means <skill-dir>/scripts/run.sh.

First-time fork users: run the invest-setup skill first to initialize. The main flow lives in this skill (the AI agent uses the CLI/MCP to view the portfolio / run the committee / replay decision history). The Web GUI has been retired (2026-07) — every capability is exposed via CLI subcommands / MCP tools. The backend is distributed from PyPI (pulled on demand via uvx) at the version pinned in run.sh, which moves with each plugin release: updating the plugin updates the backend. run.sh update re-downloads the pinned version if the uv cache breaks.

openInvest multi-asset AI investment committee. This skill is not Claude-exclusive — any agent that can run shell commands can use it; see "Choosing a path" below.

Reply in the language the user is currently speaking unless they explicitly ask to switch languages.

Choosing a path

The first question is not "which brand of agent are you" — it is "is a human present for this invocation":

Is a user asking in chat right now ("should I buy X / 该不该买 X") where you can
react in real time (wrong tool picked, blocked by a safety gate — the user sees it
on the spot and corrects it on the spot)?
→ Check whether you have an isolated sub-task delegation capability (Agent({...}) / delegate_task)
Yes → Coordinator (table below)
No → Direct
Is this a cron / scheduled run with nobody watching?
→ Always go Direct, no matter which agent you are or whether you can delegate

Why unattended runs always go Direct, even with delegation capability: the Coordinator protocol depends on you improvising "which tool to call and how to assemble the prompt". That is fine normally, but on 2026-07-14 a real Hermes cron ran Coordinator unattended — it did not faithfully call the delegation tool per the protocol, picked its own route instead, then hit the "unattended cron cannot approve dangerous commands" safety gate and stalled. Direct is pure deterministic Python code and never improvises. Saving the small hassle of configuring a key is not worth a probabilistic hang / derailment in unattended scenarios — a bad trade.

ScenarioWho you arePathWhat to runCredentials
Interactive (user present)Claude Code (has the Agent({...}) tool)Coordinatorprepare_committee → spawn 4 subagents → save_committeeNo key needed
Interactive (user present)Hermes (has the delegate_task tool)Coordinator (Hermes variant)Same as above; spawn syntax becomes delegate_task(tasks=[...])No key needed
Interactive, no delegation capabilityCodex / OpenClaw / Cursor / Cline / plain scriptDirectrun_committee <SYMBOL> one-shotNeeds LLM_API_KEY
cron / unattended, any agentAnyone, with or without delegation capabilityDirectrun_committee / daily_reportNeeds LLM_API_KEY

All three paths share the same foundation — the same prompts, the same data preparation (regime classification + probability framing + deterministic fact block), and the same on-disk format (memory/.committee/<date>/<asset>.md; both Coordinator variants must call save_committee with --provider <your-brand> so the transcript is not mislabeled as claude, and --model <the model that plays the 4 roles>, e.g. claude-haiku-5-5 — omitted is recorded as unknown, and the scorecard buckets verdicts per <provider>:<model>, so a model swap never mixes old and new track records). The only difference is "who plays the 4 LLM roles": on Coordinator you play them yourself (the model the user already subscribes to); on Direct the configured LLM (billed per token) plays them. Verdicts may differ (different models — useful for cross-validation).

`LLM_API_KEY` is not DeepSeek-only, and the cost is near zero: utils/llm.py works with any OpenAI-compatible endpoint (three envs: LLM_API_KEY/LLM_BASE_URL/LLM_MODEL; DEEPSEEK_* remains supported for compatibility). Want zero cost → providers with free tiers right now (Qwen / Zhipu / MiMo etc.) all work (free-tier terms change — verify before use); don't want the hassle → just use DeepSeek: at daily-report volume (a few assets/day) roughly ¥0.01-0.03 per run, under ¥2 a month. Do not bet the reliability of unattended runs on Coordinator just to save that much.

No sub-task delegation capability and no key configured: do not force your way through Coordinator, do not fabricate a verdict, and do not write code to brute-force around it — just call run_committee (you will get a clear error) and honestly tell the user "LLM_API_KEY needs to be configured".

Decision tree (identical up front, whichever path you take)

1. Run `run.sh doctor` (no shell access? call the MCP `doctor` tool — same output) ← mandatory first step
├─ status: "ready" → go to step 2 (keep using this skill). A missing LLM key / mail
│ credentials / .env shows up only as `optional_*` checks and never
│ flips the status: Coordinator needs no key (only Direct does — see
│ `direct_ready`), so do NOT re-onboard for those
└─ status: "needs_setup" → memory not initialized (or portfolio.md still the v1 format) →
**switch to the `invest-setup` skill** (not handled here)
(An older MCP server answers `Unknown tool` for `doctor`: call `status` instead — a normal
reply means onboarding is done.)
2. Pick the subcommand by user intent:
"show portfolio / how much do I have / 看持仓" → run.sh status
"assess the situation / risk / concentration
/ 分析战况" → run.sh status (see Constraints before
calling anything "overweight")
"how am I doing / annualised return / drawdown
/ 我的收益率 / 跑赢大盘没" → run.sh performance (TWR / XIRR / max
drawdown / vs benchmark; also inside
status.performance — quote TWR as the
return, XIRR only as money-weighted)
"what is my strategy / 我的策略是什么" → run.sh strategy
"recent trades / transaction log / 最近交易" → run.sh history
"where is the market / VIX now / 现在大盘" → run.sh live_prices
"if X drops 5% how much do I lose / 如果X跌5%" → run.sh what_if --symbol X --pct -5
(X is a yfinance symbol in the user's
portfolio; --gold-pct / --ndq-pct kept
for legacy usage)
"do I need to rebalance / what to buy or sell to
get back to my target allocation / 要不要再平衡" → run.sh rebalance_plan [--mode hybrid|cash_only|
sell_to_rebalance] [--band-pct 5] — a list
only (BUY/SELL, whole lots, reason); the user
places the orders; quote amounts from the JSON
"I got a dividend / interest / paid a fee or tax /
X split / 收到分红 利息 交了费 拆股 退回本金" → run.sh record_dividend (--kind interest) /
record_fee (--kind tax) / record_split /
record_return_of_capital (MCP tools of the same
name) — bookkeeping of what already happened,
pass the REAL date (--trade-date); always send
an idempotency key (a repeated split multiplies
the position twice); never use deposit/withdraw
for these (that would book them as new money
instead of return)
"I bought / subscribed an off-exchange fund (FUND:xxxxxx)
today / 申购了场外基金 / 基金份额确认了吗" → run.sh place_fund_order (MCP tool of the same
name) when the order was just placed: cash goes
out now, the order is "in transit" and total
assets do not dip; shares arrive when the
pricing-day NAV is published (the fund_confirm
job confirms nightly; confirm_fund_order only to
give a NAV / fee yourself, cancel_fund_order if
the order never went through). Status shows
pending_fund_orders. Don't use buy for these
"should I buy/sell X / analyze X / 该不该买卖X" → committee protocol ↓
"track AAPL / I want to watch TSLA / 跟踪苹果" → see references/adding-assets.md
"alert me if gold falls below 900 / tell me when
X drops 3% in a day / 跌破N提醒我 / 日跌超3%报警" → run.sh track_asset --symbol X
--alert-price-below 900 | --alert-day-drop-pct 3
(MCP track_asset alert_* args) — then tell
the user alerts are only SENT when the server
has INVEST_EVENT_ALERT=1 (see Constraints)
"I already held 3000 X before using this /
补录我原来就有的持仓" → run.sh status first — never re-add a
symbol it lists (double count); else
run.sh buy ... --existing-position
(MCP tool: record_existing_position;
`Unknown tool` = old server, do NOT
fall back to buy) — records it WITHOUT
deducting cash; a plain `buy` is a new
purchase paid from ledger cash
3. Run the committee per your path:
- Coordinator → read references/committee-protocol.md (spawn 4 subagents)
- Direct → just `run.sh run_committee <SYMBOL>` for a JSON verdict
4. After getting the verdict / cio_memo:
- **`cio_memo` is a Markdown string** (with `# title ## verdict` structure etc.).
Render it **as Markdown for the user** — do not print raw JSON and make the
user parse it themselves
- Execution step: check the next_step field and guide the user as it says.
**Never** write memory/ directly (see Constraints)

Coordinator path details (Claude Code only)

Read references/committee-protocol.md and follow it strictly. Full 6 stages:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • pluginCustom plugin integration

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/longsizhuo/openinvest/invest/badge)](https://verified-skill.com/skills/longsizhuo/openinvest/invest)

Something wrong with this skill or its page? Tell us.