Problem
Base still owns generic GitHub/Git helper behavior in cli/bash/commands/basectl/subcommands/gh.sh and cli/bash/commands/basectl/subcommands/repo.sh that is reusable outside Base:
- GitHub repository inference from
origin remotes.
- Default branch discovery.
- Basic
gh api/command diagnostics and bounded retry behavior for transient API pressure.
- Worktree/branch parsing primitives that are not tied to Base issue categories or Project policy.
base-bash-libs already has lib/bash/gh/lib_gh.sh, but it currently covers only thin gh availability, auth diagnostics, failure reporting, and command execution.
Scope
- Extend
base-bash-libs gh/lib_gh.sh with small generic primitives proven by the remaining Base call sites.
- Keep Base-specific concepts out of the shared library: issue categories, Project metadata, branch naming policy, repo baselines, generated PR bodies, and worktree naming conventions.
- Add BATS coverage with fake
git/gh commands where useful.
- Document the expanded reusable surface in
lib/bash/gh/README.md.
Acceptance Criteria
- New helper names and contracts are documented.
- Tests cover success and failure cases for the extracted helpers.
- The shared library remains dependency-free apart from the stdlib guard.
- A follow-up Base issue can consume the helpers without changing Base workflow semantics.
Problem
Base still owns generic GitHub/Git helper behavior in
cli/bash/commands/basectl/subcommands/gh.shandcli/bash/commands/basectl/subcommands/repo.shthat is reusable outside Base:originremotes.gh api/command diagnostics and bounded retry behavior for transient API pressure.base-bash-libsalready haslib/bash/gh/lib_gh.sh, but it currently covers only thinghavailability, auth diagnostics, failure reporting, and command execution.Scope
base-bash-libsgh/lib_gh.shwith small generic primitives proven by the remaining Base call sites.git/ghcommands where useful.lib/bash/gh/README.md.Acceptance Criteria