Agent skill

Invest Backup

by longsizhuo in 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…

MITAuto-check: notesDevOps & Cloud

Install Invest Backup

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

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

GitHub CLI
$ gh skill install longsizhuo/openInvest invest-backup --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-backup .claude/skills/invest-backup && 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-backup
GitHub stars
108
Token cost
~1.2k tokens
SKILL.md length
472 words
Files
3 (incl. scripts)
Repo updated
First seen
Licence
MIT

At a glance

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…

  • Scenarios — backup invest data / 备份一下 openInvest 的数据
  • SKILL.md covers Why this skill exists, Usage, What is not included and Relationship to…
  • Runs Shell scripts from its folder
  • My holdings/strategy look wiped / 我的持仓/策略好像被清空了

What it does

Invest Backup is an agent skill from 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 credentials) + userprofile.json. All of this data is .gitignore'd with no historical versions in git, so a single accidental overwrite (e.g. slipping and running some one-off migration/init script) means real data loss — no git revert available. Proactive trigger scenarios — "backup invest data / 备份一下 openInvest 的数据", "my…

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts (for example `CHANGELOG.md` and `scripts/run.sh`).

It sits in DevOps & Cloud, covering Transactional email and Stock and market analysis. It works with Git. 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

  • Scenarios — backup invest data / 备份一下 openInvest 的数据
  • My holdings/strategy look wiped / 我的持仓/策略好像被清空了
  • Invest data is lost / invest 数据丢了
  • Restore invest backup / 恢复一下 invest 的备份

Example prompts

  • “backup invest data / 备份一下 openInvest 的数据”
  • “my holdings/strategy look wiped / 我的持仓/策略好像被清空了”
  • “invest data is lost / invest 数据丢了”
  • “/invest-backup”

Requirements

  • A Bash shell

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 no API keys, tokens, secrets or passwords.

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

Context cost

Invest Backup loads about 1.2k tokens when it runs. Until then it costs about 207 tokens; SKILL.md has 472 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~207
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

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:4
    r, job run history, market-data cache) + .env (SMTP/API credentials) + user_profile.json. All of this data is .gitignore
  • NoteMentions a .env fileSKILL.md:30
    ks `memory/`, `db/*.sqlite`, `db/*.db`, `.env`, `user_profile.json*` into a single UTC-timestamped zip. The data directo

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). 472 words, ~1,188 tokens.

Download SKILL.mdSave it as .claude/skills/invest-backup/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
invest-backup
description
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 credentials) + user_profile.json. All of this data is .gitignore'd with no historical versions in git, so a single accidental overwrite (e.g. slipping and running some one-off migration/init script) means real data loss — no git revert available. **Proactive trigger scenarios** — "backup invest data / 备份一下 openInvest 的数据", "my holdings/strategy look wiped / 我的持仓/策略好像被清空了", "invest data is lost / invest 数据丢了", "restore invest backup / 恢复一下 invest 的备份", before any reinstall/migration of the openInvest deployment on this machine, or right before running an unfamiliar migration/init script (back up first, then act).
version
0.2.1
platforms
linux, macos

Invest Backup Skill

Why this skill exists

openInvest's real data (holdings/strategy/user profile/committee records under memory/, trade ledger/job history under db/) is entirely .gitignored — deliberately (privacy: it contains real assets/salary/trades), but the price is that git can't help at all. There was an incident on 2026-07-08: a one-off migration script named migrate_profile.py (with no safety guard whatsoever) was run directly once, overwriting user.md / strategy.md / portfolio.md with hard-coded demo defaults; daily_report then exited early every day because target_assets had become empty, emails stopped entirely from that point on, and the user had no idea until they noticed the missing emails and traced it back.

In any of the following scenarios, proactively use this skill:

  • Before running any unfamiliar migration / init / bulk script that writes to memory/ or db/ → backup first
  • The user says holdings, strategy, or committee records look wrong / wiped → backup first (even if the current state is already broken, save the "broken state" — otherwise you lose even the diagnostic material), then investigate
  • Migrating to a new machine / reinstalling the deployment → backup to package, restore on the new machine

Usage

bash
plugin/skills/invest-backup/scripts/run.sh backup [output_dir]   # defaults to $INVEST_ROOT/.backups/
plugin/skills/invest-backup/scripts/run.sh restore <zip_path> [--force]
plugin/skills/invest-backup/scripts/run.sh list
  • backup: packs memory/, db/*.sqlite, db/*.db, .env, user_profile.json* into a single UTC-timestamped zip. The data directory is resolved via openinvest.paths.INVEST_ROOT (same precedence order as the rest of the backend: INVEST_HOME env → repo-marker detection → cwd) instead of re-guessing paths in shell.
  • restore: unpacks a zip back into the data directory. By default it refuses to overwrite a portfolio.md that already contains real holdings/cash (same criterion as the 2026-05-10 incident defense in lifecycle_cmds.py:_write_v2_portfolio: cash > 0 in any currency, or non-empty holdings, counts as real data) — to confirm the overwrite you must explicitly pass --force. With or without --force, the current state is automatically backed up before restoring, so the operation itself is reversible.
  • list: lists existing backups, newest first, with sizes.
Show full SKILL.md (175 more words)Show less

What is not included

  • The memory/.backtest* family of directories (historical backtest caches, tens of MB, regenerable with scripts like scripts/backtest_committee.py — not irreplaceable data) — this skill currently does not exclude them, because the size is still acceptable and backup semantically means "the entire data directory"; if memory/ ever grows too large to package comfortably, exclude them separately then.
  • db/*.sqlite-journal, *.db-shm, *.db-wal: SQLite runtime temp files — they are rebuilt automatically after a restore, and carrying them along could actually capture a half-committed state.
  • *.lock: fcntl file locks, cleared automatically on process restart, no need to keep.

Relationship to migrate_profile.py-class incidents

This skill only solves "can it be recovered once lost" — it does not solve "why did it get overwritten". If you see a script in this repo like migrate_profile.py that calls store.write(...) directly with no safety guard, follow the pattern of _write_v2_portfolio in src/openinvest/skill_cmds/lifecycle_cmds.py (check for existing real data before overwriting; on refusal require explicit force=True; auto-backup before overwriting) and retrofit the same guard — that is the real fix; this skill is only the last safety net.

© 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 2 other files (scripts) in plugin/skills/invest-backup of longsizhuo/openInvest.

  • SKILL.md
  • CHANGELOG.md
  • scripts/run.sh

Open the folder on GitHubat commit 220abd2

Compare with similar skills

Invest Backup 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 Backup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Invest Backup this skilllongsizhuo/openInvest108—~1.2kAutomated safety check: NotesMIT
Exchange ConnectivityJoelLewis/finance_skills206—~8.9kAutomated safety check: PassMIT
Repo Mirror Sourcesnetdata/netdata81k—~1.2kAutomated safety check: NotesGPL-3.0
CI Failure Triage and RepairChachamaru127/claude-code-harness3.2k1 repos~1.1kAutomated safety check: NotesMIT
Bfe Rd Workflowbfenetworks/bfe6.3k—~1.3kAutomated safety check: PassApache-2.0
Ssh Skillbadseal/ssh-skill538—~2.4kAutomated safety check: NotesNone

Similar skills

  • Exchange Connectivity

    JoelLewis/finance_skills

    Guide the design and management of trading venue connectivity and market data infrastructure.

    206 GitHub stars~8.9k tokensUpdated 2 mo ago
    DevOps & CloudAuto-check passed
  • Repo Mirror Sources

    netdata/netdata

    Inspect Netdata-org source checkouts under NETDATAREPOSDIR, or set up and synchronize that mirror when requested.

    81k GitHub stars~1.2k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • CI Failure Triage and Repair

    Chachamaru127/claude-code-harness

    Diagnoses failing CI pipelines and tests, deciding first whether the test or the implementation is at fault, and hands hard cases to a dedicated fixer subagent.

    3.2k GitHub starsUsed in 1 repo~1.1k tokens
    DevOps & CloudAuto-check: notes
  • Bfe Rd Workflow

    bfenetworks/bfe

    引导用户在 bfe 代码库中完成一次完整的功能研发流程,包括需求对齐、文档修改、代码实现、集成测试与回归验证. An agent skill from bfenetworks/bfe.

    6.3k GitHub stars~1.3k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Ssh Skill

    badseal/ssh-skill

    A skill your agent uses when a task requires SSH or SCP/SFTP behavior, a remote server, server alias/IP/hostname/user@host, bastion or jump-host access, remote command execution, upload/download…

    538 GitHub stars~2.4k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check: notes
  • GreptimeDB Release Runbook

    GreptimeTeam/greptimedb

    Runbook for publishing a GreptimeDB version: pick the release branch, verify the Cargo version, then tag, create the GitHub release and open the docs note PR.

    6.7k GitHub stars~1.4k tokensUpdated yesterday
    DevOps & CloudAuto-check passed

More from longsizhuo/openInvest

  • Invest Setup

    longsizhuo/openInvest

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

    108 GitHub stars~2.7k tokensUpdated today
    Auto-check: notes
  • 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

Works with

Questions about Invest Backup

What does Invest Backup do?

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…. Invest Backup is an agent skill from longsizhuo/openInvest.json.

When should I use Invest Backup?

Invest Backup fits situations like: scenarios — backup invest data / 备份一下 openInvest 的数据; my holdings/strategy look wiped / 我的持仓/策略好像被清空了; invest data is lost / invest 数据丢了; restore invest backup / 恢复一下 invest 的备份.

How do I install Invest Backup in Claude Code?

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

How do I install Invest Backup in Codex?

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

Can I use Invest Backup 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-backup -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-backup, .gemini/skills/invest-backup, .github/skills/invest-backup and .opencode/skills/invest-backup in your project.

What does Invest Backup need to run?

Going by SKILL.md and its folder, Invest Backup needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does Invest Backup 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 Backup 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 Backup use?

Invest Backup 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 Backup use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Invest Backup?

Skills that share tags, products or a category with Invest Backup: Exchange Connectivity (JoelLewis/finance_skills, 206 stars), Repo Mirror Sources (netdata/netdata, 81k stars), CI Failure Triage and Repair (Chachamaru127/claude-code-harness, 3.2k stars) and Bfe Rd Workflow (bfenetworks/bfe, 6.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Invest Backup?

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.