repo-setup
Recipe card from the charly-internals plugin (Development — contributor internals).
repo-setup — the opencharly org, dotgithub config, and new-repo setup
Section titled “repo-setup — the opencharly org, dotgithub config, and new-repo setup”This skill is the companion to /charly-internals:git-workflow: git-workflow
owns the AUTHOR’s branch/PR discipline; repo-setup owns the ORG-LEVEL
configuration that discipline relies on and the checklist for standing up a
NEW repository.
The org model (verified against the live settings)
Section titled “The org model (verified against the live settings)”- The
opencharlyorg is on GitHub Team, so org rulesets and theworkflowsrule (“Require workflows to pass”) are available. - ONE organization branch ruleset named
org-wide required workflow & main protectionis the single source of main protection and the required workflow. It targets~ALLrepositories MINUS an explicit exclude set, onrefs/heads/main, and carries:workflows— requiresopencharly/.github/.github/workflows/org-wide-pr-validator-required.yml@refs/heads/main(read from the.githubrepo at the pinned ref);required_status_checks—strict: true, exactly ONE contextvalidate / validate;non_fast_forward,deletion,creation. The ONLY bypass actor is thecharly-auto-mergeGitHub App (its protected-main CHANGELOG writes must land). There is NO human bypass and NOpull_requestreview rule — the validator IS the gate.
- Owner script:
opencharly/.github/scripts/org-ruleset.sh(apply/verify). It builds two org rulesets from ONE payload builder — A for the active non-forkmain-default repos, B for the active forks on~DEFAULT_BRANCH— deletes redundant per-repo rulesets and any surviving legacy branch protection, and enforces the settings that have NO org-level default:allow_auto_merge=true,delete_branch_on_merge=true, andallow_update_branch=false. - The sets are
discover_repos(active, non-fork, defaultmain) anddiscover_forks(active forks, with their default branch). Ruleset A targets the first onrefs/heads/main; ruleset B targets the second on~DEFAULT_BRANCH—stable/masterincluded — with the same rules, including theworkflowsrule. So a fork’svalidate / validateis produced by the ORG required workflow and no per-forkpr-validator.ymlis copied into a fork. The gate cannot be switched off by deleting a fork file. - A first-party fork is therefore a LANDING TARGET like any other. The one file it
carries is
.github/workflows/tag-on-merge.yml, installed and kept canonical byreconcile-tag-on-merge-callers.shwithSCOPE=forks— which also INSTALLS it where absent. A fork left out of ruleset B failsorg-ruleset.sh verifyby name until the nextapply(the staleness control). - A fork’s
workflowsrule blocks DIRECT pushes, so a user-tokengh repo syncfails (measured, opencharly/.github#179). Sync through.github/workflows/sync-forks.yml, which uses thecharly-auto-mergeApp token — the ruleset bypass actor. It never forces; a conflict is reported. - Still outside the gate: an archived repo, a vendored upstream on a non-
maindefault (pixelflux→av1), and an artifact-branch sink (omarchy-eval-artifacts→runs).
What happens automatically on every PR (the landing chain)
Section titled “What happens automatically on every PR (the landing chain)”-
A PR is opened/updated → the org ruleset runs
org-wide-pr-validator-required.ymlin the TARGET repo’s context (definition fromopencharly/.githubat the pinned ref) → it calls the reusablepr-validator.yml→ the single required checkvalidate / validate. -
On a PASS verdict the validator enables GitHub native auto-merge (squash) inline — there is NO separate auto-merge workflow.
mainis squash-only. -
After the merge, the PER-REPO caller
.github/workflows/tag-on-merge.ymlfires (onworkflow_runofcharly/pr-validator+pushto main) → calls the org reusabletag-on-merge.yml, which mints the CalVer tagv<YYYY>.<DDD>.<HHMM>at the merge commit and writesCHANGELOG/<CalVer>.mdfrom the merged PR body (the body IS the changelog). Proxy-consumed root modules (sdk,spec,plugin-gh) get the Go-modulev0.<YYYYDDD>.<HHMM>form instead.A landing in one of those repos is not tagged at the merge instant. The org sweep that mints the tag runs on
workflow_runofcharly/pr-validatorand scans the last 24h of merged PRs, so a native-auto-merge squash - which GitHub Actions creates ZERO runs for - is tagged when the NEXT validator completes in that repo, not when it merges. Measured and diagnosed onsdk’s own.github/workflows/tag-on-merge.yml, whose header RCA states it: do not read a missing tag minutes after a merge insdk,specorplugin-ghas a defect. -
A body-only fix after the head was pushed needs NO empty commit: re-run the failed run MANUALLY with
gh api -X POST repos/<owner>/<repo>/actions/runs/<run-id>/rerun(notgh run rerun, which 404s on the org-required workflow; the re-run’s newer check run supersedes the failure). The org-widererunlabel sweep was RETIRED.
Step 0 — choose the class and the name (do this BEFORE step 1)
Section titled “Step 0 — choose the class and the name (do this BEFORE step 1)”The repo name is not a free choice: it carries the class, and the class decides what the repo may hold. Settle the class first, then the name, then run the checklist below.
- What is the entity? A candy or image, a VM, a plugin, a service bundle, a packaging repo, a distro family, or a whole product family — the KIND axis.
- Which family does it belong to (
openclaw,strata,punktfunk, …)? The family word is also the skill namespace (/charly-<family>:<skill>) and the corpus directory. - Which repo owns it? One canonical owner per behaviour (the rulebook’s R2);
every other repo references it by
@github.com/<owner>/<repo>:<vX.Y.Z>or a namespace import. - Name it by its class. Bare names are for core/contract (
charly,sdk,spec,marketplace,docs) and appliances only. Everything else carries its prefix —distro-,charly-/pkg-,layer-,plugin-,pod-,vm-— and a product family is alayer-<family>repo (layer-openclawis the canonical example). A family is never a bare name.
The full class → name → “may hold” mapping is the umbrella README.md
(“The org map”), verified by charly task org-map; the rule itself
is in the umbrella AGENTS.md (“Repo classes and naming”). Do not copy either
table into this skill: they are the canonical surfaces, and a copy drifts.
A repo whose only content is skills is not a class. No prefix exists for it, and
none may be invented. A layer-*, distro-*, plugin-*, pod-*, vm-*, charly-* or
pkg-* repo must hold the code, plugin or config its name promises, with its skills
beside that content (umbrella AGENTS.md Part II #5). A *-skills carrier REPO that
exists only to own prose is retired by this rule. Its skills move to the repo of the
entity they describe, or to the umbrella when they are general guidance. A carrier
CANDY inside a repo that already holds code is a different thing and is unaffected:
it is the shape image-owned skills need (/charly-internals:skills).
Worked counter-example, because it happened: a product family was created as a
bare openclaw. It held a box, a candy, a disposable bed and two skills — a
layer-<family> shape — so the name did not fit its class and the repo was
renamed to layer-openclaw. A bare name holding anything beyond core/contract or
an appliance is the defect this step exists to catch.
Setting up a NEW repository (checklist)
Section titled “Setting up a NEW repository (checklist)”The org ruleset’s creation rule makes the naive path IMPOSSIBLE, and it is the first step every
new repo gets wrong: a repo’s first main cannot be created by git push, by the contents API, by
repo auto_init, or by a branch rename — each fails with “Cannot create ref due to creations being
restricted” (and auto_init leaves the repo with no refs at all). The only actor that can create that
ref is the charly-auto-merge App, and the org ships a workflow that mints exactly that token for this
purpose. So the order is:
-
Create the repo EMPTY and non-fork —
gh repo create opencharly/<name> --public, with no--add-readme,--gitignore, license orauto_init(blocked anyway; see above). Adopting an existing upstream is an explicit choice: NON-FORK (it gains the org gate and CalVer tags) or a fork (it lands on its own CI, asopenclaw-enterprisedoes, or on its own repo-scoped ruleset, ascrabboxdoes, and the org mints no tag for it). -
Push ONE throwaway seed branch. Creating any ref that is not
mainis allowed:git push origin HEAD:refs/heads/seed. The seed must carry no content you will ship —mainis created at it, and a PR whose diff is empty is a no-op. -
Bootstrap
mainwith the org workflow:gh workflow run bootstrap-repo-main.yml --repo opencharly/.github -f repos=<name>. It mints the App token, createsrefs/heads/mainat the seed, and INSTALLS and asserts the per-repo.github/workflows/tag-on-merge.ymlcaller — so do NOT hand-add that file. The installed caller IS the canonicaltag-on-merge-dispatcher.yml; a committed copy differs by a byte (no final newline) and fights every future template regeneration. -
Set the three repository settings the App cannot (it holds no
administrationpermission):Terminal window gh api --method PATCH repos/opencharly/<name> \-f default_branch=main -f allow_auto_merge=true -f delete_branch_on_merge=trueUntil this runs the repo is outside the org gate: no required
validate / validate, no CalVer tag, no CHANGELOG (org-ruleset.sh verifyreports it asneeds_operator_settings=<n>). Do NOT re-apply the org ruleset on its behalf — the ONE ruleset targets~ALLminus an explicit exclude set, so a new repo is already covered; only these three settings have no org-level default. -
Land the content as ONE PR off
main(never a direct push): afeat/branch, the commit, the change-class gate on that tree, the whole body, one push, a ready PR. Because step 3 installed the caller, the FIRST merge is tagged. -
In the umbrella, the gitlink and the pin’s INTENT land in the SAME commit.
git submodule add <url> <path>writes nobranch =, and a path with neither anintent:entry nor abranch=isunpinned— which failscharly task verifystructurally:Terminal window git submodule add <url> <path>git config -f .gitmodules submodule.<path>.branch main # the pin's INTENT (a leaf)then the
import:key (if the repo has entities to address), the README org-map row and the counts that reconciler checks. The mechanism and the why are/charly-internals:git-workflow(its pin-intent-and-currency reference, “A submodule is BORNunpinned”); this checklist repeats the two commands because a checklist is read on its own, and cites the owner of the rule rather than restating the reasoning. Advance THIS pin with the narrow mechanism, NOT withcharly task ff: that verb is an ORG-WIDE wave (Part II #3), it fast-forwards every pin the umbrella declares onto its branch tip, and it holds the worktree’s index while it runs. -
Verify the org issue labels (this is the whole label contract for a new repo):
a.
opencharly/.githubowns everything label-related — the taxonomy (labels/taxonomy.json), the generic rules (labels/category-rules.json), the org issue form (.github/ISSUE_TEMPLATE/issue.yml, the default community-health file), the sync/audit workflows and the tests. A repository ships no label configuration of its own, ever. b. The bootstrap sync provisions the labels.bootstrap-repo-main.ymlrunsscripts/labels.sh sync --repo <name>; the 12 labels (category:runtime,category:delivery,category:verification,category:experience,category:governance,category:hygiene;type:fix,type:feat,type:design,type:spec,type:docs,type:chore) exist in every non-archived repo. Verify them:gh label list -R opencharly/<name> --limit 100 | grep -E '^(category|type):'must show all 12; if the label sync has not run, rungh workflow run label-sync.yml --repo opencharly/.github -f repos=<name>. c. Do not ship a repository-specific issue template unless it carries the same four required fields as the org form — Category, Type, Remedy / files the remedy will touch, and Cited design decision or org-rulebook rule (ornone). A repo template overrides the org default (a GitHub limitation), so a template without those fields silently breaks mandatory labelling for that repo. The safest choice is no template at all. d. No repository-specific label. Labels are fully generic: the repository name is never a classification signal, every category is available in every repo, and a new or future repo needs no mapping. A label likesession:,owner:,priority:,severity:,size:,status:or any repo/product-named label is a defect the audit reports. e. File through the org form orscripts/gh/cli.ts issue, which refuses withoutcategory:,type:, remedy/files, the cited rule, the verified RCA and a--blocking/--non-blockingclassification — never a baregh issue create. The full “which label” rules, the split protocol and the DESIGN/rulebook violation table are in/charly-internals:git-workflow, under its issue-labels reference page. f. Expect the orglabel-auditto check the new repo daily: it reports missing axes, two values on one axis, retired/default labels and unknown labels (report-only by default);label-syncre-provisions the 12 labels because GitHub recreates its 9 defaults on every new repository.
Onboarding a fork
Section titled “Onboarding a fork”- Do not add a repo-scoped ruleset and do not add a
pr-validator.yml. Runscripts/org-ruleset.sh apply; ruleset B picks the fork up fromdiscover_forks. A fork missing from B failsverifyuntil apply runs — that is the staleness control, not a warning. - Install the tag-on-merge caller: dispatch
.github/workflows/reconcile-tag-on-merge-callers.ymlwithscope=forks. An absent caller is INSTALLED there (the targets scope never installs); a copy that pins the reusable to a SHA keeps that policy with the current.githubmain sha. - Confirm the settings
org-ruleset.sh applyasserts (allow_auto_merge,delete_branch_on_merge,allow_update_branch=false). With auto-merge disabled, an approved PR renders as a FAILED check (opencharly/.github#212). - Land one canary PR. Confirm exactly ONE
validate / validaterun on the head (two is a duplicate producer — stop), native squash auto-merge armed, the merge, and a CalVer tag plusCHANGELOG/<CalVer>.mdon the fork’s DEFAULT branch. - Sync from upstream with
sync-forks.yml, never a user-tokengh repo sync(theworkflowsrule blocks a direct push). - Tag-on-merge means the fork mints CalVer: a landing on the fork’s default branch is tagged by the caller, like every repo. The umbrella no longer asks a pin’s relation to a tag.
The measured gap this checklist prevents
Section titled “The measured gap this checklist prevents”A repo created WITHOUT the tag-on-merge.yml caller still MERGES (the org
workflow validates it) but NEVER gets a CalVer tag: measured on
layer-nerdctl and plugin-nerdctl (no .github directory at all; their two
v2026.266.* tags were minted manually).
Three DIFFERENT things sit outside the gate, and they are not one category:
- A vendored upstream on a non-
maindefault —pixelflux(defaultav1): consumed as a pin, not a landing target. - An artifact-branch sink —
omarchy-eval-artifacts(defaultruns): a branch that receives published output, not a landing target. - An archived repo —
pod-immich-ml: read-only, so GitHub rejects pushes and new PRs.org-ruleset.sh verifynames any archived fork too.
A first-party FORK is no longer in this set: ruleset B gates it, and it mints CalVer once its tag-on-merge caller is installed. The org mints no AUTOMATIC tag for a repo with no caller, so a CalVer tag you find there was minted out-of-band.
Cross-References
Section titled “Cross-References”/charly-internals:git-workflow— the author’s branch/PR/landing discipline and the after-merge close-out checklist (B8).opencharly/.github—scripts/org-ruleset.sh,scripts/lib-org.sh,scripts/retire-per-repo-dispatchers.sh,scripts/reconcile-tag-on-merge-callers.sh,scripts/sync-forks.sh, and the workflowsorg-wide-pr-validator-required.yml,pr-validator.yml,tag-on-merge.yml,tag-on-merge-dispatcher.yml,bootstrap-repo-main.yml,reconcile-tag-on-merge-callers.yml,sync-forks.yml.
When to Use This Skill
Section titled “When to Use This Skill”Invoke when creating or onboarding a repository in the opencharly org, when adding or changing CI/landing workflows, or when explaining what the org ruleset and dotgithub workflows do automatically versus what each repo must configure.

