provision-tutorial-repo
Provision a new sap-tutorials tutorial repo pair (public source + private -Contribution), their four org teams, and the content-rebuild CI/notify workflows — matching the org convention used by every
SKILL.md.claude/skills/provision-tutorial-repo/SKILL.md
GitHubProvision a new tutorial repo pair
Sets up a new product area in the sap-tutorials org exactly like the existing
ones: a public source repo <name>, a private QA repo
<name>-Contribution, four org teams, base CI, and the content-rebuild notify
workflow that wires the repo into the tutorials-ims platform.
When to use
Asked to "set up a new repo in sap-tutorials", "create the main and -Contribution repos like the others", or stand up a new product/topic area.
Prerequisites
ghauthenticated to github.com as asap-tutorialsorg owner, or with an active just-in-time (20-minute) admin elevation. A plain org member cannot create repos or teams —provision.shfails its preflight. Ask the requester to elevate right before you run the mutating steps.- Node/
ghworkflowscope (needed to commit workflow files via the API).
Key facts (why this works)
- Templates carry the base CI.
tutorial-repo-templateandtutorial-repo-Contribution-templateare real GitHub template repos that already shipcommunity-requester-id.yaml,label-issues.yml, and the twotutorial-cicaller workflows (tutorial-pr-checks.yml+tutorial-pr-comment.yml, pinned@v1). Notutorial-cirollout is required — CI comes with the template. - Templates omit the notify workflow. The per-repo rebuild-dispatch workflow
is added separately:
notify-tutorials-ims.ymlon the source repo,notify-qa.ymlon the Contribution repo. Both are repo-agnostic (${{ github.repository }}) — copy verbatim from any current repo (btp-adai/btp-adai-Contributionare the canonical source). - No tutorials-ims code change. The platform auto-discovers any org repo
that has a
tutorials/folder (scripts/parsers/github.ts→discoverAllTutorials, skipping archived/fork/EXCLUDED_REPOS). A new source repo is picked up automatically once it has content;-Contributionrepos are private and excluded by naming, like all the others. - Notify auth is org-level. The notify workflow fires only when
vars.USE_GITHUB_APP == 'true'and thesap-tutorials-builderApp is installed on the repo (org secretsTUTORIALS_APP_ID/TUTORIALS_APP_PRIVATE_KEYare org-wide, visibility all). App installation is UI-only and org-owner-gated.
Team convention
For product <name> (mirrors ai-core):
| Team | Repo | Grant |
|---|---|---|
<name>-admin |
<name> |
admin |
<name>-team |
<name> |
maintain |
<name>-contribution-admin |
<name>-Contribution |
admin |
<name>-contribution-team |
<name>-Contribution |
maintain |
Admin grant tries the org JIT custom role admin-ondemand first, falling back
to plain admin. Admin-team membership usually mirrors between the source and
contribution admin teams; likewise for the maintain teams.
Steps
- Confirm inputs with the requester: product
<name>(prefer a neutral name over a marketing product name), repo description, admin logins, team member logins. Confirm the 4-team layout (some ask for only 2). - Dry-run first to review every mutation:
.claude/skills/provision-tutorial-repo/provision.sh \ --name integration \ --description "Developer Tutorials for SAP integration" \ --admins "ajmaradiaga,jung-thomas" \ --members "ajmaradiaga,PalakGarg7,manouxnam,shyam-corpworks" \ --dry-run - Ask the requester to elevate (org-owner / 20-min JIT) — say so explicitly; creation fails without it.
- Run for real (drop
--dry-run). The script creates both repos, copies the notify workflows, setsUSE_GITHUB_APP=true, creates the four teams, adds members, and applies the repo grants. It is re-runnable — existing teams are skipped. - Complete the org-owner-only follow-ups the script prints:
- Install
sap-tutorials-builderon both new repos (Contents:write ontutorials-ims). - Confirm the org
TUTORIALS_APP_*secrets reach the new repos. - (Optional) mark
tutorial-pr-checksRequired in branch protection to make the structural checks blocking.
- Install
- Verify:
gh repo view <org>/<name>, list.github/workflowson both repos (5 workflows: 4 base + 1 notify), andgh api orgs/<org>/teams/<team>/reposshows the grants. A first tutorial push tomainshould trigger the notify workflow and atutorial-updatedrebuild intutorials-ims.
Gotchas
- Both templates default to
main; keep it — the notify workflows trigger on[master, main]somainis correct andmaster-default repos still work. -ContributionMUST be private; source MUST be public (fork PRs get no secrets, and the publictutorial-cimust be checkout-able by every consumer).- Team slug == name (all lowercase here), so membership/grant API calls use the name directly.