Communitygithub.com

deltamaster/hansen-openclaw-config

Manage Hansen's investment portfolio stored in a local SQLite database. Use when: (1) user shares a new portfolio screenshot to update holdings, (2) user asks to see current positions or historical snapshots, (3) user wants to record a new position, (4) user asks for portfolio summary or performance analysis. Common tasks: update holdings from screenshot, take portfolio snapshot, show history, query by bank/issuer/risk level.

Was ist hansen-openclaw-config?

hansen-openclaw-config is a Claude Code agent skill that manage Hansen's investment portfolio stored in a local SQLite database. Use when: (1) user shares a new portfolio screenshot to update holdings, (2) user asks to see current positions or historical snapshots, (3) user wants to record a new position, (4) user asks for portfolio summary or performance analysis. Common tasks: update holdings from screenshot, take portfolio snapshot, show history, query by bank/issuer/risk level.

Funktioniert mit~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/deltamaster/hansen-openclaw-config/tree/HEAD/skills/portfolio

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Portfolio Skill

Hansen stores investment holdings in ~/.openclaw/workspace/data/portfolio.db (SQLite).

Quick Commands

# View summary
python3 ~/.openclaw/workspace/skills/portfolio/scripts/portfolio.py summary

# Take a snapshot (records today's values)
python3 ~/.openclaw/workspace/skills/portfolio/scripts/portfolio.py snapshot

# View historical snapshots
python3 ~/.openclaw/workspace/skills/portfolio/scripts/portfolio.py history

# Show full table (all 28 fields)
python3 ~/.openclaw/workspace/skills/portfolio/scripts/portfolio.py full

# Show all snapshots
python3 ~/.openclaw/workspace/skills/portfolio/scripts/portfolio.py history

Workflow: Update from Screenshot

  1. User sends portfolio screenshot → use image tool to extract all positions
  2. For each position, determine if it already exists (match by name or name_en)
    • Existing: UPDATE with new values (current_value, unrealized_pnl, unrealized_pct, cash_dividend, total_return, total_return_pct)
    • New: INSERT full row
  3. After DB update, run portfolio.py snapshot to record today's snapshot
  4. Confirm update to user with summary

Workflow: Add New Position

python3 portfolio.py add "基金名称" "英文名" "ticker" "fund" "发行机构" "银行" 风险等级 "CNY" 份额 买入净值 当前净值 买入金额 当前市值 未实现额 未实现% 股息 总回报 总回报% [票息] [knockin] [autocall] [strike] [maturity] [买入日期] "备注"

Schema (28 fields)

FieldTypeNotes
idINTEGERPK
nameTEXTChinese name (required)
name_enTEXTEnglish name
tickerTEXTFund code / ticker
asset_typeTEXTfund / stock / structured_deposit / bond / etf
issuerTEXTFund house / issuer
bankTEXTPurchase channel (required)
risk_levelINTEGER1-5 risk scale
currencyTEXTCNY / HKD / USD
quantityREALShares / units
purchase_navREALPurchase NAV
current_navREALCurrent NAV
purchase_amountREALTotal purchase cost
current_valueREALCurrent market value (required)
unrealized_pnlREALUnrealized P&L
unrealized_pctREALUnrealized return %
cash_dividendREALCash dividends received
total_returnREALTotal return (P&L + dividend)
total_return_pctREALTotal return %
coupon_rateREALFor structured deposits
knockin_levelREALFor structured deposits
autocall_levelREALFor structured deposits
strike_levelREALFor structured deposits
maturityTEXTMaturity date
purchase_dateTEXTPurchase date
notesTEXTFree text notes
created_atTEXTAuto
updated_atTEXTAuto

Also: snapshots table tracks historical portfolio values.

Tips

  • When updating, always match by name — don't create duplicates
  • snapshot appends to snapshots table with today's date automatically
  • NULL fields (ticker, purchase_*, maturity, coupon fields) can be updated later if user provides them

Verwandte Skills