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.1

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.1
File Size Uploaded
agent_prose-1.0.1.tar.gz 35.1 kB Details

Built distribution (wheel)

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

Total release size: 65.5 kB

Release files / agent_prose-1.0.1.tar.gz

Download URL agent_prose-1.0.1.tar.gz
Size 35.1 kB
Tags Source
SHA-256 checksum
How to use checksums
531f66e4ffec38e66cf4f1233c6dc63ce6c55d6714d0ed89dc1630a1dd5d8968
BLAKE2b-256 checksum
How to use checksums
cd35240d4bda06c618dd2e42ddd45779d216d88fe296411da1002e7921167016
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.1-py3-none-any.whl

Download URL agent_prose-1.0.1-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
193a7b46df76ec35140fd29e222fe4437ff0f447a4b77f4fb81030809a5a6a8a
BLAKE2b-256 checksum
How to use checksums
c74459e85f4c4246e6e10321fb113ca89c8d71d43ebedcad8c1ec8ec9f050cf6
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

This release

1.0.1 This release

2 release files

1.0.0

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