Skip to main content

agent-prose

Deterministic Anti-RLHF Stylometric Gate for Autonomous Agents.
Created and maintained by Nitivra.

CI PyPI License: MIT Python: 3.9+

Traditional linters check human grammar. They search for misspellings and punctuation errors that modern large language models rarely make.

They completely miss the real reason human readers identify AI-generated text in seconds: cadence symmetry, evasive verbs and synthetic balance.

Foundation models trained through Reinforcement Learning from Human Feedback (RLHF) develop predictable stylometric tells:

  • Monotone Sentence Cadence: Running four or five consecutive sentences of nearly identical word length (18 to 24 words).
  • Copula Avoidance: Refusing to write direct statements like "X is Y", substituting evasive constructions such as "X serves as Y", "stands as" or "represents a".
  • Prestige Filler Stems: Overusing academic scaffolding words like "crucial", "nuance", "bedrock", "linchpin" and "cornerstone".
  • Synthetic Balance: Forcing thoughts into artificial balance structures like "not only X, but also Y".
  • Tacked-on Participial Tails: Appending weak participial clauses to sentence endings (", ensuring that...", ", enabling...").

agent-prose is a zero-dependency Python gate and pre-commit hook that detects these structural distortions deterministically in under two milliseconds.


Why It Matters

When software engineering teams deploy autonomous agents to generate documentation, pull request summaries, technical specifications and customer communications, text quality directly reflects company credibility.

If your documentation reads like generic corporate boilerplate, readers tune out immediately.

agent-prose replaces subjective editorial debates with an automated, reproducible quality gate in your continuous integration pipeline.


What It Evaluates

  1. Sliding-Window Burstiness Analysis: Measures syntactic variance across five-sentence blocks. Requires sentence length standard deviation to reach at least 6.0, penalising monotone runs.
  2. Direct Copula Enforcement: Flags evasive linking verbs and restores direct declarative active voice.
  3. Pluggable Dialect Packs:
    • Australian English (en-AU): Australian Government Style Manual and Macquarie standard. Strict -ise spellings, British orthography (colour, centre) and Oxford comma banned.
    • American English (en-US): Chicago Manual of Style and AP standard. -ize spellings and serial comma permitted.
    • British English (en-GB): Oxford UK standard.
  4. Two-Tier Severity Architecture:
    • Blocking Defects (Exit Code 1): Fatal issues including non-ASCII smart quotes, invalid dialect spellings, contractions and raw flow arrows (->) in narrative prose.
    • Advisory Warnings: Cadence anomalies, prestige stems and synthetic balance.
    • Promotion Quota (Exit Code 2): Accumulating four or more advisory warnings promotes the scan to a blocking process exit.
  5. Agent Swarm Remediation Bounds: Includes recommended two-pass repair loop specifications to prevent autonomous agents from getting trapped in circular editing loops.

Installation

Install from PyPI:

pip install agent-prose

Or run instantly without installation using uv:

uv tool run agent-prose path/to/document.md

Or install directly from GitHub:

pip install git+https://github.com/geheharidas/agent-prose.git

Quickstart

Scan a single document:

agent-prose README.md

Scan an entire directory recursively:

agent-prose docs/

Specify a dialect profile:

# Australian English (strict -ise, colour, Oxford comma banned):
agent-prose --locale en-AU docs/

# American English (-ize, color, Oxford comma permitted):
agent-prose --locale en-US docs/

Run in strict mode (all warnings become blocking errors):

agent-prose --strict docs/

Emit machine-readable JSON results for automated CI tooling:

agent-prose --json docs/

Pre-Commit Hook Integration

Add agent-prose to your repository .pre-commit-config.yaml to gate pull requests automatically:

repos:
  - repo: https://github.com/geheharidas/agent-prose
    rev: v1.0.0
    hooks:
      - id: agent-prose
        args: ["--locale", "en-AU"]

Dialect Resolution Cascade

agent-prose resolves your active regional profile through an automated 5-stage cascade:

  1. Command-line argument: --locale <code|path>
  2. Project configuration: .proserc.json or [tool.agent-prose] in pyproject.toml
  3. Environment variable: AGENT_PROSE_LOCALE
  4. Host operating system locale detection: locale.getlocale()
  5. Fallback baseline: en-US

Multi-Agent Swarm Priming Adapters

Preventing errors before generation is faster than remediation. agent-prose provides calibration blocks tailored to specific model family failure modes:

  • Anthropic Claude: Suppresses prestige academic scaffolding (crucial, nuance, bedrock).
  • Google Gemini: Enforces burstiness variation and eliminates trailing participial clauses.
  • xAI Grok: Suppresses informal conversational swagger and prose arrows (->).
  • Meta Muse / Llama: Enforces strict dialect orthography and bans contractions.
  • Microsoft Copilot: Eliminates corporate marketing fluff (empower, seamless) and conversational customer-service patter.

View adapter templates in src/agent_prose/adapters/ or generate them dynamically:

from agent_prose.adapters import get_adapter_prompt

claude_prompt = get_adapter_prompt("claude", profile=None)
print(claude_prompt)

Zero Dependencies, Sub-2ms Latency

agent-prose relies exclusively on Python standard library modules (re, pathlib, collections, statistics, json, locale).

It introduces zero third-party supply chain risks, installs in seconds and scans complete technical specifications in under two milliseconds.


License

MIT License. Copyright (c) 2026 Nitivra.

Metadata

Release files for agent-prose 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-prose 1.0.0
File Size Uploaded
agent_prose-1.0.0.tar.gz 35.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-prose 1.0.0
File Interpreter ABI Platform
agent_prose-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 65.5 kB

Release files / agent_prose-1.0.0.tar.gz

Download URL agent_prose-1.0.0.tar.gz
Size 35.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f4dd909885bf4b0af88937c2ee239d6ab3748f61c1321c3d1bbb410168178818
BLAKE2b-256 checksum
How to use checksums
5623703ab60f4466d219eda258ecf4ec97e4db02045b0610f3005a14612fcb8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / agent_prose-1.0.0-py3-none-any.whl

Download URL agent_prose-1.0.0-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
365b45d21e96a81fe88d5638426d838c9cc61c844e2373d989633d77ef286069
BLAKE2b-256 checksum
How to use checksums
a8242dff8524f9e346ce6d4f40ecec6dabc4cf72b8be77020baa55eee0b6f264
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page