@jpeakai/prose-gates 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Reading markdown should not be hard.
4
4
  Keep AI accountable one anti-slop rule at a time.
5
5
 
6
- **[Rules](RULES.md)** | **[GitHub](https://github.com/jpeakai/jpai-prose-gates)** | **[npm](https://www.npmjs.com/package/@jpeakai/prose-gates)**
6
+ **[Docs](https://jpeakai.github.io/jpai-prose-gates/)** | **[Rules](RULES.md)** | **[GitHub](https://github.com/jpeakai/jpai-prose-gates)** | **[npm](https://www.npmjs.com/package/@jpeakai/prose-gates)**
7
7
 
8
8
  | Package Index | Published Version | Downloads | Node | CI | License |
9
9
  |---|---|---|---|---|---|
@@ -18,22 +18,26 @@ npx -y @jpeakai/prose-gates --fix README.md # apply every fix proven safe, repo
18
18
 
19
19
  Installed as a dev dependency, the command is `prose-gates`, and `--json` gives machine-readable output.
20
20
 
21
- `--max-words N` changes the sentence budget, which defaults to 25.
22
- `--config FILE` reads a config other than the one at the project root.
23
- `--no-plugins` runs the built-in rules only, and `--lenient-plugins` skips a plugin that fails to load and says so.
24
- `--validate-plugins` loads and checks every plugin, reports every failure, and runs no check or fix.
25
- `--list-rules` prints every active rule by category, including plugin rules.
21
+ - `--max-words N` changes the sentence budget, which defaults to 25.
22
+ The paragraph budget of 5 sentences is set by the `maxSentences` option in the config instead.
23
+ - `--config FILE` reads a config other than the one at the project root.
24
+ - `--no-plugins` runs the built-in rules only, and `--lenient-plugins` skips a plugin that fails to load and says so.
25
+ - `--validate-plugins` loads and checks every plugin, reports every failure, and runs no check or fix.
26
+ - `--list-rules` prints every active rule by category, including plugin rules.
27
+
26
28
  Exit codes are 0 for clean, 1 for findings, and 2 for a usage error.
27
29
 
28
30
  ## The rules
29
31
 
30
- Nine rules in three categories.
32
+ The rules are grouped by what they guard, and `--list-rules` prints them.
31
33
  [RULES.md](RULES.md) shows a failing example and the fix for each one.
34
+ [docs/examples/fixes.md](docs/examples/fixes.md) has the longer cases, and [docs/examples/agent-evals.md](docs/examples/agent-evals.md) shows how agents rewrite from a finding.
32
35
  [docs/DATA_MODEL.md](docs/DATA_MODEL.md) diagrams how a rule is checked, fixed and verified.
33
36
 
34
37
  | Category | Rules | What it guards |
35
38
  |---|---|---|
36
39
  | Sentence | sentence-one-per-line, sentence-word-budget-exceeded | How a sentence is laid out and how long it runs |
40
+ | Paragraph | paragraph-sentence-budget-exceeded | How many sentences a paragraph holds before a break |
37
41
  | List | list-semicolon-delimited-run, list-interpunct-joined-run, list-inline-enumeration-markers, list-comma-labelled-run, list-stacked-interpunct-runs | A list hidden in running prose, promoted to a real markdown list |
38
42
  | Punctuation | punctuation-em-dash-in-prose, punctuation-interpunct-in-prose | A glyph that reads as generated text |
39
43
 
@@ -50,9 +54,13 @@ Fences tagged `markdown` or `md` are the exception, since they hold templates wh
50
54
  A project adds its own rules without forking this package.
51
55
  Both sources load on their own, with no config, and every run prints a line saying what it loaded.
52
56
 
53
- - **Local rules.** A `.js`, `.mjs`, `.ts` or `.mts` file in `.prose-gates/rules/` exports one rule, and its id is `local/` followed by the file name. TypeScript needs Bun or Node 22.18 or newer.
57
+ - **Local rules.** A `.js`, `.mjs`, `.ts` or `.mts` file in `.prose-gates/rules/` exports one rule, and its id is `local/` followed by the file name.
58
+ TypeScript needs Bun or Node 22.18 or newer.
54
59
  - **Plugin packages.** A dependency named `prose-gates-plugin-name` or `@scope/prose-gates-plugin-name` loads under the namespace its own `meta.namespace` declares.
55
60
  - **New categories.** A plugin declares a category of its own, such as `frontmatter`, and its rules use it.
61
+ - **The project's own terms.** A `GLOSSARY.md` or `CONCEPTS.md` at the root is read as the project's concepts.
62
+ Each H2 is a term, and its Mermaid diagrams relate them.
63
+ Each sentence lists the concepts it names.
56
64
  - **Same treatment.** A plugin rule is switched off, given options and listed exactly like a built-in, and its fixer is verified like a built-in fixer.
57
65
 
58
66
  A config at the project root switches rules off and sets options.
@@ -81,8 +89,7 @@ bun add --dev @jpeakai/prose-gates
81
89
  ```
82
90
 
83
91
  npm works the same way, with `npm install --save-dev @jpeakai/prose-gates`.
84
- The library exports `checkMarkdown` and `fixMarkdown`, which return promises because a rule may be async.
85
- `@jpeakai/prose-gates/testing` exports the helpers a plugin's tests use.
92
+ The library exports `checkMarkdown` and `fixMarkdown`, which return promises because a rule may be async. `@jpeakai/prose-gates/testing` exports the helpers a plugin's tests use.
86
93
  Bun imports the TypeScript source, and Node imports the bundle in `dist/`.
87
94
 
88
95
  Generated markdown is gated too.