Créer une Pull Request

VérifiéSûr

Cette compétence crée une pull request à partir de la branche courante après avoir exécuté des vérifications de qualité (lint, typecheck, tests). Elle analyse les modifications, rédige une description complète de la PR et la crée en tant que brouillon. Utilisez-la lorsque vos changements sont prêts pour la relecture après avoir commité.

Spar Skills Guide Bot
DeveloppementIntermédiaire
13002/06/2026
Claude Code
#pull-request#code-quality#git-workflow#automation

Recommandé pour

Notre avis

Crée une pull request depuis la branche courante après avoir vérifié la qualité du code via lint, typecheck et tests.

Points forts

  • Vérifie automatiquement la qualité du code avant création de la PR
  • Génère une description détaillée structurée avec checklist
  • Détecte les modifications non commitées et les signale à l'utilisateur
  • Crée la PR en brouillon pour permettre une dernière révision

Limites

  • Dépend de la configuration npm (lint, typecheck, test) du projet
  • Ne gère pas les conflits de merge avancés
  • Suppose que la branche de base est 'main'
Quand l'utiliser

Utilisez cette compétence lorsque vous avez terminé des modifications sur une branche de fonctionnalité et souhaitez créer une pull request avec une assurance qualité intégrée.

Quand l'éviter

Évitez de l'utiliser pour des changements mineurs ou urgents qui ne nécessitent pas de vérifications poussées, ou si le projet ne dispose pas des scripts npm appropriés.

Analyse de sécurité

Sûr
Score qualité95/100

The skill only uses predefined, well-scoped Bash commands (git, npm test/lint/typecheck, gh pr) for a legitimate pull request workflow. No destructive, exfiltrating, or obfuscated actions are present.

Aucun point d'attention détecté

Exemples

Create PR from current branch
Create a pull request from the current branch.
Create PR with quality checks
Create a PR from this branch with lint, typecheck, and tests.
Create draft PR for review
Create a draft pull request for my changes, running all quality checks first.

name: create-pr description: Create a pull request from the current branch with quality checks. Use when changes are ready for review, after committing. allowed-tools: Bash(gh pr:), Bash(git:), Bash(npm test:), Bash(npm run lint:), Bash(npm run typecheck:*), Read, Glob, Grep

Create Pull Request

You are tasked with creating a pull request from the current branch.

Process:

1. Pre-flight Checks

  • Run git status to check for uncommitted changes
  • If there are uncommitted changes:
    • Show the uncommitted changes clearly
    • Tell the user: "You have uncommitted changes. Please either:"
      • "1. Exit and run /commit to commit your changes first (recommended)"
      • "2. Stash the changes temporarily with git stash"
      • "3. Continue anyway if these changes aren't meant for this PR"
    • Wait for user's decision
  • Run git branch --show-current to get the current branch name
  • Verify we're not on main/master branch

2. Code Quality Verification

Run the following checks in parallel:

  • npm run lint - Check for linting issues
  • npm run typecheck - Check for TypeScript errors
  • npm test - Run the test suite

If any checks fail:

  • Show me the errors
  • Ask if I want to fix them before creating the PR
  • If yes, help fix the issues and re-run the checks

3. Analyze Changes

  • Run git log origin/main..HEAD --oneline to see commits that will be in the PR
  • Run git diff origin/main...HEAD --stat to see changed files summary
  • Run git diff origin/main...HEAD to understand the full changes
  • Identify the type of changes (feature, bugfix, refactor, chore, etc.)

4. Extract Context

  • If branch name contains an issue number (e.g., "123-feature-name"), extract it
  • Look for related issue by checking recent commits for issue references
  • Understand the purpose and scope of the changes

5. Draft PR Description

Create a comprehensive PR description with:

## Summary
[2-3 bullet points describing what this PR does]

## Related Issue
Closes #[issue-number] (if applicable)

## Changes Made
- [Detailed list of changes]
- [Include technical decisions if relevant]
- [Mention any breaking changes]

## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed
- [ ] Linting and type checking pass

## Screenshots
[If UI changes, include before/after screenshots]

## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Tests added/updated for changes
- [ ] Documentation updated if needed
- [ ] No console.log or debug code left
- [ ] Translations added for new text (if applicable)

6. Review with User

  • Show me the draft PR title and description
  • Ask: "Does this look good? Any changes needed?"
  • Wait for approval or make requested changes

7. Push Changes

  • Run git push -u origin HEAD to push the branch to remote
  • This ensures the branch exists on GitHub before creating the PR

8. Create the PR

After approval, create the PR using:

gh pr create \
  --title "[Type] Clear, descriptive title" \
  --body "Full PR description from step 5" \
  --base main \
  --draft

Note: PRs are created as drafts by default to allow for final review before requesting feedback.

9. Post-Creation

  • Show me the PR URL
  • Run gh pr view --web to open the PR in browser (optional)
  • Suggest next steps:
    • Request reviews from team members
    • Add labels if needed
    • Link to project board if applicable

Important Notes:

  • Always ensure all tests pass before creating PR
  • Use conventional commit style for PR titles when possible
  • Include issue numbers for automatic linking
  • Be thorough in the description - it helps reviewers
  • Check for any .env or sensitive data in the diff

PR Title Format Examples:

  • feat: Add user authentication system
  • fix: Resolve date parsing issue in calendar
  • refactor: Improve appointment service performance
  • chore: Update dependencies to latest versions
  • docs: Add API documentation for new endpoints

Remember: A good PR description saves review time and provides context for future reference.

Skills similaires