Linter

Static analysis for prompts with quality scoring, issue detection, and auto-fix suggestions

Overview

The Prompt Linter performs static analysis on your prompts to identify issues, suggest improvements, and ensure consistent quality. Like code linters (ESLint, Pylint), it catches problems before they reach production, with a 0-100 quality score for quick assessment.

Quality Score

0-100 rating system

Issue Detection

Errors, warnings, info

Auto-Fix

One-click fixes

How to Use

  • 1
    Paste Your Prompt - Enter your prompt text into the editor. The linter analyzes as you type.
  • 2
    Click Lint - Run the full analysis to detect issues and generate your quality score.
  • 3
    Review Issues - See all detected issues organized by severity (errors, warnings, info).
  • 4
    Apply Fixes - Click 'Fix' on any issue with an available auto-fix, or 'Fix All' to apply all fixes.
  • 5
    Re-Lint - After making changes, re-lint to verify improvements and check for new issues.

Quality Score

The quality score (0-100) provides an at-a-glance assessment of your prompt's quality:

0-49
Poor
Critical issues present
50-69
Fair
Needs improvement
70-84
Good
Minor issues only
85-100
Excellent
Production ready

Score Calculation

The score is calculated based on:
  • Number and severity of detected issues
  • Prompt structure and clarity
  • Use of best practices
  • Completeness of instructions

Severity Levels

Errors

Critical issues that will likely cause problems. Must be fixed before production use. Examples: injection vulnerabilities, contradictory instructions, missing critical context.

Warnings

Potential issues that may affect quality or consistency. Should be reviewed and addressed. Examples: ambiguous instructions, missing examples, overly long sentences.

Info

Suggestions for improvement that won't cause problems if ignored. Nice-to-haves. Examples: style suggestions, optimization opportunities, readability improvements.

Lint Rules

Structure Rules

  • missing-role: No clear role definition for the AI
  • missing-task: Task or objective not clearly stated
  • missing-format: Expected output format not specified
  • missing-constraints: No boundaries or limitations set

Clarity Rules

  • ambiguous-instruction: Instructions that could be interpreted multiple ways
  • long-sentence: Sentences over 50 words that hurt readability
  • vague-quantifier: Words like "some", "few", "many" without specifics
  • passive-voice: Excessive passive voice reducing clarity

Security Rules

  • injection-risk: Patterns that could enable prompt injection
  • pii-exposure: Risk of exposing personal information
  • unrestricted-output: No guardrails on AI responses

Optimization Rules

  • redundant-text: Repeated instructions or information
  • excessive-tokens: Unnecessarily verbose phrasing
  • missing-examples: Complex tasks without examples

Auto-Fix

Many issues come with automatic fixes that can be applied with one click:

Fixable Issues

  • Trailing whitespace: Automatically trimmed
  • Double spaces: Collapsed to single space
  • Missing punctuation: Added where appropriate
  • Capitalization: Fixed for consistency
  • Redundant phrases: Removed or simplified

Manual Review Required

Some issues require human judgment and cannot be auto-fixed:
  • Ambiguous instructions (need clarification)
  • Missing context (need domain knowledge)
  • Security issues (need careful review)

AI Expert Use Cases

Quality Gates

Integrate the Linter into your prompt development workflow as a quality gate. Require a minimum score (e.g., 80+) before prompts can be deployed to production.

Team Standards

Use the Linter to enforce consistent prompt quality across your team. The rule-based approach ensures everyone follows the same best practices.

Prompt Audits

Regularly audit existing prompts using the Linter to identify degradation or opportunities for improvement in your prompt library.

Onboarding

Help new team members learn prompt engineering best practices through the Linter's feedback. The explanations teach why certain patterns are problematic.

Tips & Best Practices

Pro Tips

  • Aim for a score of 85+ for production prompts
  • Fix all errors before addressing warnings
  • Use auto-fix for quick wins, review suggestions carefully
  • Re-lint after making changes to catch new issues
  • Add the Linter to your prompt review checklist

When to Ignore Rules

Sometimes rules can be safely ignored:
  • Domain-specific terminology flagged as unclear
  • Intentionally vague instructions for creative tasks
  • Long sentences that are actually clear in context
Use your judgment, but document why rules were ignored.