Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pine Script Agent Kit

Help AI coding tools give Pine Script v6 answers they can trace to named sources.

Türkçe

Pine Script Agent Kit, a source-traceable knowledge path for AI coding tools

quality GitHub Release License: MIT Developed with Divan

Works with Codex, Claude Code, Cursor, Copilot, Gemini, Cline, Windsurf, Zed, and Devin.

In plain language

You describe the Pine indicator, strategy, migration, error, or review you need. This kit gives a supported AI coding tool source-linked Pine v6 rules, their exceptions, and honest verification limits. The tool can then return code or a review that explains what it relied on and what still needs a TradingView check.

Your Pine task and chart context
        ↓
Official sources + scoped rules + recorded evidence
        ↓
AI code or review + source IDs + remaining manual checks

The repository provides:

  • an installable Codex skill and portable agent instructions;
  • generated adapters for Codex, Claude Code, Cursor, Copilot, Gemini, Cline, Windsurf, Zed, and Devin;
  • 56 tracked Pine v6 examples with hash-bound evidence status;
  • standard-library Python checks for catalog integrity, example inventory, and generated-file drift.

It is useful when you want AI assistance with Pine code without hiding where the guidance came from or pretending that a local check is a TradingView result.

Note

Project status: This project is maintained and accepts community contributions.

The current release is v1.2.0. It packages the Codex skill, clearer community paths, and public project governance.

Important

This kit can improve an AI answer, but it cannot replace the TradingView compiler or a chart test. A repository check never becomes a claim that Pine code compiles, never repaints, is secure, or is profitable.

Start · How it works · Sources · Verification · Divan · Community · Contribute

Start with your Pine task

Choose the path that matches what you need:

  • Write or fix Pine code: open this repository in a supported AI coding tool, then describe the indicator, strategy, library, migration, or error
  • Review existing code: include the chart timeframe, requested timeframes, repaint expectations, strategy behavior, and alert or webhook use
  • Check this knowledge pack: clone the repository and run the local validation commands below

You do not need an API key or an installed package to run the repository checks.

What it does for you

  • Gives the AI named Pine v6 sources instead of an anonymous collection of tips
  • Keeps each rule within its intended scope and preserves known exceptions
  • Stops unsupported or conflicting rules before they reach generated agent instructions
  • Shows whether a result came from an official source, a recorded TradingView check, or a local repository check
  • Keeps instructions consistent across supported AI coding tools

What it does not do

  • It does not include or imitate the TradingView Pine compiler
  • It does not prove that every example compiles or behaves correctly on every chart
  • It does not promise profit, security, or non-repainting behavior
  • It does not check account plans, data access, symbols, exchanges, or available history
  • It does not send usage data or ask for secrets during local validation
  • It does not authorize live trading or place real credentials in webhook examples

How an AI agent uses this kit

Ask for the outcome you need. Include the chart context when it changes the answer.

Review this Pine v6 indicator for repaint risk. Keep its current behavior.
The chart is 15 minutes and it requests 1-hour data. Cite the source IDs you use.
Tell me what you checked locally and what still needs a TradingView test.

What the answer should tell you

A useful answer should:

  1. State the relevant assumptions before changing the code
  2. Apply only rules that match those assumptions
  3. Name the source IDs behind Pine-specific behavior
  4. Preserve exceptions instead of turning guidance into an “always” rule
  5. Separate a local repository result from a TradingView compile or chart result

A Pine request becomes an evidence-bounded answer through context, sources, rules, and validation

Quick start

You need Git and Python 3.11 or newer. The local tools use the Python standard library.

git clone https://github.com/trugurpala/pinescriptv6.git
cd pinescriptv6
python tools/psak.py validate
python tools/psak.py render --check
python tools/psak.py check

The final python tools/psak.py check command ends with:

OK: all offline checks passed
NOT CHECKED: TradingView compilation
NOT CHECKED: Runtime/chart behavior
NOT CHECKED: Repaint behavior
NOT CHECKED: Alert delivery
NOT CHECKED: Market data
NOT CHECKED: Profitability

python tools/psak.py links is the only network-aware quality command. It checks registered official URLs and reports a link it cannot reach as unverified.

Install in Codex Desktop

For reusable Pine Script guidance across projects, install the packaged Codex skill:

$skill-installer https://github.com/trugurpala/pinescriptv6/tree/main/.agents/skills/pine-script-agent-kit

If it does not appear in Codex after installation, restart Codex. Invoke it with $pine-script-agent-kit, then use the smoke prompt in ADOPTION.md. The installed entry point is .agents/skills/pine-script-agent-kit/SKILL.md. Installing a skill does not prove that a host loaded or obeyed it; confirm the loaded skill before relying on its guidance.

Where the knowledge comes from

Every generated instruction starts with a named source. A source does not become agent guidance until the project records its scope, exceptions, and evidence level.

Official Pine sources become scoped rules, pass validation, and produce consistent agent guidance

Step Repository source What it records
1. Named sources knowledge/sources.json URL, publisher, location, access date, and applicability
2. Scoped rules knowledge/catalog.json Claim, reason, scope, exceptions, source IDs, and evidence
3. Human context knowledge/rules/ Focused explanations for reviewers and contributors
4. Validation tools/psak.py Missing sources, conflicts, invalid records, and generated drift
5. Agent guidance agents/protocol.md and adapters/ A shared behavior contract and tool-specific framing
6. Example status examples/manifest.json SHA-256 and verification state for every tracked .pine file
7. Manual evidence verification/tradingview.json Hash-bound TradingView test records

Read the full model in Source provenance.

What the evidence levels mean

Level Plain meaning What the project may say
official Current TradingView documentation supports the rule Use it only within the recorded scope
tradingview-verified A person recorded a dated Pine Editor check for this exact file hash Report only that file and environment as checked
structural-only Local repository checks passed Report the checks, but do not call the code compiled
unverified The evidence is incomplete Keep it out of generated guidance

Changing a Pine file changes its SHA-256 hash and invalidates an older manual record. A temporary source-link failure creates a review signal; it does not silently delete the last known rule.

Current Pine v6 coverage

The source catalog follows official Pine v6 release notes through July 2026. Coverage includes conditionally active inputs, current-contract and ISIN fields, timeframe_bars_back, request.footprint(), multiline strings, user-defined type sorting, updated wrapping, alerts, strategy recalculation and execution timing, and a repaint taxonomy.

Coverage does not guarantee that every account, market, timeframe, or chart supports every feature. See current and planned coverage and read Pine v6 release coverage for version boundaries.

Official starting points:

Examples and verification

The repository tracks 56 Pine v6 files. examples/manifest.json records 55 as structural-only and one as tradingview-verified for a dated, hash-bound Pine Editor check. Every file exists, is non-empty, has a SHA-256 entry, and declares //@version=6 on its first line.

The manual record establishes only its stated Pine Editor check for the exact file hash and recorded environment. Neither status establishes runtime behavior, profitability, non-repainting behavior, data access, security, alert delivery, or live-trading suitability. Check examples/manifest.json and any matching verification/tradingview.json record before making a stronger claim.

To promote an example beyond structural-only, follow TradingView manual verification.

Supported AI tools

Follow the adoption guide for placement, local validation, and a host smoke prompt.

Tool Project surface
Portable Agent Skill SKILL.md
Codex Desktop skill .agents/skills/pine-script-agent-kit/SKILL.md
Codex AGENTS.md
Claude Code CLAUDE.md
Gemini CLI GEMINI.md
Cursor .cursor/rules/pinescriptv6.mdc
Cline AGENTS.md
Devin AGENTS.md
Windsurf AGENTS.md (primary)
GitHub Copilot .github/copilot-instructions.md and scoped instructions
Zed .cursorrules
Portable knowledge pack generated/custom-gpt/

Quality commands

python -m unittest discover -s tests -v
python tools/psak.py validate
python tools/psak.py render --check
python tools/psak.py check
python tools/psak.py links

check runs offline and combines catalog, example, critical-file, and generated-drift checks. Link checking stays separate because network availability does not prove repository correctness. GitHub runs the same offline gates in .github/workflows/quality.yml.

The advisory source-links workflow can be run manually or on its weekly schedule to check official source URLs without making network availability a required PR gate.

Security and privacy

Do not place webhook secrets, exchange credentials, private Pine code, customer data, or personal information in examples, issues, or pull requests. Webhook examples use placeholders. Live use still needs authentication, payload validation, replay protection, rate limits, and trading-risk controls.

Report sensitive issues privately through SECURITY.md.

Developed with Divan

This project was planned and delivered with Divan. Divan adds planning, persistent context, and verifiable delivery to coding hosts such as Codex and Claude Code. It is not an AI model and it is not a separate cloud service. You do not need Divan to install, use, validate, or contribute to Pine Script Agent Kit.

Free for the community

This project is free and open community infrastructure. It has no paid API, usage quota, runtime telemetry, or proprietary build service. Local validation works with Python's standard library.

You can contribute without writing code. Report an official-source change, improve an explanation, add a sourced rule, record a manual check, or test an adapter in another AI coding tool.

Use GitHub Discussions for questions and proposals. Use the issue chooser for reproducible defects, source changes, and documentation problems. See Support for the full routing guide.

Contributing

A knowledge contribution needs a source ID, a scoped claim, an evidence level, a verification date, tests, and current generated outputs. Start with CONTRIBUTING.md, follow the Code of Conduct, and see Governance for decision and maintainer responsibilities.

Project documentation

Releases, license, and citation

The current release is v1.2.0. See the release record and changelog. Future changes stay under Unreleased until they receive their own tag and GitHub Release.

Code and project documentation use the MIT License. Citation metadata is available in CITATION.cff.

The public visual system is Verified Signal. The editable source lives in Figma, and its principles live in the visual philosophy.

Maintained by Uğur Pala for the community.

This independent project is not affiliated with or endorsed by TradingView. Pine Script and TradingView are trademarks of their respective owners.

About

Source-traceable Pine Script v6 guidance and structured examples for AI coding agents, with honest TradingView verification limits.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages