gtt-audit
Skill0 starsChanged 5 months agoMITView on GitHub
Audit and maintain GTT orders on Zerodha. Use when the user says "audit GTTs", "check my GTTs", "GTT review", "are my positions protected", or after any corporate action, dividend, or session open reveals GTT gaps. Finds orphans, silent cancellations, unprotected holdings, and stale triggers; drafts corrections but never executes without explicit confirmation.
In this repository9 other files it gives its agents.
- crash-protocolSkill
- daily-briefingSkill
- eod-snapshotSkill
- get-startedSkill
- import-statementsSkill
- macro-briefSkill
- mf-reviewSkill
- risk-checkSkill
- session-openSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Ensure every material position has correct, active GTT protection and no orphan orders exist.
- Distinctive: line 16
Check for, in priority order:
- Distinctive: line 22
Stale triggers: stop-losses far below current price on winners (candidate for trailing up), or triggers already breached/unreachable.
- Distinctive: line 41
Never batch-execute on a blanket "yes" — confirm deletions and placements as distinct groups at minimum.
- Very specific: line 43
After execution, re-pull kite:get_gtts and confirm the final state matches intent.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GTT Audit
Ensure every material position has correct, active GTT protection and no orphan orders exist.
Step 1 — Pull current state
Call kite:get_gtts and kite:get_holdings in parallel. get_gtts payloads can exceed 50K characters: immediately reduce to {symbol, type, trigger(s), qty, status, cancellation reason} and work only from the reduced table — never re-print the raw blob. If truncated, or for portfolios with 30+ GTTs, save the raw response to a temp file immediately and parse it programmatically (Python) instead of processing it in-context — then work from the parsed table. Get LTPs for held stocks via kite:get_ltp (batch carefully; avoid quote/ohlc tools for 5+ instruments).
Step 2 — Classify every GTT and holding
Check for, in priority order:
- Silent cancellations: GTTs cancelled by corporate actions (dividends, splits). The cancellation reason is returned in the GTT object itself. These leave positions unprotected — flag first.
- Unprotected holdings: positions above ₹50K market value with no active stop-loss GTT.
- Orphan GTTs: GTTs on stocks no longer held. Recommend deletion.
- Duplicates: more than one active GTT per stock per strategy. Recommend consolidation to a single two-leg (OCO) GTT.
- Stale triggers: stop-losses far below current price on winners (candidate for trailing up), or triggers already breached/unreachable.
- Quantity mismatches: GTT quantity ≠ current holding quantity (partial exits, bonus shares).
Step 3 — Report
Output one table: Stock | Current GTT | LTP | Suggested Action | Reason. Include rows with "OK — no change" only in a count, not the table.
For each suggested new or modified GTT, prefer two-leg (SL + target) structures and state exact trigger prices, quantities, and order type.
Auto-created bracket GTTs (critical correctness rule)
Kite buy orders can auto-place an OCO bracket GTT at execution time (visible as gttp in the order's meta, e.g., a -8%/+15% pair). Consequence: a symbol traded today may ALREADY have a fresh GTT you don't know about. Therefore, before modifying or creating any GTT for a symbol that had an order today, re-fetch get_gtts and check for MULTIPLE GTTs on that symbol. Never assume one GTT per symbol. If two GTTs jointly cover more shares than held (double coverage), flag it — whichever triggers first would cause a rejected or partial order — and propose consolidation.
Execution rule (mandatory)
Claude may place, modify, or delete GTTs via Kite MCP, but MUST:
- Show the exact order details (instrument, trigger price(s), quantity, transaction type, product).
- Receive explicit user confirmation for each placement, modification, or deletion.
- Never batch-execute on a blanket "yes" — confirm deletions and placements as distinct groups at minimum.
After execution, re-pull kite:get_gtts and confirm the final state matches intent.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

