GitHub Repository Setup and Community Standards
This skill covers the best practices for setting up a robust, welcoming, and standardized repository, especially for open-source or team-based projects.
Essential Files
Every professional repository should include the following community health files at its root.
1. README.md
The entry point for the project. It should include:
- Project Name and Description: What it does.
- Badges: CI status, version, license.
- Installation: How to set it up locally.
- Usage: Basic examples of how to use the project.
- Contributing: Link to the contribution guidelines.
- License: The licensing information.
2. CONTRIBUTING.md
Guidelines for how others can contribute to the project.
- How to set up the dev environment.
- Coding standards and conventions.
- How to submit a Pull Request.
- How to report bugs (link to templates).
3. CODE_OF_CONDUCT.md
Establishes expectations for behavior within the community to ensure a welcoming environment. The Contributor Covenant is a widely used standard.
4. LICENSE
Defines how others can use, modify, and distribute the code (e.g., MIT, Apache 2.0, GPL).
Issue and PR Templates
Templates help standardize the information provided by users and contributors. Create them in the .github/ISSUE_TEMPLATE/ and .github/PULL_REQUEST_TEMPLATE.md directories.
- Bug Report Template: Prompts for steps to reproduce, environment, and expected behavior.
- Feature Request Template: Prompts for problem description and proposed solution.
- PR Template: Prompts for description, linked issues, and checklists.
Repository Settings
Configure the repository settings to enforce quality and security.
Branch Protection Rules (for main or master)
- Require Pull Request reviews before merging: Enforce at least 1-2 approvals.
- Require status checks to pass before merging: Ensure CI (tests, linters) passes.
- Require conversation resolution before merging: Ensure all review comments are addressed.
- Require linear history: Prevent merge commits if using squash/rebase strategy.
- Include administrators: Enforce these rules even for repo admins.
Open Source Best Practices
- Security Policy (
SECURITY.md): Explain how to report security vulnerabilities responsibly. - Releases: Use GitHub Releases with Semantic Versioning (SemVer) and clear changelogs.
- Automated Workflows: Set up GitHub Actions for CI/CD, linting, and stale issue management.
Setup Checklist
-
README.mdis complete and clear. -
CONTRIBUTING.mdandCODE_OF_CONDUCT.mdare added. -
LICENSEfile is present. - Issue and PR templates are configured.
- Branch protection rules are enforced on the default branch.