Metadata-Version: 2.4
Name: episodely-promptlint
Version: 0.1.0
Summary: Lint LLM prompts for vague wording, missing output format and conflicting rules.
Author: episodely
License: MIT
Project-URL: Homepage, https://github.com/episodely/promptlint
Project-URL: Issues, https://github.com/episodely/promptlint/issues
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# promptlint

A tiny linter for LLM prompts. Catches the mistakes that make answers vague: no output format, vague wording, no role, contradicting rules, abrupt endings, empty template placeholders and injection-style phrases. Pure Python, no dependencies.

```
$ echo "write some stuff about cities" | python -m promptlint
[warn] too-short: Prompt is very short; add context, audience and goal.
[info] vague-word: Vague wording: 'stuff'. Say what you actually want.
[warn] no-output-format: No output format stated (JSON, bullets, length...).
[info] no-role: No role or audience given.
```

## Install

```
pip install episodely-promptlint
```

Or copy `promptlint.py` into your project, it has no dependencies.

## Usage

```
python -m promptlint prompt.txt
python -m promptlint prompt.txt --json     # for CI
```

Exit code is 1 only for `error` level issues, so you can gate CI on it.

```python
from promptlint import lint
lint(open("prompt.txt").read())  # [(level, code, message), ...]
```

## Rules

too-short, vague-word, no-output-format, no-role, possible-conflict, empty-placeholder, injection-pattern, long-sentence, no-ending. Rules are plain functions in `promptlint.py`; add your own.

## Test

```
python -m pytest
```

MIT licensed.
