/india-trading-skills:portfolio-reviewfrom india-trading-skills
Health check for an Indian delivery (CNC) stock portfolio from a holdings CSV or broker export: P&L, sector weights, concentration, group exposure, mcap mix, pledged/SME/surveillance flags, STCG→LTCG countdown, beta vs NIFTY, drawdown, correlated clusters, stop heat, and tax-aware rebalance plans.
Ships in india-trading-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Look at the whole book before the next trade. This skill reports facts and flags (INFO / WARN / REVIEW). It never says "sell": every flag is a prompt for the user to re-check a thesis.
python3 scripts/portfolio.py review holdings.csv --cash 200000 # weights, flags, tax clock
python3 scripts/portfolio.py review console.xlsx --sheet Equity --max-stock 8 --mcap-target 50/30/20
python3 scripts/portfolio.py risk holdings.csv --prices-dir prices/ --benchmark NIFTY # or --yf
python3 scripts/portfolio.py rebalance holdings.csv --cash 50000 # equal weight
python3 scripts/portfolio.py rebalance holdings.csv --targets targets.csv --broker groww --realized-ltcg 40000
python3 scripts/portfolio.py rebalance holdings.csv --cash 75000 --no-sell # deploy new money only
Every command takes --as-of YYYY-MM-DD and --json. --prices-dir holds daily candles named
SYMBOL.csv or SYMBOL.json (any format ../technical-analysis/scripts/ta.py reads) plus NIFTY.csv.
Targets file: symbol,weight[,price] or sector,weight, in percent. Weight 0 means exit; symbols
or sectors left out stay unchanged. A price column lets you add a stock you do not hold yet.
Required: symbol, qty, buy_price (average cost), ltp. Strongly recommended: buy_date, with one
row per lot, as in ../indian-tax-for-traders/scripts/tax.py harvest files. Optional: sector,
mcap (large/mid/small, or a number in ₹ crore), group, stop, pledged_qty, series (EQ/BE/SM...),
sme, illiquid, surveillance (ASM/GSM text), promoter_pledge (%), isin, exchange, fmv_2018.
Broker headers are mapped automatically, and preamble rows above the header are skipped:
| Source | Headers recognised | Status |
|---|---|---|
Kite Connect / Kite MCP get_holdings | tradingsymbol, quantity + t1_quantity, average_price, last_price, collateral_quantity, isin, exchange | Checked against the Kite Connect v3 docs |
| Zerodha Console holdings (XLSX) | Symbol, ISIN, Sector, Quantity Available, Quantity Long Term, Quantity Pledged (Margin/Loan), Average Price, Previous Closing Price | Assumed. Compare with your file |
| Kite web holdings CSV | Instrument, Qty., Avg. cost, LTP, Cur. val | Assumed |
| Groww holdings statement (Reports) | Stock Name, ISIN, Quantity, Average buy price, Buy value, Closing price/value | Assumed. Gives company names, so add a symbol column before running risk --yf |
Broker MCPs (broker-integration): call the holdings tool and write a CSV with one row per holding
using the fields above. Keep the raw field names; the mapper understands them. Broker exports carry
no buy dates. Console's "Quantity Long Term" is still used, but for a lot-level countdown, rebuild
open lots with tax.py tradebook and add buy_date. Keep holdings files local. Do not commit them.
| Setting | Default | Reason |
|---|---|---|
--max-stock | 10% of capital | One bad result or fraud should not sink the book. REVIEW above 2× |
--max-sector | 25% | Sectors move together on policy, commodity and rate news |
--max-group | 20% | Group companies share promoters, lenders and governance risk |
--mcap-target | 60/25/15 | A core-heavy mix for a retail investor. Change it to match your plan |
--mcap-cutoffs | ₹1,00,000 cr / ₹33,000 cr | Rough stand-ins for AMFI's rank-based list (top 100 / 101–250). Update every half-year |
--loser-pct | 20% below cost | A decline that big needs a thesis check |
--max-heat | 6% of capital | The total loss if every stop is hit together |
--band / --min-trade | 1 pp / ₹1,000 | Avoids churn where DP charges (~₹15 per scrip per sell day) and STT eat the benefit |
Holdings without a sector use a built-in map of about 55 NIFTY 50 names, marked *, which are also
treated as large caps. Anything else shows as Unknown, so add the column.
pledged_qty is shares you pledged for F&O margin. A fall shrinks
collateral and can trigger forced square-offs. promoter_pledge above 20% is a governance red flag;
see fundamental-screening.group column; a small built-in map covers
common NIFTY names.risk, such as private banks, PSU banks or IT exporters, are where
diversification is weaker than the stock count suggests.rebalance sells oldest lots first (FIFO, as for demat shares) and takes the holding-period rules,
grandfathering and rates from indian-tax-for-traders (tax.py). Charges come from trading-costs
(../trading-costs/scripts/charges.py). For each sale it flags:
--wait-days (default 60). Selling now is
taxed at 20%; waiting brings it to 12.5%, or nil inside the ₹1.25 lakh exemption. Weigh the tax saved
against the price risk.--realized-ltcg so the remaining exemption is right.Prefer --no-sell (new SIP or bonus money into underweights) when selling would realise STCG.
For harvesting ideas, run tax.py harvest on the same file; review already lists them.
market-regime sets how much equity exposure makes sense. portfolio-review checks what you hold.
In a risk-off regime, look at heat and beta first.sector-rotation says which sectors lead. Feed its view into a sector,weight targets file.position-sizing and stop-loss-strategies supply the stop column that makes heat meaningful.trading-discipline runs the pre-trade gate. Treat heat above the limit, or a WARN on the stock or
sector you are adding to, as a reason to stop at that gate.Portfolio review as of 2026-11-01 (6 stocks, 7 lots)
Holdings ₹8,00,000 | Cash ₹2,00,000 (20.0%) | Total ₹10,00,000 (₹10.00 L)
Invested ₹7,10,000 | Unrealised P&L ₹90,000 (+12.68%) | Top-5 76.0%
Sectors (limit 25%): Information Technology 55.0%, Energy 10.5%, ...
Tax clock: 1 lot turns long-term within 30 days, 1 in 31–60 days
REVIEW AAA is 30.0% of capital (single-stock limit 10%).
Lead with the two or three flags that matter most, then the numbers. Say which inputs were missing
(sector, buy dates, prices). Never turn a flag into an order. Orders follow the broker-integration
confirmation protocol.
Educational analysis, not investment or tax advice. Data: [holdings file + as-of date].
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub xdhruv/claude-trading-skills-india-mv --plugin india-trading-skills36 skills in this plugin
/backtest-labBacktests rule-based swing ideas on NSE/BSE daily bars with Indian frictions built in: decide on
the close and fill at the next open, gap-through stops, slippage, exact per-trade charges by
segment and broker (STT, stamp duty, GST, DP), whole shares or lots, circuit-band no-fills,
futures-only shorts and an optional STCG/LTCG estimate. Six built-in strategies; CAGR vs
buy-and-hold, drawdown, Sharpe/Sortino, profit factor, expectancy in ₹ and R; parameter sweeps
with a plateau-or-spike read, walk-forward and Monte Carlo. backtest.py, stdlib only, offline.
Use when the user asks: "backtest this strategy", "would a 20/50 crossover have worked on X",
"is this edge real or curve-fit", "optimise my parameters", "walk-forward test", "Monte Carlo my
trades", "what drawdown should I expect", "do charges kill this idea", "does a NIFTY 200-DMA
filter help", or before putting real money behind any mechanical rule.
/breakout-plannerStage-2 breakout setups on NSE/BSE stocks: a trend-template check (rising 200 DMA, 50>150>200
stack, distance from 52-week high/low, relative strength vs NIFTY), base detection (volatility
contraction with successively tighter pullbacks, or a flat base) with pivot, depth, duration,
volume dry-up and a grade, then an order-ready plan: trigger, chase limit, capped stop, size,
Indian charges, R targets, GTT/SL templates, circuit-band and NSE tick-size checks. breakout.py
scans a folder of CSVs or yfinance symbols and ranks them, offline-capable.
Use when the user asks: "is X in a Stage 2 uptrend", "find VCP setups", "where is the pivot on X",
"plan a breakout trade in X", "breakout buy point and stop", "scan these stocks for breakouts",
"Minervini trend template for NSE stocks", "how do I place a GTT for a breakout", or any question
about buying stocks as they clear a base.
2 plugins ship this exact skill · first indexed Nov 1, 2026
Other plugins' skills for the same job