Goal
Continue the documented basectl repo ownership reduction by separating GitHub repository settings, branch-protection payloads, and Project metadata delegation from local baseline generation where that can be done without changing behavior.
Background
docs/repo-command-ownership.md records that repo.sh has already had repo installer-template and repo agent-guidance extracted into command-owned helpers. The same map names GitHub repository settings, branch-protection payloads, and Project metadata delegation as follow-up candidates. Current repo.sh still combines local baseline writers, GitHub repo creation/configuration, default branch ruleset payloads, Project metadata handoff, PR branch/worktree helpers, clone, checks, and dispatch. The reason to split is ownership clarity around these responsibilities, not raw line count.
Scope
- Re-read
docs/repo-command-ownership.md and confirm the current implementation still matches its responsibility map.
- Extract one cohesive GitHub settings boundary if it is still natural, such as repository labels/settings plus default-branch ruleset payload helpers.
- Keep shared path, dry-run, Git, and PR worktree primitives in
repo.sh unless multiple extracted commands prove a smaller common helper is needed.
- Keep structured GitHub Project semantics in Python or existing Project engines rather than adding more shell policy.
- Update the ownership doc to record what moved and what intentionally stayed.
Acceptance Criteria
- Public
basectl repo init, repo configure, repo clone, repo check, repo agent-guidance, and repo installer-template behavior is unchanged.
- The extracted boundary has a command-specific or responsibility-specific name and tests that match the moved behavior.
- Existing generated PR and Project metadata flows continue to work.
docs/repo-command-ownership.md is current after the change.
- The PR explains why the split is a natural ownership reduction, not a cosmetic file-size edit.
Validation
- Focused BATS coverage for
repo configure, repo init, generated PR flows, and any moved helper behavior.
- Relevant GitHub helper tests if Project or ruleset handoff is touched.
git diff --check.
Non-Goals
- Do not rewrite
basectl repo in Python in this slice.
- Do not move generic GitHub shell helpers to base-bash-libs in this issue.
- Do not split every section of
repo.sh.
- Do not change generated repository baseline files or GitHub Project field semantics.
Project Fields
- Priority: P3
- Status: Backlog
- Size: M
- Area: Shell
- Initiative: Contract Hardening
Agent Assignment
Human first. This is refactor work with public behavior preservation and should be reviewed against the ownership map before implementation.
Goal
Continue the documented
basectl repoownership reduction by separating GitHub repository settings, branch-protection payloads, and Project metadata delegation from local baseline generation where that can be done without changing behavior.Background
docs/repo-command-ownership.mdrecords thatrepo.shhas already hadrepo installer-templateandrepo agent-guidanceextracted into command-owned helpers. The same map names GitHub repository settings, branch-protection payloads, and Project metadata delegation as follow-up candidates. Currentrepo.shstill combines local baseline writers, GitHub repo creation/configuration, default branch ruleset payloads, Project metadata handoff, PR branch/worktree helpers, clone, checks, and dispatch. The reason to split is ownership clarity around these responsibilities, not raw line count.Scope
docs/repo-command-ownership.mdand confirm the current implementation still matches its responsibility map.repo.shunless multiple extracted commands prove a smaller common helper is needed.Acceptance Criteria
basectl repo init,repo configure,repo clone,repo check,repo agent-guidance, andrepo installer-templatebehavior is unchanged.docs/repo-command-ownership.mdis current after the change.Validation
repo configure,repo init, generated PR flows, and any moved helper behavior.git diff --check.Non-Goals
basectl repoin Python in this slice.repo.sh.Project Fields
Agent Assignment
Human first. This is refactor work with public behavior preservation and should be reviewed against the ownership map before implementation.