Repository navigation
[Phase 1] Create petry-projects/repo-template as a flagged template repository #965
Copy link
Copy link
Closed
Labels
dev-lead:hands-offExclude from dev-lead agent automationExclude from dev-lead agent automationinitiativeEpic / initiative tracking issueEpic / initiative tracking issueinitiative:holdInitiative driver must not release this issue (human hold)Initiative driver must not release this issue (human hold)
Description
Story
As a org admin,
I want create an empty petry-projects/repo-template repository and flag it as a GitHub template repository with the standard general settings applied,
so that new repos can be scaffolded with one "Use this template" click instead of a manual copy-from-standards runbook.
Acceptance Criteria
- petry-projects/repo-template exists and
gh repo view petry-projects/repo-template --json isTemplatereturns isTemplate: true. - The repo has a default
mainbranch and the standard general settings applied (squash-only merge with merge/rebase disabled, delete-branch-on-merge, auto-merge enabled) — because a template click copies files only, not settings. - The repo is empty of product scaffold content (the verbatim scaffold lands in the Phase 1 scaffold story); only an initial commit / placeholder README is present.
- Repo creation and the
is_templateflag are set with an org-admin classic PAT (not the Actions GITHUB_TOKEN), and the who/when of the action is recorded for auditability. - No activation label (e.g.
initiative:auto) is applied to the repo or this work.
Tasks / Subtasks
- Create the repo (
gh repo create petry-projects/repo-templateat the org default visibility) and setis_templateviagh api -X PATCH repos/petry-projects/repo-template -f is_template=true. (AC: test issue from agent #1) - Apply baseline general settings by running
scripts/apply-repo-settings.sh petry-projects/repo-templateso the template repo itself is compliant. (AC: Go-live improvements for PR review agent #2) - Confirm the empty/placeholder state and leave content seeding to the scaffold story. (AC: Add @claude delegation, auto-merge, and rebase handling #3)
- Record the creation (operator + token identity + timestamp) in the epic/discussion thread. (AC: Optimize review: small-PR and incremental fast paths #4, feat: add Copilot engine support via REVIEW_ENGINE toggle #5)
Dev Notes
- Hands-off: creating an org repo and setting
is_templaterequires org-admin and a classic PAT; the Actions GITHUB_TOKEN / dev-lead cannot create org repos or changesecurity_and_analysis.scripts/apply-repo-settings.shdocuments that a classic PAT withreposcope is required and OAuth app tokens are rejected by the check-suites API. - GitHub template repos copy files + (optionally) branches with UNRELATED history only — they do NOT carry settings, branch protection, rulesets, required checks, labels, secrets, or security config. That non-file gap is closed by the Phase 2 bootstrap, not here.
- Pick the org default visibility and note it; do not apply
initiative:autoor any activation label (apply-plan.sh enforces this for issues, and the same inert-by-default discipline applies to the new repo).
Project Structure Notes
This story operates on a new external repo, not on files in .github-private. Settings are applied by reusing the existing scripts/apply-repo-settings.sh against the new target.
References
- scripts/apply-repo-settings.sh
- https://github.com/petry-projects/.github/blob/main/standards/github-settings.md
- discussion Create a GitHub template repository to scaffold new petry-projects repos with org standards #962
Likely target surface
scripts/apply-repo-settings.sh
Story prepared by the BMAD Scrum Master (Bob) for epic #964. Status: ready-for-dev.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dev-lead:hands-offExclude from dev-lead agent automationExclude from dev-lead agent automationinitiativeEpic / initiative tracking issueEpic / initiative tracking issueinitiative:holdInitiative driver must not release this issue (human hold)Initiative driver must not release this issue (human hold)
Activity
don-petry commentedon Jun 28, 2026
✅ Template repo created (AC #4 audit record)
Repo: https://github.com/petry-projects/repo-template
Operator:
don-petry(org-admin)Token: gh CLI token, scopes
admin:org,repo(OAuthgho_, not a classic PAT)When: 2026-06-28T01:41:12Z
Acceptance criteria
isTemplate=true. ✅main; general settings applied: squash-only (merge & rebase disabled), delete-branch-on-merge, auto-merge enabled. ✅ (set viaPATCH /repos/{owner}/{repo})README.mdfrom the initial commit. ✅ (verbatim scaffold lands in [Phase 1] Seed the verbatim file scaffold into repo-template #966)initiative:auto/activation label applied to the repo or this work. ✅public(org default — every existing petry-projects repo is public).scripts/apply-repo-settings.shcould not apply the check-suite auto-trigger prefs (disable Claude/CodeRabbit auto-trigger): the check-suites API rejects the OAuth token (could not read check-suite preferences). This needs an org-admin classic PAT withreposcope. Re-runGH_TOKEN=<classic-PAT> bash scripts/apply-repo-settings.sh petry-projects/repo-templatewhen one is available. For repos created from the template this is covered by the Phase 2 bootstrap (#967, merged).Closing as done — this unblocks #966 (seed scaffold) → #969 → #970.
don-petry commentedon Jun 28, 2026
✅ Check-suite follow-up completed (2026-06-28T02:11:27Z)
Applied with an org-admin classic PAT (
ghp_, provided out-of-band and shredded immediately after use — never written to disk in-repo or printed).Disabled auto-trigger on
petry-projects/repo-templatefor the apps that queue check suites they never complete (the auto-merge blockers):setting=false✓setting=false✓Verified via the API read-back of
PATCH /repos/petry-projects/repo-template/check-suites/preferences.Minor note / latent bug:
scripts/apply-repo-settings.shcould not apply this via its normal path even with a valid classic PAT — its check-suite read precheck emitscould not read check-suite preferencesand bails before writing. I applied the write directly viagh api. Worth a follow-up issue to fix the script's precheck so the standard path works. The general settings andis_templatefrom the earlier comment remain in place; repo-template's day-0 compliance for the check-suite dimension is now satisfied.