Synthèse automatique
Automatise la création d’une pull request GitHub pour la branche courante en collectant les diffs, en lançant les vérifications préalables, en analysant la santé du code, en synchronisant avec main, en détectant le ticket lié et en classant les changements pour la revue.
Points forts
- Impose le passage des vérifications CI locales (lint, JSDoc, tests, build/typecheck) avant l’ouverture de la PR.
- S’appuie sur le MCP CodeScene pour noter les fichiers JavaScript modifiés et guider la correction des code smells.
- Distingue les changements triviaux des changements non triviaux afin de concentrer la revue sur ce qui compte.
- Détecte le numéro de ticket, vérifie qu’il est ouvert avant d’ajouter le mot-clé de fermeture, et synchronise la branche avec main.
Limites
- Suppose un projet Node avec des scripts npm précis, ainsi que le MCP CodeScene et GitHub CLI.
- La section sur le contrôle ADR est tronquée dans le fichier fourni, ce qui rend son comportement final incertain.
- S’arrête sur les conflits de fusion ambigus et ne garantit pas une résolution automatique fiable.
À utiliser pour un flux /pr rigoureux qui exécute les contrôles, synchronise avec main et prépare un résumé de PR axé sur la revue.
À éviter sur un projet non Node, sans CodeScene, ou lorsqu’une résolution autonome des conflits sans revue manuelle est attendue.
Analyse de sécurité
PrudenceThe skill is a transparent, well-documented PR workflow that only uses conventional tooling (git, npm, gh, CodeScene MCP) for its stated purpose. There is no obfuscation, credential harvesting, or destructive command, but it does perform privileged writes (auto merge-conflict resolution, commit and push, autonomous CI/review fixes, PR creation) and ships code to a third-party service, so it warrants a caution rating rather than safe. No prompt-injection or instruction-override attempts were present in the content.
- •Runs git write operations (fetch, merge, commit, push -u origin) and gh pr create; these mutate the repository and remote branch, which is legitimate for a PR workflow but is meaningful non-read-only execution.
- •Automatically resolves merge conflicts and pushes ('Resolve each conflict automatically only when the resolution is unambiguous', then commit and push) - bounded by an abort-and-report rule for ambiguous cases, but still an autonomous write path.
- •Autonomously applies and pushes fixes for review comments and loops on CI failures without per-change confirmation (only ambiguous comments escalate via AskUserQuestion).
- •Sends changed .js files' content to the external CodeScene MCP service for code_health_score / code_health_review, a third-party data-sharing consideration.
- •Relies on an agent-specific tool (subscribe_pr_activity) whose availability is environment-dependent; no malicious/obfuscated instructions, no secret exfiltration, no curl|sh or destructive commands found.
- •Automatically merges origin/main into the working branch and resolves conflicts, then pushes — automated write operations against the remote repository (aborts only on ambiguous conflicts and re-runs tests).
- •Subscribes to remote PR webhook activity (subscribe_pr_activity / unsubscribe_pr_activity) and auto-applies/pushes fixes for CI failures and unambiguous review comments, which could land changes with limited human oversight between events.
- •Uses powerful tooling (git, npm, gh CLI, CodeScene MCP, remote-execution integration) for legitimate purposes; no secret exfiltration, obfuscated payloads, curl|sh, or destructive filesystem commands are present.
Exemples
/prUse /pr to open a GitHub pull request for this branch, run all pre-flight checks, sync with main, and summarize non-trivial changes for reviewers.Before opening the PR, run /pr and check CodeScene health scores for every changed JavaScript file.Pull Request Command
You are creating a GitHub Pull Request for the current branch with an AI-generated summary that highlights non-trivial changes for manual review.
Core Principle
Categorize every change as trivial or non-trivial so reviewers can focus their attention where it matters most.
Workflow
When the user invokes /pr:
1. Gather Context
First sync the fresh upstream ref without touching the local main branch: git fetch origin main.
Then run in parallel:
git branch --show-currentgit log origin/main..HEAD --onelinegit diff origin/main...HEADgit statusgit log origin/main..HEAD --format="%s%n%n%b"
If the branch is main, stop. If no commits ahead of origin/main, stop. If there are uncommitted changes, invoke /commit first.
2. Pre-flight CI checks
Run all four CI jobs locally in sequence. Stop immediately and report the failure if any step exits non-zero — do not open the PR.
npm run standard
npm run jsdoclint
npm test
npm run build && npm run typecheck
Report format on failure:
"Pre-flight failed:
<step name>— <first error line>. Fix the issue and run/pragain."
3. Code Health Check
Get the list of .js files changed in this branch:
git diff origin/main...HEAD --name-only | grep '\.js$'
For each changed .js file, call the CodeScene code_health_score tool. If any file scores below 10.0:
- Call
code_health_reviewon that file for detailed guidance. - Fix the identified code smells following the MCP server's guidance.
- Re-run
npm run standard && npm testto confirm nothing broke. - Repeat until the score reaches 10.0, or document in the PR body why a remaining smell is out of scope for this change (e.g., a god file that can't be split without a major refactor).
If no .js files were changed, skip this step.
5. Sync with Main
Before opening the PR, merge the latest main into the current branch to eliminate post-open merge conflicts.
Run in sequence:
git fetch origin main
git merge origin/main --no-edit
If the merge succeeds cleanly, push the updated branch:
git push -u origin <current-branch>
If the merge fails with conflicts:
- Run
git statusto list conflicting files. - Resolve each conflict automatically only when the resolution is unambiguous (e.g., the branch added a new file that
mainnever touched). - If any conflict is ambiguous, abort the merge (
git merge --abort), report the conflicting files to the user, and stop — do not proceed to PR creation. - After resolving, run
npm run standard && npm testto confirm the merge didn't break anything, thengit commit --no-editand push.
6. Detect the Issue Number
Search in this order, stopping at the first match:
- Branch name — patterns:
^(\d+)-,^claude/build-(\d+)-,^claude/(\d+)- - Commit messages —
git log origin/main..HEAD --format=%B | grep -oE '#[0-9]+' - Plan frontmatter — look for
github_issue: <number>
If no issue detected, skip the closing keyword. Do not invent one.
Verify the issue is open before adding the keyword:
gh issue view <number> --json number,state -q '.state' 2>/dev/null
Skip if CLOSED or lookup fails.
7. Analyze Changes
Categorize every change:
Non-trivial (warrant manual review):
- New distributions or statistical methods
- Changed PDF/CDF/quantile formulas
- New special functions or algorithms
- Behavioral changes (different return values, changed parameter constraints)
- New public API surface
- Dependency changes
Trivial (mechanical/low-risk):
- Formatting, whitespace, line reordering
- Method/function reordering within a file
- Renames with no logic change
- Import reordering or cleanup
- Docstring/comment additions only
8. ADR Gate (non-trivial PRs only)
Check for ADR references in the diff and commits:
git diff origin/main...HEAD --name-only | grep decisions/
If non-trivial changes exist but no ADRs are found, add a warning block:
> **⚠ Missing ADR**: This PR contains non-trivial changes but no Architecture Decision Record was found.
> Consider adding one at `decisions/` to document the design rationale.
> See `decisions/0000-template.md` for the format.
9. Generate PR Title
- Concise (under 70 characters), imperative mood
- e.g., "Add LogNormal distribution", "Fix CDF for discrete distributions"
10. Generate PR Body
<If an issue was detected:>
Closes #<issue-number>
<If ADR warning needed, insert it here>
## Summary
- <1-3 bullet points describing what this PR does and why>
## Design decisions
<If ADRs exist:>
- [ADR-NNNN: <title>](decisions/NNNN-slug.md) — <one-line summary>
<If no ADRs and no non-trivial changes, omit this section.>
## Non-trivial changes
<List them:>
- **`<file path>`**: <Description of what changed and why it matters>
<If no non-trivial changes:>
_No non-trivial changes — this PR is purely mechanical._
## Comprehension checklist
- [ ] I can explain what this code does without reading line-by-line
- [ ] I understand *why* this approach was chosen over alternatives
- [ ] WHY comments are present where the logic is non-obvious
- [ ] Tests verify observable behavior, not internal state
- [ ] A developer encountering this code in 6 months could understand it
<details>
<summary>Trivial changes</summary>
- **`<file path>`**: <Brief description>
</details>
---
*Generated with [Claude Code](https://claude.ai/code)*
11. Create the PR
gh pr create --title "<title>" --body "$(cat <<'EOF'
<body content>
EOF
)"
12. Watch the PR (CI + reviews)
Immediately after the PR is created, subscribe to its activity so CI failures and review comments are handled without the user having to ask:
subscribe_pr_activity(<pr-number>)
Availability:
subscribe_pr_activityis provided by the remote-execution / GitHub webhook integration. If the tool is unavailable (e.g. a purely localghsession), skip this step and tell the user the PR can't be auto-watched here.
After subscribing, end the turn — do not poll with sleep or repeated status checks.
PR events arrive as <github-webhook-activity> messages that wake the session. When one
arrives, investigate it and follow this loop:
- CI check failed → reproduce locally, diagnose the root cause, push the fix, and update a short status checklist. Re-kick on each failure until green; the green status IS the deliverable, not a no-op to skip. Reply only when it resolves the task or raises a question.
- Review comment → if the fix is unambiguous and not architecturally significant, apply
and push it. If there is any ambiguity (a comment open to interpretation, or a change
touching something significant), use
AskUserQuestionto confirm before acting. - Duplicate / no-action-needed event → skip silently.
- Merge conflict reported → fetch the base branch, merge it in, resolve conflicts,
re-run
npm run standard && npm test, and push.
Stop watching the moment the user asks — call unsubscribe_pr_activity(<pr-number>) and push
no further changes to that PR.
13. Report
"PR created: <URL>
Closes: #<issue> (or "None") Non-trivial changes: <count> (or "None") Watching: subscribed to PR activity — I'll auto-fix failing CI and respond to review comments as they arrive (or "not available in this environment")."
Rules
DO:
- Read the FULL diff before categorizing
- Always include
Closes #Nwhen an issue is detectable - Be specific about what changed in non-trivial items
- Subscribe to PR activity after creation and follow through on CI/review events
- Escalate ambiguous review comments via
AskUserQuestionbefore acting
DO NOT:
- Create a PR if on
main - Invent an issue number
- Add
Closes #Nfor an already-closed issue - Poll for CI/review status with
sleepor repeated checks — react to webhook events instead - Keep pushing to a PR after the user asks you to stop watching it
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 annexesCe 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.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/pull-request-command-mt9mgloj/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/pull-request-command-mt9mgloj' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/pull-request-command-mt9mgloj/download' --output '.skill-downloads/pull-request-command-mt9mgloj/SKILL.md.part' && mv '.skill-downloads/pull-request-command-mt9mgloj/SKILL.md.part' '.skill-downloads/pull-request-command-mt9mgloj/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/pull-request-command-mt9mgloj/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.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.