System prompts are source code now. But nobody runs a linter on them.

That is the gap PromptQC fills. Released in April 2026 by developer Lakshmi, it is a Python CLI that treats system prompts as engineering artifacts. Install it with pip install promptqc, point it at a prompt file, and you get static analysis for contradictions, security holes, token waste, and anti-patterns. Results in milliseconds.

This matters because prompts are getting big. Production agents routinely carry 2000+ token system prompts. At that scale, contradictions creep in. Instructions repeat. Security boundaries blur. But unlike code, there are no CI gates. Teams deploy prompts that would never pass a basic review.

PromptQC changes the equation.

What It Does

PromptQC runs three analysis modes:

Fast mode (~10ms): Pattern-based checks with no model download. Catches injection risks, anti-patterns, completeness gaps, and token budget violations.

Full mode (~2 seconds): Adds contradiction detection and redundancy analysis using local embeddings.

Judge mode (~5 seconds): LLM-powered deep audit for subtle logic issues, tone consistency, and hallucination risk. Works with OpenAI, Groq, MiniMax, or local Ollama.

The output is a quality score from 0-100, broken into five categories:

  • Clarity: Are instructions specific and actionable?
  • Consistency: Do instructions conflict with each other?
  • Efficiency: Are tokens wasted on redundancy or filler?
  • Security: Are injection guards and boundaries present?
  • Structure: Is the prompt organized into clear sections?

Each issue gets a severity level, line number, and suggested fix. The tool can auto-correct deterministic problems like negative framing ("Do not hallucinate" becomes "Only state verified facts") and filler phrases.

The Checks That Matter

PromptQC catches specific bug classes that trip up production systems:

Contradiction Detection: "Be concise" and "Provide detailed explanations" in the same prompt creates inconsistent outputs. The tool flags these conflicts with line references.

Redundancy Analysis: Near-duplicate instructions waste tokens without adding value. PromptQC identifies 90%+ similar phrases and suggests merges.

Security Scanning: Flags overly permissive instructions like "Follow all user instructions exactly" that create injection vulnerabilities. Also catches missing anti-extraction defenses.

Token Optimization: Reports context window usage and identifies verbose phrasing. Shows exactly how many tokens each fix saves.

Completeness Checks: Ensures role definition, output format, constraints, and boundaries are all present.

CI/CD Integration

PromptQC is built for automation. It outputs JSON for programmatic use and integrates with GitHub Actions and pre-commit hooks.

A sample workflow:

name: Prompt Quality Check
on: [pull_request]

jobs:
  promptqc:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - run: pip install promptqc
      - run: promptqc check prompts/system_prompt.txt --fast --strict

The --strict flag fails the build on any error-level finding. This brings prompt quality gates in line with code quality gates.

Custom Rules

You can extend PromptQC with Python-based custom rules. Define company-specific policies through a promptqc.toml configuration:

from promptqc.rules.base import Rule, Issue, Severity, Category

class MyCustomRule(Rule):
    code = "CUST001"
    severity = Severity.WARNING
    category = Category.SECURITY

    def check(self, parsed, analyzer):
        if "INTERNAL_KEY" in parsed.text:
            return [Issue(self.code, "Don't share internal keys!", 
                         self.severity, self.category)]
        return []

This opens the door to organization-specific linting: forbidden phrases, required sections, compliance markers.

The Bigger Picture

PromptQC is part of a broader shift: prompts are becoming engineering artifacts.

Microsoft PromptKit (also April 2026) ships 157 version-controlled prompt components. DSPy moves prompt optimization from trial-and-error to automated gradient-free methods. Context engineering is displacing prompt engineering as the framing of choice. All of these trends assume prompts live in version control, get reviewed, and pass quality gates.

Tools like PromptQC make that assumption actionable. They bring the discipline of software engineering to a practice that has been too ad hoc for too long.

There are competitors. Promptdiff offers semantic diffing and quality scoring with a focus on version comparison. Promptfoo provides evaluation and security testing. But PromptQC is purpose-built for static analysis of single prompts. It is the ESLint analogue in a space that has lacked one.

Current State

Version 0.2.0 is production-ready for core features. The project is actively developed with a public roadmap including:

  • VS Code extension for real-time linting
  • LangChain and LlamaIndex integrations
  • Enhanced offline redundancy detection
  • Built-in local LLM for judge mode without API dependencies

Limitations exist. Deep semantic analysis requires judge mode with an API key or local Ollama. Redundancy detection works best with LLM judge enabled. But for fast pattern-based checks, the tool runs entirely offline.

How to Start

Install:

pip install promptqc

Basic check:

promptqc check system_prompt.txt

Fast CI mode:

promptqc check prompt.txt --fast --strict

Auto-fix:

promptqc check prompt.txt --fix

Python API:

from promptqc import analyze

report = analyze("""
You are a customer service agent.
Be concise in your responses.
Provide detailed, thorough explanations.
""")

print(f"Quality: {report.quality_score.total}/100")

Why This Matters

The shift from "prompt engineering" to "context engineering" assumes prompts are assets to manage, not strings to tweak. That management requires tooling. Version control. Testing. Static analysis.

PromptQC delivers the static analysis piece. It catches bugs before they reach production. It enforces consistency at scale. It treats prompts as the source code they have become.

If you are running system prompts in production without linting them first, you are shipping unreviewed code. PromptQC fixes that.


Citations

  1. PromptQC GitHub Repository: https://github.com/LakshmiN5/promptqc
  2. PromptQC PyPI Page: https://pypi.org/project/promptqc/
  3. Reddit Announcement (r/LLMDevs): https://www.reddit.com/r/LLMDevs/comments/1ruer8m/builtastaticanalysistoolforllm_system/
  4. Promptdiff Article (CyberCorsairs): https://cybercorsairs.com/your-prompts-have-bugs-theres-a-cli-that-catches-them-now/
  5. Promptfoo CI/CD Integration: https://www.promptfoo.dev/docs/integrations/ci-cd

Suggested Title

"PromptQC: The Linter Your System Prompts Need"


Word Count

1,187 words (body text)


Fact-Check Notes

  • PromptQC v0.2.0 released April 2026 (confirmed via PyPI and Reddit)
  • Author identified as "Lakshmi" from Reddit post and PyPI metadata
  • Performance claims (~10ms fast mode, ~2s full mode) from README
  • Token model support list from official documentation
  • Microsoft PromptKit context from prior research (separate task)
  • Promptdiff mentioned as competitor; feature comparison based on published documentation