Skip to content

feat: Add conventional commit title derivation for pull requests - #164

Open
Ziinc wants to merge 2 commits into
mainfrom
claude/conventional-commits-pr-titles-394b04
Open

feat: Add conventional commit title derivation for pull requests#164
Ziinc wants to merge 2 commits into
mainfrom
claude/conventional-commits-pr-titles-394b04

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

This change adds intelligent PR title generation that derives conventional commit format titles from branch names and PR titles, with support for common type aliases and flexible branch naming patterns.

Key Changes

  • New deriveConventionalPrTitle() function that intelligently generates conventional commit-formatted PR titles by:
    • Normalizing existing conventional commit titles and their aliases (e.g., featurefeat, bugfixfix)
    • Extracting type information from branch naming patterns like type/description or type-description
    • Preserving scope and breaking change markers from titles
    • Falling back gracefully to the original title or branch name when no conventional signal is detected
  • Type alias mapping via CONVENTIONAL_TYPE_ALIASES that normalizes common variations:
    • featurefeat, bugfix/hotfixfix
    • doc/documentationdocs, performanceperf
    • And others for chore, refactor, test, style, build, ci, revert
  • Flexible branch pattern matching that handles:
    • Slash-separated patterns: fix/login-bugfix: login bug
    • Dash-prefixed patterns: bugfix-login-crashfix: login crash
    • Nested patterns: treq/bugfix-login-crashfix: login crash
  • Integration with CreatePrButtonGroup to automatically apply conventional title derivation when creating pull requests

Implementation Details

  • Uses regex pattern matching (CONVENTIONAL_TITLE_RE) to parse conventional commit format
  • Includes a humanize() helper to convert slug-style text (dashes/underscores) to readable descriptions
  • Comprehensive test coverage with 6 test cases covering various scenarios
    https://claude.ai/code/session_01FrmZ3AmfmpnS48es3e3c13

@Ziinc Ziinc changed the title Add conventional commit title derivation for pull requests feat: Add conventional commit title derivation for pull requests Aug 5, 2026
…aces

When a workspace's title or branch name already signals a conventional-commit
type (e.g. "feat: ..." or a "fix/..." branch), normalize the PR title created
from the workspace into strict type(scope)?: description form so it passes
the repo's conventional-commit title check.
@Ziinc
Ziinc force-pushed the claude/conventional-commits-pr-titles-394b04 branch from 82f824b to e9f0dcd Compare August 5, 2026 04:33
The Create PR flow now derives conventional-commit titles from the
workspace title/branch, so these tests need to expect the "feat: "
prefix that gets added when the branch is "feat/..." but the workspace
title has no type prefix yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants