Rédiger une page de documentation xmris

VérifiéSûr

Créez ou modifiez n'importe quelle page de documentation xmris : notebooks didactiques, explications de concepts ou guides contributeurs.

Spar Skills Guide Bot
DocumentationIntermédiaire
27/07/2026
Claude CodeCursorCodex
#myst#jupyter-notebooks#docs-structure#technical-writing#style-guide

Recommandé pour

Synthèse automatique

Guide la rédaction ou la refonte d'une page de documentation xmris (tutoriel, explicateur ou guide contributeur) écrite en notebook MyST, en imposant le bon genre, le bon gabarit et les règles structurelles vérifiées par la CI.

Points forts

  • Un tableau de routage par genre qui croise emplacement, lecteur visé, forme et canaux d'exécution (nbmake vs myst build --execute), évitant de choisir au hasard parmi quatre gabarits.
  • Rassemble les règles transverses réellement appliquées par check_docs.py : frontmatter figé, H1 unique en tête de page, cibles MyST explicites au-dessus de chaque titre, interdiction des liens .ipynb.
  • Explique le pourquoi de chaque règle (titres dupliqués par mystmd, ancres renumérotées par position, liens DOI non figés), ce qui rend les consignes applicables sans les mémoriser.
  • Signale explicitement les deux zones interdites — docs/diary/ à confier à la skill dev-diary et docs/api_reference/ généré puis détruit à chaque régénération — avec la bonne alternative (corriger la docstring dans src/).

Limites

  • Fortement spécifique au dépôt xmris : les chemins, la commande check_docs.py, le job CI « Docs style » et le label Python 3 (xmris) n'ont pas d'équivalent ailleurs.
  • Suppose l'outillage déjà en place (uv, jupytext, nbmake, mystmd) et délègue une partie du style éditorial à CLAUDE.md, non reproduit ici.
  • Le texte fourni s'interrompt au milieu de la règle sur le gel des liens doi.org dans docs/myst.doi.bib, donc la procédure exacte de ce point reste incomplète.
Quand l'utiliser

À mobiliser dès qu'on ajoute, restructure ou corrige une page écrite à la main dans la documentation xmris.

Quand l'éviter

Ne pas l'utiliser pour rédiger une entrée de journal de développement, pour toucher à la référence API générée, ni pour de la documentation hors du dépôt xmris.

Analyse de sécurité

Sûr
Score qualité88/100

The skill is a pure documentation-authoring guide for a specific repository. It references project-internal tooling (check_docs.py, uv run, pytest, myst build) that executes the repo's own notebooks and build, but contains no destructive commands, no network exfiltration, no obfuscated payloads, and no attempts to override agent safety. Nothing in the text tries to redirect the auditor. Residual risk is limited to ordinary local build/test execution, which is legitimate for a docs workflow.

Aucun point d'attention détecté

Comment cette analyse est faite

Exemples

New tutorial notebook
Add a tutorial notebook under docs/notebooks/io/ that walks through loading a NIfTI volume and asserting its shape, following templates/tutorial.md.
Fix a doubled title
This explanation page renders its title twice — the setup cell sits above the H1 with the MyST target. Restructure the top of the page so it complies with check_docs.py.
Consolidate thin pages
Merge the three overlapping explanation pages on masking into one explainer, giving it kebab-case MyST targets above every header and no .ipynb links.

name: docs-page description: Create or edit any hand-authored page in the xmris docs — tutorial notebooks (docs/notebooks/), concept explainers (docs/explanation/), or contributor guides (docs/contributing/). Use when adding or restructuring a doc page, writing notebook tests for a function, documenting a new .xmr method, thinning or consolidating existing pages, or fixing a page that renders wrong.

Write an xmris docs page

All three hand-authored genres are MyST notebooks — jupytext frontmatter plus a kernelspec — so any of them can reach for live code-cells, real output and plots. What separates them is shape, reader, and where the cells are executed.

1. Route by genre — read one template, not all four

| | Tutorial | Explainer | Guide | |---|---|---|---| | Lives in | docs/notebooks/<area>/ | docs/explanation/ | docs/contributing/ | | Reader wants | to do the task | to know why it is like this | to contribute | | Shape | demonstrate → assert, step by step | motivated narrative, claim → live proof | numbered steps + commands | | uv run test (nbmake + coverage) | ✅ | ✅ | ❌ | | myst build --execute (deploy.yml, on PRs) | ✅ | ✅ | ✅ | | Template | templates/tutorial.md | templates/explainer.md | templates/guide.md |

templates/patterns.md is the shared MyST pattern library — read it alongside whichever genre template applies. It holds the devices mined from the pages that work, each pointing at its live example so you copy rather than reinvent.

Two paths never route here:

  • docs/diary/ belongs to the dev-diary skill. Hand off; do not write an entry from here. (check_docs.py still checks entries — the structural rules in §2 bind every page in the tree.)
  • docs/api_reference/ is generated and gitignored. docs_api() clears the directory before regenerating, so a hand edit there is destroyed with no git history to recover it. Fix the docstring in src/ instead.

House style — motivated narrative, one home per concept, every article stands alone, the MyST palette carries the argument — lives in CLAUDE.md § "Documentation style" and is not restated here. One carve-out: the motivated narrative rule binds explainers and tutorials, not guides. A numbered list of commands is the correct shape for setup.md; novelizing an install guide makes it worse.

2. Rules that survive genre

Every one of these is enforced by check_docs.py, which the Docs style CI job runs over the whole tree on every PR. The build is silent about all of them; the gate is not. The tree is at zero errors — do not be the change that reopens the backlog.

  • Frontmatter is exact, and display_name: Python 3 (xmris) is the frozen project label. If your local Jupyter rewrites it (to .venv, Python 3 (ipykernel), …), fix it back before committing. Execution is unaffected either way; name: python3 resolves to the uv venv.
  • Nothing before (target)= + # H1. mystmd lifts the first heading into the page title but only removes it from the body when it leads the page. Put anything first — even a hidden remove-cell — and the title renders twice. The setup cell always comes after the H1. Exactly one H1 per file; never restate the title as another header.
  • Explicit MyST target above every header (Commandment 8), kebab-case, prefixed with the page topic. Auto-generated slugs are numbered by document position — id-1-, id-2- — so inserting one section silently renumbers every anchor below it and breaks deep links.
  • Never link .ipynb. myst.yml excludes notebooks/**/*.ipynb, so the link resolves to null and dies — with no build warning. Use [text](#explicit-target) or a relative .md path.
  • A new doi.org link must be frozen into docs/myst.doi.bib (cd docs && uv run myst build --doi-bib, then commit it). mystmd resolves DOI links against the network at build time, so an unfrozen one makes the build fail whenever a runner's lookup is rate-limited — on somebody else's pull request. Link text is irrelevant; [paper](https://doi.org/…) is resolved just like [](…).
  • TOC entry in docs/myst.yml is mandatory (except testonly_). The sidebar shows the TOC title — keep it consistent with the H1. A page missing from the TOC never renders.
  • Reader-facing cells use plain strings ("time", "frequency") — the low entrance barrier is deliberate. ATTRS/DIMS/COORDS appear only in hidden test cells or in passages explicitly addressed to contributors.
  • Commit only the .md. docs/**/*.ipynb is gitignored; edits made in an .ipynb twin are invisible to both tests and docs until synced back (uv run jupytext --sync <file>).

Tone across all three: conversational, sharp, concise, no filler — but never assuming expertise. Background an expert would skip goes in a :::{dropdown}, off the main line.

3. Editing an existing page

Most doc work is editing, and the house rules make thinning expected work, not scope creep.

  • Run the checker on the page before you start. It should already be at zero errors; if it is not, you inherited a broken page and CI will blame your PR for it — fix it and say so.
  • Every header already carries a target, so the live risk is renaming one: targets are page-global in MyST, and a rename breaks every deep link to it. Grep first — git grep -nF "#old-slug" -- docs — and prefer adding a new section over re-keying an old one.
  • Consolidating across pages is the one home per concept rule doing its job. Say what you moved in the PR body, and keep the orienting recap on the page you thinned.

4. Verify before finishing

uv run python .claude/skills/docs-page/check_docs.py docs/<path>/<page>.md

Errors are render-breaking and exit 1 — the same exit code the Docs style CI job gates on, so this run is the gate, locally. Warnings are drift and exit 0. Then, for a tutorial or an explainer — test-gen walks docs/notebooks/ and docs/explanation/, so both are in the pytest suite:

uv run test-gen
uv run pytest "tests/autogen_notebooks/<category>/<name>.ipynb" -n0 --no-cov
# explainers land flat under explanation/:
uv run pytest "tests/autogen_notebooks/explanation/<name>.ipynb" -n0 --no-cov

(--nbmake is already in pytest addopts.) A page only joins that suite once it carries a jupytext kernelspec — that is the exact condition _is_executable_page tests, so a frontmatter-less page is skipped rather than failing with no kernel to start.

Guide cells are executed by the docs build only — cd docs && uv run myst build --html --execute locally, the same command deploy.yml runs on every PR. A guide that pulls in an external file (the per-skill Contribute pages quote each SKILL.md this way — a literalinclude with :filename: as the label and :class: skill-quote) is re-read on every build, so the quoted content is always current; a missing or renamed path surfaces as a ⛔️ error and hard-fails myst build --strict. (uv run docs and myst start serve a live preview and never exit; they are for reading the site, not for checking it.)

Two pathspec traps, both of which produced wrong answers while auditing this repo:

  • git grep … -- 'docs/**/*.md' silently skips docs/index.md — no intermediate directory. Use -- docs.
  • grep -r docs/ walks ~9,800 gitignored _build/ files carrying stale copies of everything.

Checklist

<!-- excerpt:start -->
  • [ ] Genre identified; the matching template and patterns.md read
  • [ ] Frontmatter exact, display_name: Python 3 (xmris)
  • [ ] (target)= + single H1 is the very first content; a target above every header
  • [ ] Reader-facing cells use plain dim strings; config singletons only in hidden cells
  • [ ] Synthetic MRS data comes from simulate_fid; tutorials open with the functions-used table
  • [ ] TOC entry in docs/myst.yml (unless testonly_); no .ipynb links
  • [ ] New doi.org link frozen into docs/myst.doi.bib (myst build --doi-bib) and committed
  • [ ] check_docs.py passes on the page (0 errors)
  • [ ] Tutorial only: single-notebook nbmake run is green
  • [ ] Only the .md staged
<!-- excerpt:end -->

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/write-an-xmris-docs-page-ms2s7bcz/download' --output '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md.part' && mv '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md.part' '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md' && test -s '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/docs-page' && cp -R '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz' '.claude/skills/docs-page'

Cursor
test -f '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md' && test -s '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/docs-page' && cp -R '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz' '.cursor/skills/docs-page'

Codex
test -f '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md' && test -s '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/docs-page' && cp -R '.skill-downloads/write-an-xmris-docs-page-ms2s7bcz' '.agents/skills/docs-page'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/write-an-xmris-docs-page-ms2s7bcz'

openskills read 'write-an-xmris-docs-page-ms2s7bcz'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/write-an-xmris-docs-page-ms2s7bcz/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires