Synthèse automatique
Prépare et ouvre une pull request en brouillon dans le dépôt Redocly CLI à partir d'une branche existante ou d'une nouvelle branche créée depuis main, en gérant les fichiers indexés, les vérifications et le changeset.
Points forts
- Distingue clairement les fichiers indexés de ceux à indexer et demande confirmation en cas d'ambiguïté.
- Définit des règles explicites pour choisir ou créer la branche, avec l'interdiction de pousser main.
- Prévoit l'exécution des contrôles npm pertinents et la création d'un changeset avant publication.
- Garde les échecs visibles sans les intégrer au corps de la PR lorsqu'ils ne sont pas liés au changement.
Limites
- Le texte fourni s'arrête au milieu de la section sur le changeset : la création effective de la PR et le remplissage du modèle ne sont pas détaillés.
- Le skill est fortement spécifique au dépôt Redocly CLI, à ses scripts npm, à son changelog et à son modèle de PR.
- Il suppose que git, GitHub CLI et les dépendances locales du projet sont disponibles.
À utiliser lorsqu'un contributeur du dépôt Redocly CLI veut transformer des modifications locales ou une branche en PR ou PR brouillon prête à être relue.
À éviter pour un autre dépôt, ou lorsque l'utilisateur veut seulement modifier du code sans publier de branche ni de PR.
Analyse de sécurité
PrudenceThe skill uses legitimate but powerful tooling: git fetch/switch/add/commit/push, npm scripts, and gh API/PR creation against a public repository. These actions are intentional for opening a draft PR, and the instructions include sensible guardrails such as never pushing main, avoiding broad git add, preserving the PR template, and not hiding failures. I found no destructive commands, secret exfiltration, obfuscated payloads, or attempts to override the auditor.
- •No allowed-tools are declared, yet the skill depends on shell access, `git push`, and GitHub CLI network calls; it relies on the host agent's ambient permissions instead of an explicit tool allowlist.
- •Step 3 runs `npm run compile`, `npm run lint`, `npm run typecheck`, and `npm test`, which execute repository-controlled scripts and dependencies; normal for this repo, but it is arbitrary code execution if the skill is pointed at an untrusted checkout.
- •The workflow pushes a branch to a public remote and opens a public PR, so staged files, commits, and the PR body become public; the skill does warn about this and keeps secrets out of scope.
Exemples
Open a draft PR in the Redocly CLI repo from my current branch. The changes are already staged, and I need the changeset checked.Create a draft pull request for this fix, but my current branch is main. Put the uncommitted files on a new fix/ branch from origin/main and add the changeset.Prepare my Redocly CLI change for review: run the required checks, add a changeset if needed, and open a draft PR without touching my local notes.name: pr description: Open a draft pull request in the Redocly CLI repository from a branch without a PR, or a new branch from main — commit the staged files, or the files of the change when nothing is staged, check the changeset, and fill the PR template without removing any of its sections. Use whenever the user asks to open, create, or prepare a PR or draft PR, push work for review, or ship a change, even if they do not say "draft".
Open a draft pull request
Redocly CLI is a public repository. The branch name, commits, PR title, and PR body are public, and a reviewer reads every line.
This skill publishes the user's work. It does not change code: the only file it may create is a changeset.
1. Understand the change
- Run
git fetch origin main, then readgit status --short,git diff --cached, andgit diff. The change is the uncommitted files, plus the commits of the current branch when step 2 uses that branch. - When the user staged files, they chose the files of the change, so the change is the staged files. When an unstaged or untracked file seems to belong to it, ask the user to stage it before you go on.
- When nothing is staged, list the files that belong to the change, and step 5 stages them.
Leave out everything else: untracked drafts, local notes and plans, and a
package-lock.jsonthat only a localnpm installchanged. When you are not sure that a file belongs, ask. - Find the why in the conversation, the commits, or the linked issue. If no source says why, ask the user before you write the PR body.
2. Choose the branch
Use the current branch when it is not main and has no PR yet (gh pr list --head <branch> --state all is empty).
The user created it for this change, so its commits belong to the PR: read them with git log origin/main..HEAD and git diff origin/main...HEAD.
Otherwise, create the PR branch from origin/main:
git switch -c <type>/<short-topic> origin/main
The uncommitted files come with the switch, and the commits of the current branch stay out of the PR.
Name the branch after the commit type and the topic, for example fix/bundle-ref-paths.
Never push main.
- If git refuses the switch because an uncommitted file conflicts with
origin/main, stop and ask. - Do not rebase, merge, reset, or stash without asking.
3. Check the change
Run these from the repository root:
npm run compile # tests import the compiled lib/ output
npm run lint
npm run typecheck
npm test
- For a change to docs only,
npm run lintandnpx redocly recheck <changed files> --config docs/redocly.yamlare enough. - If the diff came from an AI assistant, run
/deslopbefore you commit. When the user staged the files, ask them to review its edits and stage the edited files. - If a check fails because of the change, stop and report the failure. If it fails for an unrelated reason, such as a flaky test or a missing local tool, report it to the user with its output. Never hide a failure, but keep it out of the PR body: the pipelines show it, and every check must pass before the merge.
4. Add a changeset
Every feat or fix that changes a published package needs a changeset (see CONTRIBUTING.md and .claude/rules/workflow.md).
When the change needs a changeset and none exists, write one. It is a file of the change: when the user staged the files, ask them to stage it too, and otherwise step 5 stages it.
-
Read the package names in
.changeset/config.json, and read the top of the packageCHANGELOG.mdto match its wording. -
Write
.changeset/<three-random-words>.md:--- '@redocly/cli': minor --- Added the `skills` command that installs the Redocly CLI agent skills for AI coding agents.
- List only the packages whose behavior changed for users.
If the code is in another package, such as
@redocly/openapi-core, but it changes CLI behavior, list@redocly/clitoo. - Write one sentence in the past tense from the user's point of view: "Added …", "Fixed … so that …". Add a short Note only when the user has to change something to keep an existing flow working, and say what. A Note that repeats the sentence, such as "lint now reports …" after "Added the … rule", is noise.
- Changes to docs, tests, CI, or AI instructions need no changeset.
The PR then gets the
no changeset neededlabel (step 7).
5. Commit
- When the user staged the files, commit them and stage nothing else.
- Otherwise, stage each file of the change by its path:
git add <path> <path>. Do not usegit add .,git add -A, or a folder path. They also stage untracked drafts, and a draft stays in the public history even after you remove it. - Before you commit, compare
git diff --cached --name-onlywith the files of the change from step 1. - Write one Conventional Commits sentence, such as
feat: add the skills commandorfix(respect): keep cookies between steps. The types in use arefeat,fix,docs,chore, andtest. The scope is optional. - Do not add AI co-author or "Generated with" lines.
- The pre-commit hook lints and formats the staged files.
If it fails, fix the cause, then stage the fixed file again when you staged it, and otherwise ask the user to review and stage it.
Do not use
--no-verify.
6. Write the PR body
Copy .github/pull_request_template.md to a temporary file, for example $TMPDIR/pr-body.md, and fill it in.
Write the file with your file-writing tool instead of echo or a heredoc, so backticks and quotes stay intact.
Keep the template whole.
Keep every header, every checkbox, and every <!-- required 🔒 --> comment.
Keep ## Screenshots (optional) even when it stays empty.
CONTRIBUTING.md says: "Please do not modify the PR template."
- What/Why/How?
The reader knows Redocly CLI but has not read this code.
Describe the changes, and keep the section short:
- One sentence on why: the current limit or bug that users have.
- One sentence on what changes, at the level of commands, options, rules, and output.
- A bullet only for a major decision that the code does not show. A decision that follows the existing approach is obvious, so it stays out.
- Leave out the background that does not explain the problem, and what the reader can read in the code, such as the details of the implementation.
- Reference: public links only, such as a GitHub issue or a related PR. Leave it empty when there is none. Each related link goes in this section.
- Testing: one line that lists the kinds of tests applied, such as local, unit, e2e, smoke, or performance, for example "Locally, E2E tests.". Describe the procedure only when it is specific to the change, such as a manual check that no test covers. The section describes what was done, so it carries no results and no failures.
- Screenshots (optional): keep the header. For a change to CLI output, tell the user that a screenshot helps the reviewer. Add images only when the user gives them.
- Check yourself and Security: check a box only when it is true for this PR. A box about code, such as "All new/updated code is covered by tests" or "Code follows company security practices and guidelines", stays unchecked when the PR changes no code. Leave the other boxes unchecked. Do not delete any box.
The repository is public, so keep internal context out of the title, body, and commits. When the user tells you such context, use it to understand the why. Then write the why as the public problem that users have.
Write plain English: short sentences, active voice, no filler, and no marketing tone. Say each thing once in the whole body.
7. Push and open the draft PR
git push -u origin HEAD
gh pr create --draft --base main --title "<title>" --body-file "$TMPDIR/pr-body.md"
- Use the main commit sentence as the title.
- Add
--label "no changeset needed"when step 4 found that no changeset is needed. - When the author is a member of the Redocly organization (
gh api orgs/Redocly/members/$(gh api user --jq .login)returns204), add--assignee @me. - Add
--project "Dark Side Board"when the user asks for it. - Always open a draft PR.
- Delete the temporary body file.
- Give the user the PR URL and the list of committed files. Name anything that you left out on purpose, such as untracked files or an unrelated failing check.
Update an open PR
The user often edits the PR body on GitHub, for example to add screenshots.
Before you change the body, read the current version with gh pr view <number> --json body, and change only the part that must change, so that their edits stay.
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/open-a-draft-pull-request-mwrc4xnc/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/open-a-draft-pull-request-mwrc4xnc' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/open-a-draft-pull-request-mwrc4xnc/download' --output '.skill-downloads/open-a-draft-pull-request-mwrc4xnc/SKILL.md.part' && mv '.skill-downloads/open-a-draft-pull-request-mwrc4xnc/SKILL.md.part' '.skill-downloads/open-a-draft-pull-request-mwrc4xnc/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/open-a-draft-pull-request-mwrc4xnc/SKILL.md' && test -s '.skill-downloads/open-a-draft-pull-request-mwrc4xnc/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/pr' && cp -R '.skill-downloads/open-a-draft-pull-request-mwrc4xnc' '.claude/skills/pr'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’OpenSkillsopenskills install './.skill-downloads/open-a-draft-pull-request-mwrc4xnc'openskills read 'open-a-draft-pull-request-mwrc4xnc'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 syncMode 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/open-a-draft-pull-request-mwrc4xnc/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.