Title Enhancement

The Problem

We’ve all seen (and written) these PR titles:

Vague titles force reviewers to read the entire diff just to understand what’s happening. That’s 5-10 minutes of context-building before actual review can begin.

The Solution

lazyPR uses a hybrid pattern + AI approach to analyze and improve vague titles automatically.

Example transformation:

Before: “fixes”

After: “Fix authentication token validation in auth service”

The improved title tells reviewers exactly what to expect before they open a single file.


How It Works

lazyPR uses a cost-optimized hybrid approach:

PR Title

[Pattern Check] → Obviously vague? (score >= 60) → Rename immediately (no AI)

[Branch Name Check] → Looks like branch name? → AI evaluates

[Threshold Check] → Score >= threshold? → Rename immediately (no AI)

✓ Keep title

Cost Optimization

ScenarioAI Call?TokensCost
fixes, wip (obvious vague)❌ No0$0
Add login button (descriptive)❌ No0$0
feat/auth-integration (branch name)✅ Yes~300~$0.001

~80% of PRs require no AI call. When AI is needed, it uses ~10x fewer tokens than full summary generation.


Branch Name Detection

When GitHub creates a PR from a branch via the web interface, it often uses the branch name as the title:

Branch NameDefault PR TitlelazyPR Action
feat/auth-integrationFeat/auth-integrationAI evaluates
fix-null-pointerFix-null-pointerAI evaluates
auth_integrationAuth_integrationAI evaluates

These patterns trigger AI evaluation (not auto-rename) to intelligently decide if they’re descriptive enough.

Branch Patterns Detected

The AI uses minimal context (max 5 files) to suggest a proper title if the branch name isn’t descriptive.


Usage

Enable title enhancement in your workflow:

- uses: elvis-ndubuisi/lazypr@v1
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    api_key: ${{ secrets.OPENAI_API_KEY }}
    auto_update_title: true

Configuration

InputDefaultDescription
auto_update_titlefalseEnable automatic title updates
vagueness_threshold40Score (0-100) that triggers auto-rename. Lower = more aggressive

Threshold Guide

ThresholdBehaviorCatches
40 (default)Aggressive”fixes”, “updates”, “wip”, “hotfix”, “done”
50ModerateVery generic single-word titles
70LenientOnly extremely vague titles

Example with custom threshold:

- uses: elvis-ndubuisi/lazypr@v1
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    api_key: ${{ secrets.OPENAI_API_KEY }}
    auto_update_title: true
    vagueness_threshold: 50  # Less aggressive

Vague Patterns Detected

lazyPR catches these common lazy dev patterns:

Action verbs without context:

Rush indicators:

Generic nouns:


Output

When enabled, PR titles are updated with descriptive alternatives:

OriginalEnhanced
”fixes""Fix authentication token validation in auth service"
"updates""Update user profile component with avatar support"
"wip""Update checkout flow with payment integration"
"hotfix""Fix null pointer exception in payment processor”

Output: The enhanced_title output contains the updated title (empty if no change needed).


Key Benefits


When Titles Get Enhanced

lazyPR scores titles based on:

Note: Already descriptive titles are left unchanged.


_Write once, communicate clearly. See user guide for other quality features.