AGENT SKILL

devops:pr

Crée une Pull Request GitHub standard avec workflow complet : QA, commits, assignation milestone/projet, code review automatique.

使用场景代码审查
License 许可
MIT
最近更新
2026-03-02
Stars
★ 0
Forks
0

01 前言 Front Matter

name
devops:pr
model
sonnet
license
MIT
version
1.0.0
description
Crée une Pull Request GitHub standard avec workflow complet : QA, commits, assignation milestone/projet, code review automatique.
allowed-tools
[ "Bash", "Read", "Write", "TaskCreate", "TaskUpdate", "TaskList", "AskUserQuestion" ]

02 资源文件 3

03 SKILL.md 正文

DevOps PR Skill (Standard)

Usage

/devops:pr [branche-base] [milestone] [projet] [--no-interaction] [--delete] [--no-review]

Configuration

CORE_SCRIPTS="${CLAUDE_PLUGIN_ROOT}/scripts"
PR_TEMPLATE_PATH=".github/PULL_REQUEST_TEMPLATE/default.md"
ENV_FILE_PATH=".env.claude"

Instructions à Exécuter

IMPORTANT : Exécute ce workflow étape par étape :

Initialisation

Créer les tâches du workflow avec TaskCreate :

TaskCreate #1: Charger config .env.claude
TaskCreate #2: Confirmation initiale (si --no-interaction absent)
TaskCreate #3: Vérifier scopes GitHub
TaskCreate #4: Vérifier template PR
TaskCreate #5: Lancer QA intelligente
TaskCreate #6: Analyser changements git
TaskCreate #7: Confirmer branche de base
TaskCreate #8: Générer description PR
TaskCreate #9: Push et créer PR
TaskCreate #10: Assigner milestone
TaskCreate #11: Assigner projet GitHub
TaskCreate #12: Code review automatique (si plugin installé)
TaskCreate #13: Nettoyage branche locale

Important :

  • Utiliser activeForm (ex: "Chargeant config", "Vérifiant scopes GitHub")
  • Ne créer la tâche #12 que si plugin review installé ET --no-review absent
  • Chaque tâche doit être marquée in_progress puis completed

Étapes

  1. Charger configuration depuis .env.claude :

    • Parser les variables MAIN_BRANCH et PROJECT
    • Ignorer si absent
  2. Confirmation initiale :

    • Si --no-interaction : passer toutes les confirmations
    • Sinon : résumer paramètres et demander confirmation
  3. Vérifier scopes GitHub ($CORE_SCRIPTS/check_scopes.sh)

  4. Vérifier template PR ($CORE_SCRIPTS/verify_pr_template.sh)

  5. Lancer QA intelligente ($CORE_SCRIPTS/smart_qa.sh)

  6. Analyser changements git ($CORE_SCRIPTS/analyze_changes.sh)

  7. Confirmer branche de base (ou AskUserQuestion)

  8. Générer titre PR via $PR_SCRIPTS/generate_pr_title.sh :

    TITLE=$($PR_SCRIPTS/generate_pr_title.sh)
    EXIT_CODE=$?
    
    • Exit 0 → titre prêt (issue extraite du nom de branche)
    • Exit 2 → AskUserQuestion "Cette PR est-elle liée à une issue ?" avec options :
      • "Oui, numéro : ___" → relancer avec --issue <N>
      • "Non" → relancer avec --no-issue
    • Générer ensuite la description PR intelligente
  9. Push et créer PR ($CORE_SCRIPTS/create_pr.sh)

  10. Assigner milestone ($CORE_SCRIPTS/assign_milestone.py)

  11. Assigner projet GitHub ($CORE_SCRIPTS/assign_project.py)

  12. Code review automatique (si plugin review installé)

  13. Nettoyage branche locale ($CORE_SCRIPTS/cleanup_branch.sh)

Code Review

Si plugin review installé, lance 4 agents en parallèle :

  • code-reviewer - Conformité CLAUDE.md
  • silent-failure-hunter - Erreurs silencieuses
  • test-analyzer - Couverture tests
  • git-history-reviewer - Contexte historique

Agrège résultats (score >= 80) dans commentaire PR.

Options

Flag Description
--no-interaction Mode automatique : passer confirmations, utiliser defaults
--delete Supprimer branche LOCALE uniquement après création PR
--no-review Désactiver code review automatique

Règles critiques

INTERDICTION ABSOLUE :

  • Ne JAMAIS exécuter git push origin --delete <branche> ou git push -d origin <branche>
  • Ne JAMAIS supprimer la branche remote (fermerait automatiquement la PR)
  • Le flag --delete ne concerne QUE la branche locale

Error Handling

  • Template absent -> ARRÊT
  • QA échouée -> ARRÊT
  • Milestone/projet non trouvé -> WARNING (non bloquant)

04 同仓库更多 Skills