Skip to content

[ghcp-handoff] T2: Auto-suffix target-branch on collision #18

@bminier

Description

@bminier

Problem

Target-branch derivation has no uniqueness check. If `ghcp/fix-auth-bug` already exists, `ghcp-worktree.ts add` fails. User then has to pick a different name manually.

Approach

In `cmdAdd`: if the target branch exists AND the user didn't explicitly ask to reuse it, auto-suffix `-2`, `-3`, etc. until we find a free name. Print the final chosen name in the JSON result so the skill can use it.

Escape hatch: an `--exact` flag to fail instead of auto-suffix.

Review reference

Adversarial review T2

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestghcp-handoffRelates to /ghcp-handoff skill

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions