pine-debugger
Skill0 starsChanged 41 days agoMITView on GitHub
Diagnoses and surgically fixes Pine Script compiler errors, runtime crashes, logical bugs, repainting issues, and unexpected trade behavior. Use when code fails to compile, produces warnings, hangs, or behaves incorrectly.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- JerryLiu369/awesome-quant-skillstheir own version, first seen Nov 1, 2026
- TradersPost/pinescript-agentstheir own version, first seen Jul 9, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- TradersPost/pinescript-agents★ 156same name
- JerryLiu369/awesome-quant-skills★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- beginner-helperSkill
- pine-architectSkill
- pine-auditorSkill
- pine-backtesterSkill
- pine-developerSkill
- pine-explorerSkill
- pine-optimizerSkill
- pine-publisherSkill
- pine-visualizerSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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 12
When diagnosing any issue:
- Distinctive: line 17
Re-Check Surrounding Logic: Verify that types, historical offsets, array references, and variable declarations remain coherent after the …
- Very specific: line 55
Fix: Use for...in or cache the boundary:
- Distinctive: line 87
When runtime values need inspection without altering strategy execution:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Pine Script Debugger
Specialized in diagnosing and repairing Pine Script v6 scripts with minimal, targeted fixes.
Systematic Debugging Protocol
When diagnosing any issue:
- Reproduce & Identify: Analyze the exact compiler error message, line number, or symptom reported by the user.
- Isolate the Root Cause: Pinpoint the precise variable, line continuation, scope mismatch, or logic error causing the fault.
- Explain the Cause: Provide a concise explanation of why TradingView's compiler or execution model rejected the code.
- Propose the Smallest Correct Fix: Apply surgical changes to fix the error without gratuitously rewriting working parts of the script.
- Re-Check Surrounding Logic: Verify that types, historical offsets, array references, and variable declarations remain coherent after the edit.
Common Pine Script v6 Compiler Errors & Solutions
1. Cannot use 'plot' in local scope
- Cause: Calling
plot(),plotshape(), orplotcandle()inside anif,for, or function block. - Fix: Move
plot()to global script scope and use ternary conditions:// ❌ Broken if buySignal plot(fastMA) // ✅ Fixed plot(buySignal ? fastMA : na, "Buy Signal MA", color=color.green)
2. Syntax error at input 'end of line without line continuation'
- Cause: Breaking expressions across lines incorrectly, especially splitting ternary operators (
? :) or indenting continuation lines with multiples of 4 spaces. - Fix:
// ❌ Broken sig = condition ? "Buy" : "Sell" // ✅ Fixed sig = condition ? "Buy" : "Sell" // For boolean chains outside (), use 5 spaces (non-multiple of 4) valid = condA and condB and condC
3. Loop Freezes / Script Exceeds Maximum Execution Time
- Cause: Traditional
for i = 0 to array.size(arr)re-evaluating boundaries in v6 (March 2025 change) causing infinite loops if elements are pushed inside. - Fix: Use
for...inor cache the boundary:// ✅ Fixed with for...in for [idx, item] in myCollection // Safe execution // ✅ Fixed with cached size total = array.size(myCollection) for i = 0 to total - 1 // Safe execution
4. undeclared identifier / Variable Scope Shadowing
- Cause: Assigning to a variable created inside an inner scope or using
=instead of:=for re-assignment. - Fix: Declare variable at the outer scope with
varorvarip, and use:=for assignment:var float highestHigh = na if condition highestHigh := math.max(highestHigh, high)
5. request.security Repainting Warning
- Cause: Missing
lookahead=barmerge.lookahead_offor referencing current bar close of higher timeframe. - Fix:
htfClose = request.security(syminfo.tickerid, "D", close[1], lookahead=barmerge.lookahead_off)
Interactive Debugging Tools (Non-Intrusive)
When runtime values need inspection without altering strategy execution:
1. Single-Bar Debug Label
if barstate.islast
label.new(bar_index, high,
str.format("Debug Info:\nClose: {0,number,#.##}\nRSI: {1,number,#.##}\nSignal: {2}",
close, rsiVal, signalBool),
style=label.style_label_down, color=color.navy, textcolor=color.white)2. Variable Monitor Table
var table dbg = table.new(position.top_right, 2, 4, bgcolor=color.new(color.black, 70))
if barstate.islast
table.cell(dbg, 0, 0, "Var", text_color=color.white)
table.cell(dbg, 1, 0, "Val", text_color=color.white)
table.cell(dbg, 0, 1, "RSI", text_color=color.gray)
table.cell(dbg, 1, 1, str.tostring(rsiVal, "#.##"), text_color=color.yellow)Consult docs/pine-error-log.md for project-specific compiler logs and solutions.
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.

