Agent skill

Invest Setup

by longsizhuo in longsizhuo/openInvest

First-time openInvest installation and onboarding. An agent skill from longsizhuo/openInvest.

MITAuto-check: notesAgent Workflows

Install Invest Setup

skills CLI
$ npx skills add longsizhuo/openInvest --skill invest-setup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install longsizhuo/openInvest invest-setup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/longsizhuo/openInvest.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugin/skills/invest-setup .claude/skills/invest-setup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
invest-setup
GitHub stars
108
Token cost
~2.7k tokens
SKILL.md length
1,306 words
Files
5 (incl. scripts, references)
Repo updated
First seen
Licence
MIT

At a glance

First-time openInvest installation and onboarding. An agent skill from longsizhuo/openInvest.

  • Works in 5 steps: Run doctor first to confirm setup is… → Ask the user 5 questions (use… → wealth_context (optional but recommended) → …
  • User explicitly says set up invest / init invest / 帮我初始化 invest
  • SKILL.md covers When to Use, When NOT to Use, Two onboarding paths and Path B: connect to an existing…, plus 4 more sections
  • Runs Shell scripts from its folder; needs INVEST_API_TOKEN and LLM_API_KEY

What it does

Invest Setup is an agent skill from longsizhuo/openInvest. First-time openInvest installation and onboarding. ONLY use when user explicitly says "set up invest" / "init invest" / "帮我初始化 invest", OR when invest skill's doctor returns status="needssetup". NOT for daily usage — once onboarding is done, the invest skill takes over (portfolio viewing, committee analysis, buy/sell tracking). Wraps run.sh init --from-stdin with the canonical 5-question flow.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts and reference files (for example `CHANGELOG.md`, `README.md` and `references/onboarding-detailed.md`).

It sits in Agent Workflows. The repository describes itself as: Research-grade investment decision engine for AI agents: isolated multi-agent committee, auditable verdicts, backtests with lookahead protection, published negative results. The licence is MIT.

When your agent uses it

  • User explicitly says set up invest / init invest / 帮我初始化 invest
  • When invest skills doctor returns status=needssetup

Example prompts

  • “set up invest”
  • “init invest”
  • “帮我初始化 invest”
  • “/invest-setup”

Requirements

  • A Bash shell
  • A credential in INVEST_API_TOKEN
  • A credential in DEEPSEEK_API_KEY

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Run doctor first to confirm setup is really needed
  2. Ask the user 5 questions (use AskUserQuestion on the Coordinator path, your conversational tool on the Direct path)
  3. wealth_context (optional but recommended)
  4. Assemble the payload + run init
  5. Confirm + hand over

What it can do on your machine

Read from SKILL.md and the folder at commit 220abd2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • INVEST_API_TOKEN
    • LLM_API_KEY
    • DEEPSEEK_API_KEY
    • EMAIL_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Invest Setup loads about 2.7k tokens when it runs, and up to ~2.8k if it reads all its reference files. Until then it costs about 107 tokens; SKILL.md has 1,306 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~107
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:53
    2. Write the answers into `$INVEST_HOME/.env` (only these two or three lines are
  • NoteMentions a .env fileSKILL.md:195
    A: When editing `.env`, **the model name must change too**:

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from longsizhuo/openInvest at commit 220abd2, republished under its MIT licence (© longsizhuo). 1,306 words, ~2,744 tokens.

Download SKILL.mdSave it as .claude/skills/invest-setup/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
invest-setup
description
First-time openInvest installation and onboarding. **ONLY use when** user explicitly says "set up invest" / "init invest" / "帮我初始化 invest", OR when `invest` skill's `doctor` returns `status="needs_setup"`. **NOT for daily usage** — once onboarding is done, the `invest` skill takes over (portfolio viewing, committee analysis, buy/sell tracking). Wraps `run.sh init --from-stdin` with the canonical 5-question flow.
version
0.5.1
platforms
linux, macos

Invest Setup Skill

Single responsibility: turn an empty openInvest deployment into a working one. Triggers only on the user's first-time setup — run once, then step aside (the invest skill takes over all day-to-day interaction).

When to Use

  • User explicitly says "set up invest" / "initialize invest" / "帮我初始化 invest"
  • The invest skill's doctor returns status: "needs_setup" (memory / user_profile missing)
  • User wants to reconfigure (explicitly says "reset" / "重新配置"; requires --force): on an existing install --force only updates name and risk tolerance in user.md — holdings, tracking, strategy and history stay as they are; change allocations with set_allocations, caps and tracking with track_asset / untrack_asset
  • v1 → v2 schema migration: doctor's portfolio_schema check says needs_migration (an install made by an older version; status shows cash 0). Run the exact command in that check's hint — it backs up portfolio.md and converts it. Do not rerun init for this

When NOT to Use

  • User is already onboarded (doctor returns status: "ready") → switch to the invest skill
  • User wants to view holdings / P&L / run the committee → use the invest skill
  • User wants to track a new asset but is already onboarded → the invest skill's POST /api/holdings endpoint
  • User wants to commit / push code → that's a git operation, unrelated to setup

If you (the agent) entered this skill by mistake, exit immediately and tell the user to use the invest skill instead.

Two onboarding paths

PathScenarioFlow
A. Fresh deployment (default)User's first time with openInvest; data lives on this machine"Flow (4 steps)" below
B. Connect to an existing hubUser already runs openInvest on another machine (a server) and wants this machine to share the same data (multi-device)"Path B" below, 2 minutes

Phrasings that trigger Path B: "connect to my hub / 连接我的 hub" / "it's already installed on my server / 我服务器上已经装好了" / "share one portfolio across machines / 多台电脑共用持仓" / "connect to my existing deployment".

Path B: connect to an existing hub (no init)

  1. Ask two questions:
    • Hub address? (e.g. https://invest.example.com or http://10.0.0.6:8765)
    • Does the hub have auth enabled? A token (INVEST_API_TOKEN) or a Cloudflare Access service token (CF_ACCESS_CLIENT_ID/SECRET)? Skip if not enabled.
  2. Write the answers into $INVEST_HOME/.env (only these two or three lines are needed; no DeepSeek key / Gmail / 5-question flow — those all live on the hub):
    env
    INVEST_API_BASE=https://invest.example.com
    INVEST_API_TOKEN=...        # optional
  3. Verify: run run.sh doctor → it should return status: "ready" plus a remote section (api_base / auth method). If it can't connect, the error JSON's hint tells you whether the problem is the address, the token, or the hub service not running.
  4. Done — hand over to the invest skill.

Note: Path B must not run init (init is disabled in remote mode and will error); no memory/ is created on this machine — all data stays on the hub.

Flow (4 steps)

1. Run doctor first to confirm setup is really needed
bash
~/.claude/skills/invest-setup/scripts/run.sh doctor

Returns status: "ready" → exit immediately and tell the user "you're already onboarded — just use the invest skill".

Returns status: "needs_setup" → go to step 2.

2. Ask the user 5 questions (use AskUserQuestion on the Coordinator path, your conversational tool on the Direct path)
#AskNotes
Q1What should we call you?display name; Anonymous if they'd rather not say
Q2Risk tolerance?Conservative / Balanced / Aggressive
Q3Monthly income / monthly expenses / FX working buffer (CNY)?three numbers; all can be 0 to skip
Q4What do you currently hold? (free-form description)natural language, see below
Q5DeepSeek API key & Gmail App Password?Optional. Not needed on the Coordinator path
Q4 natural language (key change 2026-05)

Do not ask field by field. Let the user describe their holdings in one sentence:

"510300 CSI 300 ETF, 3000 shares at 4.2 CNY; 80k in CMB Zhaozhaobao; 50 grams of ICBC gold accumulation at 750 average cost" "AAPL 100 shares at 150 USD cost, 0.3 BTC, 50k CNY cash" "Nothing at all, just 10k CNY"

When the backend cmd_init sees a holdings_description field it calls DeepSeek to parse it into the v2 schema. Without a DeepSeek key it falls back to profile.current_assets (only cash_cny / aud_cash get written into the portfolio) — so always copy the cash amounts the user mentioned into current_assets too, and tell the user about this.

Boundary rules to tell the user (not enforced):

  • For A-shares, just say the code (510300) — no .SS suffix needed
  • For HK / US stocks, say the ticker (0700.HK or "Tencent")
  • For crypto, just say the coin (BTC / ETH)
  • Yu'ebao / Zhaozhaobao / money-market funds → the parser routes them into cash, not holdings

If the user reveals "this account is pocket money" / "I have an emergency reserve" / "family backup" → ask one more question:

Do you have an emergency fund / family backup outside this portfolio? Roughly how much? (Family funds cannot be used for investing — they only serve to prevent the "low cash = high risk" misjudgment.)

Record it into wealth_context:

yaml
wealth_context:
  emergency_buffer_cny: 200000  # or whatever number the user gives
  family_backup_available: true
  account_purpose: "pocket-money account"  # the user's own words
  lifestyle_notes: "..."

See docs/wiki/12-verification.md claim 7 (WealthContextOfficer) for details.

Show full SKILL.md (506 more words)Show less
4. Assemble the payload + run init

The payload must be nested as {"profile": {...}, "env": {...}} — a flat object (no top-level "profile") is rejected with status: "error" and an expected_shape field. Fill it with the user's real answers (the numbers below are placeholders):

bash
echo '{
  "profile": {
    "name": "<Q1>",
    "risk_tolerance": "<Q2: Conservative | Balanced | Aggressive>",
    "monthly_income_cny": 0,
    "monthly_expenses_cny": 0,
    "exchange_buffer_cny": 0,
    "holdings_description": "<the user's exact words from Q4>",
    "current_assets": {"cash_cny": 0, "aud_cash": 0},
    "wealth_context": {}
  },
  "env": {
    "DEEPSEEK_API_KEY": "<Q5 key, or empty string>",
    "EMAIL_SENDER": "<Gmail address, or empty string>",
    "EMAIL_PASSWORD": "<Q5 Gmail App Password, or empty string>"
  }
}' | ~/.claude/skills/invest-setup/scripts/run.sh init --from-stdin
  • current_assets.cash_cny / aud_cash: the cash the user mentioned in Q4 — this is what gets recorded when there is no LLM key (or the parse fails) on a fresh install. Positions are never paid out of it: without a key they are added later with buy --existing-position.
  • wealth_context: optional, from step 3; omit it if the user didn't mention any.
  • env: every key is optional; LLM_API_KEY / LLM_BASE_URL work in place of DEEPSEEK_*.

Returns JSON:

json
{
  "status": "ok",
  "completion": "completed_full | completed_partial",
  "holdings_parse_note": "...",  // natural-language parse result, **show it to the user**
  "parsed_holdings_for_user_review": { ... },  // present when the LLM parsed holdings
  "next_step": "..."
}
5. Confirm + hand over

After it finishes:

  1. Render holdings_parse_note to the user (so they can confirm the parse is correct)
  2. Run doctor again to confirm status: "ready"
  3. Tell the user: "✓ Onboarding complete. Next time you say 'show portfolio' / 'analyze X', the invest skill kicks in automatically. To reconfigure, say 'reset invest'."

Error handling

  • "existing portfolio left unchanged" / "v2 write failed" (check first; it wins over the item below): the portfolio already had holdings or trades, so this run wrote no cash and no holding (with --force, name and risk tolerance may still have been updated — see profile_note). Run status first; add only the positions missing there, with --existing-position. Never re-add a symbol that status already lists
  • DeepSeek parse timeout / no key on a fresh install: report it to the user; the cash in current_assets (cash_cny / aud_cash) is still recorded (cash_recorded in the init JSON shows what this run wrote). Add the positions the user already held afterwards, one per call, with run.sh buy --symbol S --units N --price P [-c CCY] --existing-position (MCP: the record_existing_position tool; an older MCP server answers Unknown tool — don't fall back to buy) — that does not touch cash. Run status first and skip any symbol it already lists. A plain buy is a new purchase paid from ledger cash
  • status: "error" with expected_shape: the payload wasn't nested under "profile" — rebuild it as shown in step 4
  • schema validation fail: usually a wrong field type — check the error field in the init response
  • user_profile.json already exists: refuse to overwrite; have the user add --force to confirm explicitly

FAQ

Q: I swapped DeepSeek for Qwen / Zhipu and it doesn't work

A: When editing .env, the model name must change too:

env
LLM_API_KEY=...
LLM_BASE_URL=...
LLM_MODEL=qwen-max         # ← don't forget this

Changing only the API key + base_url while the model stays deepseek-chat → the upstream returns 400 "model not found". Every provider names its models differently — check the provider's own site.

Q: The committee decision replay is blank after a run

A: Check whether the memory/.committee/<today>/<asset>.md file was generated. If not, something failed during the call — run run.sh doctor and see which item's hint is red.

Q: The code seems older than the demo site

A: Run run.sh update (pulls the latest release from PyPI). openInvest is still iterating quickly.

References

The detailed 5-step flow lives in the original references/onboarding.md (179 lines). This SKILL.md is the condensed agent-trigger guide.

© longsizhuo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references) in plugin/skills/invest-setup of longsizhuo/openInvest.

  • SKILL.md
  • CHANGELOG.md
  • README.md
  • references/onboarding-detailed.md
  • scripts/run.sh

Open the folder on GitHubat commit 220abd2

Compare with similar skills

Invest Setup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Invest Setup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Invest Setup this skilllongsizhuo/openInvest108—~2.7kAutomated safety check: NotesMIT
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k10 repos~4.1kAutomated safety check: NotesApache-2.0
Using Superpowersfarm-fe/farm5.6k36 repos~1.4kAutomated safety check: PassMIT
Executing Plans Inlineobra/superpowers297k2 repos~5.1kAutomated safety check: PassMIT
Skill CreatorAzure/azqr79689 repos~8.2kAutomated safety check: PassApache-2.0

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 10 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Using Superpowers

    farm-fe/farm

    A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

    5.6k GitHub starsUsed in 36 repos~1.4k tokens
    Agent WorkflowsAuto-check passed
  • Executing Plans Inline

    obra/superpowers

    Has the agent carry out an implementation plan itself, task by task in the current session, keeping a ledger, proving each step with a test and ending with one whole-branch review.

    297k GitHub starsUsed in 2 repos~5.1k tokens
    Agent WorkflowsAuto-check passed
  • Skill Creator

    Azure/azqr

    Official

    Create new skills, modify and improve existing skills, and measure skill performance.

    796 GitHub starsUsed in 89 repos~8.2k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    38k GitHub starsUsed in 7 repos~2.8k tokens
    Agent WorkflowsAuto-check passed

More from longsizhuo/openInvest

  • Okf Frontmatter

    longsizhuo/openInvest

    Maintain openInvest's docs (docs/wiki chapters + docs/wiki/adr) under Google's Open Knowledge Format (OKF).

    108 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Invest

    longsizhuo/openInvest

    openInvest multi-asset AI investment committee — daily use. An agent skill from longsizhuo/openInvest.

    108 GitHub stars~5.9k tokensUpdated today
    Auto-check: notes
  • Invest Backup

    longsizhuo/openInvest

    Back up / restore openInvest's local state — memory/ (holdings, strategy, user profile, committee records, dream logs) + db/ (trade ledger, job run history, market-data cache) + .env (SMTP/API…

    108 GitHub stars~1.2k tokensUpdated today
    Auto-check: notes

Categories

Questions about Invest Setup

What does Invest Setup do?

First-time openInvest installation and onboarding. An agent skill from longsizhuo/openInvest. Invest Setup is an agent skill from longsizhuo/openInvest. First-time openInvest installation and onboarding.

When should I use Invest Setup?

Invest Setup fits situations like: user explicitly says set up invest / init invest / 帮我初始化 invest; when invest skills doctor returns status=needssetup.

How do I install Invest Setup in Claude Code?

Run `npx skills add longsizhuo/openInvest --skill invest-setup -a claude-code`. Or copy the skill folder (plugin/skills/invest-setup in longsizhuo/openInvest) into .claude/skills/invest-setup in your project. Claude Code loads it when a task matches its description.

How do I install Invest Setup in Codex?

Run `npx skills add longsizhuo/openInvest --skill invest-setup -a codex`. Or copy the skill folder (plugin/skills/invest-setup in longsizhuo/openInvest) into .agents/skills/invest-setup in your project. Codex loads it when a task matches its description.

Can I use Invest Setup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add longsizhuo/openInvest --skill invest-setup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/invest-setup, .gemini/skills/invest-setup, .github/skills/invest-setup and .opencode/skills/invest-setup in your project.

What does Invest Setup need to run?

Going by SKILL.md and its folder, Invest Setup needs a shell for the scripts in its folder and credentials named INVEST_API_TOKEN, LLM_API_KEY, DEEPSEEK_API_KEY and EMAIL_PASSWORD. Our summary lists: A Bash shell; A credential in INVEST_API_TOKEN; A credential in DEEPSEEK_API_KEY.

Does Invest Setup access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Invest Setup safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Invest Setup use?

Invest Setup is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Invest Setup use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 10 tokens, read only when the agent opens those files.

What are the alternatives to Invest Setup?

Skills that share tags, products or a category with Invest Setup: MCP Server Builder (anthropics/skills, 180k stars), Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Using Superpowers (farm-fe/farm, 5.6k stars) and Executing Plans Inline (obra/superpowers, 297k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Invest Setup?

longsizhuo (a GitHub user) maintains it in longsizhuo/openInvest, which has 108 GitHub stars. The repository was last updated on October 11, 2026.

Source: longsizhuo/openInvest on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.