1Introduction

A language model applies the rules it is given, in the order they were given, with the priority they carry. It does not arbitrate between contradictory instructions — it accumulates them.

It is also built to be helpful and accommodating. That combination sets a classic trap: the user makes a request that contradicts a Kit rule, the AI obliges, and the structure degrades silently. This is precisely why the Kit rules must be laid down before any request to produce something, and why cases the rules do not cover must be treated as evolutions of the Kit, never as one-off exemptions.

This document gathers the commands to paste into the chat to keep the session inside the Kit's frame: starting a production session, steering back a session that has drifted, tightening a gradual drift, authorising a one-off surgical modification, the pre-check before any document is created or modified, the documentation update and the maintenance rebuild.

The blocks in this document are given in English. The French and German variants carry the same blocks in their own language, and say the same thing — use the one that matches the working language of the session.

Formatting convention for the blocks: the title is in capitals, followed by a separating line of thirty equals signs. Internal sections are separated by a line of dashes. Enumerations use dashed items, with continuations aligned under the text. Stop conditions are introduced by an ASCII arrow. Each new idea is separated by a blank line holding a non-breaking space — without it, the web converter removes the line.

2Dialogue commands

2.1Starting a production session

Use at the start of any session involving the generation or modification of a document. This command enforces the reading of the sources of truth before the first line of script.

Hello. New production session on the Kit.
Before any generation, here is the frame to work within.
 
ABSOLUTE RULE — ZERO FORMATTING FROM MEMORY
==============================
 
MANDATORY READING BEFORE ANY GENERATION:
------------------------------
 
0. CHECK the working tree against the latest inventory,
   and ANNOUNCE the Kit version read in the Registry — Kit
   Prompt §8.3 and §10.1.
1. READ Kit - Projet - Prompt in full.
2. READ the General stylesheet and the one of the document
   to produce — Glossary, YAML or HTML —, each .js in full
   — Kit Prompt §5.1.
 
3. READ the Reference .docx of each — same timestamp as
   its .js.
   §9.1 = makeTable row format.
   §9.3 = indentation constants and column widths.
   §13 = return contracts, spread, predecessors, successors.
 
4. READ the prompt of the current project.
5. READ Kit - Documentation - Quality Control §3.13 and §3.14
   — absolute calling chain and environment prerequisites.
 
− Reference .docx — NEVER recreated from the .js alone.
  The .js holds the code. The .docx holds the recipe for
  applying it: contracts, predecessors, successors,
  anti-patterns.
  That information cannot be deduced from the .js alone.
  Without the source file: full stop.
 
No numeric value, no function signature, no colour, no
indentation constant may be used without having been checked
in the .js read in this session.
 
VALIDATION CHAIN — ABSOLUTE ORDER:
------------------------------
 
0. PREREQUISITES: the check of Execution environment §5,
   each capability before the step that uses it, from the
   Kit folder. The following links run from the project
   folder, the tools taken from ../kit/.
   For the Kit itself: from its own folder, without ../kit/.
 
1. BEFORE any generation:
   python ../kit/kit_check_registry.py
   -> exit 0 required.
 
2. BEFORE every node gen-*.js:
   python ../kit/kit_check_setters.py gen-document.js
   python ../kit/kit_check_setters.py gen-[prefix]-site.js --html
   -> exit 0 required.
 
3. AFTER generating a .docx:
   node ../kit/kit_validate_docx.js document.docx --version {version}
   python ../kit/kit_check_fidelite.py document.docx --version
   {version} -> the fingerprint does not say which chain built the
      document; the round trip does. Glossary and templates
      outside the Kit excluded — Quality Control §3.10.
 
4. AFTER generating a .xlsx:
   python ../kit/kit_validate_xlsx.py document.xlsx
 
5. AFTER regenerating an existing document:
   python ../kit/kit_check_markup.py source.docx produit.docx
   -> a text diff does not see a loss of markup.
 
6. AFTER regenerating a language variant:
   python ../kit/kit_check_ossature.py reference.docx variante.docx
 
7. AFTER a change to the extraction:
   python ../kit/kit_check_fidelite.py over the corpus, --version
   {version}
 
8. BEFORE any delivery touching a member of a file set:
   python ../kit/kit_check_couplets.py
 
No file is delivered until the whole chain has passed.
 
CHECKS BEFORE RUNNING THE SCRIPT:
------------------------------
 
− The level of a body element comes from the current
  heading. h1, h2 and h3 set it; the other helpers read
  it. No level suffix to check.
 
− Document section:
  properties: { ...style.pageProps, titlePage: true }
  Without this flag, Word ignores the first-page headers and
  footers and the title page loses its bareness.
 
− makeTable receives the cells in the right format:
  a string "text", an array ["text", italic], an object
  { text, href } for a link, or an object { image } set by
  makeImageRun — General Reference §9.1.
  Never a numeric width inside a cell.
 
− Conditional loading of the data modules according to
  [Prefix] - Registry.requires. If a flag is false, no
  require() and no setter; a file already present stays
  until the user decides. If true, load it and call the
  setter:
  style.setGlossaryTerms(...) / style.setBrands(...)
  style.setVariableNames(...) / style.setHassEntities(...)
  style.setTextHighlights(...) / style.setColors(...)
  style.setDocumentTitles(...)
  Under colors, the Glossary and YAML stylesheets in use follow:
  glossStyle.setColors(style.getColors())
  yamlStyle.setColors(style.getColors())
 
− style.getLuxTimestamp() used for the timestamp.
  Never reuse the timestamp of an earlier delivery, apart
  from the cases in Kit Prompt §4.1 and §14: a document
  returned identical, a file set, a cover image rendered alone.
 
− Consult the Contracts section of the Reference .docx
  (General §13 / Glossary §3 / YAML §8 / HTML §13) before any call.
 
− makeImageRun(buffer, width, height, format, fallback) for
  every embedded image — format among png, jpg, gif, bmp,
  svg, mandatory; an svg requires a fallback image as fifth
  parameter. A photo is linked, never embedded:
  makeLinkedImageRun(fichier, alt), from assets/png/{slug}/
  — General Reference §13.5.
 
− File names without underscores, except kit_* and [prefix]_*
  tools — Naming Convention §2.1.
− File set integrity: any change to a member of a file set
  requires the simultaneous update of the other members,
  even for a cosmetic bump, save the cover image rendered
  alone — Kit Prompt §6.2.
 
− Check before production: ask explicitly what changes or
  is added. Confirm the exact file name before writing the
  first line.
 
STOP CONDITIONS:
------------------------------
 
If an anomaly, inconsistency or ambiguity is detected at
any step:
 
-> Full stop.
-> Report it clearly and wait for an explicit confirmation.
-> No answer is a stop signal.
-> Never report and carry on in the same sentence.
 
If a formatting case is not covered by the stylesheet:
 
-> Report it as a need for a Kit evolution. Do not improvise.
 
If the document to modify already exists:
 
-> Reread the source file .docx of the working tree
   before starting.
-> Start from that file, never from a memory.
-> Change only what is explicitly requested.

2.2Steering back — drifting session

Use when the session has drifted beyond what spot corrections can fix. The most effective remedy is to open a new chat and paste this command as the first message.

The session has drifted. We go back to the sources and
reconstruct nothing from memory.
 
STEERING BACK — BACK TO THE SOURCES
==============================
 
CONTEXT:
------------------------------
 
A new chat is mandatory when the session has grown too large.
Purge the previous chats before starting over.
 
TECHNICAL NOTE:
------------------------------
 
− File names shown with underscores are a platform
  transformation. The canonical name uses spaces.
 
− The .docx files in the working tree are the source files.
  Any change starts from the file itself, reread before it
  is touched.
 
SESSION START — MANDATORY ORDER:
------------------------------
 
0. Check the working tree against the latest inventory,
   and announce the Kit version read in the Registry — Kit
   Prompt §8.3 and §10.1.
1. Read Kit - Projet - Prompt in full.
2. Read the stylesheets .js and their Reference .docx.
3. Read the prompt of the current project.
4. Read every document not yet gone through in detail.
5. Purge anything that contradicts these documents.
6. Purge anything that could lead to an unrequested
   initiative or to any shortcut.
 
7. Report what was eliminated, then what remains in memory.
 
PRODUCTION RULES:
------------------------------
 
− Formatting exclusively according to the active stylesheet.
  Never formatting from memory.
 
− Generator script recreated from scratch at every session
  for a new document. An existing document is regenerated
  from its map — Quality Control §3.9 and §3.16.
− Conditional loading of the data modules according to
  [Prefix] - Registry.requires. Correspondences:
  glossary -> Terms.js -> setGlossaryTerms
  brands -> Brands.js -> setBrands
  variableNames-> Variable Friendly Names -> setVariableNames
  hassEntities -> HASS Entities -> setHassEntities
  textHighlights -> Text Highlights -> setTextHighlights
  colors -> Colors -> setColors
                  Glossary and YAML: setColors(style.getColors())
  documentTitles -> Document Titles -> setDocumentTitles
 
− Source file .docx reread in the working tree before any
  change.
  Change only what is explicitly requested.
  No unauthorised loss of information.
 
− Work only from the latest export provided in the session.
  Never infer or reconstruct from a document already
  generated or from the memory of a previous session.
 
− File set integrity: any change to a member of a file set
  requires the simultaneous update of the other members,
  save the cover image rendered alone — Kit Prompt §6.2.
 
− Report any inconsistency before launching the generation
  of the script, and wait for the explicit go.
 
− Check that the validator points to the right version of
  the file.
 
− Strict naming: spaces and hyphens; underscores
  for kit_* and [prefix]_* tools only — Naming Convention §2.1.
  A fresh timestamp at every delivery; the only exceptions
  are those of Kit Prompt §4.1 and §14 — a document returned
  identical, a file set, a cover image rendered alone.
 
− The level is written by h1, h2 and h3, and resetLevel
  sets it back to 1; the other functions read it.
 
MANDATORY FILE SETS:
------------------------------
 
− Stylesheet .js and its Reference .docx, same timestamp.
− Kit Cover Sheet .docx and its .png files, one rendering per
  published language, same timestamp.
− Project Cover Sheet .docx and its .png files, one rendering per
  published language, same timestamp, independent of the
  Kit's.
− Document Titles changed: the .png files alone are
  rendered again, at the timestamp of the existing .docx
  — Kit Prompt §14.
 
− Terms module and glossary .docx, same timestamp.
  A multilingual project produces one glossary per
  language, all at the same timestamp.
 
− Cover Sheet: every instruction for assembling the image
  is inventoried in the matching .docx, §3; its Source
  column says where each value is read from — the .docx,
  Document Titles, the localisation table, the renderer. Rendering
  through constants only, never free composition.

2.3Tightening — gradual drift

Today's artificial intelligence engines tend to favour what pleases the user over what was asked of them. The drift is slow and raises no alert: answers grow longer, unrequested analysis creeps in, and rules that are written down stop being reread. The engine therefore has to be tightened regularly, without waiting for the session to become unusable.

To be used as soon as answers grow longer or stray from the request. Unlike the previous block, this tightening does not call for a new chat: it is pasted into the session in progress.

TIGHTENING
==============================
 
Reread Kit Prompt §1 (checklist) and §2 (tone). Apply them
from now on.
 
BEFORE EVERY ANSWER:
------------------------------
 
− Answer what is asked. Nothing else.
− No unrequested analysis, no summary of what I have just
  said, no lesson on the rules.
− A formatting value is read in the .js and the Reference
  of this session, never from memory.
− If you do not know, say so in one sentence.
 
Confirm in one line, then carry on.

2.4Authorising a surgical modification

Use only when a targeted change to an existing document is needed and a full regeneration would be disproportionate. Paste it just before making the request.

Precise request: modify an existing .docx by surgical
patch, without regenerating it. Here are the conditions.
 
RULE — DIRECT XML EDITING OF AN EXISTING .docx
==============================
 
REQUIRED CONDITIONS (all at once):
------------------------------
 
− The target .docx was generated by a script using the
  active stylesheet. Never on a file of unknown origin or
  produced by hand.
 
− The document's generator script is no longer available in
  the session. If it is, XML editing is forbidden: the
  document is regenerated.
 
− Every value changed (colour, size, indentation, spacing)
  is taken from the active stylesheet file .js read in the
  current session. No numeric value from memory.
 
− The change is surgical: only what is explicitly requested
  is touched. No rewriting, rewording or unrequested
  addition.
 
− No loss of content on an existing document. Everything in
  the source file is preserved in full, unless explicitly
  instructed otherwise.
 
− Before any change: announce precisely which nodes will be
  touched and wait for the explicit confirmation.
 
− Regex is forbidden for writing to a structured file. Every
  change goes through the format's native parser. Regex for
  pure reading remains allowed.
 
− To insert a note or a box, use the helpers of
  kit_patch_helpers.py — never clone a fragment of the
  target document.
 
− After the change: run the full chain of Quality Control
  §3.13, kit_check_markup.py included, and report any
  warning before delivering.
 
STOP CONDITIONS:
------------------------------
 
If one of these conditions is not met:
 
-> Full stop.
-> Report the anomaly clearly.
-> Wait for an explicit confirmation before carrying on.
-> Never report and carry on in the same sentence.

2.5Pre-check — document creation or modification

Paste before any document creation or modification. This pre-check has the sources of truth declared as read, the source file as inventoried, and every content change as approved, before the script is touched.

Before creating or modifying a document, here is the check
to run point by point.
 
PRE-CHECK — DOCUMENT CREATION / MODIFICATION
==============================
 
MANDATORY READING BEFORE ANY ACTION:
------------------------------
 
1. READ Kit - Projet - Prompt in full.
2. READ the General stylesheet and the document's, each .js
   in full — Kit Prompt §5.1.
3. READ the Reference .docx of each (same timestamp).
   This .docx is the application recipe of the stylesheet.
   A gap between it and the .js code stops the work and is
   reported — Kit Prompt §4.1, API contracts.
   §9.1 = makeTable row format: strings, pairs,
          { text, href } and { image }; never TableCell.
   §9.3 = constants and column widths.
   §13 = return contracts, spread, predecessors, successors.
 
4. READ the current project prompt.
5. READ Kit - Documentation - Quality Control §3.13 and §3.14.
 
− Reference .docx — NEVER recreated from the .js alone.
  Without the source file: full stop.
 
READING REPORT — ANSWER EACH POINT:
------------------------------
 
− Kit Projet Prompt read in full: yes / no.
− General stylesheet and the document's, each .js read in
  full: yes / no, and version.
− Reference .docx of each read in full: yes / no, and
  timestamp.
− Project prompt read: yes / no.
− Quality Control §3.13 and §3.14 read: yes / no.
 
-> If a point is "no": full stop. Read before carrying on.
 
IF AN EXISTING DOCUMENT IS MODIFIED:
------------------------------
 
− Reread the source file .docx in the working tree; if it
  is missing there, ask for it. Start from that file, never
  from a memory.
 
− File set integrity: if the modified file belongs to a
  file set, the other members are assessed AND updated in the
  same session, save the cover image rendered alone — Kit
  Prompt §6.2. A member's source file missing: full stop.
 
− Inventory the source file: paragraphs, tables, images.
  Record the exact count before writing the script.
 
− Extract the images from the source file before any script.
  No image left out without explicit instruction. A linked
  image stays under the project’s assets/png/: the map records
  its path.
 
− The document is regenerated from the map of its source
  file: kit_extract_map.py extracts it, kit_gen_document.js
  rebuilds it — Quality Control §3.9 and §3.16. Never from
  memory or a previous script.
 
− List every planned content change against the source
  version. Wait for the explicit approval before writing the
  script.
 
VALIDATION CHAIN:
------------------------------
 
0. PREREQUISITES: the check of Execution environment §5,
   each capability before the step that uses it, from the
   Kit folder. The following links run from the project
   folder, the tools taken from ../kit/.
   For the Kit itself: from its own folder, without ../kit/.
1. BEFORE any generation: python ../kit/kit_check_registry.py.
2. BEFORE node gen-*.js:
   python ../kit/kit_check_setters.py gen-document.js
   python ../kit/kit_check_setters.py gen-[prefix]-site.js --html
   -> exit 0 required.
 
3. AFTER generating a .docx:
   node ../kit/kit_validate_docx.js document.docx --version {version}
   python ../kit/kit_check_fidelite.py document.docx --version
   {version} -> the fingerprint does not say which chain built the
      document; the round trip does. Glossary and templates
      outside the Kit excluded — Quality Control §3.10.
 
4. AFTER generating a .xlsx:
   python ../kit/kit_validate_xlsx.py document.xlsx
 
5. AFTER regenerating an existing document:
   python ../kit/kit_check_markup.py source.docx produit.docx
   -> a text diff does not see a loss of markup.
 
6. AFTER regenerating a language variant:
   python ../kit/kit_check_ossature.py reference.docx variante.docx
 
7. AFTER a change to the extraction:
   python ../kit/kit_check_fidelite.py over the corpus, --version
   {version}
 
8. BEFORE any delivery touching a member of a file set:
   python ../kit/kit_check_couplets.py
 
CHECK BEFORE FINAL DELIVERY:
------------------------------
 
Compare the produced document with the inventory of the
source file:
 
− Number of sections and headings: identical?
− Number of tables: identical?
− Number of images: identical?
− Content of each section: no loss?
− Image captions: present and exact?
 
-> If a gap is detected: report, correct, check again.
-> Delivery only after explicit confirmation of zero loss.
 
FORMATTING RULES:
------------------------------
 
− Zero formatting from memory. Every value checked in the
  .js or the Reference read in this session.
 
− makeTable: rows = plain strings, pairs of text and
  italic, { text, href } or { image }. Never a bodyCell()
  or TableCell object in rows.
 
− Column widths: sum equal to the width of the level.
  Number of widths equal to the number of columns.
 
− Level of each element consistent with the parent heading.
− Section: properties with titlePage set to true.
 
NOTE AND BOX RULES:
------------------------------
 
− Note: only if the information is important, not obvious
  and absent from the body text. Never directly under a
  heading, never without a paragraph before it. When in
  doubt -> ordinary paragraph.
 
− Box: only if the advice brings what the reader does not
  find in the running text. If it gives nothing new ->
  delete it.
 
STOP CONDITIONS:
------------------------------
 
If an anomaly, inconsistency or ambiguity is detected:
 
-> Full stop.
-> Report it clearly and wait for an explicit confirmation.
-> Never report and carry on in the same sentence.
 
If a formatting case is not covered by the stylesheet:
 
-> Report it as a need for a Kit evolution. Do not improvise.

2.6Documentation update

To be pasted when documents have changed and the documentation must follow them. Only what must change to stay true is regenerated, then the site runs in delta — Kit Prompt §4.1.

DOCUMENTATION UPDATE
==============================
 
Apply Kit Prompt §4.1, daily rebuild.
On the Kit, run the maintenance rebuild, §2.7.
 
SCOPE:
------------------------------
 
− The modified documents.
− Those that refer to a renumbered or rewritten
  section: search over the whole set, never from memory.
− Those that restate a rule touched.
− Their translations and the members of their couplet.
 
THEN:
------------------------------
 
− The validation chain on every document.
− The site pass in delta.
-> A document in scope that cannot be regenerated:
  stop, and tell me.
 
State the scope, then wait for my go.

2.7Maintenance rebuild

To be pasted after several weeks of work, to return to clean documentation: content audit, then regeneration of the whole set and a full site pass. The Kit runs it at every release — Kit Prompt §4.1.

MAINTENANCE REBUILD
==============================
 
Apply Kit Prompt §4.1, maintenance rebuild.
 
AUDIT — QUALITY CONTROL §4.4:
------------------------------
 
− Missing documents: Registry, working tree,
  Document Titles and site set side by side.
− Rules stated in two places.
− Stale content: keys, functions, versions, references
  to a section that has disappeared or been renumbered.
− Orphan files.
 
Return the findings by name, then wait for my go.
-> Nothing is removed without my go.
 
THEN:
------------------------------
 
− Regeneration of the whole set, validation chain on
  every document. A document that comes back identical
  keeps its timestamp.
− Full site pass, --full.