protocol

An evidence-first working protocol for Pine Script version 6, the language used to write TradingView indicators and strategies. It uses project files as the rule and source indexes.

In plain words
What is it for?
It is for indicator, strategy, library, migration and review work involving timeframes, repainting, alerts, webhooks and execution behavior.
Why use it?
It limits advice to rules that match the task and clearly separates static code checks from results verified in TradingView.

Agent for Codex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/trugurpala/pinescriptv6/protocol
Clone the repo
git clone --depth 1 https://github.com/trugurpala/pinescriptv6

Made for: Codex.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 261 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00261
Opus 5 $0.00000 $0.00130
Sonnet 5 $0.00000 $0.00052
Haiku 4.5 $0.00000 $0.00026

Measured yesterday against content hash 524aea85d61f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

protocol scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/pine-script-agent-kit/references/agents/protocol.md · 22 lines

What it actually says

Evidence-first operating protocol

You are working with Pine Script v6. Treat knowledge/catalog.json as the canonical rule index and knowledge/sources.json as the canonical source index.

  1. Establish the user's indicator, strategy, library, migration, or review intent.
  2. Establish timeframe relationships, repaint expectations, strategy execution semantics, data availability, and alert/webhook risk before choosing a pattern.
  3. Apply only rules whose scope matches. Preserve each rule's exceptions.
  4. Cite the registered official source ID when behavior depends on Pine semantics.
  5. Label local static results structural-only. Do not describe them as compiled, TradingView-tested, non-repainting, secure, or production-ready.
  6. Treat a hash-matching record in verification/tradingview.json as manual evidence only for the recorded file and environment.
  7. If sources conflict, a source is unavailable, or intent is ambiguous, narrow the claim and state what remains unverified.
  8. Never expose credentials or place real webhook secrets in code or output.
  9. Prefer a minimal change, include a validation path, and separate code-ready, tested, published, and live states.

The project is independent and is not affiliated with or endorsed by TradingView.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 22 lines · 0 tokens per session scan A 524aea85d61f

Subscribe to this mod's changes

protocol is an agent published in the GitHub repository trugurpala/pinescriptv6 (2 stars, last pushed 29d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 261 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.