humanizer-lint 0.0.0-stage → 0.2.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 yanstd888
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,529 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ <div align="center">
2
+
3
+ # humanizer-lint
4
+
5
+ ### Deterministic prose and Markdown style linting for Indonesian and English
6
+
7
+ Detect repetitive LLM phrasing, uniform sentence rhythm, structural clichés, and voice-profile drift without sending text to an external service.
8
+
9
+ [![GitHub Release](https://img.shields.io/github/v/release/yanstd888/humanizer-lint?style=flat-square&logo=github)](https://github.com/yanstd888/humanizer-lint/releases)
10
+ [![npm](https://img.shields.io/npm/v/humanizer-lint)](https://www.npmjs.com/package/humanizer-lint)
11
+ [![CI](https://img.shields.io/github/actions/workflow/status/yanstd888/humanizer-lint/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/yanstd888/humanizer-lint/actions/workflows/ci.yml)
12
+ [![License](https://img.shields.io/github/license/yanstd888/humanizer-lint?style=flat-square)](LICENSE)
13
+ [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18.3-339933?style=flat-square&logo=nodedotjs&logoColor=white)](https://nodejs.org/)
14
+ [![skills.sh](https://skills.sh/b/yanstd888/humanizer-lint)](https://skills.sh/yanstd888/humanizer-lint)
15
+ [![GitHub Stars](https://img.shields.io/github/stars/yanstd888/humanizer-lint?style=flat-square)](https://github.com/yanstd888/humanizer-lint/stargazers)
16
+
17
+ [What it does](#what-it-does) | [Install](#install) | [Quick start](#quick-start) | [CLI reference](#cli-reference) | [Detectors](#detectors-and-violation-types) | [Agent skill](#use-as-an-agent-skill) | [FAQ](#frequently-asked-questions)
18
+
19
+ </div>
20
+
21
+ **humanizer-lint is an open-source natural-text and Markdown prose linter that deterministically identifies style patterns often associated with AI-generated writing in Indonesian and English; it is a style validator, not an authorship detector.**
22
+
23
+ Try the static browser demo: [humanizer-lint.pages.dev](https://humanizer-lint.pages.dev).
24
+
25
+ It works locally with zero runtime dependencies. Instead of rewriting text through another language model, it reports paragraph- and sentence-level violations with specific correction instructions. Use it to lint LLM-generated documentation, remove robotic AI phrasing from Markdown, check burstiness and lexical diversity, or add a deterministic prose gate to an agent workflow.
26
+
27
+ It can serve as a CLI text humanizer guardrail, automated writing style linter, or CI/CD documentation linter. The bundled rules flag overused AI clichés such as `delve` and `tapestry` without rewriting the source.
28
+
29
+ ## What it does
30
+
31
+ `humanizer-lint` analyzes prose after removing or neutralizing common non-prose Markdown structures. It then combines lexical rules, sentence-length statistics, structural checks, Indonesian morphology checks, and an optional voice profile into a score from 0 to 100.
32
+
33
+ The project includes:
34
+
35
+ - 86 reviewable lexical and structural regex rules: 42 Indonesian and 44 English.
36
+ - Sentence-length burstiness, adjacent rhythm delta, short/long sentence ratios, and adaptive MATTR.
37
+ - Repetition checks based on paragraph symmetry, repeated sentence starters, and compression ratio.
38
+ - Indonesian nominalization, passive-voice, loanword, and translation-style opening checks.
39
+ - Optional voice profiles generated from one to five writing samples.
40
+ - Human-readable terminal output and pure JSON output.
41
+ - Standard exit codes for agents, scripts, and CI jobs.
42
+
43
+ It does not estimate perplexity, classify who wrote the text, rewrite prose automatically, scan directories, or provide SARIF output.
44
+
45
+ ## Terminal demo
46
+
47
+ Given this input:
48
+
49
+ ```text
50
+ In today's fast-paced world, teams delve into a robust landscape. Moreover, this pivotal approach fosters seamless collaboration across every project. In conclusion, the solution unlocks valuable insights for everyone.
51
+ ```
52
+
53
+ Run the analyzer:
54
+
55
+ ```sh
56
+ humanizer-lint --file draft.md --lang en
57
+ ```
58
+
59
+ The current CLI reports:
60
+
61
+ ```text
62
+ Status: FAIL
63
+ Score: 39
64
+ Language: en
65
+
66
+ Metrics:
67
+ wordCount: 29
68
+ sentenceCount: 3
69
+ meanSentenceLength: 9.6667
70
+ stdDev: 0.4714
71
+ burstinessCV: 0.0488
72
+ adjacentDelta: 0.5
73
+ shortSentenceRatio: 0
74
+ longSentenceRatio: 0
75
+ mattr: 1
76
+ compressionRatio: 0.6972
77
+ nominalizationRatio: 0
78
+ passiveRatio: 0
79
+ voiceProfileDeviation: 0.5319
80
+
81
+ Violations:
82
+ SLOP_PHRASE | Paragraph 1, Sentence 1 | Name the exact action or subject instead.
83
+ SLOP_PHRASE | Paragraph 1, Sentence 2 | Describe the actual consequence without inflated significance.
84
+ SLOP_PHRASE | Paragraph 1, Sentence 2 | Name the concrete behavior or outcome.
85
+ SLOP_PHRASE | Paragraph 1, Sentence 1 | Name the field or conditions directly.
86
+ SLOP_PHRASE | Paragraph 1, Sentence 3 | Name what becomes possible and how.
87
+ SLOP_PHRASE | Paragraph 1, Sentence 2 | Connect the sentences by their actual relationship.
88
+ SLOP_PHRASE | Paragraph 1, Sentence 3 | End on the final concrete point.
89
+ SLOP_PHRASE | Paragraph 1, Sentence 1 | Name the current condition precisely.
90
+ SLOP_PHRASE | Paragraph 1, Sentence 2 | Describe the missing step, delay, or transition precisely.
91
+ SLOP_PHRASE | Paragraph 1, Sentence 1 | Name the failure mode or capacity the system handles.
92
+ SLOP_PHRASE | Paragraph 1, Sentence 3 | State the finding itself.
93
+ MONOTONOUS_RHYTHM | Paragraph 1, Sentences 1-3 | Sentence lengths are uniform (10, 10, 9 words). Split one sentence into a short statement or merge two into a longer clause.
94
+ LOW_BURSTINESS | Whole text | Vary sentence lengths by splitting one uniform sentence and merging another where the meaning supports it.
95
+ LOW_ADJACENT_DELTA | Whole text | Change neighboring sentence lengths by splitting or merging only where the content allows it.
96
+ ```
97
+
98
+ A failed analysis exits with code `1`. A passing fixture returns:
99
+
100
+ ```text
101
+ Status: PASS
102
+ Score: 100
103
+ Language: en
104
+ ```
105
+
106
+ and exits with code `0`.
107
+
108
+ ## Why humanizer-lint
109
+
110
+ Many AI humanizer services send text to another model and return a rewritten version. That can alter facts, quotations, formatting, or technical meaning. `humanizer-lint` takes the smaller and more predictable approach: it identifies the prose that needs attention and leaves the edit under your control.
111
+
112
+ | Capability | humanizer-lint | Web rewriting service | General grammar checker |
113
+ |---|---|---|---|
114
+ | Detects configured LLM clichés | Yes, with rule IDs and locations | Usually rewrites them | Usually not |
115
+ | Measures sentence rhythm | Yes | Usually not exposed | Limited |
116
+ | Preserves source text | Yes, analysis only | No, returns a rewrite | Depends on product |
117
+ | Handles common Markdown structures | Yes, through deterministic sanitization | Product-dependent | Product-dependent |
118
+ | Runs offline after installation | Yes | Usually no | Product-dependent |
119
+ | Supports Indonesian and English lexical rules | Yes | Product-dependent | Product-dependent |
120
+ | Produces JSON | Yes | Product-dependent | Product-dependent |
121
+ | Proves human authorship | No | No | No |
122
+
123
+ If you are looking for an AI writing detector linter, a ChatGPT tone remover CLI, or an open-source alternative to AI humanizers, note the boundary: this tool detects configured style signals and rhythm problems. It does not claim to determine whether a human or model wrote the text.
124
+
125
+ ## Install
126
+
127
+ ### CLI
128
+
129
+ Run the published CLI without a global install:
130
+
131
+ ```sh
132
+ npx humanizer-lint --file tulisan.md --lang id
133
+ ```
134
+
135
+ Or install it globally:
136
+
137
+ ```sh
138
+ npm install -g humanizer-lint
139
+ ```
140
+
141
+ ### Install as an agent skill
142
+
143
+ The recommended installation for coding agents is through the skills CLI:
144
+
145
+ ```sh
146
+ npx skills add yanstd888/humanizer-lint --skill humanizer-lint
147
+ ```
148
+
149
+ The public listing, installation command, and install count are available on [skills.sh](https://skills.sh/yanstd888/humanizer-lint).
150
+
151
+ ### Development (from source)
152
+
153
+ Clone the repository and use `npm link` only when developing the local source:
154
+
155
+ ```sh
156
+ git clone https://github.com/yanstd888/humanizer-lint.git
157
+ cd humanizer-lint
158
+ npm test
159
+ npm link
160
+ humanizer-lint --help
161
+ humanizer-fingerprint --help
162
+ ```
163
+
164
+ No dependency installation or build step is required.
165
+
166
+ ## Quick start
167
+
168
+ Analyze one file:
169
+
170
+ ```sh
171
+ humanizer-lint --file draft.md --lang auto
172
+ ```
173
+
174
+ Return machine-readable JSON:
175
+
176
+ ```sh
177
+ humanizer-lint --file draft.md --lang id --json
178
+ ```
179
+
180
+ Analyze stdin without creating a temporary file:
181
+
182
+ ```sh
183
+ cat draft.md | humanizer-lint --stdin --lang auto --json
184
+ ```
185
+
186
+ Use a custom voice profile:
187
+
188
+ ```sh
189
+ humanizer-lint --file draft.md --lang en --profile profiles/custom-voice.json --json
190
+ ```
191
+
192
+ Without `npm link`, replace `humanizer-lint` with `node scripts/analyze.mjs` and replace `humanizer-fingerprint` with `node scripts/fingerprint.mjs`.
193
+
194
+ ## Contoh / Example
195
+
196
+ Skor mengukur kecocokan dengan sinyal gaya yang diperiksa oleh linter: skor lebih tinggi berarti lebih sedikit pelanggaran yang ditemukan. Ini bukan skor probabilitas penulis AI atau manusia.
197
+
198
+ ### Before
199
+
200
+ ```text
201
+ Di era digital saat ini, penggunaan teknologi menjadi sangat penting bagi setiap bisnis. Tidak hanya itu, solusi ini juga memberikan manfaat yang sangat besar bagi semua pihak. Dengan demikian, organisasi dapat meningkatkan efisiensi secara signifikan dalam berbagai aspek. Pada akhirnya, pendekatan ini membuka peluang baru yang lebih optimal bagi masa depan.
202
+ ```
203
+
204
+ Output dari `tests/fixtures/ai-before-id.md`:
205
+
206
+ ```text
207
+ Status: FAIL
208
+ Score: 38
209
+ Language: id
210
+
211
+ Violations:
212
+ SLOP_PHRASE | Paragraph 1, Sentence 1 | Mulai langsung dari subjek atau fakta konkret.
213
+ SLOP_PHRASE | Paragraph 1, Sentence 3 | Sebutkan aspek yang relevan.
214
+ SLOP_PHRASE | Paragraph 1, Sentence 4 | Tutup langsung dengan akibat atau keputusan akhir.
215
+ MONOTONOUS_RHYTHM | Paragraph 1, Sentences 1-3 | Sentence lengths are uniform (13, 14, 11 words).
216
+ LOW_BURSTINESS | Whole text | Vary sentence lengths by splitting one uniform sentence and merging another where the meaning supports it.
217
+ LOW_ADJACENT_DELTA | Whole text | Change neighboring sentence lengths by splitting or merging only where the content allows it.
218
+ ```
219
+
220
+ ### After
221
+
222
+ ```text
223
+ Pemilik toko memakai aplikasi stok untuk melihat barang yang habis pada hari yang sama. Semua melihat angka yang sama. Saat satu produk menipis, petugas memesan ulang sebelum rak kosong dan mencatat alasan setiap perubahan. Laporan harian menunjukkan barang mana yang laku, barang mana yang tertahan, dan kapan petugas harus menghubungi pemasok lagi agar toko tidak kehabisan barang yang dicari pelanggan. Pemilik toko kini membeli barang berdasarkan catatan, bukan tebakan.
224
+ ```
225
+
226
+ Output dari `tests/fixtures/human-after-id.md`:
227
+
228
+ ```text
229
+ Status: PASS
230
+ Score: 100
231
+ Language: id
232
+ ```
233
+
234
+ Untuk contoh ini, skor naik dari **38** menjadi **100** setelah frasa template dihilangkan, subjek dibuat konkret, dan panjang kalimat divariasikan.
235
+
236
+ ## CLI reference
237
+
238
+ ### Analyzer
239
+
240
+ ```text
241
+ humanizer-lint (--file <path> | --stdin) [--lang id|en|auto] [--profile <path>] [--json]
242
+ ```
243
+
244
+ | Option | Required | Description |
245
+ |---|---:|---|
246
+ | `--file <path>` | One input required | Read one UTF-8 text or Markdown file. |
247
+ | `--stdin` | One input required | Read the complete document from standard input. |
248
+ | `--lang id|en|auto` | No | Select Indonesian, English, or function-word auto-detection. Default: `auto`. |
249
+ | `--profile <path>` | No | Load a JSON voice profile. |
250
+ | `--json` | No | Print JSON only. Without it, print the terminal report. |
251
+ | `--help` | No | Print command usage. |
252
+
253
+ Exactly one of `--file` or `--stdin` is required.
254
+
255
+ ### Voice fingerprint
256
+
257
+ ```text
258
+ humanizer-fingerprint --input <file-or-dir> --output <profile.json> [--name <name>] [--lang id|en|auto]
259
+ ```
260
+
261
+ | Option | Required | Description |
262
+ |---|---:|---|
263
+ | `--input <path>` | Yes | Read one file or up to five `.md` and `.txt` files from one directory. |
264
+ | `--output <path>` | Yes | Write the generated profile atomically. |
265
+ | `--name <name>` | No | Set the profile name. Default: `custom-voice`. |
266
+ | `--lang id|en|auto` | No | Record the intended language. Default: `auto`. |
267
+ | `--help` | No | Print command usage. |
268
+
269
+ ### Exit codes
270
+
271
+ | Code | Meaning |
272
+ |---:|---|
273
+ | `0` | `PASS`, or `SKIP` for text too short for statistical scoring. |
274
+ | `1` | Analysis completed and returned `FAIL`. |
275
+ | `2` | Invalid arguments, unreadable input, or malformed profile. |
276
+
277
+ ## Detectors and violation types
278
+
279
+ The JSON rule catalogs contain stable IDs. Runtime statistical checks use named violation types.
280
+
281
+ | Violation type or rule range | Language | What it detects |
282
+ |---|---|---|
283
+ | `ID001`-`ID040`, `EN001`-`EN040` / `SLOP_PHRASE` | Indonesian and English | Configured clichés, generic transitions, inflated wording, and repeated LLM vocabulary such as `delve`, `tapestry`, `testament`, and their Indonesian equivalents. |
284
+ | `ID041`-`ID042` / `DEFINITIONAL_OPENING` | Indonesian | Formulaic paragraph openings and rigid definition templates. |
285
+ | `EN041`-`EN044` / `STRUCTURAL_CLICHE` | English | Participial tails, binary formulas, repeated double-hyphens, and similar structural templates. |
286
+ | `MONOTONOUS_RHYTHM` | Both | Three adjacent sentences whose lengths differ by at most three words. |
287
+ | `LOW_BURSTINESS` | Both | Sentence-length coefficient of variation below the configured threshold. |
288
+ | `MISSING_SENTENCE_RANGE` | Both | Text with at least eight sentences that lacks enough short or long sentences. |
289
+ | `LOW_ADJACENT_DELTA` | Both | Consecutive sentence lengths that change too little. |
290
+ | `LOW_LEXICAL_DIVERSITY` | Both | Adaptive MATTR below the language threshold. |
291
+ | `LOW_ENTROPY_REPETITION` | Both | Low DEFLATE compression ratio in text of at least 150 words. |
292
+ | `SYMMETRIC_PARAGRAPHS` | Both | Three consecutive paragraphs with the same sentence count. |
293
+ | `REPETITIVE_STARTERS` | Both | A paragraph with at least three sentences beginning with the same token. |
294
+ | `EXCESSIVE_NOMINALIZATION` | Indonesian | Nominalization density above the configured threshold after whitelist filtering. |
295
+ | `PASSIVE_BLOATING` | Indonesian | Passive morphology density or consecutive translation-style subordinate openings. |
296
+ | `VOICE_PROFILE_DEVIATION` | Both | Custom-profile mean sentence length that differs from the target by more than 30 percent. |
297
+
298
+ ## Metrics and scoring
299
+
300
+ | Metric | Definition |
301
+ |---|---|
302
+ | `burstinessCV` | Population standard deviation divided by mean sentence length. |
303
+ | `adjacentDelta` | Mean absolute difference between neighboring sentence lengths. |
304
+ | `mattr` | Moving-average type-token ratio over an adaptive 10- to 50-token window. |
305
+ | `compressionRatio` | Raw DEFLATE byte length divided by original UTF-8 byte length. |
306
+ | `shortSentenceRatio` | Share of sentences containing six words or fewer. |
307
+ | `longSentenceRatio` | Share of sentences containing 26 words or more. |
308
+ | `voiceProfileDeviation` | Mean relative deviation from available profile targets. It is not an authorship probability. |
309
+
310
+ The score starts at 100 and applies these caps:
311
+
312
+ | Category | Maximum deduction |
313
+ |---|---:|
314
+ | Burstiness and sentence-range checks | 25 |
315
+ | Monotonous rhythm windows | 20 |
316
+ | Lexical and structural clichés | 30 |
317
+ | Indonesian morphology | 15 |
318
+ | Vocabulary, entropy, and custom-profile deviation combined | 10 |
319
+
320
+ A normal-length document passes only when the score is at least 80, no `SLOP_PHRASE` or `DEFINITIONAL_OPENING` remains, burstiness and adjacent-delta gates pass, and the sentence-range requirement passes when applicable.
321
+
322
+ Documents below 20 words or three sentences return `SKIP`. Lexical slop phrases are still reported.
323
+
324
+ ## Markdown sanitization
325
+
326
+ Before tokenization, the analyzer:
327
+
328
+ - removes YAML frontmatter, fenced code blocks, headings, and Markdown tables;
329
+ - keeps Markdown link anchor text while removing the URL;
330
+ - replaces inline code and bare URLs with `TOKEN_ENTITY`;
331
+ - removes short or unfinished list fragments while keeping complete list prose;
332
+ - removes blockquote markers while preserving the quoted prose;
333
+ - preserves paragraph boundaries for locations and structural checks.
334
+
335
+ This is deterministic sanitization, not a full Markdown or MDX abstract syntax tree parser. HTML blocks and arbitrary MDX components do not receive special parsing.
336
+
337
+ ## Voice profiles
338
+
339
+ Generate a profile from one to five samples:
340
+
341
+ ```sh
342
+ humanizer-fingerprint \
343
+ --input writing-samples \
344
+ --output profiles/custom-voice.json \
345
+ --name editorial-voice \
346
+ --lang en
347
+ ```
348
+
349
+ The profile records mean sentence length, standard deviation, burstiness, adjacent delta, MATTR, average paragraph sentence count, and punctuation rates. Supplying it with `--profile` adds `voiceProfileDeviation`; a mean sentence-length drift above 30 percent creates a five-point profile penalty inside the 10-point vocabulary and entropy cap.
350
+
351
+ ## JSON output
352
+
353
+ `--json` writes a single JSON object to stdout. The stable top-level fields are:
354
+
355
+ ```json
356
+ {
357
+ "status": "FAIL",
358
+ "score": 39,
359
+ "language": "en",
360
+ "metrics": {
361
+ "wordCount": 29,
362
+ "sentenceCount": 3,
363
+ "burstinessCV": 0.0488,
364
+ "adjacentDelta": 0.5,
365
+ "mattr": 1
366
+ },
367
+ "violations": [
368
+ {
369
+ "type": "LOW_BURSTINESS",
370
+ "location": "Whole text",
371
+ "actual": 0.0488,
372
+ "target": 0.4,
373
+ "fixInstruction": "Vary sentence lengths by splitting one uniform sentence and merging another where the meaning supports it."
374
+ }
375
+ ]
376
+ }
377
+ ```
378
+
379
+ The real result may contain additional metric properties and violations.
380
+
381
+ ## Use as an agent skill
382
+
383
+ After installation, an agent can use the skill as a closed verification loop:
384
+
385
+ 1. Draft or edit Indonesian or English prose without changing supported facts.
386
+ 2. Run the analyzer against the exact complete draft.
387
+ 3. Read every violation and edit only the affected prose or named whole-document gate.
388
+ 4. Re-run the analyzer, stopping after three iterations.
389
+ 5. Return only a `PASS`, or an honestly labeled short-text `SKIP` with no unresolved lexical violations.
390
+
391
+ The skill is indexed on skills.sh and its current listing passes the platform's Snyk security audit.
392
+
393
+ ## Used by
394
+
395
+ The skills.sh badge at the top of this README is the public source for anonymous installation activity. GitHub's native `Used by` sidebar is generated automatically from its dependency graph; repository owners cannot set that count manually.
396
+
397
+ Because the CLI is not published to npm, skill installations are represented by skills.sh rather than GitHub package dependents. The GitHub panel will appear when downstream repositories declare a dependency that GitHub can detect.
398
+
399
+ ## CI and repository automation
400
+
401
+ This repository keeps `.github` intentionally small. The included `.github/workflows/ci.yml` workflow runs the test suite and package dry-run on supported Node.js versions. A CI badge is useful because it reflects an actual workflow; issue templates, Dependabot, and release automation are omitted until the repository needs them.
402
+
403
+ To use the analyzer in another GitHub Actions workflow without an npm release, check out this repository into a subdirectory and run the script directly:
404
+
405
+ ```yaml
406
+ name: prose-check
407
+
408
+ on:
409
+ pull_request:
410
+ paths:
411
+ - "**/*.md"
412
+ - "**/*.txt"
413
+
414
+ jobs:
415
+ lint-readme:
416
+ runs-on: ubuntu-latest
417
+ steps:
418
+ - uses: actions/checkout@v4
419
+ - uses: actions/checkout@v4
420
+ with:
421
+ repository: yanstd888/humanizer-lint
422
+ path: .humanizer-lint
423
+ - uses: actions/setup-node@v4
424
+ with:
425
+ node-version: "22"
426
+ - run: node .humanizer-lint/scripts/analyze.mjs --file README.md --lang auto --json
427
+ ```
428
+
429
+ The analyzer accepts one file per invocation. Invoke it once for each document you want to gate.
430
+
431
+ ## Security properties
432
+
433
+ Production scripts use only Node.js built-ins and have no runtime dependencies. The test suite rejects production use of `child_process`, `eval`, dynamic `Function` construction, and `fetch`. The fingerprint writer writes to a temporary file and renames it into place.
434
+
435
+ Text remains local unless the surrounding agent or workflow sends it elsewhere.
436
+
437
+ ## Frequently asked questions
438
+
439
+ <details>
440
+ <summary><strong>Is humanizer-lint an AI content detector?</strong></summary>
441
+
442
+ No. It detects configured lexical, structural, rhythm, and morphology signals. A pass or failure does not prove who wrote the text.
443
+
444
+ </details>
445
+
446
+ <details>
447
+ <summary><strong>Does humanizer-lint rewrite or auto-fix prose?</strong></summary>
448
+
449
+ No. It returns correction instructions but does not modify the source file. This prevents silent factual or formatting changes.
450
+
451
+ </details>
452
+
453
+ <details>
454
+ <summary><strong>Can it remove robotic AI phrasing from Markdown?</strong></summary>
455
+
456
+ It can identify the exact paragraph or sentence that matches a configured phrase or style gate. A human or coding agent then makes the smallest supported edit and runs the analyzer again.
457
+
458
+ </details>
459
+
460
+ <details>
461
+ <summary><strong>Can I install it from npm?</strong></summary>
462
+
463
+ Not currently. Install the agent skill with `npx skills add yanstd888/humanizer-lint --skill humanizer-lint`, or clone the repository and use `npm link` for the local CLI binaries.
464
+
465
+ </details>
466
+
467
+ <details>
468
+ <summary><strong>Which languages are supported?</strong></summary>
469
+
470
+ The configured lexical and language-detection paths support Indonesian and English. Do not treat the current statistical thresholds as validated defaults for other languages.
471
+
472
+ </details>
473
+
474
+ <details>
475
+ <summary><strong>Does it send text to an API?</strong></summary>
476
+
477
+ No. Production code has no network call. The skills installer and Git operations need network access only to download the repository.
478
+
479
+ </details>
480
+
481
+ <details>
482
+ <summary><strong>Why did a short document return SKIP?</strong></summary>
483
+
484
+ Documents below 20 words or three sentences do not contain enough material for the configured statistical gates. Lexical slop phrases are still checked.
485
+
486
+ </details>
487
+
488
+ ## Contributing
489
+
490
+ Contributions should remain deterministic, zero-dependency, and covered by a focused regression test.
491
+
492
+ 1. Fork the repository.
493
+ 2. Create a focused branch.
494
+ 3. Add or update one minimal test for non-trivial behavior.
495
+ 4. Run `npm test` and `npm pack --dry-run`.
496
+ 5. Open a pull request that explains the user-visible effect.
497
+
498
+ Every repository change updates the package and skill version, then publishes a matching Git tag and GitHub release after verification.
499
+
500
+ ## Project layout
501
+
502
+ ```text
503
+ .github/
504
+ workflows/
505
+ ci.yml
506
+ LICENSE
507
+ README.md
508
+ SKILL.md
509
+ package.json
510
+ profiles/
511
+ default-human.json
512
+ rules/
513
+ en-slop.json
514
+ id-slop.json
515
+ scripts/
516
+ analyze.mjs
517
+ fingerprint.mjs
518
+ utils/
519
+ metrics.mjs
520
+ sanitizer.mjs
521
+ tokenizer.mjs
522
+ tests/
523
+ fixtures/
524
+ test-runner.mjs
525
+ ```
526
+
527
+ ## License
528
+
529
+ Licensed under the [MIT License](LICENSE).
package/SKILL.md ADDED
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: humanizer-lint
3
+ description: Closed-loop stylometric linter and anti-AI-slop validator for Indonesian and English prose. Use when writing, editing, humanizing, or auditing articles, essays, documentation, and copy.
4
+ license: MIT
5
+ compatibility: Node.js >= 18.3.0 (zero external dependencies)
6
+ allowed-tools: Bash(node:*) Read Write
7
+ metadata:
8
+ version: "0.2.4"
9
+ author: "yanstd888"
10
+ domain: "writing"
11
+ ---
12
+
13
+ # Humanizer Lint
14
+
15
+ Use this skill when writing or revising Indonesian or English prose that must avoid uniform agent rhythm, repeated stock phrases, and excessive translation-style structure. The local analyzer is mandatory. It uses only Node.js built-ins and sends no text over the network.
16
+
17
+ ## When to use
18
+
19
+ - Humanize an agent-generated draft in Indonesian or English.
20
+ - Check prose for uniform sentence rhythm and repeated lexical templates.
21
+ - Match a user voice profile generated from writing samples.
22
+ - Verify edited prose before returning it.
23
+
24
+ Do not use it to alter code, commands, structured data, quotations, legal language, or factual identifiers. The sanitizer excludes common Markdown structures, but the agent must still preserve meaning and supported facts.
25
+
26
+ ## Prerequisites
27
+
28
+ - Node.js 18.3 or newer.
29
+ - Resolve this skill's installed directory as `<skill_dir>` at runtime.
30
+ - Optional custom profile: `<skill_dir>/profiles/custom-voice.json`.
31
+
32
+ ## Closed-loop protocol
33
+
34
+ ### 1. Resolve context
35
+
36
+ 1. Resolve `<skill_dir>` from this `SKILL.md`; never assume the current working directory.
37
+ 2. Determine `id`, `en`, or `auto` from the requested output.
38
+ 3. If `<skill_dir>/profiles/custom-voice.json` exists, pass it with `--profile`. Otherwise use the bundled default profile.
39
+ 4. Keep source facts, names, numbers, dates, quotations, citations, and technical terms unchanged unless the user explicitly requests a factual edit.
40
+
41
+ Completion criterion: language, analyzer path, and optional profile path are known before drafting.
42
+
43
+ ### 2. Draft with asymmetric rhythm
44
+
45
+ Write the first draft with concrete subjects and verbs. Mix short 2 to 6 word sentences with longer 26 to 38 word sentences where the meaning supports them. Avoid generic introductions and summary paragraphs that merely repeat earlier content.
46
+
47
+ Do not distort meaning to hit a metric. Sentence-length variation must come from legitimate splitting, merging, or reordering of supported material.
48
+
49
+ Completion criterion: the draft preserves every source claim and contains no invented detail.
50
+
51
+ ### 3. Run deterministic verification
52
+
53
+ Prefer stdin so the target repository remains clean:
54
+
55
+ ```sh
56
+ node <skill_dir>/scripts/analyze.mjs --stdin --lang auto --json
57
+ ```
58
+
59
+ Pipe the complete draft to stdin. With a custom profile:
60
+
61
+ ```sh
62
+ node <skill_dir>/scripts/analyze.mjs --stdin --lang auto --profile <skill_dir>/profiles/custom-voice.json --json
63
+ ```
64
+
65
+ Never skip this command. Read `status`, `score`, `metrics`, and every item in `violations`.
66
+
67
+ Completion criterion: a parseable JSON report exists for the exact draft being considered.
68
+
69
+ ### 4. Correct only flagged prose
70
+
71
+ If `status` is `FAIL`:
72
+
73
+ 1. Group overlapping violations by paragraph. Whole-text statistical diagnostics (`LOW_BURSTINESS`, `MISSING_SENTENCE_RANGE`, `LOW_ADJACENT_DELTA`, and `LOW_LEXICAL_DIVERSITY`) identify the global gate when no single sentence is solely responsible.
74
+ 2. Edit only the cited sentences or paragraphs, or make the smallest whole-text rhythm correction named by a statistical diagnostic.
75
+ 3. Follow each `fixInstruction` without adding or dropping facts.
76
+ 4. Run the analyzer again on the complete revised draft.
77
+ 5. Stop after three analyzer iterations.
78
+
79
+ If `status` is `SKIP`, statistical stylometry is unavailable. Fix any lexical violations that are still reported, preserve the short form, and state that the statistical gate was skipped because the text is too short.
80
+
81
+ If the third iteration still returns `FAIL`, do not present the draft as verified. Return the remaining diagnostics and ask whether the user wants a broader rewrite.
82
+
83
+ Completion criterion: return prose only after `PASS`, or an explicitly labeled short-text `SKIP` with no unresolved lexical violations.
84
+
85
+ ## Analyzer commands
86
+
87
+ ```sh
88
+ node <skill_dir>/scripts/analyze.mjs --file draft.md --lang id --json
89
+ node <skill_dir>/scripts/analyze.mjs --file draft.md --lang en
90
+ node <skill_dir>/scripts/analyze.mjs --stdin --lang auto --json
91
+ node <skill_dir>/scripts/fingerprint.mjs --input samples --output <skill_dir>/profiles/custom-voice.json
92
+ ```
93
+
94
+ Exit codes:
95
+
96
+ - `0`: `PASS` or `SKIP`.
97
+ - `1`: analyzed successfully and returned `FAIL`.
98
+ - `2`: invalid arguments, unreadable input, or malformed profile.
99
+
100
+ ## Pitfalls
101
+
102
+ - A high score does not prove human authorship. It proves only that the configured checks passed.
103
+ - Very short text cannot support statistical stylometry.
104
+ - Technical, legal, and intentionally repetitive prose may require a custom profile.
105
+ - Do not rewrite unflagged paragraphs merely to increase the score.
106
+ - Do not treat `voiceProfileDeviation` as an authorship probability; it is a relative distance from the selected profile.
107
+
108
+ ## Verification
109
+
110
+ Before returning revised prose:
111
+
112
+ - [ ] Analyzer ran against the final exact text.
113
+ - [ ] Final status is `PASS`, or an honest lexical-clean `SKIP` for short text.
114
+ - [ ] No source fact, identifier, number, quotation, or citation changed unintentionally.
115
+ - [ ] Only flagged prose was revised after the first analyzer pass.
116
+ - [ ] No network service or external package was used.