← 返回 Skills 市场
ckchzh

Investment Portfolio

作者 BytesAgain2 · GitHub ↗ · v4.0.0 · MIT-0
cross-platform ✓ 安全检测通过
1369
总下载
0
收藏
6
当前安装
20
版本数
在 OpenClaw 中安装
/install investment-portfolio
功能描述
Track investments with buy/sell records, allocation charts, and P/L analysis. Use when managing a stock or crypto portfolio, rebalancing, or comparing assets.
使用说明 (SKILL.md)

investment-portfolio

Investment portfolio tracker — record holdings with buy prices, track performance and P/L, view allocation charts, analyze risk, calculate DCA, manage dividends, rebalance to targets, compare assets, and view sector breakdown. All data stored locally in JSONL format.

Commands

add

Add a holding — specify ticker, number of shares, and purchase price.

scripts/script.sh add AAPL 10 175.50
scripts/script.sh add BTC 0.5 42000

remove

Remove a holding by ticker symbol.

scripts/script.sh remove TSLA

update

Update the current market price of a holding.

scripts/script.sh update AAPL 195.00

list

Show all holdings with shares, buy price, and current price.

scripts/script.sh list

summary

Portfolio summary — total value, total cost, overall P/L.

scripts/script.sh summary

allocation

ASCII bar chart showing portfolio allocation by ticker as percentage.

scripts/script.sh allocation

performance

Detailed gain/loss analysis per holding with percentage returns.

scripts/script.sh performance

risk

Risk metrics — standard deviation of returns and diversification score.

scripts/script.sh risk

rebalance

Generate buy/sell suggestions to match target allocation percentages.

scripts/script.sh rebalance '{"AAPL":40,"GOOGL":30,"BTC":30}'

dca

Dollar-cost averaging calculator — monthly investment table over 12 months.

scripts/script.sh dca AAPL 500

dividend

Calculate dividend yield from annual dividend and current price.

scripts/script.sh dividend AAPL 3.76 195.00

compare

Compare two holdings side by side — shares, prices, and P/L.

scripts/script.sh compare AAPL GOOGL

sectors

Sector breakdown with allocation chart. Uses built-in ticker-to-sector mapping.

scripts/script.sh sectors

export

Export portfolio data as CSV.

scripts/script.sh export csv

history

Show transaction history from the log file.

scripts/script.sh history

help

scripts/script.sh help

version

scripts/script.sh version

Examples

# Build a portfolio
scripts/script.sh add AAPL 10 175
scripts/script.sh add GOOGL 5 140
scripts/script.sh add BTC 0.1 42000
scripts/script.sh update AAPL 195

# Analyze
scripts/script.sh summary
scripts/script.sh allocation
scripts/script.sh performance
scripts/script.sh risk

# Rebalance
scripts/script.sh rebalance '{"AAPL":50,"GOOGL":30,"BTC":20}'
scripts/script.sh compare AAPL GOOGL
scripts/script.sh sectors

Configuration

Variable Required Description
PORTFOLIO_DIR No Data directory (default: ~/.local/share/investment-portfolio/)

Data Storage

All data saved in ~/.local/share/investment-portfolio/:

  • holdings.jsonl — Portfolio holdings (one JSON object per line)
  • history.log — Transaction log

Requirements

  • bash 4.0+
  • python3 (for JSONL processing and calculations)

All prices are manually entered — no external API calls.


Powered by BytesAgain | bytesagain.com | [email protected]

安全使用建议
This skill appears to do what it claims: a local portfolio tracker implemented as a bash script that runs python snippets. Before installing or running: (1) review the full scripts/script.sh yourself (you already have it) to confirm there are no hidden network calls in the truncated portion; (2) note that data is stored unencrypted in your home directory (script defaults to ~/.investment-portfolio unless you set PORTFOLIO_DIR), so do not store sensitive credentials or private data there; (3) if you prefer the SKILL.md path (~/.local/share/...) update PORTFOLIO_DIR or the docs to avoid confusion; (4) ensure you are comfortable executing a shell script that writes files — consider running it in a limited account or container if you want extra isolation.
功能分析
Type: OpenClaw Skill Name: investment-portfolio Version: 4.0.0 The investment-portfolio skill is a local tool for tracking financial holdings, calculating performance metrics, and generating rebalancing suggestions. The logic is implemented in a bash script (scripts/script.sh) that uses Python heredocs for data processing, storing all information locally in a JSONL file within the user's home directory. There are no network requests, no attempts to access sensitive system files (like SSH keys or environment variables), and no evidence of malicious intent or prompt injection in the documentation (SKILL.md).
能力评估
Purpose & Capability
Name/description align with the included scripts: add/remove/update/list/analysis features are implemented in scripts/script.sh. The declared runtime requirements (bash, python3) are appropriate. Minor mismatch: SKILL.md documents a default data directory of ~/.local/share/investment-portfolio/ while the script defaults to $HOME/.investment-portfolio (PORTFOLIO_DIR override is supported). This is likely a documentation/config inconsistency rather than malicious.
Instruction Scope
SKILL.md and the script operate entirely on local files (holdings.jsonl, history.log) and prompt the user to input prices manually; the script invokes embedded python snippets but they only read/write the DB file and history. No external API/network calls are present in the visible code. The script will create and write files in the user's home directory (un-encrypted JSONL and logs), which is expected for this tool but worth noting for privacy.
Install Mechanism
There is no install spec; this is an instruction-only skill with an included bash script. That is low-risk compared to arbitrary network downloads or package installs.
Credentials
The skill requests no credentials and only an optional PORTFOLIO_DIR environment variable to override the data directory. It uses HOME to locate the default directory. No unrelated secrets or config paths are requested.
Persistence & Privilege
always is false and the skill does not modify other skills or system-wide agent settings. It writes files to its own data directory under the user's home, which is normal for this kind of utility.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install investment-portfolio
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /investment-portfolio 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v4.0.0
v4.0.0: Complete rewrite — clean heredocs, all 16 commands with real calculations.
v3.0.1
v3.0.1: SKILL.md aligned with new rebalance/compare/sectors commands.
v3.0.0
v3.0.0: Implemented rebalance, compare, sectors commands with real calculations.
v2.4.2
v2.4.2: SKILL.md accurately describes offline portfolio tracker with placeholder commands noted.
v2.4.1
v2.4.1: SKILL.md from script help output
v2.4.0
v2.4.0: SKILL.md rewritten to match script.sh commands exactly.
v2.3.8
update
v2.3.7
Fix VT: remove old skeleton scripts, align SKILL.md
v2.3.6
SKILL.md aligned with script.sh for moderation fix
v2.3.5
v2.5 standard: Use-when desc, homepage, source, security fix
v2.3.4
yaml-fix+quality
v2.3.3
yaml-fix+quality
v2.3.2
Quality upgrade
v2.3.1
Standards compliance: unique content, no template text
v2.3.0
Quality fixes: removed third-party references, aligned docs with implementation
v2.2.0
Enhanced descriptions for better AI triggering
v1.0.2
Runtime fix
v2.0.0
Rewritten: full functional tool replacing prompt shell
v1.0.1
- Removed the "tips.md" file. - No changes to core functionality or documentation.
v1.0.0
Initial release of Investment Portfolio skill: - Provides portfolio analysis features: asset allocation, risk assessment, rebalancing, return analysis, diversification, and backtesting. - Includes six core commands: allocate, risk, rebalance, return, diversify, and backtest. - Supports both English and Chinese descriptions and workflows.
元数据
Slug investment-portfolio
版本 4.0.0
许可证 MIT-0
累计安装 6
当前安装数 6
历史版本数 20
常见问题

Investment Portfolio 是什么?

Track investments with buy/sell records, allocation charts, and P/L analysis. Use when managing a stock or crypto portfolio, rebalancing, or comparing assets. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1369 次。

如何安装 Investment Portfolio?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install investment-portfolio」即可一键安装,无需额外配置。

Investment Portfolio 是免费的吗?

是的,Investment Portfolio 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Investment Portfolio 支持哪些平台?

Investment Portfolio 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Investment Portfolio?

由 BytesAgain2(@ckchzh)开发并维护,当前版本 v4.0.0。

💬 留言讨论