|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +Repository guidance for LLM agents working in `docs/`. |
| 4 | + |
| 5 | +## Scope |
| 6 | + |
| 7 | +- This repository contains the documentation site for the `multilingualprogramming` project. |
| 8 | +- The public site is built with Jekyll from the top-level site files (`index.md`, `_layouts/`, `_includes/`, `assets/`, `_config.yml`). |
| 9 | +- The structured multilingual source of truth lives under `docs/` and currently supports English (`en`) and French (`fr`). |
| 10 | + |
| 11 | +## Primary Goal |
| 12 | + |
| 13 | +Help users write, explain, or update programs for the `multilingualprogramming` language using the documentation in this repository. |
| 14 | + |
| 15 | +For now, optimize for: |
| 16 | + |
| 17 | +- English code and explanations |
| 18 | +- French code and explanations |
| 19 | +- EN/FR documentation parity when editing docs assets |
| 20 | + |
| 21 | +## Source Of Truth |
| 22 | + |
| 23 | +When answering language or API questions, prefer these locations in order: |
| 24 | + |
| 25 | +1. `docs/content/en/` and `docs/content/fr/` for authored documentation |
| 26 | +2. `docs/snippets/<snippet_id>/en.code` and `docs/snippets/<snippet_id>/fr.code` for runnable examples |
| 27 | +3. `docs/routing/*.routes.yml` and `docs/i18n/*/ui.yml` for localized paths and UI labels |
| 28 | +4. Top-level Jekyll pages only when you need to understand the published site shell |
| 29 | + |
| 30 | +Do not invent syntax if the docs or snippets already show it. |
| 31 | + |
| 32 | +## Programming Guidance |
| 33 | + |
| 34 | +When a user asks for code in this language: |
| 35 | + |
| 36 | +- Pick the requested locale. If unspecified, default to English unless the user writes in French. |
| 37 | +- Keep one lexical style per file. Do not mix French and English keywords in the same example unless the user asks for comparison. |
| 38 | +- Prefer examples that match documented syntax from the repo. |
| 39 | +- For French examples, use documented forms such as `soit`, `afficher`, `si`, `sinon`, `pour`, `dans`, `fonction`, `retourner`, `classe`, `importer`. |
| 40 | +- For English examples, use documented forms such as `let`, `print`, `if`, `else`, `for`, `in`, `function`, `return`, `class`, `import`. |
| 41 | +- When helpful, provide parallel EN and FR versions of the same program. |
| 42 | + |
| 43 | +## Docs Editing Rules |
| 44 | + |
| 45 | +If you modify multilingual docs content: |
| 46 | + |
| 47 | +- Keep `page_id` identical across locales. |
| 48 | +- Keep `source_hash` synchronized from the English source to the French translation. |
| 49 | +- Keep `path_segments` localized per language. |
| 50 | +- Ensure every referenced `{{snippet:<id>}}` has both `en.code` and `fr.code`. |
| 51 | +- Do not add inline runnable Python blocks inside `docs/content/`; use snippet tokens instead. |
| 52 | + |
| 53 | +## Validation Commands |
| 54 | + |
| 55 | +Run these when your changes touch docs structure, snippets, or CI: |
| 56 | + |
| 57 | +```powershell |
| 58 | +python scripts/validate_multilingual_docs.py --strict-freshness |
| 59 | +python -m pytest _tests -q |
| 60 | +bundle exec jekyll build |
| 61 | +python scripts/check_pages_artifact.py --site-dir _site --base-path /docs |
| 62 | +``` |
| 63 | + |
| 64 | +## CI Files |
| 65 | + |
| 66 | +- `.github/workflows/docs-ci.yml` validates docs metadata, runs tests, and builds the site. |
| 67 | +- `.github/workflows/docs-deploy-pages.yml` rebuilds and deploys the site to GitHub Pages after successful CI on `main`. |
| 68 | + |
| 69 | +## Known Constraint |
| 70 | + |
| 71 | +The `_tests/` suite exercises docs examples through the PyPI package `multilingualprogramming`. |
| 72 | +Install it with `pip install multilingualprogramming`. |
| 73 | +If that package is not installed in the current environment, those tests should be skipped rather than failing at import time. |
0 commit comments