Créer ou mettre à jour une pull request

VérifiéPrudence

Guide l'IA pour rédiger des descriptions de PR structurées avec résumé, plan de test, diagrammes d'architecture et différences de format. Inclut des commandes git pour rassembler le contexte.

Spar Skills Guide Bot
DeveloppementIntermédiaire
26/07/2026
Claude CodeCursorCodex
#pull-requests#git-workflow#pr-description#mermaid-diagrams#test-plan

Recommandé pour

Synthèse automatique

Rédige ou met à jour la description d'une pull request selon un squelette fixe (résumé, plan de test) complété par des sections conditionnelles : diff de format filaire, architecture, flux CLI, arborescence de stockage et sémantique HA.

Points forts

  • Lit le git log et le diff par rapport à origin/main et repère les issues liées (#N, Closes #N) dans les messages de commit avant de rédiger.
  • Impose un squelette homogène, dont une checklist de tests listant les commandes réellement exécutées et leurs résultats (fmt, clippy, cargo test, e2e, check-docs).
  • N'ajoute les sections de forme (diff de format filaire, diagramme mermaid, sémantique HA) que si le diff les justifie, et fait valider les blocs mermaid via make check-docs.
  • Gère aussi la mise à jour d'une PR existante par son numéro et renvoie à une PR canonique pour le ton et la structure.

Limites

  • Très lié aux conventions d'un dépôt précis (Rust/cargo, CLI plonk, FlatBuffers, PlonkStorage) : le squelette doit être adapté ailleurs.
  • Suppose un remote origin/main et une branche locale ; ne pousse pas le code et ne crée pas la PR lui-même.
  • Processus disproportionné pour un correctif d'une ligne ou une revue purement conversationnelle.
Quand l'utiliser

À utiliser quand une branche est terminée et qu'il faut un corps de PR lisible pour la revue, ou pour rafraîchir la description d'une PR existante.

Quand l'éviter

À éviter pour une modification triviale ou dans un dépôt qui ne suit pas ce squelette, le processus étant alors plus coûteux que le changement.

Analyse de sécurité

Prudence
Score qualité92/100

The skill uses standard development tools (git, gh) for a legitimate purpose: creating or updating pull requests. It does not include destructive commands, exfiltration, obfuscation, or disabling safety. The main concern is the use of shell and network operations, which warrant a caution rating.

Points d'attention
  • •Skill executes shell commands (git, gh, mktemp) and pushes code to a remote repository via `git push -u origin`, which is a network action.
  • •Declared allowed-tools is empty, but the skill body uses bash commands; if the execution platform enforces allowed-tools, this may fail or need declaration.
Comment cette analyse est faite

Exemples

Create PR for current branch
/pr
Update an existing PR description
/pr 364
Natural-language trigger
Draft a pull request description for my branch: diff it against origin/main, list the tests I ran with their results, and include a wire-format before/after if the spec changed.

/pr — Create or Update a Pull Request

Description

Creates a PR with a structured description that lets a reader understand the change without reading the diff. Can also update an existing PR's description.

The canonical example for this project is PR #364 (PlonkStorage slice 5 — PlonkNats CRD + conditions-based reconciler/worker). When in doubt about structure, tone, or how to weave code blocks and mermaid diagrams into the body, open that PR and match it.

Instructions

When the user runs /pr or /pr <pr-number>, follow this workflow:

Phase 1: Gather context

  1. Determine mode:

    • /pr with no number: create a new PR
    • /pr <number>: update the description of an existing PR
  2. Read the branch state:

    git log --oneline origin/main..HEAD
    git diff --stat origin/main..HEAD
    
  3. Read the full diff to understand all changes:

    git diff origin/main..HEAD
    
  4. Check for linked issues in commit messages (look for #<number>, Part of #<number>, Closes #<number>).

Phase 2: Draft the description

The description has a fixed skeleton plus change-shape sections that you include only when the change actually has them. The skeleton always present:

Summary

2–4 sentences. State what the PR does and the headline test signal (e.g. make e2e-full → 39/39 green in 9m). Link the epic it's part of. If it lands a methodology shift (new architectural pattern, refactor target), name it here and link the doc that codifies it.

Test plan

Markdown checklist. Mark completed items with [x]. List every verification command actually run, with results:

  • cargo fmt --all
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test -p <package> with pass count
  • make e2e-full with pass count + wall-clock when relevant
  • make check-docs when docs were touched
  • Manual verifications and the commands that produced them

Change-shape sections (include the ones that apply, in this order):

Wire-format diff

Whenever the PR changes a CRD spec/status, a FlatBuffer message, an env var contract, or any other persisted interface, show the before → after as YAML/Rust/proto snippets in a fenced code block. The reader should see the shape change without inferring it from the diff.

Architecture

Explain how the new pieces fit together. For reconciler/worker work this means: which fieldManager owns which condition, how the watch fires, what the worker's exact responsibility is. Include a mermaid sequence diagram when the flow crosses ≥3 actors (CR → reconciler → NATS → worker → apiserver → kube-controller). Validate every mermaid block with make check-docs (or mmdc) before pushing — broken diagrams render as raw text on GitHub.

When this section is non-trivial, put the full version in docs/<feature>.md and link it from the PR; the PR section is the precis.

CLI flow

If plonk install / plonk uninstall ordering changed, list the new steps with the prior order alongside (numbered list or table). Call out steps that exist purely to dodge a chicken-and-egg (e.g. bootstrapping NATS with the operator's fieldManager so the first operator reconcile is a no-op SSA).

Storage layout / mount paths

If persistent storage shape changed (new PVC, new mount path, new tier consumer), state the path convention applied (<tier-base>/<workload>/<n> for StatefulSets, <tier-base>/<workload> for Deployments) and how the ordinal subdir is realised (downward API → shell wrapper).

HA semantics

For workloads that scale: explain the replicas: 1 behaviour and the replicas: N behaviour. State the failure mode tolerated (e.g. "JetStream streams configured replicas: 3 tolerate single-node failure"). Name any production-only knobs the change unlocks.

What this slice does NOT ship

Bullet list of related work explicitly out of scope, each pointing at the issue/epic that tracks it. The point is to head off "why didn't you also fix X?" review comments by showing that X is known and queued.

Spec-change re-dispatch (reconciler PRs only)

When the reconciler decides whether to re-publish a worker task, name the helper (e.g. dispatched_for_generation) and the comparison it does (Dispatched.observedGeneration vs metadata.generation). Link the unit test that pins boundary behaviour.

Phase 3: Create or update the PR

For new PRs:

Write the body to a tempfile and use --body-file. Heredoc + inline backticks in the body breaks GitHub's markdown rendering — backticks inside heredocs get escaped or mangled. Tempfile + --body-file is the only reliable form.

BODY_FILE=$(mktemp)
cat > "$BODY_FILE" <<'EOF'
## Summary
...
EOF

git push -u origin <branch-name>
gh pr create --draft --title "<title>" --body-file "$BODY_FILE"
rm "$BODY_FILE"

PRs are always created as draft ([[feedback_draft_prs]]). The user marks ready for review; never do it automatically.

For existing PRs:

BODY_FILE=$(mktemp)
cat > "$BODY_FILE" <<'EOF'
...
EOF
gh pr edit <number> --title "<title>" --body-file "$BODY_FILE"
rm "$BODY_FILE"

Rules

  • Title: Under 70 characters. Lead with a verb or the epic/slice name (PlonkStorage slice 5: ...). No period.
  • Body: Use a tempfile + --body-file, never inline heredoc with backticks.
  • Tone: Concrete and specific. Code blocks beat prose summaries — show the actual YAML/Rust diff instead of describing it ([[feedback_human_communication]]).
  • Mermaid diagrams: Validate with make check-docs before pushing. Avoid semicolons inside Note over text — the parser breaks.
  • No AI references: Never mention AI tools, Claude, or add Co-Authored-By tags.
  • No fabricated estimates: Don't add "rollout takes ~2h" or similar timings unless they were actually measured ([[feedback_no_fabricated_estimates]]).
  • No forward-looking phrasing in inline comments the PR introduces: keep PR-anchored TODOs out of source per the CLAUDE.md comment-hygiene rules.
  • Always show the user the drafted title and description before creating/updating.
  • Return the PR URL when done.

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/create-or-update-a-pull-request-ms1aw3cj/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/create-or-update-a-pull-request-ms1aw3cj' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-or-update-a-pull-request-ms1aw3cj/download' --output '.skill-downloads/create-or-update-a-pull-request-ms1aw3cj/SKILL.md.part' && mv '.skill-downloads/create-or-update-a-pull-request-ms1aw3cj/SKILL.md.part' '.skill-downloads/create-or-update-a-pull-request-ms1aw3cj/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

Le fichier ne fournit pas un en-tête name/description exploitable pour cette procédure native. Le téléchargement reste disponible pour lecture ; utilisez le mode manuel ci-dessous.

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/create-or-update-a-pull-request-ms1aw3cj/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