Mise à jour de documentation technique

VérifiéSûr

Aligner un document technique avec l'implémentation réelle du code. Corriger la dérive documentaire entre la documentation et le comportement du système.

Spar Skills Guide Bot
DocumentationIntermédiaire
28/07/2026
Claude CodeCursorWindsurfCopilotCodex
#documentation-drift#code-audit#technical-writing#repo-analysis#docs-maintenance

Recommandé pour

Synthèse automatique

Compare les affirmations d'un document technique au code réellement présent dans le dépôt, puis corrige la dérive documentaire en éditant le document concerné.

Points forts

  • Déroule une méthode explicite : extraire les affirmations du document, inspecter l'implémentation, puis éditer en conséquence.
  • Distingue clairement les sources de vérité (code, tests, schémas, configuration) du matériau de référence non vérifié (anciens docs, commentaires, issues).
  • Préserve l'état cible de la documentation canonique sous docs/ et signale les écarts d'implémentation au lieu d'aligner les docs sur un bug.
  • Oriente les notes de migration, checklists et travaux exploratoires vers docs/tmp/ ou des chemins de passation ignorés par git.

Limites

  • Suppose un dépôt déjà extrait et l'accès à git ; inutilisable sur une simple pièce jointe ou un document isolé.
  • Dépend fortement des conventions internes du dépôt (docs/Workflows/MoonSpecDocumentModel.md, docs/DocumentationArchitecture.md) qui n'existent pas partout.
  • Reste un guide de procédure : la qualité de l'audit dépend de la profondeur d'inspection du code par l'agent.
Quand l'utiliser

À utiliser lorsqu'un document technique est soupçonné d'être obsolète par rapport au code et qu'il faut le réaligner ou produire un rapport de dérive.

Quand l'éviter

À éviter pour rédiger une documentation entièrement nouvelle ou pour modifier volontairement un contrat cible, cas où l'alignement sur l'implémentation actuelle serait trompeur.

Analyse de sécurité

Sûr
Score qualité88/100

The skill provides instructions for auditing and editing documentation against source code. It does not declare or invoke any shell commands, destructive actions, network calls, or data exfiltration. The only execution-adjacent references are read-only searches like `rg` and file inspection, which present no meaningful security risk.

Aucun point d'attention détecté

Comment cette analyse est faite

Exemples

Realign an architecture doc
Update docs/Architecture/WorkflowEngine.md so it matches the current implementation. Audit each claim against the source, tests, and schemas, and list any places where the code does not meet the documented target behavior instead of rewriting the target.
Audit API docs for drift
Our API documentation in docs/api/ is probably stale. Compare it against the actual routes, request/response schemas, and validation in the repo, then fix the drift and tell me what changed.
Scoped operator runbook check
Only review the 'Retry policy' and 'Configuration' sections of docs/Operators/Runbook.md. Verify them against the committed config and retry logic, correct anything that is wrong, and report gaps you cannot resolve rather than guessing.

name: document-update description: Align a technical document with the actual code implementation and correct drift. Use when a user asks to update docs to match current behavior, audit a technical document against the repository, or fix stale architecture, API, workflow, or operator documentation. metadata: required-capabilities: - git

Document Update

Update one or more technical documents so they accurately describe the implementation that exists in the current checkout.

Purpose

Correct documentation drift by comparing the document's claims against source code, tests, schemas, configuration, and runtime entrypoints, then editing the document to describe the actual system behavior.

For canonical documentation under docs/, do not downgrade the documented desired state to match a buggy or incomplete implementation. When code contradicts the intended architecture, contract, operator-visible behavior, or target semantics, report the implementation gap clearly and preserve the canonical desired-state framing unless the user explicitly asks to change the target contract.

Inputs

  • Required: target document path, documentation topic, or explicit drift report.
  • Required: current repository checkout containing the implementation to verify.
  • Optional: feature/spec path that explains intended behavior.
  • Optional: scope limits, such as specific sections, APIs, workflows, UI behavior, or files.
  • Optional: verification commands requested by the user or repository instructions.

Documentation Boundaries

  • Treat repository files, tests, schemas, and executable configuration as the source of truth for implementation behavior.
  • Treat retrieved context, old docs, comments, generated artifacts, and issue text as reference material until confirmed against the current checkout.
  • Keep canonical docs under docs/ focused on desired state: architecture, contracts, operator-visible behavior, and target semantics.
  • Put migration notes, rollout checklists, implementation backlogs, and temporary investigation details under docs/tmp/ or in gitignored handoff paths (for example artifacts/ for tool handoffs, or run-local specs/<feature-id>/ packets), not as the main framing of canonical docs.
  • Follow the document classes and precedence rules in docs/Workflows/MoonSpecDocumentModel.md.
  • When docs/DocumentationArchitecture.md exists, fix or report missing metadata, unclear authority, missing embedded rationale, duplicate contract definitions, imperative leakage in canonical docs, and unverifiable canonical claims.
  • Route broad, multi-document, or uncertain improvement work to a bounded docs/tmp/ improvement plan instead of making speculative canonical edits.
  • When a superseded behavior is no longer implemented, remove or replace the stale description instead of preserving compatibility-era ambiguity.

Workflow

  1. Resolve the update target.

    • Identify the document path or section to update.
    • If the user provides only a topic, search likely docs with rg and choose the narrowest document that owns the topic.
    • If multiple documents conflict, identify the canonical owner before editing and update cross-references only when needed.
  2. Extract the document claims.

    • Read the relevant sections and list the concrete claims they make about behavior, contracts, configuration, data flow, APIs, UI, workflows, or operator actions.
    • Separate durable system semantics from historical notes, TODOs, migration plans, or examples.
    • Mark claims that are ambiguous instead of silently guessing their intent.
  3. Inspect the implementation.

    • Search the repository for the named classes, functions, routes, models, settings, activities, schemas, tests, and UI components.
    • Prefer direct evidence from source files, tests, migrations, fixtures, route contracts, type definitions, and committed configuration.
    • For workflow or activity boundaries, inspect the real invocation shape and payload models, not only helper functions.
    • For UI behavior, inspect the component, state helpers, API client, and tests that exercise the user-visible behavior.
  4. Build a drift ledger before editing.

    • For each document claim, classify it as:
      • accurate
      • stale
      • missing
      • ambiguous
      • out_of_scope
    • Record concise evidence for every stale, missing, or ambiguous item.
    • If the implementation appears internally inconsistent, document the inconsistency in the ledger and avoid inventing a new contract.
  5. Determine if the document is out-of-date or not fully implemented.

    • Compare the drift ledger against the current codebase. If all claims are accurate and nothing is missing, the document is up-to-date; stop and report that no update is needed.
    • If the document is stale or missing, check whether the needed update aligns with the project's declared direction.
    • Read the constitution (AGENTS.md), README.md, and the main architecture document under docs/.
    • Assess whether the drift-correcting update would move the document toward or away from those canonical sources.
    • If the update is clearly aligned with the constitution, README, and architecture, proceed to edit the document.
    • If the update appears to contradict the project's declared direction, or if the correct direction is uncertain, do not edit the document. Instead, proceed to step 8 (Jira fallback).
    • If the needed work spans many documents or cannot be made safely in one bounded edit, write a docs/tmp/ improvement plan that records the findings, authority owners, and proposed follow-up instead of broadening the update.
  6. Edit the document.

    • Update only the sections needed to correct the drift.
    • Describe the current behavior directly and concretely.
    • Remove obsolete compatibility language, stale migration framing, and contradicted examples.
    • Preserve the document's existing voice, heading structure, and terminology where they remain accurate.
    • Add or update cross-references only when they help readers find the canonical contract.
    • For documentation architecture defects, either fix the local defect directly or report why it needs follow-up: missing metadata, authority mismatch, missing rationale, duplicate contracts, imperative leakage, and unverifiable claims must not be silently ignored.
  7. Verify the update.

    • Re-read the changed sections and compare them against the drift ledger.
    • Run targeted documentation checks if available.
    • Run the repository-mandated programmatic checks from AGENTS.md, even for documentation-only updates.
    • Add any extra targeted code tests needed when the documentation change depends on behavior that is not already evident from existing tests or source inspection.
    • If verification cannot be run, record the exact blocker.
  8. Jira fallback for misaligned updates.

    • If step 5 determined that the document update is not aligned with the project's direction, create a Jira issue instead of editing the document.
    • Read .agents/skills/jira-issue-creator/SKILL.md and follow its workflow.
    • The Jira issue must include:
      • A clear summary naming the document and the planned update.
      • A description that explains the drift found in the drift ledger.
      • An explicit statement of why the update may conflict with the constitution, README, or main architecture document.
      • The specific document path and relevant implementation evidence.
    • Do not edit the document when creating the Jira fallback issue.
    • Report the created Jira issue key and URL as the primary output.
  9. Finalize the evidence.

    • Summarize which document changed, what drift was corrected, and the implementation evidence used.
    • Include validation commands and results.
    • If a Jira fallback issue was created, include its key, URL, and rationale.
    • If requested by the task, commit the documentation update with a concise message.

Outputs

  • Updated document path(s), or the reason no update was performed.
  • Drift ledger summary with each corrected or intentionally deferred claim.
  • Implementation evidence references, including file paths and relevant tests or schemas.
  • Validation commands run and their result, or the reason validation was not run.
  • Commit hash when the user requested a commit.
  • Jira issue key and URL when a misaligned update triggered the Jira fallback.

Failure Modes

  • Target document cannot be identified: stop and report the candidate documents or missing path.
  • Implementation evidence cannot be found: mark the claim ambiguous; do not assert behavior as implemented.
  • Multiple canonical docs conflict: update the identified owner and note any remaining conflict that needs a separate decision.
  • The document describes intended behavior that code does not implement: report the gap clearly and update only if the user's goal is to document actual behavior.
  • Required verification cannot run: keep the doc update if source evidence is sufficient, but report the blocked command and reason.
  • Secret-like content appears in examples or copied logs: redact it before writing or reporting.
  • Document update contradicts the constitution, README, or architecture: do not edit; create a Jira issue and report the misalignment.
  • Jira fallback blocked: report the exact blocker and preserve the drift ledger for manual review.

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/document-update-ms47vr44/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/document-update-ms47vr44' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/document-update-ms47vr44/download' --output '.skill-downloads/document-update-ms47vr44/SKILL.md.part' && mv '.skill-downloads/document-update-ms47vr44/SKILL.md.part' '.skill-downloads/document-update-ms47vr44/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/document-update-ms47vr44/SKILL.md' && test -s '.skill-downloads/document-update-ms47vr44/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/document-update' && cp -R '.skill-downloads/document-update-ms47vr44' '.claude/skills/document-update'

Cursor
test -f '.skill-downloads/document-update-ms47vr44/SKILL.md' && test -s '.skill-downloads/document-update-ms47vr44/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/document-update' && cp -R '.skill-downloads/document-update-ms47vr44' '.cursor/skills/document-update'

Codex
test -f '.skill-downloads/document-update-ms47vr44/SKILL.md' && test -s '.skill-downloads/document-update-ms47vr44/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/document-update' && cp -R '.skill-downloads/document-update-ms47vr44' '.agents/skills/document-update'

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/document-update-ms47vr44'

openskills read 'document-update-ms47vr44'

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/document-update-ms47vr44/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