本文へ移動
cccskills
無料GitHub で公開

pr

Analyze changes, detect scope issues, and create a well-structured PR

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Create pull request

Analyze changes, detect scope issues, and create a well-structured PR following project conventions.

Process

  1. Analyze Changes: Calculate complexity score from files, commits, and directories
  2. Detect Scope Issues: Warn if PR is too large or mixes unrelated changes
  3. Suggest Split: If needed, group commits by scope and propose separate PRs
  4. Collect Info: Ask for type, target branch, draft status, labels
  5. Generate Content: Create TLDR + description + checklist
  6. Create PR: Execute gh pr create with proper formatting
  7. Remind Follow-up: Display post-PR checklist (SonarQube, Claude Review)

Complexity score

Calculate PR complexity to detect if split is needed:

CriterionWeightDescription
Code filesx2*.ts, *.tsx (excluding tests)
Test filesx0.5*.test.ts, *.spec.ts
Config filesx1*.json, *.yml, *.md
Directoriesx3Distinct src/* directories
Commitsx1Number of commits

Thresholds: 0-15 ✅ Normal | 16-25 ⚠️ Large | 26+ 🔴 Split recommended

Scope coherence

PatternVerdict
Single scope✅ OK
Related scopes (sessions + calendar)✅ OK
Unrelated scopes (payments + auth)🔴 Split
feat + fix same scope✅ OK
feat + fix different scopes🔴 Split

Split suggestion format

When split is recommended, display:

🔴 Scope trop large (score: 32)

Commits par scope :
├── payments (5 commits, 8 fichiers)
│   ├── feat(payments): add Stripe checkout
│   └── fix(payments): handle currency
│
└── notifications (3 commits, 6 fichiers)
    └── feat(notifications): add email templates

💡 Suggestion :
1. PR #1 : feature/payments-stripe → Commits payments
2. PR #2 : feature/notifications → Commits notifications

Options :
[A] Continuer avec une seule PR (non recommandé)
[B] Découper (semi-auto - commandes git fournies)
[C] Voir détail fichiers

Semi-auto split provides copy-paste commands:

git checkout develop
git checkout -b feature/payments-stripe
git cherry-pick abc1234 def5678
git push -u origin feature/payments-stripe

Questions to ask

  1. Type: feature | fix | tech | docs | security
  2. Target Branch: Show recent branches (develop, main, others)
  3. Draft: Yes (WIP) | No (ready for review)
  4. Labels: Based on type + optional (breaking-change, security)

PR title format

<type>(<scope>): <description>

Examples:

  • feat(payments): add Stripe checkout integration
  • fix(sessions): resolve timezone calculation bug

PR body template

## TLDR
<!-- 2 lines max - Executive summary -->

---

## Type
{Feature | Fix | Tech | Docs | Security}

## Description
{Context and changes}

## Technical Changes
{List of main modifications}

## Tests
- [ ] Unit tests added/passing
- [ ] Manual testing completed

## Checklist
- [ ] Code follows conventions
- [ ] No console.log left
- [ ] Types OK (`pnpm typecheck`)

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Available labels

LabelColorUse When
feature🟢New functionality
fix🔴Bug fix
tech🔵Refactoring, tech debt
docs📘Documentation only
security🟣Security fix
breaking-change⚫Breaking changes
WIP🟡Work in progress (draft)

Commands to execute

# 1. Get base branch (usually develop)
BASE_BRANCH="develop"

# 2. Calculate complexity score
CODE=$(git diff --name-only $BASE_BRANCH..HEAD | grep -E '\.(ts|tsx)$' | grep -v test | wc -l)
TESTS=$(git diff --name-only $BASE_BRANCH..HEAD | grep -E '\.test\.|\.spec\.' | wc -l)
DIRS=$(git diff --name-only $BASE_BRANCH..HEAD | cut -d'/' -f1-2 | sort -u | wc -l)
COMMITS=$(git rev-list --count $BASE_BRANCH..HEAD)
SCORE=$((CODE * 2 + TESTS / 2 + DIRS * 3 + COMMITS))

# 3. Get scopes from commits
git log --oneline $BASE_BRANCH..HEAD --format="%s" | sed -n 's/^\w*(\([^)]*\)).*/\1/p' | sort | uniq -c

# 4. Recent branches for selection
git branch --sort=-committerdate --format='%(refname:short)' | head -5

# 5. Create PR
gh pr create \
  --title "<type>(<scope>): <description>" \
  --body "$BODY" \
  --base $BASE_BRANCH \
  --label "<label>" \
  --draft  # if WIP

Post-PR output

After PR creation, ALWAYS display:

✅ PR créée : https://github.com/org/repo/pull/XXX

📋 Prochaines étapes automatiques :
   • SonarQube analysera la qualité du code (bugs, vulnérabilités, code smells)
   • Claude Code Review fournira un feedback IA sur votre PR

⏳ Pensez à surveiller ces analyses dans les prochaines minutes.
   Si des problèmes sont détectés, corrigez-les avant de demander une review humaine.

Edge cases

SituationBehavior
No scope in commitsAnalyze by directories
Non-conventional commitsWarn + ask type manually
No commits (same as base)Error: "Aucun changement"
Single commitUse commit message as title
Merge commitsIgnore (--no-merges)

Usage

/pr
/pr --base main
/pr --draft

Target: $ARGUMENTS (optional: --base, --draft)

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Audit Claude Code agents, skills, and commands for quality and production readiness. Use when evaluating skill quality, checking production readiness scores, or comparing agents against best-practice templates.

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

Codebase health audit scoring 7 categories with progression plan

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

Autonomous improvement loop: scan codebase metrics, scaffold experiment files, run agent-driven iterations until metric improves

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

best-of-n

無料

Generate bounded independent candidates, score them against a frozen rubric, and verify the selected result with a proof log.

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

canary

無料

Post-deploy monitoring: watch production after a deploy and alert on regressions

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

catchup

無料

Restore context after /clear by summarizing recent work and project state

日本語の概要は準備中です。原文の説明を表示しています。

FlorianBruniaux/claude-code-ultimate-guide6,1432026年10月7日 更新

FlorianBruniaux のスキルをすべて見る

このスキルの問題を報告する