Skip to main content
skill CX Codex

pine-optimizer — Claude Code skill for faster Pine Script

A skill that rewrites Pine Script on TradingView: faster calculations, cleaner indicator settings, simpler code.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add TradersPost/pinescript-agents --skill pine-optimizer -a claude-code
Open on GitHub

What pine-optimizer does

The skill reads your Pine Script and rewrites it around newer language features. The core of it is UDT-first organisation: one array of a custom type instead of six parallel arrays that have to stay in sync. That kills the sync bugs and the bar_index clamping code along with them.

On the UI side it shows how the active parameter on input.* hides settings that do not apply to the current choice, and how to tuck a whole advanced block behind one checkbox. For drawing, built-in line styles replace hand-rolled visuals.

It works with Read, Edit, Grep, Glob, so it finds and edits files on its own. The skill recommends xloc.bar_time for lines because that mode has no historical buffer limit, which makes coordinate clamping unnecessary. If traditional for loops stay in the script, cache the boundary with array.size() before the loop — the array can change mid-iteration otherwise.

What it helps with

  • drop parallel arrays and keep related data in one type
  • hide indicator inputs that do not apply to the selected mode
  • remove bar_index clamping when drawing lines over history
  • fold repeated drawing blocks into a single type method
  • swap manual line styling for built-in plot.linestyle_*

Example prompts for the agent

  • Rewrite this indicator with UDTs: no parallel arrays, drawing moved into a type method.
  • Hide the length inputs with active so they only show for the Custom mode.
  • Check the for loops and cache the array bounds before iterating.

How to install pine-optimizer

1Skills CLI (Vercel)

npx skills add TradersPost/pinescript-agents --skill pine-optimizer -a claude-code

2Manually: put the files in place

~/.claude/skills/pine-optimizer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pine-optimizer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about pine-optimizer

How do I install pine-optimizer in Claude?

Run npx skills add TradersPost/pinescript-agents --skill pine-optimizer -a claude-code. The skill lands in ~/.claude/skills/pine-optimizer/SKILL.md.

What does pine-optimizer do?

It optimizes Pine Script: speeds up calculations, tidies indicator inputs and moves the code to a UDT architecture.

Which tools can the skill use?

Read, Edit, Grep and Glob — it reads project files, locates the relevant code and edits it.

Similar skills

All skills for Programming languages →

From the same set5

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor