SuperAPI AI Directory

normalisation-juridique-fr-christophe-quezel-ambrunaz

Office & productivity

View repository

Updated 10-15 23:49

About this skill

Normalisation of legal French language — v1.0

Skill designed with Christophe Quézel-Ambrunaz. It directly corrects a legal Word document, autonomously, then returns in the conversation a compact summary table and reversible.

Guiding principle

Two regimes of modification, which must never be confused:

  1. Deterministic normalisations — typography, non-breaking spaces, apostrophes, quotation marks, improprieties with a single unambiguous correction (stipuler→disposer), unambiguous anglicisms, form of references. Safe, applied automatically by scripts/normaliser.py.
  2. Judgment rewrites — comma before et (contextual), hollow ternary, empty emphasis, contextual anglicism, citation tolerances. They require intelligent reading: it is you who decides them and puts them in place, guided by the files of references/.

The deterministic normalisations are applied directly, without tracked changes — so as not to burden the review; their reversibility is fully ensured by the register (défais). Only the judgment rewrites are placed as Word revisions (w:ins/w:del): these are the only ones to examine, the user accepts or rejects them in Word, and the register also makes it possible to undo them. Tracking can be extended to the deterministic lexicon via the option --track-lexical (disabled by default).

Cardinal safeguard on citations : the normalisation of references is purely formal (abbreviations, order, spaces). Never modify the substance of a reference (court, date, number), never invent one. In case of doubt about accuracy, flag it, do not “correct” it.

Environment and delegation

  • Requires Cowork or computer use : placing revisions requires XML editing of the .docx. In a simple chat without a file, request the document and the appropriate environment.
  • The OOXML mechanics are delegated to the docx skill (always available): scripts/office/unpack.py → editing of word/document.xml (and footnotes.xml/endnotes.xml) → scripts/office/pack.py → validation; scripts/comment.py for comments; scripts/accept_changes.py to produce the clean version. Consult the SKILL.md of docx for the exact patterns of w:ins/w:del. Author of revisions: “Claude — normalisation” (unless instructed otherwise).

Workflow

1. Framing (a single, brief interruption)

Identify the .docx target file and the scope : body only, or body + footnotes + bibliography (by default: all, the user has confirmed it). If the file is a .doc, convert it first (docx/scripts/office/soffice.py).

2. Full read

Extract the text (extract-text of docx) and read it in full before any modification. The read is used for the judgment regime; the deterministic one, for its part, is handled by script without human review.

3. Deterministic pass (script)

python scripts/normaliser.py apply \
  --in "<document.docx>" \
  --out "<document — normalisé.docx>" \
  --registry "<.normjur/registre.json>" \
  --scope all          # all | body | body+notes

The script applies the deterministic rules (typography and safe lexicon) directly, without tracking changes, writes the corrected .docx and the JSON log. Option --track-lexical to place the lexicon in revisions. Detail of the rules: references/typographie.md, references/lexique-juridique.md, references/anglicismes.md (section "safe core").

4. Judgment pass (you, on the already corrected document)

Relying on references/marqueurs-ia.md, references/anglicismes.md (section "contextual") and references/citations-reflex.md, place in Word revisions the judgment rewrites, via the template docx. For each rewrite, record a judgment entry in the log:

python scripts/registre.py add-jugement \
  --registry "<.normjur/registre.json>" \
  --cle emphase --libelle "Emphase creuse réécrite" --categorie stylistique \
  --avant "<texte d'origine>" --apres "<texte réécrit>" --wids "101,102"

Golden rules of judgment:

  • Comma before and : never remove mechanically. Keep in legitimate cases (clauses with different subjects, closing of a parenthetical, "…, and that, …", polysyndeton). Remove only the faulty comma between two simple coordinated terms.
  • Ternary : tighten only the hollow and formulaic tricolon empty and form, never the substantive enumeration.
  • Em dashes : they are kept. The script only normalizes their spacing (—). Do not replace them.
  • Verbo-nominal periphrases and spelling harmonization (1990) : see references/marqueurs-ia.md (§10) and references/orthographe-harmonisation.md.

5. Summary

python scripts/registre.py recap --registry "<.normjur/registre.json>"

Paste the table (compact, aggregated by rule) into the conversation, followed by the sentence inviting cancellation (see below).

6. Final verification (mandatory)

  • Validate integrity: python scripts/registre.py verify --registry … --doc "<corrigé.docx>" (idempotence, counts, OOXML validity via docx/scripts/office/validate.py).
  • Check thatno stylistic rewrite has altered the meaning and thatno reference has been corrupted. For a long or sensitive document, delegate this check to a diff-review sub-agent.

The log

File JSON written outside the conversation (in .normjur/ next to the document); the conversation displays only the aggregated table. Schema: see references/registre-schema.md. Each modification is attached to a numbered rule group numbered n and carries an intra-group index i. Deterministic groups are numbered first (fixed order), judgment groups follow, in the order you add them.

Summary table (fixed format)

| N° | Règle                                | Type        | Occ. | Exemple (avant → après)        |
|----|--------------------------------------|-------------|------|--------------------------------|
| 1  | Apostrophes courbes                  | détermin.   |  42  | l'article → l’article          |
| 2  | Insécables (; : ! ? « »)             | détermin.   |  37  | art. 9 ; → art. 9 ;            |
| 5  | stipuler → disposer (loi/texte)      | détermin.   |   3  | la loi stipule → la loi dispose|
| 7  | Emphase creuse resserrée             | STYLISTIQUE |   5  | « il importe de souligner… » → …|

Highlight lines STYLISTIC (the user must be able to check the subjective register first). End with:

To revert changes, reply e.g.: undo 3, 7-10, 12 (whole group) or undo 7.2 (one occurrence). redo to restore.

Cancellation grammar

The user replies in natural language; interpret and execute:

python scripts/registre.py undo "3, 7-10, 12" \
  --registry "<.normjur/registre.json>" \
  --in "<document.docx — ORIGINAL>" \
  --out "<document — normalisé.docx>"
  • défais 3 → disables the entire group 3; défais 7-10 → groups 7 to 10; défais 7.2 → the 2nd occurrence of group 7.
  • Mechanics: for deterministicgroups, the script rebuilds the document from the original by reapplying only the rules/occurrences that remain active — clean reversibility, with no drift. For judgmentgroups, the script rejects the corresponding revisions (w:id recorded).
  • refais 7 reactivates the group; défais tout / refais tout for the global toggle.

After each undo/redo, redisplay the updated table recap (compact).

Context economy

Never dump the register contents into the conversation: only the aggregated table appears there. The “before → after” examples are truncated (≈ 40 characters). For a large document, process it section by section during the judgment pass, but write only the consolidated summary into the conversation.

Reference files

  • references/marqueurs-ia.md — French AI writing markers and their treatment (apostrophes, comma before and, ternary constructions, emphasis, dashes, empty formulas).
  • references/anglicismes.md — safe core (script) / contextual (judgment) / whitelist of retained subject-matter terms.
  • references/lexique-juridique.md — legal improprieties (stipulate/provide, jurisdiction/justice, ruling/judgment…).
  • references/typographie.md — apostrophes, non-breaking spaces (accepted scheme), quotation marks, dashes, accented capitals.
  • references/citations-reflex.md — RefLex SNE 2022 standard, tolerances, harmonization by majority usage.
  • references/orthographe-harmonisation.md — harmonization of 1990 spellings according to majority usage (judgment).
  • references/registre-schema.md — JSON schema of the register.

Known limitations (v1.0, to be stated honestly to the user if relevant)

  • Script insertion of revisions targets the case of an occurrence within a single run. Occurrences spanning several runs are logged as “to be placed manually”: handle them via the pattern docx.
  • Accented capitals and ambiguous grammar are matters of judgment, not of the script.
  • The rejection of judgment revisions by w:id is at best reliable as long as the user has not already accepted/rejected those revisions in Word; in that case, switch to a replacement après → avant read from the registry.