pine-auditor
Skill0 starsChanged 41 days agoMITView on GitHub
Proactively audits Pine Script indicators and strategies for repainting, lookahead leakage, unconfirmed bar dependencies, backtest realism (commission, slippage, fill assumptions), code quality, and adherence to user specification. Use when asked to audit, review, verify, validate, or inspect Pine Script code.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- beginner-helperSkill
- pine-architectSkill
- pine-backtesterSkill
- pine-debuggerSkill
- pine-developerSkill
- pine-explorerSkill
- pine-optimizerSkill
- pine-publisherSkill
- pine-visualizerSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 63
Use of legacy v4/v5 functions (security(), study(), iff()).
≈ “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 Auditor
The Pine Auditor is a dedicated auditing layer that thoroughly inspects Pine Script code for repainting vulnerabilities, backtest distortion, code quality defects, and deviations from specifications.
Audit Dimensions
graph TD
A[Pine Script Code] --> B[1. Repainting & Lookahead Audit]
A --> C[2. Backtest Validity Audit]
A --> D[3. Code Quality & Syntax Audit]
A --> E[4. Specification Compliance Audit]
B --> F[Audit Report]
C --> F
D --> F
E --> F1. Repainting & Future Leakage Check
Inspect for:
request.security()Lookahead:- ⚠️ Flags any
request.security()missinglookahead=barmerge.lookahead_off. - ⚠️ Flags
lookahead=barmerge.lookahead_onon historical bars unless explicitly intended for session reference (e.g. daily open). - ⚠️ Flags higher-timeframe data accessed without bar offset (e.g.
request.security(syminfo.tickerid, "D", close)accesses the daily close before the day ends on intraday historical bars).
- ⚠️ Flags any
- Realtime Bar Instability:
- Flags signals dependent on
close,high,lowon unconfirmed bars where signals can appear and disappear on every tick. - Verifies whether
barstate.isconfirmedorclose[1]is required.
- Flags signals dependent on
- Pivots and Swings:
- Verifies that
ta.pivothigh()andta.pivotlow()have their inherent right-side bar delay acknowledged (e.g.ta.pivothigh(5, 5)only evaluates true 5 bars after the peak).
- Verifies that
- Drawing Coordinate Degradation:
- Flags usage of
xloc.bar_indexon historical lookback beyond 5,000 bars.
- Flags usage of
2. Backtest Validity & Realism Check
Inspect for:
- Commission & Slippage Assumptions:
- Flags strategies with 0% commission or 0 slippage. High-frequency or low-timeframe strategies with zero commission produce severely distorted equity curves.
- Order Execution Realism:
calc_on_order_fills=true/calc_on_every_tick=true: Check if intrabar fills assume fills at the close or intrabar extremes.- Limit and stop orders: Check whether realistic bid/ask spread and price gaps are accounted for.
- Position Sizing & Margin:
- Checks
default_qty_typeanddefault_qty_value. - Flags 100% equity compounding without risk caps.
- Flags unintended pyramiding (
pyramiding > 0allowing duplicate entries on every bar).
- Checks
3. Code Quality & Pine Script v6 Standards Check
Inspect for:
- Deprecated Syntax:
- Missing
//@version=6. - Use of legacy v4/v5 functions (
security(),study(),iff()).
- Missing
- Syntax Trap Detection:
- Split ternary operators (
? :) across multiple lines outside parentheses. - Incorrect continuation indentation (multiples of 4).
plot()called inside local scopes (if,for).
- Split ternary operators (
- Loop Boundary Vulnerabilities:
- Traditional
for i = 0 to array.size(arr)without boundary caching (March 2025 breaking change).
- Traditional
- Missing Strategy Alert Annotations:
- Verifies
//@strategy_alert_message {{strategy.order.alert_message}}is present and placed afterstrategy().
- Verifies
- State Management & Persistence:
- Incorrect use of
var/varipvs series re-initialization. - Missing
na()handling on historical offset series (series[1]).
- Incorrect use of
4. Audit Report Structure
Generate the audit findings in this clear format:
# Pine Script Audit Report: [Script Name]
## 1. Repainting & Future Leakage
- **Status**: [PASSED / WARNING / CRITICAL]
- **Findings**:
- `Line XX`: [Explanation and risk assessment]
## 2. Backtest Validity & Execution Realism
- **Status**: [PASSED / REALISTIC / DISTORTED]
- **Findings**:
- Commission: [Configured or missing]
- Slippage: [Configured or missing]
- Intrabar assumptions: [Evaluation]
## 3. Code Quality & Syntax Compliance
- **Status**: [CLEAN / WARNINGS / ERRORS]
- **Findings**:
- Pine Version: [v6 confirmed / outdated]
- Loop safety: [Verified / vulnerable]
- Line formatting: [Valid / invalid]
## 4. Specification Adherence
- Matches requested rules: [Yes / Partial / Discrepancy]
- Discrepancies noted: [None or bullet points]
## 5. Recommended Fixes (Surgical)
```pinescript
// Specific corrected code snippetDoes 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.

