From lynch
Canonical loader — reads the portfolio/ folder and returns a validated PortfolioSnapshot. Called first by every other skill. Use when you need current holdings, IPS, targets, or tax rules for any workflow.
How this skill is triggered — by the user, by Claude, or both
Slash command
/lynch:portfolio-stateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Load + validate the full portfolio state and enrich with live quotes and FX.
Load + validate the full portfolio state and enrich with live quotes and FX.
Check staleness. Read portfolio/holdings.yaml. If as_of is older than 7 days, emit a warning:
"holdings.yaml is N days old — run
holdings-importbefore relying on this snapshot."
Load and validate by running the state loader:
python -c "
import json
from dataclasses import asdict
from utils.state import load_snapshot
s = load_snapshot('portfolio')
print(json.dumps({
'as_of': s.as_of, 'fx_usdinr': s.fx_usdinr,
'accounts': [asdict(a) for a in s.accounts],
'lots': [asdict(l) for l in s.lots],
'targets': s.targets, 'constraints': s.constraints,
'universes': s.universes,
}, default=str))
"
Fetch live quotes. For every unique symbol in lots, call mcp__market-data__quote. Batch where possible.
Fetch FX. Call mcp__market-data__fx_usdinr. If the returned rate differs from holdings.yaml.fx.USDINR by >1%, note the drift in the output.
For MF lots (instrument == equity_mf), fetch AMFI NAV:
curl -sSL https://www.amfiindia.com/spages/NAVAll.txt > /tmp/amfi-nav.txt
python -c "
import json
from utils.amfi_nav import parse_amfi_nav_file
print(json.dumps(parse_amfi_nav_file('/tmp/amfi-nav.txt')))
" > /tmp/amfi-nav.json
Lookup MF lots by ISIN (stored in symbol field for MF).
Compute derived fields:
market_value_native = qty × pricemarket_value_inr = native * FX (for USD) or native (for INR)current_weight = market_value_inr / totaldrift_vs_target per asset class per targets.yamlValidate invariants. Fail loudly if any lot has no entry_date, any symbol has no price, or any account referenced in a lot is not in accounts.yaml.
Return a PortfolioSnapshot JSON blob to the caller.
holdings.yaml, a tool call, or a rules file.npx claudepluginhub sarthak-patidar/magellan --plugin lynchProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.