Skip to content

agent: shorten branch names in make-branch command #22

@p-iknow

Description

@p-iknow

Context

The /make-branch command currently generates branch names by converting the full issue title/description into the branch name format i{issue-index}-{type}/{action-description_with_underscores}. This results in excessively long branch names that are difficult to work with.

For example, issue #21 "agent: rename custom commands to shorter aliases for easier invocation" would create: i21-agent/rename-custom-commands-to-shorter-aliases-for-easier-invocation

Users expect more concise, manageable branch names while maintaining clarity about the issue's purpose.

Requirement

When generating branch names with /make-branch, the command should create shorter, more concise branch names while preserving the essential meaning of the issue. Branch names should be compressed and easier to type/read.

Expected behavior:

  • Branch names should be limited to a reasonable length (e.g., 50-60 characters max)
  • The core intent of the issue should be preserved
  • Names should remain readable and meaningful

Solution

Enhance the /make-branch command to intelligently shorten branch names:

  1. Implement length limiting (max 50-60 characters total)

  2. Intelligent truncation strategy:

    • Remove common filler words (the, a, an, for, to, of, with, etc.)
    • Keep only key action verbs and nouns
    • Use abbreviations for common terms
    • Truncate at word boundaries, not mid-word
  3. Add AI-powered summarization:

    • Extract core intent from issue title
    • Generate concise branch-friendly descriptions
    • Maintain clarity while reducing length

Example transformations:

  • Before: i21-agent/rename-custom-commands-to-shorter-aliases-for-easier-invocation

  • After: i21-agent/rename-commands-to-aliases

  • Before: i19-agent/update-make-task-issue-to-use-prompt-based-input-instead-of-editor

  • After: i19-agent/prompt-based-input

Test Plan

The enhanced command should:

  • Maintain the i{index}-{type}/{description} format
  • Keep branch names under 50 characters when possible
  • Preserve essential meaning from the issue title
  • Handle edge cases (very short titles, special characters, etc.)
  • Allow manual override if user wants a different name

Test with various issue titles:

  • Long descriptive titles
  • Short titles (should not over-truncate)
  • Titles with special characters
  • Titles with common filler words

Reference

Metadata

Metadata

Assignees

Labels

agentAgent rules and commands

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions