Logo Portfolio Review

Portfolio Review

Cộng đồng
Shubhamkumartrichy
portfolio-review

Health check for an Indian delivery (CNC) stock portfolio from a holdings CSV or a Zerodha Console, Kite, Groww or broker-MCP export: value and unrealised P&L, position and sector weights, top-5/top-10 concentration, business-group exposure (Adani, Tata...), large/mid/small mix against a target, pledged, SME and surveillance flags, a per-lot STCG→LTCG countdown, volatility, beta vs NIFTY, drawdown, correlated clusters, portfolio heat to stops, and a tax-aware rebalance plan with charges. Use when the user asks: "review my portfolio", "am I too concentrated", "sector allocation of my holdings", "how risky is my portfolio / what is my beta", "how much am I risking to my stops", "rebalance to equal weight", "what should I trim", "which holdings turn long-term soon", or uploads a holdings file from their broker.

Add to TypingMind

Tổng quan

Nhà phát hànhShubhamkumartrichy
Kho mãclaude-trading-skills-india
Tên kỹ năngportfolio-review
Sao
57
Bản fork
11
Tệp đi kèm
1
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được Shubhamkumartrichy công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Portfolio Review trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Shubhamkumartrichy/claude-trading-skills-india/tree/main/skills/portfolio-review
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Shubhamkumartrichy/claude-trading-skills-india.git /tmp/claude-trading-skills-india
mkdir -p .claude/skills
cp -r /tmp/claude-trading-skills-india/skills/portfolio-review .claude/skills/portfolio-review
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Portfolio Review trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Portfolio Review ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Portfolio Review với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Portfolio Review (India)

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.

Commands

bash
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.

Input columns

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:

SourceHeaders recognisedStatus
Kite Connect / Kite MCP get_holdingstradingsymbol, quantity + t1_quantity, average_price, last_price, collateral_quantity, isin, exchangeChecked 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 PriceAssumed. Compare with your file
Kite web holdings CSVInstrument, Qty., Avg. cost, LTP, Cur. valAssumed
Groww holdings statement (Reports)Stock Name, ISIN, Quantity, Average buy price, Buy value, Closing price/valueAssumed. 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.

Defaults and why

SettingDefaultReason
--max-stock10% of capitalOne bad result or fraud should not sink the book. REVIEW above 2×
--max-sector25%Sectors move together on policy, commodity and rate news
--max-group20%Group companies share promoters, lenders and governance risk
--mcap-target60/25/15A core-heavy mix for a retail investor. Change it to match your plan
--mcap-cutoffs₹1,00,000 cr / ₹33,000 crRough stand-ins for AMFI's rank-based list (top 100 / 101–250). Update every half-year
--loser-pct20% below costA decline that big needs a thesis check
--max-heat6% of capitalThe total loss if every stop is hit together
--band / --min-trade1 pp / ₹1,000Avoids 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.

Reading the results in an Indian context

  • Your pledge vs promoter pledge. 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.
  • ASM/GSM/ESM and BE/BZ series. These bring higher margins, trade-for-trade settlement and tight price bands. Exits get slow just when you need them.
  • SME stocks (NSE Emerge, BSE SME; series SM/ST) trade in large lots with thin books. Size them as illiquid, whatever their weight.
  • Group concentration. Three Adani or Tata companies at 8% each fit under the single-stock limit but form one 24% bet on a single promoter group. Add a group column; a small built-in map covers common NIFTY names.
  • Correlated clusters from risk, such as private banks, PSU banks or IT exporters, are where diversification is weaker than the stock count suggests.
  • Beta above about 1.2 means a 10% NIFTY fall is likely to cost more than 10%. With cash, the "incl. cash" beta is the one that matters.

Tax-aware rebalancing

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? A profitable short-term lot turns long-term within --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.
  • LTCG inside the exemption. Pass --realized-ltcg so the remaining exemption is right.
  • Booked losses. Short-term losses offset STCG or LTCG; long-term losses offset only LTCG.

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.

How it fits with other skills

  • 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.

Output

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].

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Portfolio Review làm được gì?

Health check for an Indian delivery (CNC) stock portfolio from a holdings CSV or a Zerodha Console, Kite, Groww or broker-MCP export: value and unrealised P&L, position and sector weights, top-5/top-10 concentration, business-group exposure (Adani, Tata...), large/mid/small mix against a target, pledged, SME and surveillance flags, a per-lot STCG→LTCG countdown, volatility, beta vs NIFTY, drawdown, correlated clusters, portfolio heat to stops, and a tax-aware rebalance plan with charges. Use when the user asks: "review my portfolio", "am I too concentrated", "sector allocation of my holding...

Vì sao nên dùng Portfolio Review trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Portfolio Review là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Portfolio Review trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Shubhamkumartrichy/claude-trading-skills-india/tree/main/skills/portfolio-review. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Portfolio Review?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Portfolio Review với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Portfolio Review với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Portfolio Review có miễn phí không?

Có. Kỹ năng này được Shubhamkumartrichy phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇