Use these recipes when you want Patina to flag AI-sounding prose before Markdown changes land in a docs or blog repository.
The hook is score-only: it never rewrites files during commit. It uses Patina's deterministic stylometry/lexicon layer, so it does not need an API key and it does not claim authorship provenance.
# .pre-commit-config.yaml
repos:
- repo: https://github.com/devswha/patina
rev: main # replace with a release tag after v1 is cut
hooks:
- id: patina-score
args: [--score-threshold, "30", --lang, auto]Run it locally:
pre-commit run patina-score --all-filesnpm install --save-dev husky lint-staged patina-cli
npx husky init# .husky/pre-commit
npx lint-stagedInstall the package in the repository first:
npm install --save-dev patina-cli# lefthook.yml
pre-commit:
commands:
patina-score:
glob: "*.{md,mdx}"
run: npx patina-score --score-threshold 30 --lang auto {staged_files}A repo-local Lefthook command if this repository is vendored or checked out:
pre-commit:
commands:
patina-score:
glob: "*.{md,mdx}"
run: node scripts/precommit-score.mjs --score-threshold 30 --lang auto {staged_files}--score-threshold 30means fail when more than 30% of prose paragraphs in a file trip a hot signal.--lang autoinfers language from filename and Unicode ranges; passko,en,zh, orjawhen a repo is single-language.- Use this as a discussion prompt, not as an accusation. See ETHICS.md.