Commit 217cabe2 by PLN (Algolia)

buvard: l'anti-slop qui tache

Standalone prose-slop linter extracted from the www multi-score suite:
catalog v2 as data (weighted patterns, five-source provenance), a CLI
over any markdown tree (scores, grouped hits, JSON), punctuation
budgets, node:test suite, the clustering study, and a SKILL.md so
agents can load the catalog as a skill. GPL-3.0.
parents
This diff is collapsed. Click to expand it.
# buvard
**L'anti-slop qui tache.** Blotting paper for AI-flavored prose: a weighted,
multi-score linter for French and English slop patterns. It absorbs what
baves — the empty openers, the inflated adjectives, the "Ce n'est pas X,
c'est Y" pivots, the tirets cadratins by the dozen.
One catalog, clustered from five anti-slop sources (two French skills, two
bilingual frameworks, one EN framework), scored by a ratified barème, and
tested. Zero config, by design — like black, the formatting is the tool's;
the words stay the author's.
```bash
git clone https://git.nech.pl/pln/buvard.git && cd buvard
sudo ln -sf "$PWD/bin/buvard.js" /usr/local/bin/buvard
buvard check posts/ # scores + grouped hits, per file
buvard check article.md --json # machine-readable, for pipelines
```
## The barème
Score starts at 100. A lexique hit costs 5, a structure hit 8, servility or
meta-commentary 10. Punctuation runs on budgets: one tiret cadratin per 500
words, one `!` per 1000 — each excess occurrence costs 5.
- **100–90** — publish.
- **80–95** — real hits only; fix what reads wrong.
- **<80** — rewrite pass, then re-run. The score is a smoke alarm, not a grade.
Every hit is a review candidate, not a verdict. Never touch: the author's
ideas, data, deliberate jargon, quoted speech, or the voice.
## Scope and honesty
buvard is a **style linter**, not an AI detector. It finds statistically
over-represented patterns; it cannot and does not claim to detect machine
authorship. Its catalog is deliberately regex-shaped (high precision, low
recall): règle de trois, synonyme acrobatique and sentence-length monotony
stay manual checks. docs/research.md holds the clustering study;
docs/research-litreview.md (in progress) holds the literature review and
the falsifiable recommendations that will become catalog v3.
## Skill
`SKILL.md` ships the catalog as an agent skill: load it, run the linter,
apply the findings by hand. The remedies are content, not code.
## License
GPL-3.0-only — see [LICENSE](LICENSE). The name: a buvard is blotting paper;
it exists because l'encre bave.
---
name: buvard
description: Use when writing, editing or reviewing French or English prose that must not read as AI-generated — blog posts, docs, newsletters, READMEs — or before publishing any text an agent drafted. Runs the buvard linter and applies its catalog by hand.
---
# buvard — l'anti-slop qui tache
Blotting paper for AI-flavored prose. A weighted catalog of slop patterns
clustered from five anti-slop sources, plus punctuation budgets
(1 tiret cadratin per 500 words, 1 `!` per 1000).
## Run it
```bash
buvard check <files|dirs> # scores + grouped hits
buvard check . --json # machine-readable
```
## Apply the findings
1. Every hit is a **review candidate**, not a verdict. Read the sentence.
2. The remedy is always **content, not code**: cut the opener, name the
actor, say the second half directly, replace the adjective with the fact
that justifies it. Repetition of the right word beats an elegant synonym.
3. Never touch: the author's ideas, data, deliberate technical jargon,
quoted speech, or the voice. Two `!` in a joyful 137-word post is not slop.
4. Known regex gaps, check by eye: règle de trois, synonyme acrobatique,
sentence-length monotony, parataxis chains.
## Score interpretation
- 100–90: publish.
- 80–95: real hits only; fix what reads wrong.
- <80: rewrite pass, then re-run. Score is a smoke alarm, not a grade.
#!/usr/bin/env node
/**
* buvard — l'anti-slop qui tache. Blotting paper for AI-flavored prose.
*
* buvard check <files|dirs> [--json] run the catalog over markdown/text
* buvard score <file> single-file score, machine-readable
*
* Scoring starts at 100; each hit costs its weight (lexique 5, structure 8,
* servile 10; punctuation charges per occurrence past the budget: one tiret
* cadratin per 500 words, one exclamation per 1000). Every hit is a review
* candidate, not a verdict — the author's voice always wins.
*
* Known gaps, deliberately manual: règle de trois, synonyme acrobatique and
* sentence-length variance need document-level analysis that regex fakes
* badly. Read the text too.
*/
import fs from 'fs';
import path from 'path';
import { CATALOG, CATALOG_VERSION, BUDGETS } from '../lib/catalog.mjs';
const TEXT_EXT = /\.(md|txt|mdx)$/i;
function collect(target, files) {
if (TEXT_EXT.test(target) && fs.existsSync(target)) return files.push(path.resolve(target));
if (fs.existsSync(target) && fs.statSync(target).isDirectory()) {
for (const f of fs.readdirSync(target)) {
const p = path.join(target, f);
if (fs.statSync(p).isDirectory()) collect(p, files);
else if (TEXT_EXT.test(f)) files.push(path.resolve(p));
}
return;
}
console.error(`buvard: no file or directory for "${target}"`);
}
/** Body = everything after the frontmatter fence (frontmatter is data, not prose). */
export function bodyOf(text) {
const parts = text.split('---');
return parts.length >= 3 && text.startsWith('---') ? parts.slice(2).join('---').trim() : text.trim();
}
export function lint(text) {
const words = text.split(/\s+/).filter(Boolean).length;
const hits = [];
let score = 100;
for (const [id, w, , , re] of CATALOG) {
for (const m of text.matchAll(re)) {
hits.push({ id, w, at: excerpt(text, m.index) });
score -= w;
}
}
for (const { re, perWords, floor, id, weight } of BUDGETS) {
const budget = Math.max(floor, Math.floor(words / perWords));
const n = (text.match(re) || []).length;
for (let i = budget; i < n; i++) {
hits.push({ id: `budget ${id} (>${budget}/${words} mots)`, w: weight, at: `occurrence ${i + 1}` });
score -= weight;
}
}
return { words, hits, score: Math.max(0, score) };
}
function excerpt(text, index) {
return '…' + text.slice(Math.max(0, index - 38), index + 52).replace(/\s+/g, ' ') + '…';
}
function main(argv) {
const json = argv.includes('--json');
const targets = argv.filter((a) => !a.startsWith('--'));
const files = [];
if (targets.length > 0) targets.forEach((t) => collect(t, files));
else collect('.', files);
const results = files.map((file) => ({ file, ...lint(bodyOf(fs.readFileSync(file, 'utf8'))) }));
if (json) {
console.log(JSON.stringify({ buvard: CATALOG_VERSION, results }, null, 1));
return 0;
}
for (const r of results) {
const grouped = {};
for (const h of r.hits) (grouped[h.id] ??= []).push(h);
console.log(`\n== ${path.relative(process.cwd(), r.file)} — ${r.score}/100 (${r.words} mots)`);
for (const [id, list] of Object.entries(grouped)) {
console.log(` [${id}] ×${list.length} (-${list[0].w} chacun)`);
for (const h of list.slice(0, 4)) console.log(` ${h.at}`);
}
}
console.log(`\n---- buvard v${CATALOG_VERSION} ----`);
for (const r of results) console.log(`${String(r.score).padStart(3)}/100 ${path.relative(process.cwd(), r.file)}`);
const worst = results.filter((r) => r.hits.length > 0).sort((a, b) => a.score - b.score)[0];
if (worst) console.log(`priorité: ${path.relative(process.cwd(), worst.file)} (${worst.score}/100)`);
return 0;
}
if (process.argv[1] && path.resolve(process.argv[1]) === path.resolve(import.meta.url.replace('file://', ''))) {
process.exit(main(process.argv.slice(2)));
}
# Recherche anti-slop — cinq sources, une suite multiscore
*2026-11-07. Contexte : l'axe slop de la suite prose (`yarn slop`, `scripts/slop.mjs`)
est dérivé de ce document. L'axe grammaire reste `yarn prose` (LanguageTool).*
## Les sources
| # | Source | Nature | Ce qu'elle apporte d'unique |
|---|---|---|---|
| fr1 | [JulienSnsnCode/anti-slop-fr](https://github.com/JulienSnsnCode/anti-slop-fr) | skill FR, lexique 13 catégories + structures | le lexique FR le plus fin (kitsch narratif, faux poids, anti-copule) ; notation 5 dimensions /50 |
| fr2 | [captain-marketing/anti-slop-fr](https://github.com/captain-marketing/anti-slop-fr) | skill FR, blacklist + `identity/VOICE.md` | le concept de **voix d'auteur** : les interdits génériques ne suffisent pas, il faut un profil de voix par auteur |
| étape | [letape-dapres.fr writing-unslop](https://letape-dapres.fr/ressources/skills/writing-unslop) | skill bilingue FR+EN | listes « hard replacements » FR et EN ; scoring chiffré base 100 (-5/-8/-10) |
| no-slop | [creatoreconomy.so, skill 20 patterns](https://creatoreconomy.so/p/use-my-no-ai-slop-skill-to-remove-20-ai-slop-patterns) | skill EN | la taxonomie la plus courte ; contrastes binaires, reveals au colon, fins faux-profondes |
| ui-sk | [ui-skills.com anti-ai-slop-writing](https://www.ui-skills.com/skills/jalaalrd/anti-ai-slop-writing) | framework EN | les seuls **budgets de ponctuation quantifiés** (1 tiret cadratin / 500 mots, 1 ! / 1000) ; parataxe, hedging seesaw |
Écosystème (flaviocopes [anti-slop](https://flaviocopes.com/anti-slop/)) : les skills
concurrents s'appellent `unslop`, `stop-slop` (hardikpandya, MIT — l'ancêtre cité par fr1),
`humanizer`, `deslop`. Le nôtre n'en remplace aucun : il les **compresse en linter exécutable**
pour ce repo, là où ils sont des prompts de réécriture.
## Le clustering — ce que les cinq disent ensemble
Vote = nombre de sources qui portent la règle.
| Cluster | Vote | Forme canonique |
|---|---|---|
| Tiret cadratin | **5/5** | jamais comme séparateur de proposition ; la phrase se coupe ou se colle |
| Adjectifs gonflés | 5/5 | révolutionnaire, incontournable, robuste, seamless… le fait ou rien |
| Règle de trois | 5/5 | deux éléments, ou un seul bien choisi |
| Contraste binaire (« pas X, c'est Y ») | 5/5 | dire Y directement |
| Adverbes de remplissage | 4/5 | vraiment, littéralement, fondamentalement → supprimer |
| Ouvertures à vide | 4/5 | « Soyons honnêtes », « Dans un monde où » → commencer par le fond |
| Anti-copule (constitue, serves as) | 4/5 | « est » presque toujours meilleur |
| Attribution vague | 4/5 | nommer la source ou assumer |
| Conclusions-bilans | 4/5 | finir sur un fait, pas un résumé |
| Méta-commentaire / annonce de plan | 4/5 | le texte ne se raconte pas |
| Fragments dramatiques | 3/5 | « Un mot. Un seul. » → phrase complète |
| Question-réponse (« Le problème ? ») | 3/5 | phrase affirmative |
| Faux poids (tournant, game-changer) | 3/5 | le chiffre ou l'exemple |
| Servilité / artefacts collaboratifs | 3/5 | « N'hésitez pas à », « I hope this helps » → couper |
## Ce que chaque source apporte en propre
- **fr1** : kitsch narratif (« un silence vibrant ») ; synonyme acrobatique (répéter le
mot juste) ; la vérification « un adverbe en -ment ? ».
- **fr2** : `VOICE.md` — la liste noire générique ne fait pas la voix ; les interdits
personnels et les expressions signature vivent à part. *À porter plus tard : un
`voice.md` par section du site.*
- **étape** : les listes FR/EN prêtes pour regex ; le barème chiffré.
- **no-slop** : reveals au colon (« The best part: ») ; fins faux-profondes.
- **ui-sk** : budgets quantifiés (adoptés tels quels dans le linter) ; parataxe ;
« hedging seesaw » (prendre position).
- **flaviocopes** : le slop de *code* (try/catch sur chemins sûrs, abstractions à un
appelant, casts `any`) — hors périmètre prose, à garder pour une revue code.
## Le barème retenu (`scripts/slop.mjs`)
Base 100. Lexique -5, structure -8, servilité/méta -10 ; ponctuation : -5 par
occurrence au-delà du budget (1 tiret / 500 mots, 1 `!` / 1000 mots). Le catalogue
est volontairement **haute précision** : chaque hit est un candidat relecture, pas un
verdict. Le code compte les mots hors frontmatter.
**Gaps assumés, à relire à l'œil** : règle de trois, synonyme acrobatique, variance de
longueur de phrases, parataxe — l'analyse est document-niveaux, le regex la simule mal.
**Ce que le linter ne touche jamais** (unanime des sources) : les idées, les données,
le jargon technique assumé, et la voix de l'auteur. Un « ! » dans un post joyeux de
137 mots n'est pas du slop.
/**
* buvard catalog v2 — the slop patterns, as data.
*
* Every entry: [id, weight, sources, languages, regex]. Weights follow the
* barème ratified in docs/research.md (lexique 5, structure 8, servile 10);
* punctuation budgets live in the CLI, not here (they are per-document
* arithmetic, not patterns).
*
* Sources: fr1 = JulienSnsnCode/anti-slop-fr, fr2 = captain-marketing/
* anti-slop-fr, étape = letape-dapres.fr writing-unslop, no-slop = the
* creatoreconomy 20-pattern skill, ui-sk = ui-skills.com anti-ai-slop-writing.
* See docs/research.md for the clustering and the vote table.
*
* High-precision by design: every hit is a review candidate, not a verdict.
* The author's voice always wins — the sources agree on this unanimously.
*/
export const CATALOG_VERSION = 2;
export const CATALOG = [
// --- ouvertures à vide (fr1 §1, étape FR)
['ouverture-vide', 5, 'fr1 fr2 étape', 'fr',
/\b(soyons honn[êe]tes|soyons clairs|on ne va pas se mentir|la v[ée]rit[ée],? c'est que|parlons peu,? parlons bien|il faut le dire|spoiler\s*:|petit rappel\s*:|petite pr[ée]cision\s*:|autant vous le dire tout de suite)\b/gi],
// --- décors grandioses (fr1 §2, étape FR)
['décor grandiose', 5, 'fr1 étape', 'fr',
/\b(dans un monde (trépidant|en constante évolution|[a-zéèà-ÿ]+)|[àa] l'[èe]re de|[àa] l'heure [oùo]|dans le paysage (du|de la|des)|au c[œo]ur de|au coeur de|aujourd'hui plus que jamais|face aux défis de|dans un contexte o[ùu]|dans un monde o[ùu])\b/gi],
// --- impératifs impersonnels (fr1 §5, étape FR)
['impératif impersonnel', 5, 'fr1 fr2 étape', 'fr',
/\bil est (essentiel|important|crucial|imp[ée]ratif|int[ée]ressant) de\b|\bil convient de (noter|souligner|rappeler|pr[ée]ciser)\b|\bforce est de constater\b|\bil va sans dire\b|\bil appert que\b/gi],
// --- anti-copule (fr1 §6, étape EN "copula avoidance", flaviocopes)
['anti-copule', 5, 'fr1 étape flaviocopes', 'fr',
/\b(constitue|repr[ée]sente|s'impose comme|se positionne comme|incarne|se r[ée]v[èe]le [êe]tre|t[ée]moigne de|s'inscrit dans|se veut [a-zéèà-ÿ]+|se traduit par)\b/gi],
// --- connecteurs en chaîne (fr1 §7, étape FR)
['connecteur en début', 5, 'fr1 étape', 'fr',
/^(de plus|en outre|par ailleurs|en effet|ainsi|de ce fait|dès lors|néanmoins|cependant|toutefois|qui plus est|de surcroît|dans cette optique|à cet égard)\b *[,:]?/gim],
// --- conclusions-bilans (fr1 §8, étape, no-slop)
['conclusion-bilan', 5, 'fr1 étape no-slop', 'fr',
/\b(en conclusion|en résumé|en somme|en définitive|au final|pour conclure|en bref|vous l'aurez compris|voilà pour (cet|cette)|l'avenir nous le dira|seul le temps nous dira|the future isn'?t coming)\b/gi],
// --- attribution vague (fr1 §10, étape, no-slop)
['attribution vague', 8, 'fr1 étape no-slop', 'fr en',
/\b(les experts s'accordent|de nombreuses études montrent|on observe que|on constate que|il est reconnu que|il est admis que|d'aucuns|selon certains|experts (agree|argue|say)|studies show)\b/gi],
// --- faux poids (fr1 §11, étape "significance inflation")
['faux poids', 8, 'fr1 étape no-slop', 'fr en',
/\b(marque un tournant|moment charnière|change la donne|game-?chang(er|ing)|le potentiel est immense|les enjeux (sont )?(considérables|énormes)|un tournant décisif|plus que jamais|stands as|is a testament to|marks a pivotal|pivotal moment)\b/gi],
// --- servilité et méta-commentaire (fr1 §12, étape "sycophancy")
['servilité/méta', 10, 'fr1 fr2 étape no-slop', 'fr en',
/\b(excellente question|n'hésitez pas [àa]|n'hésitez plus|plot twist|cerise sur le gâteau|dans cet article,? nous (allons|allions)|au programme\s*:|installez-?vous confortablement|c'est parti !|que vous soyez (débutant|[a-zéèà-ÿ]+) ou|i hope this (helps|this helps)|as an? (ai|assistant|language model)\b)/gi],
// --- adjectifs gonflés (fr1 §4, fr2 hyperboles, étape EN, flaviocopes)
['adjectif gonflé', 5, 'fr1 fr2 étape flaviocopes', 'fr en',
/\b(incontournable|r[ée]volutionnaire|disruptif|innovant|captivant|fascinant|redoutable|holistique|granulaire|sublimer|débloquer le potentiel|cutting-edge|groundbreaking|revolutioniz\w+|seamless\w*|robuste|robust)\b/gi],
// --- adverbes de remplissage (fr1 §9, fr2) — à relire, FP possibles
['adverbe remplissage', 3, 'fr1 fr2', 'fr',
/\b(vraiment|littéralement|fondamentalement|intrinsèquement|résolument|crucialement|absolument|incroyablement|extrêmement|parfaitement|totalement|véritablement)\b/gi],
// --- contraste binaire (fr1 st§1, fr2 règle 2, étape, no-slop, flaviocopes)
['contraste binaire', 8, 'fr1 fr2 étape no-slop flaviocopes', 'fr en',
/\bce n'est pas\b[^.!?]{1,90}?\b(c'est|mais)\b|[Cc]e n'est pas [^.!?]{1,60}[.!?]\s*[^\n]{0,20}\bc'est\b|not (just|merely|only)? ?[^.!?]{1,60}\bbut\b/gi],
// --- question-réponse artificielle (fr1 st§2, étape EN rhetorical openers)
['question-réponse', 8, 'fr1 étape no-slop', 'fr en',
/\b(le problème\s*\?|la bonne nouvelle\s*\?|le résultat\s*:|résultat\s*\?|mon conseil\s*\?|la réponse\s*:)\b/gi],
// --- fragments dramatiques (fr1 st§3, no-slop)
['fragment dramatique', 8, 'fr1 no-slop', 'fr en',
/\b(un mot\.|simple\. efficace\.|c'est tout\.|that'?s it\. that'?s)\b/gi],
// --- EN lexical slop (étape EN, flaviocopes, no-slop)
['EN slop lexique', 5, 'étape flaviocopes no-slop', 'en',
/\b(delve into|unpack\w*|navigate the complexit\w+|ever-changing landscape|the landscape of|synerg\w+|leverage\w*|holistic approach|it'?s worth noting|lean into|foster a culture|at the end of the day|moving forward|in today'?s world|unlock the potential|harness the power|deep dive|key takeaways|north star|double down on|at scale|boasts a|vibrant|profound)\b/gi],
];
/** Punctuation budgets (ui-sk): 1 tiret cadratin / 500 words, 1 ! / 1000. */
export const BUDGETS = [
{ re: /—/g, perWords: 500, floor: 1, id: 'tiret cadratin', weight: 5 },
{ re: /!/g, perWords: 1000, floor: 1, id: 'exclamation', weight: 5 },
];
{
"name": "buvard",
"version": "0.1.0",
"description": "buvard — l'anti-slop qui tache. Blotting paper for AI-flavored prose: a weighted multi-score linter for French and English slop patterns.",
"type": "module",
"bin": { "buvard": "bin/buvard.js" },
"main": "lib/catalog.mjs",
"files": ["bin", "lib", "docs", "SKILL.md", "README.md", "LICENSE"],
"scripts": { "test": "node --test test/" },
"keywords": ["slop", "linter", "prose", "french", "writing", "ai-writing", "style"],
"license": "GPL-3.0-only",
"repository": { "type": "git", "url": "https://git.nech.pl/pln/buvard.git" },
"engines": { "node": ">=18" }
}
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { lint, bodyOf } from '../bin/buvard.js';
test('clean prose scores 100', () => {
const r = lint("J'ai réparé le montage smb. Le mot de passe vivait dans le trousseau.");
assert.equal(r.score, 100);
});
test('an opening vide costs 5', () => {
const r = lint('Soyons honnêtes : le montage cassait.');
assert.equal(r.score, 95);
assert.equal(r.hits[0].id, 'ouverture-vide');
});
test('contraste binaire costs 8', () => {
const r = lint("Ce n'est pas un outil. C'est une révolution.");
assert.ok(r.hits.some((h) => h.id === 'contraste binaire'));
assert.ok(r.score <= 92);
});
test('tiret budget: 1 per 500 words', () => {
const words = Array(600).fill('mot').join(' ');
const r = lint(words + ' — fin.');
assert.equal(r.score, 100); // one dash within budget
const r2 = lint(words + ' — fin — vraiment.');
assert.ok(r2.score < 100); // second dash past budget + adverbe
});
test('frontmatter is stripped before linting', () => {
const t = "---\ntitle: 'Soyons honnêtes : le test'\n---\n\nLe texte, lui, est propre.";
assert.equal(lint(bodyOf(t)).score, 100);
});
test('empty body scores 100 and zero hits', () => {
const r = lint('');
assert.deepEqual([r.score, r.hits.length, r.words], [100, 0, 0]);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment