Skip to content

Pine Script debugging toolkit for TradingView covering v6 pitfalls, value inspectors, and UDT state tracing.

CCM score
54 of 100
skills.sh installs
519
GitHub stars
249
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers v6 pitfalls such as the March 2025 for loop boundary change, line continuation errors, and bid/ask returning na outside 1T
  • Includes label, table, loop, repainting, NA, and request.security() debuggers, plus a conditional-input check using input.bool with active=
  • Provides UDT debugging methods that print each field of a user-defined type into a label, with an array inspector table for collections
  • Designed for Pine Script authors whose scripts show errors or unexpected behavior in TradingView

Install

$ npx -y skills add traderspost/pinescript-agents --skill pine-debugger -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Pine Script Debugger

Specialized in adding debugging tools and troubleshooting Pine Script code in TradingView's often opaque environment.

⚠️ Pine Script v6 2025 Common Pitfalls

CRITICAL: March 2025 Breaking Change - For Loop Boundaries

for loops now re-evaluate boundaries every iteration.

PREFERRED FIX: Use for...in loops:

// ✅ BEST: Use for...in for arrays (safe and clean)
for element in myArray
    // Process element - safe even if array is modified

// ✅ BEST: Use for...in with index when needed
for [index, element] in myArray
    // Have both index and value

// ✅ for...in works with matrices too
for row in myMatrix
    // row is an array of the current row's values

// ✅ for...in works with maps (key-value pairs)
for [key, value] in myMap
    // Iterate in insertion order

FALLBACK: Cache boundary if traditional for is required:

// ❌ BUG: Infinite loop or unexpected behavior
var arr = array.new<int>()
for i = 0 to array.size(arr)  // Re-evaluated each iteration!
    array.push(arr, i)        // Array grows, loop never ends

Details

Repository
github.com/traderspost/pinescript-agents
Categories
Debugging, Finance & Trading
First seen
Jun 3, 2026

Questions

What does the pine-debugger skill do?

pine-debugger troubleshoots Pine Script issues on TradingView and adds debugging tools to scripts. It covers common v6 pitfalls such as for loop boundaries, line continuation errors and bid/ask variables returning na, and it provides label, table and repainting debug helpers.

How do I install the pine-debugger skill?

Run npx -y skills add traderspost/pinescript-agents --skill pine-debugger -y in a project. The skill then lets the agent read, edit, grep and search your Pine Script files to find and fix errors or unexpected behavior.

Which tools does pine-debugger use?

The pine-debugger skill is allowed to use Read, Edit, Grep and Glob. It needs no accounts or keys in its own instructions, and it works on the Pine Script code in your project.

When should I use pine-debugger instead of other debugging skills?

Use pine-debugger when a Pine Script has errors or behaves unexpectedly. It is built for TradingView's Pine Script environment, while other skills in the Debugging category cover general bugs, messaging or error tracking.

More from traderspost/pinescript-agents

All 6

Similar to Pine Debugger

More Debugging