Skip to content

feat: add setup-target-repo.sh label bootstrap - #6

Merged
yihanzhu merged 1 commit into
mainfrom
issue-5-setup-script
Jun 20, 2026
Merged

feat: add setup-target-repo.sh label bootstrap#6
yihanzhu merged 1 commit into
mainfrom
issue-5-setup-script

Conversation

@yihanzhu

Copy link
Copy Markdown
Owner

Closes #5

What

Adds scripts/setup-target-repo.sh to bootstrap a target repo's loop labels
(ready, round-0..round-3, needs-human) with one command, and points the
docs at it.

Why

Onboarding a new target repo currently means hand-running a gh label create
loop from templates/repo-setup.md. Scripting the labels step makes adding a
repo one command, supporting the reusability goal in CLAUDE.md.

How

  • scripts/setup-target-repo.sh
    • #!/usr/bin/env bash, set -euo pipefail, executable bit set.
    • Parameterized on <owner>/<repo> (no hardcoded repo); prints usage and
      exits non-zero if the arg is missing.
    • Idempotent: gh label create ... || gh label edit ... so re-runs on a
      repo that already has the labels update rather than fail.
    • After labels, prints the manual follow-ups it can't script (branch
      protection, CI workflow, Claude GitHub App, Codex reviewer) and points to
      templates/repo-setup.md.
  • templates/repo-setup.md: labels step now references the script instead of
    the inline loop.
  • README.md: scripts/ added to the Layout block.

How verified

  • shellcheck scripts/setup-target-repo.sh → clean (exit 0), installed locally.
  • bash -n parse check passes.
  • Missing-arg path prints usage to stderr and exits 1.
  • Structure check (all CI-required files present) still green.

Scope is label bootstrap only — no branch-protection / CI / GitHub-App / Codex
automation (out of scope per the issue).

Automate the scriptable part of onboarding a target repo: create the loop
labels (ready, round-0..3, needs-human) idempotently from one command, and
print the manual follow-ups (branch protection, CI, Claude GitHub App, Codex)
pointing at templates/repo-setup.md.

- scripts/setup-target-repo.sh: parameterized <owner>/<repo>, no hardcoded
  repo; usage + non-zero exit on missing arg; create-or-edit so re-runs don't
  fail; shellcheck-clean; executable.
- templates/repo-setup.md: labels step now calls the script.
- README.md: add scripts/ to the Layout block.

Closes #5

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yihanzhu yihanzhu added the round-0 Review-loop counter: initial PR label Jun 19, 2026
@yihanzhu

Copy link
Copy Markdown
Owner Author

🤖 Codex reviewer (gpt-5.5) — automated cross-vendor review vs main (codex exec review):

Verdict: no actionable correctness issues. No blocking comments → ready for the human merge gate.

Verified during review:

  • shellcheck clean + bash -n parse OK
  • the gh label create … || gh label edit … idempotency approach is valid against the actual gh CLI
  • doc updates (repo-setup.md, README) align with the script's usage
  • consistent with CLAUDE.md conventions

Reviewer = Codex · coder = Claude — cross-vendor decorrelation. Converged at round-0 (no revisions needed).

@yihanzhu
yihanzhu merged commit 68f5639 into main Jun 20, 2026
1 check passed
@yihanzhu
yihanzhu deleted the issue-5-setup-script branch June 20, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

round-0 Review-loop counter: initial PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add scripts/setup-target-repo.sh to bootstrap a target repo's labels

1 participant