Bootstrap a Contributor-Ready Open Source Repo on GitHub
Set up issue forms, a PR template, CODEOWNERS, and good first issues so outside contributors can land PRs fast.
What you'll build
A public GitHub repo where an outside contributor can pick a beginner-friendly issue, file a well-formed bug report, and open a PR that automatically requests your review. You'll wire up an issue form, a template chooser config, a PR template, CODEOWNERS, and a seeded good first issue that appears on your repo's /contribute page.
Prerequisites
- A GitHub account (free tier is fine).
- GitHub CLI 2.x, authenticated via
gh auth login. Verified against gh 2.100.0. - Git 2.x.
- macOS or Linux shell. On Windows, run the heredoc commands in Git Bash or WSL.
Verified against GitHub Docs as of September 2026.
1. Create the repo
gh repo create contrib-demo --public --add-readme --clone
cd contrib-demo
mkdir -p .github/ISSUE_TEMPLATE
Everything contributor-facing lives under .github/, and none of it takes effect until it lands on the default branch.
2. Add an issue form
Issue forms are YAML files in .github/ISSUE_TEMPLATE/. Unlike old Markdown templates, form fields can be required, so you stop getting one-line "it doesn't work" reports.
cat > .github/ISSUE_TEMPLATE/bug_report.yml <<'EOF'
name: Bug report
description: Report something broken
labels: ["bug"]
body:
- type: input
id: version
attributes:
label: Version
placeholder: v1.2.3
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce
description: Exact commands, one per line.
validations:
required: true
- type: textarea
id: expected
attributes:
label: What you expected vs. what happened
validations:
required: true
EOF
name, description, and body are the required top-level keys. The labels key auto-applies bug on submit, which feeds your triage flow later.
Now the chooser config, which hides the blank-issue option and redirects questions away from the tracker:
cat > .github/ISSUE_TEMPLATE/config.yml <<'EOF'
blank_issues_enabled: false
contact_links:
- name: Questions and ideas
url: https://github.com/orgs/community/discussions
about: Ask here instead of opening an issue.
EOF
Point url at your own Discussions or Discord once you have one.
3. Add a PR template
cat > .github/pull_request_template.md <<'EOF'
## What this changes
## Why
## Checklist
- [ ] Linked the issue this closes (e.g. `Closes #1`)
- [ ] Tests pass locally
EOF
The filename must be exactly pull_request_template.md; valid locations are the repo root, docs/, or .github/.
4. Add CODEOWNERS
CODEOWNERS maps file patterns to reviewers, and GitHub auto-requests a review from the matching owner on every PR. Owners need write access, so for a new repo that's you:
echo "* @$(gh api user -q .login)" > .github/CODEOWNERS
Patterns use gitignore-style syntax and the last matching line wins, so you can add docs/ @your-docs-teammate below the catch-all later.
5. Label and seed a good first issue
New repos ship with default labels including good first issue, help wanted, and documentation. Add one for triage, then push everything and file a starter issue:
gh label create "needs triage" --color D93F0B --description "Awaiting maintainer review"
git add .github
git commit -m "Add contributor templates, CODEOWNERS, and chooser config"
git push
gh issue create --title "Add a CONTRIBUTING.md" \
--body "Write a short CONTRIBUTING.md covering setup and how to run tests. Good starter task." \
--label "good first issue" --label "documentation"
Issues labeled good first issue populate github.com/YOU/contrib-demo/contribute, the page GitHub shows newcomers looking for a way in.
Verify it works
Check the labels:
gh label list
Expected output includes your custom label alongside the defaults:
bug Something isn't working #d73a4a
good first issue Good for newcomers #7057ff
needs triage Awaiting maintainer review #D93F0B
The gh issue create command should have printed an issue URL like https://github.com/YOU/contrib-demo/issues/1. Then open https://github.com/YOU/contrib-demo/issues/new/choose in a browser: you should see the "Bug report" card and your contact link, with no blank-issue option. Finally, visit https://github.com/YOU/contrib-demo/contribute and confirm issue #1 is listed (this page can lag a few minutes behind labeling).
Troubleshooting
To get started with GitHub CLI, please run: gh auth login — any gh command prints this when you're not authenticated. Run gh auth login and pick HTTPS with browser auth.
HTTP 422: Validation Failed ... already_exists from gh label create — the label already exists (remember, good first issue is a default). Rerun with --force to update its color and description instead.
Unknown owner on line 1: make sure @user exists and has write access to the repository — shown when viewing .github/CODEOWNERS on github.com. The named user or team either doesn't exist, is a typo, or lacks write access. Fix the handle or grant access, then recommit.
Your template doesn't appear in the issue chooser — no error is shown; it's just missing. Either the file isn't on the default branch yet (push it) or the YAML lacks one of the required name, description, or body keys.
Next steps
Turn on branch protection requiring code-owner review so CODEOWNERS gates merges instead of just requesting them. Add more issue forms (feature request, docs fix) and a SECURITY.md. When that CONTRIBUTING.md PR lands, check your repo's Community Standards page under Insights, which scores exactly these files and tells you what's still missing.
Sources & further reading
- Syntax for issue forms — docs.github.com
- Configuring issue templates for your repository — docs.github.com
- Creating a pull request template for your repository — docs.github.com
- About code owners — docs.github.com
- Managing labels — docs.github.com
- gh label create — cli.github.com
Lenn writes about cloud platforms, Kubernetes internals, and the infrastructure decisions that quietly make or break engineering organizations. Based in Berlin's vibrant tech scene, they have a talent for turning dense platform-engineering topics into prose that people actually finish reading.
Discussion 0
No comments yet
Be the first to weigh in.