Repository Initialization Scaffold
Initialize a repo as a human-agent engineering system: Matt skills for process control, Chinese-first repo assets for team continuity, worktree/branch coordination for execution isolation, and GitHub entities for issues, PRs, CI, review, and release governance.
This is a generic repository scaffold. It must not encode a business domain such as law, finance, healthcare, or a product-specific ontology. Domain facts belong in the target repo's README.md, CONTEXT.md, docs/adr/, custom labels, or project-local skills maintained by that repo.
Workflow
1. Ground the repo
Inspect the current directory before changing anything:
pwdgit status --short --branchgit remote -vgh auth status- existing
AGENTS.md,CONTEXT.md,docs/agents/,.github/,.agents/skills/,skills-lock.json
Completion criterion: know whether this is a git repo, whether it already has a GitHub remote, which gh account is active, and which governance assets already exist.
2. Establish GitHub identity
Use local gh as the primary execution surface for repository setup.
- If
ghis missing, tell the user to install GitHub CLI and stop before GitHub writes. - If
gh auth statusfails, guide the user throughgh auth loginand stop before GitHub writes. - If multiple accounts exist, use the active account from
gh api user --jq .loginunless the user explicitly chooses another account.
Completion criterion: one GitHub owner/account is selected and can perform repo writes.
3. Establish repo target
Collect or infer:
- repository full name:
OWNER/REPO - description
- visibility:
privateby default unless user asks forpublic - whether to create a new GitHub repo or bind an existing one
- remote name:
originby default
If the local repo already has a GitHub remote, prefer that repo and ask only if the user wants to switch. If there is no remote, create or bind the target repo before pushing.
Completion criterion: local repo and GitHub repo identity are aligned.
4. Run the bootstrap script
Use scripts/init_matt_engineering_discipline.py from this skill. Prefer dry-run first:
python3 /path/to/init-matt-engineering-discipline/scripts/init_matt_engineering_discipline.py --dry-run
Then run for real with explicit repo values:
python3 /path/to/init-matt-engineering-discipline/scripts/init_matt_engineering_discipline.py \
--repo OWNER/REPO \
--description "..." \
--visibility private \
--create-repo \
--yes
The script is intentionally idempotent. It writes missing repo assets, installs Matt skills when absent, installs bundled runtime skills such as worktree-agent-coordination under .agents/skills/, configures labels and milestone, optionally creates a GitHub Project and branch ruleset, commits the governance baseline, and pushes it.
By default, consumer repos do not receive local skill source under skills/. Use --include-local-skill-source only when the target repo is itself meant to author and maintain project-local skills.
Completion criterion: the script finishes or reports the exact blocked operation and the command/user action needed to resume.
4.1 Keep the scaffold domain-neutral
The generated baseline may require Chinese-first communication, GitHub governance, and worktree discipline. It must not write business-domain assumptions into the target repo.
Allowed:
- Chinese-first documentation and prompt preferences
- generic GitHub labels for triage, type, area, priority, size, and risk
- generic
CONTEXT.mdplaceholders for project language - worktree/branch/Codex task coordination rules
Not allowed:
- domain-specific area labels unless the user explicitly asks
- legal, finance, medical, ERP, AI-product, or other business assumptions
- README claims about what the product does beyond the repository name
- issue template fields that only make sense for one domain
5. Verify GitHub governance
After the script:
- Confirm
git remote -vpoints at the intended GitHub repo. - Confirm labels exist.
- Confirm issue templates and PR template exist.
- Confirm CI workflow exists.
- Confirm the governance issue exists.
- If
--apply-rulesetwas used, confirm the default branch cannot be changed without PR checks/review.
Completion criterion: the repo can accept work through issue -> execution workspace -> branch/worktree -> PR -> CI -> review -> merge -> release.
What the script creates
Local repo assets:
AGENTS.mdCONTEXT.mdCONTRIBUTING.mdCODEOWNERSREADME.mdif missingdocs/agents/*docs/adr/.gitkeep.github/ISSUE_TEMPLATE/*.yml.github/pull_request_template.md.github/workflows/ci.yml.agents/skills/*andskills-lock.jsonthroughnpx skills@latest add mattpocock/skillswhen absent.agents/skills/worktree-agent-coordinationfrom this scaffold's bundled local skills- optionally
skills/productivity/worktree-agent-coordinationonly when--include-local-skill-sourceis set
GitHub assets:
- repo remote
- triage/type/area/priority/size/risk labels
- first milestone:
v0.1-project-governance - optional GitHub Project
- optional default-branch ruleset
- initial governance issue
GitHub details
Read references/github-governance.md when the user asks what each GitHub entity means, wants to adjust labels/templates/rules, or needs a manual fallback for permissions.
Safety rules
- Never ask for GitHub tokens in chat. Use
gh auth login. - Never overwrite non-empty user files silently. The script writes missing files and can overwrite only with
--force. - Never push without a commit summary and explicit user intent or
--yes. - Treat branch rulesets, Projects, and org-owned repos as permission-sensitive. Try them only when requested; report failures cleanly.
- Keep Chinese-first project assets, but preserve code identifiers, commands, API names, file paths, and external protocol names in English.
- Keep the scaffold domain-neutral. If the user wants domain-specific labels or docs, treat that as target-repo customization after initialization.