analyze-dependencies
Analyze project dependencies and evaluate architectural health. Trigger with "analyze dependencies", "detect circular dependencies", "architecture issues?",…
Auto-update PR description and labels from changes. Trigger with "update PR description", "refresh PR", "update labels".
$ npx -y skills add wasabeef/claude-code-cookbook --skill pr-auto-update --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/pr-auto-updateContext preview
The summary Claude sees to decide when to auto-load this skill.
Auto-update PR description and labels from changes. Trigger with "update PR description", "refresh PR", "update labels".
description: 'Auto-update PR description and labels from changes. Trigger with "update PR description", "refresh PR", "update labels".' allowed-tools: - Bash(gh *) - Bash(git *) - Read - Grep - Glob
A command that automatically updates Pull Request descriptions and labels. Analyzes Git changes to generate and set appropriate descriptions and labels.
/pr-auto-update [options] [PR number]
# Auto-update PR for current branch /pr-auto-update # Update specific PR /pr-auto-update --pr 1234 # Update description only /pr-auto-update --description-only # Check with dry-run /pr-auto-update --dry-run
Automatically detects the corresponding PR from the current branch:
# Search PR from branch gh pr list --head $(git branch --show-current) --json number,title,url
Collects and analyzes the following information:
1. **Existing PR description**: Completely follows already written content 2. **Project template**: Gets structure from `.github/PULL_REQUEST_TEMPLATE.md` 3. **Default template**: Fallback when above don't exist
**Important**: Do not modify existing content
# Parse structure of .github/PULL_REQUEST_TEMPLATE.md
parse_template_structure() {
local template_file="$1"
if [ -f "$template_file" ]; then
# Extract section structure
grep -E '^##|^###' "$template_file"
# Identify comment placeholders
grep -E '<!--.*-->' "$template_file"
# Completely follow existing template structure
cat "$template_file"
fi
}**Priority**:
1. **`.github/labels.yml`**: Get from project-specific label definitions 2. **GitHub API**: Get existing labels with `gh api repos/{OWNER}/{REPO}/labels --jq '.[].name'`
**File Pattern Based**:
**Change Content Based**:
**When `.github/labels.yml` exists**:
# Auto-retrieve from label definitions grep "^- name:" .github/labels.yml | sed "s/^- name: '\?\([^']*\)'\?/\1/" # Example: Use project-specific label system
**When retrieving from GitHub API**:
# Get list of existing labels
gh api repos/{OWNER}/{REPO}/labels --jq '.[].name'
# Example: Use standard labels like bug, enhancement, documentation#!/bin/bash
# 1. PR Detection & Retrieval
detect_pr() {
if [ -n "$PR_NUMBER" ]; then
echo $PR_NUMBER
else
gh pr list --head $(git branch --show-current) --json number --jq '.[0].number'
fi
}
# 2. Change Analysis
analyze_changes() {
local pr_number=$1
# Get file changes
gh pr diff $pr_number --name-only
# Content analysis
gh pr diff $pr_number | head -1000
}
# 3. Description Generation
generate_description() {
local pr_number=$1
local changes=$2
# Get current PR description
local current_body=$(gh pr view $pr_number --json body --jq -r .body)
# Use existing content if available
if [ -n "$current_body" ]; then
echo "$current_body"
else
# Generate new from template
local template_file=".github/PULL_REQUEST_TEMPLATE.md"
if [ -f "$template_file" ]; then
generate_from_template "$(cat "$template_file")" "$changes"
else
generate_from_template "" "$changes"
fi
fi
}
# Generate from template
generate_from_template() {
local template="$1"
local changes="$2"
if [ -n "$template" ]; then
# Use template as-is (preserve HTML comments)
echo "$template"
else
# Generate in default format
echo "## What does this change?"
echo ""
echo "$changes"
fi
}
# 4. Label Determination
determine_labels() {
local changes=$1
local file_list=$2
local pr_number=$3
# Get available labels
local available_labels=()
if [ -f ".github/labels.yml" ]; then
# Extract label names from labeA collection of commands, roles, and automation scripts for Claude Code. Automate your workflow without unnecessary confirmations, allowing you to focus on what matters.
Repo: wasabeef/claude-code-cookbook
Analyze project dependencies and evaluate architectural health. Trigger with "analyze dependencies", "detect circular dependencies", "architecture issues?",…
Performance analysis based on Core Web Vitals with UX scoring. Trigger with "analyze performance", "improve speed", "check Core Web Vitals", "page speed",…
Verify information accuracy against codebase and documentation. Trigger with "is this correct?", "fact check", "verify this", "is this accurate?".
Evaluate and improve AI prompt quality. Trigger with "check this prompt", "evaluate prompt quality", "improve this prompt".
Generate commit messages from staged changes. Trigger with "suggest commit message", "generate commit message", "what should the commit say?", "write commit…