npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pinescript-v6

v1.0.0

Published

Chunked TradingView Pine Script v6 reference for LLM agents, plus a global installer and an MCP server.

Readme

Pine Script v6 Reference for LLMs

Current Version: v6
Source: TradingView Pine Script™ v6 Reference Manual & Welcome to Pine Script® v6

Recent Release Coverage

The repository now explicitly surfaces the additions documented in release_notes.md:

  • request.footprint() and the footprint / volume_row types
  • syminfo.isin
  • time() / time_close() support for timeframe_bars_back
  • Updated line-wrapping rules for expressions enclosed in parentheses

These updates are reflected in:

🤖 What is this?

This repository contains the official Pine Script v6 documentation, restructured and "chunked" specifically for Large Language Models (LLMs).

The official documentation is massive. Feeding the entire raw documentation into an LLM often confuses it or exceeds context limits, leading to hallucinations or generic v5 code. This repository breaks the documentation into logical, namespaced markdown files to improve Retrieval Augmented Generation (RAG) and Context Window efficiency.

On top of the raw docs, the repo also ships as a Claude Code plugin — a pinescript-v6 skill that auto-routes to the right file, and a pinescript-developer subagent for writing/reviewing Pine Script v6 code.


👨‍💻 For Humans: How to use this Repo

Option 1: Global install for any agent (recommended)

One command, no clone, works on any machine with Node 18+:

npx pinescript-v6 install

This copies the reference to ~/.pinescript-v6 and wires it into every agent that reads files:

| Agent | What it gets | |---|---| | Claude Code | ~/.claude/skills/pinescript-v6/ (skill) + ~/.claude/agents/pinescript-developer (subagent), available in every project | | Codex | a managed block in ~/.codex/AGENTS.md pointing at the docs | | Cursor / Windsurf | ~/.cursor/rules/pinescript-v6.md | | Anything else reading a global AGENTS.md | ~/.config/AGENTS.md |

Existing content in those instruction files is preserved — only the block between <!-- BEGIN pinescript-v6 --> and <!-- END pinescript-v6 --> is managed, and re-running the installer updates it in place. npx pinescript-v6 uninstall removes everything.

MCP (for agents that prefer tools over files):

claude mcp add -s user pinescript-v6 -- npx -y pinescript-v6 mcp
codex  mcp add     pinescript-v6 -- npx -y pinescript-v6 mcp

Any other MCP client: {"command": "npx", "args": ["-y", "pinescript-v6", "mcp"]}. The server exposes three tools — pinescript_manifest (routing table, call first), pinescript_doc (read one reference file), pinescript_search (grep the reference).

Option 2: Claude Code Plugin

This repo is self-hosting as a plugin marketplace, so no separate marketplace repo is needed.

/plugin marketplace add jabez4jc/pinescriptv6
/plugin install pinescript-v6@pinescriptv6

This installs:

  • pinescript-v6 skill — auto-triggers on Pine Script work and routes through LLM_MANIFEST.md to the correct reference file instead of relying on stale v4/v5 training data.
  • pinescript-developer agent — a subagent specialized in writing, refactoring, debugging, and reviewing Pine Script v6 (repainting checks, var/varip correctness, drawing-object limits, publishing compliance).

To try it locally before pushing changes, point the marketplace at a local path instead of the GitHub repo:

/plugin marketplace add /path/to/your/local/pinescriptv6

Option 3: AI Code Editors, manual setup (Cursor, Windsurf, Copilot)

If you use AI-native editors like Cursor or Windsurf:

  1. Clone this repository locally.
  2. In your chat interface, reference specific documentation based on what you are building.

Option 4: Claude Projects / Custom GPTs

  1. Download this repository as a ZIP.
  2. Upload the relevant files to your Claude Project Knowledge (YouTube Help Here) or Custom GPT Knowledge.
  3. Recommendation: Upload LLM_MANIFEST.md and the specific reference/ folders you use most often.

🧠 For LLMs: Usage Instructions

If you are an LLM or AI Assistant reading this file, follow these instructions:

  1. Entry Point: Always check LLM_MANIFEST.md first. It acts as the map for this repository.
  2. Modular Retrieval: Do not attempt to ingest the entire codebase at once.
  3. Syntax Version: Enforce //@version=6 in all code generation.
  4. No Hallucinations: If a function is not found in these files, it likely does not exist in v6 or has been renamed. Do not invent syntax.

📂 Repository Structure

  • .claude-plugin/: plugin.json + marketplace.json — makes this repo installable as a Claude Code plugin (Option 2 above).
  • skills/pinescript-v6/: The Claude Code skill that routes Pine Script requests to the right reference file. Self-contained — bundles its own copy of the docs so it works if copied out on its own.
  • agents/pinescript-developer.md + agents/pinescript-developer/: The pinescript-developer subagent definition and its bundled reference copy — also self-contained; copy both together.
  • bin/cli.mjs: The npx pinescript-v6 CLI — global installer (install / uninstall) and MCP server (mcp).
  • LLM_MANIFEST.md: The master index. Start here.
  • concepts/: Explanations of how the Pine engine works (Execution model, Timeframes).
  • reference/: The strict API dictionary.
  • visuals/: Drawing/plotting cookbook — plots, bar coloring, tables, lines/boxes, fills, backgrounds, text/shapes, levels.
  • writing_scripts/: Style guide, debugging, profiling/limitations, and publishing guidelines.

📋 Recommended System Prompt

If you are building a Custom GPT or setting up a Project, use this prompt:

You are an expert Pine Script v6 Developer. You have access to a reference library structured into specific folders.

  1. When I ask for code, ALWAYS consult the LLM_MANIFEST.md to locate the correct reference file.
  2. Prefer ta.* namespace functions over manual calculations.
  3. Ensure all scripts start with //@version=6.
  4. If I ask for a Strategy, strictly check reference/functions/strategy.md for the latest order placement syntax.
  5. If I ask for complex visuals, check reference/functions/drawing.md for polyline and box capabilities.

🔄 Maintaining the Bundles (contributors)

The root-level concepts/, reference/, visuals/, writing_scripts/, release_notes.md, pine_script_execution_model.md, and LLM_MANIFEST.md are the single canonical source. The copies inside skills/pinescript-v6/ and agents/pinescript-developer/ are generated from them — never hand-edit those copies directly, edits will be overwritten.

  1. Edit the canonical root files.
  2. Regenerate the bundles: ./scripts/sync-bundles.sh
  3. Commit everything together.

To avoid forgetting step 2, enable the provided pre-commit hook once per clone:

git config core.hooksPath .githooks

It re-runs the sync script and stages the regenerated bundles automatically on every commit. As a backstop, .github/workflows/verify-bundle-sync.yml re-runs the same script in CI and fails the build if any bundle is out of sync with the canonical docs — so drift can't land on main even if the hook was skipped or bypassed.

Run npm test (./tests/test-cli.sh) after touching bin/cli.mjs — it exercises install/uninstall against a throwaway HOME and does an MCP handshake. Publishing a new npm version runs sync-bundles.sh automatically via prepack:

npm version patch && npm publish

Disclaimer: This repository is a community-maintained restructuring of the official documentation designed for AI efficiency. It is not affiliated with TradingView.