From lynch
Ingest CSV drops from Kite / Coin / IndMoney under imports/YYYY-MM-DD/, rebuild lots via FIFO, update portfolio/holdings.yaml. Use when the user has dropped new broker exports.
How this skill is triggered — by the user, by Claude, or both
Slash command
/lynch:holdings-importThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
User has dropped CSVs into `imports/YYYY-MM-DD/`:
User has dropped CSVs into imports/YYYY-MM-DD/:
kite-tradebook.csv (required for lot entry dates)kite-holdings.csv (optional, for reconciliation)coin-holdings.csv (optional — current Coin MF balance)indmoney-trades.csv (required)indmoney-holdings.csv (optional)If any REQUIRED file is missing, abort and tell the user what's needed.
ls -1d imports/*/ | sort -r | head -1
(account, symbol) — do not pool trades across accounts. Invoke:python - <<'PY'
import yaml
from datetime import date
from utils.csv_parsers import parse_kite_tradebook, parse_indmoney_trades
from utils.fifo import build_lots
# Each account gets its own trade stream + enrichment metadata.
per_account = [
{"id": "kite-eq", "market": "IN", "instrument": "equity", "currency": "INR",
"trades": parse_kite_tradebook("imports/LATEST/kite-tradebook.csv")},
{"id": "indmoney-us", "market": "US", "instrument": "equity", "currency": "USD",
"trades": parse_indmoney_trades("imports/LATEST/indmoney-trades.csv")},
]
all_lots = []
for acc in per_account:
lots = build_lots(acc["trades"])
for l in lots:
lot = {
"account": acc["id"],
"symbol": l.symbol,
"market": acc["market"],
"instrument": acc["instrument"],
"qty": l.qty,
"entry_date": l.entry_date.isoformat(),
}
if acc["currency"] == "INR":
lot["avg_cost_inr"] = l.cost_basis / l.qty
lot["cost_basis_inr"] = l.cost_basis
else:
lot["avg_cost_usd"] = l.cost_basis / l.qty
lot["cost_basis_usd"] = l.cost_basis
all_lots.append(lot)
doc = {
"as_of": str(date.today()),
"fx": {"USDINR": 0.0}, # filled by portfolio-state at read time
"lots": all_lots,
}
print(yaml.safe_dump(doc, sort_keys=False))
PY
Replace LATEST with the actual folder.
USD→INR cost basis enrichment. For each US-currency lot in the output, fetch the USDINR rate on the lot's entry_date via mcp__market-data__history (or a fallback spot if historical is unavailable) and populate avg_cost_inr and cost_basis_inr alongside the USD fields. Indian tax computations require INR basis.
Reconcile the computed open-lot totals against kite-holdings.csv (current qty per symbol). Emit a diff report. If a symbol in kite-holdings.csv has no derived lot OR quantities disagree by >0.5%, flag loudly.
Write the assembled doc to portfolio/holdings.yaml.
Emit a diff vs the prior holdings.yaml (if any): new lots, closed lots, quantity changes.
If portfolio/accounts.yaml sets source: mcp for any Kite-based account AND the Kite MCP is reachable (mcp__kite__* tools present), skip CSV parsing for that account and call the MCP's holdings endpoint instead. Resolve trades/lots from the MCP's position + transaction endpoints. Output contract is identical.
holdings.yaml if any required input is missing.holdings.yaml if reconciliation fails — write to holdings.yaml.proposed and ask the user to review.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.