Skip to main content

prosefix

prosefix fixes spelling, style, typos and punctuation in Markdown files, in place.

prosefix draft.md             # fix one file in place
prosefix draft.md --diff      # show the changes without writing them
prosefix vault/ --check       # exit 1 if any file would change

prosefix runs two passes over each file with one model endpoint, one decision cache and one change list. The style pass (stylefix) settles one English variety and one style guide; the proof pass (proofix) fixes typos, punctuation, compounds and commas. Front matter, code, links, HTML and Obsidian syntax are never changed.

prosefix applies a fix only when it is always right; when judgement is needed it asks the model; anything uncertain is listed for you.

Before:  We recieved the the new colour scheme -- the teams programme , which covers analysis,design and testing.
After:   We received the new colour scheme – the teams programme, which covers analysis, design and testing.

(A British draft, kept British, with the tools installed and no model. Words that depend on meaning, such as licence and license, are listed for review until a model decides them; see Questions without a model.)

Install

brew install andrewbroz/tap/prosefix     # also installs Vale, LanguageTool and typos
uv tool install prosefix                 # or: pipx install prosefix

Without Homebrew, install the tools you want. prosefix runs every tier whose requirements are met:

missing skipped still runs
Vale (brew install vale) variety, guide, ambiguous, numbers serial-comma, abbreviations, punctuation, and all of the proof pass
LanguageTool (brew install languagetool) mechanical, adjudicated hygiene, basics, compounds, commas
typos (brew install typos-cli) typos everything else
a model decisions that need judgement, commas rule-based tiers; undecided items are listed for review (see Questions without a model)

First run

prosefix draft.md --diff   # see what would change
prosefix draft.md          # write it

The first in-place run prints tip: prosefix --diff <path> shows changes without writing them; it stops once prosefix has a cache directory.

Without the tools. A bare uv tool install prosefix still fixes the obvious mechanical faults with the basics tier, which needs nothing else: a doubled small word from a closed list (a, an, the, of, to, at, for, with, from, into, onto, and, or, but, nor, it, we, they, my, your, our, their: the the), a space before a comma or period (programme ,), and a missing space after a comma, semicolon or colon between two words (analysis,design). Other repeats (that that, log in in the corner, turn it on on Monday) go to the model or to review, as does a closed-list double LanguageTool ran over without flagging; a hyphen touching either copy (to to-do) makes it no double. A space before : ; ! ? is removed at the end of a line; with more text after it (Press : to enter) it is listed for review. It never touches 1,000, 10:30, URLs or code (fenced, inline or indented). prosefix then says once, in one line, how to get the rest:

prosefix: most fixes need Vale and LanguageTool — brew install andrewbroz/tap/prosefix (or: brew install vale languagetool typos-cli)

Without a model, one more line says prosefix: model decisions and comma placement need a model — prosefix --setup. Set one up, and check what this machine has:

prosefix --setup      # choose and test a model endpoint
prosefix --doctor     # tools found or missing, the endpoint, the settings file for this directory

The endpoint comes from flags, PROSEFIX_LLM_* / ADJUDICATE_LLM_* environment variables, ~/.config/prosefix/config.toml and ~/.config/adjudicate/config.toml, never from a project file. Without a model, all rule-based tiers still run.

Questions without a model. Some items need judgement but have a likely answer: a capitalised swap (Color to Colour), a serial comma, a number the guide may spell out, an abbreviation that may end a sentence, and a comma or full stop at a closing quote. Without a model, prosefix asks about each one whenever it can store your answer, that is, whenever it uses a decision cache. The question is listed for review, and the text is left as written. --no-cache reads and stores nothing, so it does not ask: it applies the capitalised swap and lists the others as plain review items. Before 0.3.0, only --llm cached asked.

--llm none contacts no model and reads only your own answers from the cache, never the model's. It applies them and asks the same questions as --llm cached, so the two write the same text when the cache holds only your answers. Before 0.3.1 it read no cache at all.

Which English

When nothing sets the variety (no --target, no project target, no front matter prosefix: {target: …} or lang:), prosefix reads the note and keeps the variety it is already written in. It counts the distinct words that only one variety spells that way (colour, programme, finalise against color, program, finalize), outside code and quotations; names, words in your accept lists and words both varieties accept do not count. Two or more British words, and at least twice as many as American ones, mean UK; the same the other way means US. A note with such words but no clear majority keeps its spellings, its outer quote marks and the order of its dates as written (no variety conversion; everything else follows the US default), and a note with no such words at all uses US. The per-file line says which:

prosefix: draft.md: en-GB (detected) · 6 change(s), 4 for review
prosefix: draft.md: no clear variety (1 UK, 1 US words); variety spellings left alone — set --target or lang: · 1 change(s), 0 for review
prosefix: notes.md: no clear variety (0 UK, 0 US words); using en-US — set --target or lang: · 1 change(s), 0 for review

Each file is decided on its own, so a mixed vault keeps every note consistent. To choose instead, pass --target uk (or us), set target in the project file, or put lang: en-GB in a note's front matter.

Review items

Anything prosefix will not apply on its own (no model, the model unsure, or no single right fix) is a review item, with its line and reason:

draft.md:5: review — A comma may be missing after the conjunctive/linking adverb ‘However’. [proofix SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA]

For one file (or stdin), review items go to stderr after the run. For several files, each file's line counts them and the total line adds (--changes lists them); --changes prints every change, with a few words of context either side, and then the file's review items. --report FILE writes them all to a Markdown file. -q prints none of this.

Use

prosefix note.md                          # rewrite one note in place
prosefix vault/ --diff                    # show what would change in a vault
prosefix vault/ --changes                 # rewrite, listing every change and review item
prosefix content/ --check --llm cached    # CI: fail if anything would change
prosefix - < in.md > out.md               # filter
prosefix note.md --target uk --skip commas

Directory walks take *.md and *.markdown, skipping .git, .obsidian, node_modules, other dot-directories and your exclude globs. Exit status: 0 success; 1 from --check (or --strict) when something would change; 2 for usage, configuration, input or write errors, a file that changed on disk during the run (it is left alone), or a failed --require. Any per-file error is reported on stderr and gives 2, but the other files are still processed.

Writes are atomic, keep the file's mode, and follow symlinks to their target; read-only files are reported and left alone.

With LanguageTool installed, prosefix starts one local LanguageTool server for the run (on 127.0.0.1 only), shares it between files and stops it when the run ends, including on errors and Ctrl-C. If it cannot start, or stops answering mid-run, prosefix says so in one line and uses the command line for the rest of the run. Ctrl-C stops it, saves the decisions already made, prints prosefix: interrupted and exits 130.

Obsidian

Run prosefix in place on a vault. Wikilinks and their aliases, embeds, #tags, %%comments%%, ^block-ids, the > [!note] marker of a callout, maths, and Markdown code, links and HTML are never edited; quotes beside them are curled sensibly. Prose that only looks like syntax ("issue #42", "C#", "costs $5 and $10") is edited as prose.

Until the prosefix plugin exists, use the Shell Commands community plugin with:

prosefix {{file_path:absolute}}

Publishing

- run: pipx install prosefix
- run: prosefix content/ --check --llm cached

Commit .prosefix/ so CI replays your decisions: --llm cached applies decisions already in the cache and never contacts a model. With no settings file, decisions are cached under $XDG_CACHE_HOME/prosefix/ (default ~/.cache/prosefix/) instead.

Settings

prosefix looks upward from each file for prosefix.toml, .prosefix.toml, or [tool.prosefix] in pyproject.toml:

target = "uk"                    # "us" or "uk"
style = "oxford"                 # style guide
only = ["style", "proof"]        # passes to run
skip = ["commas"]                # tiers to skip
exclude = ["drafts/**", "templates/**"]
accept = ["Obsidian", "Zettelkasten"]
accept_file = ".prosefix/accept.txt"
cache = ".prosefix/cache.json"   # comma decisions go to commas.json beside it

exclude globs are relative to the settings file; ** crosses directories, * and ? do not, and a bare directory name does not exclude its contents (write templates/**). cache and accept_file must stay inside the project directory.

A note can override the project in its front matter:

---
lang: en-GB                      # sets the target when prosefix.target is absent
prosefix:
  target: uk
  skip: [commas]
---

or opt out with prosefix: off. Only target, style, only and skip are allowed there. Flags beat front matter, which beats the project file; when none of them sets a target, the note's own spelling decides (see Which English).

The tiers are variety, guide, ambiguous, numbers, serial-comma, abbreviations, punctuation (style) and hygiene, mechanical, basics, typos, adjudicated, compounds, commas (proof).

JSON

prosefix --json prints one document, "schema": 1, for editors and plugins. It holds the endpoint, the capabilities skipped and an entry for each file. Each entry has the file's status, settings, input_sha256, a list of changes (id, pass, check, start, end, line, before, after, reason, decided_by, confidence, depends_on), review items and the full output. The settings include target_source, one of flag, front matter, lang, project, detected or default. They include detected word counts when detection ran, and "variety_conversion": false when no clear variety meant the variety spellings were left alone. input_sha256 is the SHA-256 of the input as UTF-8, so a plugin can tell whether the note changed after the run. Change offsets are UTF-16 code units into the whole input file; line is 1-based. A change that lists depends_on supersedes the changes it names. decided_by is rule, model, cache or user; user marks a change made from your answer. A file with "status": "error" has only path, status, reason and settings.

Settled output. prosefix runs again on its own output until a run changes nothing. So output is settled: a run on it reports unchanged, with the same questions and keys. The review items come from that last run. This happens in every mode, so an in-place write gives the same text as output.

Questions. A review item with options is a question. Only a question has these fields:

  • start and end: UTF-16 offsets into output, not into the input, left out when they cannot be placed there;
  • options: the replacements on offer (keeping the text as written is always possible, and never listed);
  • suggestion: the model's pick even when it was too unsure to apply it, or null;
  • message: the question in plain words, such as Keep 'monday', or change it to 'Monday' or 'today'?;
  • confidence and reason: the model's reason, or why no model answered (no model configured or model error);
  • explain: a sentence or two on the rule, for the person answering, when the question has one;
  • key: what --decide takes.

One line per file. prosefix --json-lines writes nothing to the notes either. It prints one line per file, "type": "file" followed by the file's entry, as each file finishes, in any order. Then it prints one "type": "summary" line with schema, prosefix, endpoint and skipped. endpoint is null when no model is used. Otherwise it has url, model, source and error: null, or the run's first model failure, given once rather than in every question. Each line is compact JSON in ASCII. A file that fails, including a path that does not exist, gets a line with "status": "error", and the exit status stays 0. A --report file that cannot be written makes it 2.

Answers. prosefix --decide reads answers as JSON on stdin and stores each in the cache that its note's path uses:

{"decisions":[
  {"path":"/v/essay.md","key":"3b9e0c1d2a4f5e6a7b8c9d0e","choice":"licence",
   "word":"license","options":["licence","license"],"start":118,"end":125},
  {"path":"/v/essay.md","key":"…","choice":"KEEP"},
  {"path":"/v/notes.md","key":"…","choice":{"text":"licensed"}}]}

choice is one of the options, "KEEP" to keep the text as written, or {"text": …} for your own words. It prints {"written": 3, "caches": [...]}. Malformed input prints {"error": "…"}, stores nothing and exits 2. The next run with the cache applies the answers, for example prosefix --json-lines --llm cached /v/essay.md.

One answer can change the sentence of another question in the same note, and so that question's key. word is the text at the question's start:end in output. With word and options, prosefix carries such an answer over: an answer the run did not use moves to the one open question in the same note with the same word and options, and the note runs again, up to three times. An answer gets one chance to move: the next run of its note, normally the cached run right after --decide. An answer also settles any other question on the same place, from either pass: once you choose licence over license, or keep license, prosefix doesn't ask whether that word should be the other one. It answers such a question KEEP. start and end, the question's UTF-16 offsets in output, give the place. Without them, only a question on the word an answer put in, with the same options, is settled.

Known limits: an answer to a proofix compound question applies to every occurrence of that form. An answer whose edit overlaps a stylefix edit loses to it and is dropped without notice. An answer without word and options is not carried over.

Setup. Three commands print one JSON object each, for a plugin's setup screen:

  • prosefix --doctor --json: schema, the prosefix and python versions, each tool (name, found, version, path, adds, fix), the endpoint (found, url, model, source, error), config_file and settings_file (null when there is none). fix is a Homebrew command, with Homebrew's full path when it is found.
  • prosefix --check-endpoint --json [--url URL] [--model NAME]: tests the endpoint and gives ok, url, model, models, model_info, latency_ms and error. model_info lists each model's id and created (Unix seconds, or null) in the server's order. It exits 1 when the test fails.
  • prosefix --setup --url URL [--model NAME] [--thinking-switch] --json: tests the endpoint and, only if the test passes, writes ~/.config/prosefix/config.toml with mode 0600. It gives ok, written, url, model and error, and exits 1 when nothing was written.

--key-stdin reads the API key from the first line of stdin; prosefix never prints it. It works only with --check-endpoint --json and --setup --url … --json, and --thinking-switch only with --setup --url; prosefix refuses them elsewhere, with exit status 2. Without --key-stdin, a --url equal to the configured endpoint's uses its key, timeout and thinking switch, so a change of model keeps them. The configured endpoint is the one a plain run uses: from prosefix's config file, adjudicate's (~/.config/adjudicate/config.toml) or the PROSEFIX_LLM_* and ADJUDICATE_LLM_* variables. --setup writes a key that came from a variable as api_key_env naming it, never as its value. Another URL gets no key. The details are in the man page (man prosefix, or man/prosefix.1 in the source).

License

MIT

Metadata

Release files for prosefix 0.3.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 prosefix 0.3.1
File Size Uploaded Provenance Actions
prosefix-0.3.1.tar.gz 66.5 kB With provenance Details for prosefix-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for prosefix 0.3.1
File Interpreter ABI Platform Actions
prosefix-0.3.1-py3-none-any.whl Python 3 none any Details for prosefix-0.3.1-py3-none-any.whl

Total release size: 102.7 kB

Release files / prosefix-0.3.1.tar.gz

Download URL prosefix-0.3.1.tar.gz
Size 66.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c69db0eeaab223b8dda8e81b5e50188f642dd706c3a47854b289683306f293b9
BLAKE2b-256 checksum
How to use checksums
d3a6c93b329a3e7fb061faa2ae20c862918cc74245b52aad77150eeb633ed47f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / prosefix-0.3.1-py3-none-any.whl

Download URL prosefix-0.3.1-py3-none-any.whl
Size 36.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb90242f53114b89ad146374ab1a946f49f321a82f96902d9455362b9e36b98d
BLAKE2b-256 checksum
How to use checksums
bc945a761cb638928d2a5278f9a3b48dcaa002b286ddb0be7741b2038dfb8dd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Security for prosefix 0.3.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for prosefix-0.3.1.tar.gz

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 Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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