Replies: 2 comments
-
|
Sharpened problem & goal Create Context Two scripts in this repo already cover the post-creation half and are designed for exactly this use:
A Impact / Effort
Suggested acceptance criteria
|
Beta Was this translation helpful? Give feedback.
-
|
📋 Initiative planned by the BMAD Scrum Master (Bob). Epic #964 — Initiative: GitHub template repo + bootstrap for one-click compliant new petry-projects repos 6 stories created (inert — labelled
Open questions for review:
Review the epic and its sub-issue DAG, adjust as needed, then add |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Create a GitHub template repository (
petry-projects/repo-template) that scaffolds new org reposwith our standards already in place, so spinning up a compliant repo is one "Use this template" click
plus a single bootstrap step — instead of the current manual copy-from-
standards/runbook. Today a newrepo only becomes compliant after someone hand-copies caller stubs, config, and docs, then runs the
settings/ruleset scripts. A template repo turns the file scaffold half of that into a button; an
explicit bootstrap must turn the org-policy / settings half into one command — including
confirming which release ring the new repo joins.
Background — verified gaps
Researched across
petry-projects/.github(standards source),.github-private, and the 6 productconsumers (
ContentTwin,TalkTerm,bmad-bgreat-suite,broodly,google-app-scripts,markets):gh repo listshows none flaggedis_template. Onboarding isentirely script + PR driven:
scripts/deploy-standard-workflows.sh,apply-repo-settings.sh,apply-rulesets.sh, plus the manual "Applying to a New Repository" checklists instandards/github-settings.md(9 steps) andstandards/ci-standards.md(13 steps).template should ship:
.github/workflows/thin caller stubs (≈10):agent-shield.yml,auto-rebase.yml,ci.yml,copilot-setup-steps.yml,dependabot-automerge.yml,dependabot-rebase.yml,dependency-audit.yml,dev-lead.yml,pr-review-mention.yml,sonarcloud.yml(+ optionally
feature-ideation.yml). All present in all 6 consumers..github/CODEOWNERS(* @petry-projects/org-leads),.github/dependabot.yml— all 6.AGENTS.md,CLAUDE.md(1-line pointer to orgAGENTS.md),sonar-project.properties,.gitignore,LICENSE— all 6;SECURITY.md,README.md,.coderabbit.yaml— 5/6.standards/(workflow stubs instandards/workflows/,per-stack Dependabot in
standards/dependabot/,gitleaks.toml, etc.). A template repo is apackaging/distribution layer over content we already maintain — not new policy.
The key constraint (shapes the whole design)
Per GitHub docs, a template repository copies only files + (optionally) branches — with unrelated
history. It does NOT carry repository settings, branch protection, rulesets (
pr-quality,code-quality), required status checks, labels, secrets, Dependabot/GHAS security config, orcollaborators. Those are precisely the non-file standards our
apply-repo-settings.sh/apply-rulesets.sh/ security-config scripts apply today.Implication: the template solves the file scaffold only. Full compliance still needs the
settings/ruleset/security step. The clean design is therefore template repo + a one-shot bootstrap
(a
workflow_dispatch"repo-init" workflow, or a documentedscripts/init-new-repo.shwrapper) that,after creation, invokes the existing apply-* scripts against the new repo. The template gets you the
files in one click; the bootstrap closes the rest.
Bootstrap: org policies & settings (the non-file half — must be explicit)
The bootstrap must apply the full non-file standard surface by reusing the existing scripts (no
reimplementation). Concretely it must cover:
apply-repo-settings.sh): squash-only merge (disable merge/rebase), auto-merge,delete-branch-on-merge, and the standard general settings.
apply-repo-settings.sh+ push-protection lib): GHAS /security_and_analysisper
standards/advanced-security.md, secret-scanning push protection + custom patterns perstandards/push-protection.md, Dependabot security updates.apply-rulesets.sh+fix-ruleset-bypass.sh): the two sanctioned rulesets only —pr-quality(1 approval, code-owner review, required thread resolution, dismiss-stale, squash-only)and
code-quality(required status checks,strict: true, enforce-for-admins) — each with themandatory bypass actors
dependabot-automerge-petry(App) +OrganizationAdmin, bothbypass_mode: always. Legacy/ad-hocmainrulesets must not be created.SonarCloud,Dev-Lead Agent / dev-lead, CI pipeline name,coverage,Secret scan (gitleaks),dependency-audit / Detect ecosystems— not the per-ecosystem jobs, which skip).@petry-projects/org-leadsfirst owner).fix-check-suite-prefs.sh) and add-to-project board wiring.This makes "org repo policies and settings" a first-class, automated bootstrap output rather than an
implied follow-up.
Release-ring assignment (confirm at setup — currently silent)
Ring membership is not encoded in a repo's own stubs. It lives centrally in two files that must stay
in sync, both read by the compliance audit and the deploy sweep:
standards/canary-rings.json(.github-private) andscripts/lib/ring-pins.sh(.github). The model isnext → ring0 → ring1 → stable.stablevia the*catch-all (*) printf 'stable') — a new repo joins thebroad fleet with no decision point and its stubs pin
@<agent>/stable.ring1, likeTalkTerm/bmad-bgreat-suite) you mustedit both central files and pin its stubs to the matching ring channel — otherwise audit/deploy
flag drift.
The bootstrap must therefore prompt/confirm the repo's ring (default
stable) and, when a non-stablering is chosen, register the repo in
canary-rings.jsonandring-pins.sh(keeping them in sync) andpin the shipped stubs to that channel. Even when the answer is
stable, recording the confirmation makesring membership a deliberate, auditable choice instead of an accident of the wildcard.
Goals
run one bootstrap command/workflow that applies files and org policies/settings and confirms
the release ring.
standards/(CI mustguard drift), so the template never becomes a competing fork of the standards.
@<name>/stableby default, public@v2, private@main) in shippedstubs — not the local dogfood
./...refs the source repos use internally.Acceptance criteria
petry-projects/repo-templaterepo exists, flagged as a template repository.standards/workflows/and Dependabot from the appropriatestandards/dependabot/stack template../...refs.CLAUDE.mdis the 1-line pointer;AGENTS.mdfollows the consumer convention.scripts/init-new-repo.sh) applies the fullnon-file policy surface above — repo settings, security/GHAS + push protection, the
pr-quality+code-qualityrulesets with the required bypass actors, required status checks,labels, CODEOWNERS, check-suite prefs — by reusing the existing apply-* scripts (no reimplementation).
stable); for a non-stable ring it registersthe repo in both
standards/canary-rings.jsonandscripts/lib/ring-pins.shand pins stubs tothe matching channel. The chosen ring is recorded/auditable even when it is
stable..github) fails if the template's stubs/config diverge fromstandards/, so the template stays a thin distribution layer.github-settings.md/ci-standards.mdareupdated to point at the template + bootstrap as the primary path.
fullstack) or a documented post-clone "pick your Dependabot + ci.yml" step (
ci.ymlis the onestub with real build/test steps and must be customized per stack).
Out of scope
deploy-standard-workflows.shongoing sync — the template seeds day-0; ongoing updates toalready-created repos still flow through the existing PR-based sync.
Assessment
standards/; apply-* scripts and the ring config already exist. Mostly packaging + a bootstrap wrapper + a drift-guard check.Adversarial review
Strongest objection: "A template repo duplicates
standards/and will drift — we'd maintain thesame stubs in two places." Rebuttal: valid, and it's why the drift-guard CI check + verbatim-copy
rule are acceptance criteria. The template must be a distribution artifact of
standards/, regenerablefrom it, not a hand-edited fork. If a drift guard proves too costly, the fallback is generating the
template contents from
standards/in CI rather than committing them.Suggested next step
Have the initiative-planner scope this as: (1) template repo + verbatim scaffold, (2) bootstrap
workflow/script wrapping the apply-* scripts for the full policy/settings surface, (3) release-ring
confirmation + central-config registration, (4) drift-guard CI, (5) docs update — and decide
single-template-with-post-clone-choices vs. per-stack variants for the Dependabot/
ci.ymlsplit.Beta Was this translation helpful? Give feedback.
All reactions