Lesson 06 — Repository Documentation and Collaboration Standards¶
Module: 01 — Code
Difficulty: Beginner to Intermediate
Repository: github-deep-dive-training
1. Learning objectives¶
By completing this lesson, you should understand how to:
- Create a professional repository README.
- Choose and configure an open-source license.
- Write contribution guidelines.
- Establish a Code of Conduct.
- Create a security policy.
- Configure GitHub Issue Forms.
- Create a Pull Request template.
- Organize repository documentation.
- Understand GitHub Community Standards.
- Maintain repository standards as a project evolves.
2. Why repository standards matter¶
A GitHub repository is more than a place to store source code.
A professional repository should explain:
- What the project does.
- How to install or use it.
- How other developers can contribute.
- What license applies to the project.
- How to report problems.
- How security issues should be handled.
- What information is required when submitting changes.
Without these documents, contributors may not understand how to work with the project.
Repository standards make collaboration more consistent and reduce misunderstandings.
3. README.md¶
Purpose¶
The README is usually the first document people see when opening a repository.
It should answer these questions:
- What is this project?
- Why does it exist?
- What does it provide?
- How do I get started?
- Where can I find more information?
- How can I contribute?
Recommended sections¶
| Section | Purpose |
|---|---|
| Project title | Identify the repository |
| Description | Explain what it does |
| Features | Summarize important capabilities |
| Screenshots | Show the application, when relevant |
| Requirements | List prerequisites |
| Installation | Explain setup |
| Usage | Explain how to use it |
| Project structure | Explain the directories |
| Contributing | Link to contribution instructions |
| License | Explain licensing |
| Contact | Identify maintainers or support channels |
Markdown commands and syntax¶
Headings:
Links:
Images:
Code blocks:
Tables:
| Command | Purpose |
|---|---|
| git status | Show working tree status |
| git branch | List branches |
Task lists:
Exercise¶
- Open your repository.
- Create or update
README.md. - Add a project description.
- Add the training modules table.
- Add repository setup instructions.
- Add links to your contribution and security policies.
- Preview the Markdown in VS Code.
In VS Code, use:
to open the Markdown preview.
4. LICENSE¶
Purpose¶
A license defines what other people are allowed to do with your work.
Without an explicit license, people generally do not automatically receive permission to reuse, modify, or redistribute your copyrighted material.
Common open-source licenses¶
| License | Main characteristics |
|---|---|
| MIT | Permissive; allows broad reuse with license notice preservation |
| Apache 2.0 | Permissive; includes express patent-related provisions |
| GPL-3.0 | Copyleft; distributed derivative works must comply with its terms |
| BSD 2-Clause | Permissive with relatively simple conditions |
| BSD 3-Clause | Similar to BSD 2-Clause, with an additional non-endorsement condition |
Choosing a license¶
For a small educational repository, MIT is a straightforward option if you want others to reuse and adapt the material under its terms.
For software that requires stronger sharing obligations, you may consider GPL-3.0.
For projects requiring explicit patent provisions, consider Apache-2.0.
Read the full license before choosing it. A license is a legal permission, not just a GitHub configuration.
Exercise¶
- Create a file named
LICENSE. - Add the chosen license text.
- Replace the copyright holder placeholder.
- Commit the file.
- Open the repository on GitHub.
- Check whether GitHub recognizes the license.
5. CONTRIBUTING.md¶
Purpose¶
This document explains how contributors should work with your repository.
It should define:
- Branch naming.
- Commit message conventions.
- Development workflow.
- Pull Request requirements.
- Documentation standards.
- Review expectations.
Recommended workflow¶
Update main
|
v
Create feature branch
|
v
Make changes
|
v
Review changes
|
v
Create commits
|
v
Push branch
|
v
Open Pull Request
|
v
Review and corrections
|
v
Merge
Important Git commands¶
Update your local main branch:
git switch main: switches to the local main branch.git pull origin main: fetches and integrates changes from the remote main branch.
Create a branch:
git switch: changes branches.-c: creates a new branch and switches to it.docs/improve-readme: branch name.
Inspect changes:
Stage changes:
Inspect staged changes:
Commit:
Push:
The -u option sets the upstream tracking branch, so later you can usually use:
without specifying the remote and branch every time.
Exercise¶
Create a branch:
Create CONTRIBUTING.md.
Add the contribution rules.
Commit:
Push:
Open a Pull Request and merge it after reviewing the changes.
6. CODE_OF_CONDUCT.md¶
Purpose¶
A Code of Conduct establishes expected behaviour for contributors.
It helps create a respectful environment and explains how unacceptable behaviour should be handled.
It should define:
- Expected behaviour.
- Unacceptable behaviour.
- Reporting procedures.
- Maintainer responsibilities.
- Possible enforcement actions.
Example expected behaviour¶
- Respect other contributors.
- Provide constructive feedback.
- Avoid personal attacks.
- Explain technical disagreements professionally.
- Welcome questions from beginners.
- Focus on improving the project.
Exercise¶
Create CODE_OF_CONDUCT.md.
Add the project's behavioural expectations and reporting procedure.
Commit:
7. SECURITY.md¶
Purpose¶
A security policy tells people how to report vulnerabilities.
For example, imagine someone discovers that a project accidentally exposes an API token.
Publishing that token in a public Issue would make the situation worse.
A security policy should direct people toward private reporting.
Recommended sections¶
- Supported versions.
- How to report a vulnerability.
- What information to include.
- What information must not be published.
- Expected response process.
GitHub private vulnerability reporting¶
If enabled for the repository, GitHub provides a private reporting mechanism.
Typical navigation:
Availability and configuration depend on repository settings and GitHub's current feature support.
Exercise¶
- Create
SECURITY.md. - Define the reporting procedure.
- Explain what information a report should contain.
- Open the repository's Security tab.
- Inspect the available security features.
Never use real credentials in training exercises.
8. GitHub Issue Templates¶
Purpose¶
Issue templates standardize how contributors report bugs and request features.
Without templates, reports may lack important details.
For example, a bug report should ideally include:
- Affected lesson or file.
- Problem description.
- Expected result.
- Steps to reproduce.
- Environment information.
Two ways to create Issue templates¶
GitHub supports traditional Markdown templates and structured Issue Forms.
For this training repository, use Issue Forms because they provide structured fields.
Folder structure¶
Understanding Issue Form properties¶
Example:
name: Bug report
description: Report an error or incorrect example.
title: "[BUG]: "
labels:
- bug
body:
- type: textarea
id: description
attributes:
label: Describe the problem
placeholder: Explain what happened.
validations:
required: true
Explanation:
| Property | Purpose |
|---|---|
name |
Template name |
description |
Short explanation |
title |
Default Issue title |
labels |
Labels automatically applied |
body |
Form fields |
type |
Field type |
id |
Unique field identifier |
attributes |
Field configuration |
validations |
Validation rules |
required |
Whether the field is mandatory |
Common field types include:
markdowninputtextareadropdowncheckboxes
Exercise¶
Create:
.github/ISSUE_TEMPLATE/bug_report.yml
.github/ISSUE_TEMPLATE/feature_request.yml
.github/ISSUE_TEMPLATE/config.yml
Add the provided templates.
Commit:
Push your branch and merge the Pull Request.
Verify on GitHub¶
- Open your repository.
- Select Issues.
- Select New issue.
- Confirm that the templates appear.
- Open each template.
- Verify that required fields work as expected.
9. Pull Request template¶
Purpose¶
A Pull Request template helps contributors explain their changes consistently.
A useful template asks:
- What changed?
- Why was it changed?
- Which Issue does it resolve?
- What type of change is this?
- How was it tested?
- Are there screenshots or additional notes?
Location¶
GitHub automatically uses this template when someone creates a Pull Request.
Exercise¶
Create:
Add the provided template.
Commit:
Push your branch and merge the Pull Request.
Verify¶
Create a small test branch and open a Pull Request.
Confirm that the template appears automatically.
You can close the test Pull Request if it is not needed.
10. FUNDING.yml¶
Purpose¶
This file configures sponsorship links for repositories.
Location:
Example:
Other supported funding platforms may also be configured.
Only add this file when you have a real sponsorship account and want to display sponsorship options.
Exercise¶
For this training repository, you can skip this file unless you intend to accept sponsorships.
11. Recommended repository structure¶
A clean repository structure makes it easier to maintain and expand the project.
Example:
github-deep-dive-training/
│
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── feature_request.yml
│ │ └── config.yml
│ │
│ └── PULL_REQUEST_TEMPLATE.md
│
├── docs/
│ └── github/
│ ├── module-01-code/
│ │ ├── README.md
│ │ ├── lesson-01-repository-basics.md
│ │ ├── lesson-02-branches.md
│ │ ├── lesson-03-commits-and-history.md
│ │ ├── lesson-04-comparing-branches.md
│ │ ├── lesson-05-tags-and-releases.md
│ │ └── lesson-06-repository-standards.md
│ │
│ └── module-02-issues/
│
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
└── SECURITY.md
As you add modules, create separate directories for them.
Avoid putting every document in the repository root.
12. GitHub Community Standards¶
GitHub has a Community Standards area that helps repository owners identify missing community health files.
Typical standards include:
| Standard | Related file or feature |
|---|---|
| Description | Repository description |
| README | README.md |
| License | LICENSE |
| Contributing guidelines | CONTRIBUTING.md |
| Code of Conduct | CODE_OF_CONDUCT.md |
| Issue templates | .github/ISSUE_TEMPLATE/ |
| Pull Request template | .github/PULL_REQUEST_TEMPLATE.md |
How to inspect Community Standards¶
- Open your repository on GitHub.
- Select the Insights tab.
- Find Community Standards.
- Review the checklist.
- Identify missing files.
- Add the missing files.
The exact interface and navigation may change.
Exercise¶
Open the Community Standards page.
Verify that GitHub recognizes your repository files.
Fix any missing items that are relevant to this repository.
13. Practical project exercise¶
Your task is to prepare github-deep-dive-training as a repository that another developer can understand and contribute to.
Step 1 — Inspect the repository¶
Explanation:
git status: checks your current working tree.git branch -a: lists local and remote branches.git tag: lists local tags.
Do not assume a tag exists just because it was discussed in an earlier lesson.
Step 2 — Create a working branch¶
Step 3 — Create the files¶
Create the following:
README.md
LICENSE
CONTRIBUTING.md
CODE_OF_CONDUCT.md
SECURITY.md
.github/ISSUE_TEMPLATE/bug_report.yml
.github/ISSUE_TEMPLATE/feature_request.yml
.github/ISSUE_TEMPLATE/config.yml
.github/PULL_REQUEST_TEMPLATE.md
Step 4 — Review the changes¶
If some files are untracked, git diff will not show their contents yet. Use:
to inspect the untracked file list.
Step 5 — Stage the files¶
Step 6 — Inspect staged changes¶
Make sure you did not accidentally include:
- Personal access tokens.
- Passwords.
- Private keys.
- Local environment files.
- Unrelated files.
Step 7 — Commit¶
Step 8 — Push¶
Step 9 — Create a Pull Request¶
On GitHub:
- Open the repository.
- Select Pull requests.
- Select New pull request.
- Choose
mainas the base branch. - Choose
docs/add-repository-standardsas the compare branch. - Review the changes.
- Create the Pull Request.
- Check that the Pull Request template appears.
- Merge after reviewing.
Step 10 — Verify the repository¶
After merging:
- Check the README on the repository home page.
- Check that GitHub recognizes the license.
- Open the Issue creation page.
- Verify both Issue Forms.
- Create a test Pull Request to inspect its template.
- Inspect Community Standards.
- Check that the security and contribution documents are visible.
14. Troubleshooting¶
GitHub does not display my Issue Form¶
Check:
- The file is inside
.github/ISSUE_TEMPLATE/. - The extension is
.ymlor.yaml. - The YAML indentation is correct.
- Required fields have valid identifiers.
- The changes have been pushed to the default branch.
Pull Request template does not appear¶
Check:
- The filename is exactly
PULL_REQUEST_TEMPLATE.md. - It is inside
.github/. - It exists on the repository's default branch.
GitHub also supports other template locations and configurations, but use this standard location for this exercise.
Git does not show my new file in git diff¶
New untracked files are not shown by git diff by default.
Use:
After staging them:
Git says there is nothing to commit¶
Check:
Possible reasons:
- The file was not saved.
- No changes were made.
- The changes were already committed.
- You are working in a different repository or branch.
GitHub does not recognize my license¶
Check that:
- The file is named
LICENSEorLICENSE.md. - It contains a recognized license text.
- The file is committed and pushed.
15. Completion checklist¶
Repository documentation¶
- [ ] README.md created or updated.
- [ ] LICENSE added and copyright holder configured.
- [ ] CONTRIBUTING.md added.
- [ ] CODE_OF_CONDUCT.md added.
- [ ] SECURITY.md added.
GitHub templates¶
- [ ] Bug report Issue Form created.
- [ ] Feature request Issue Form created.
- [ ] Issue template configuration created.
- [ ] Pull Request template created.
- [ ] Templates verified on GitHub.
Git workflow¶
- [ ] Created a documentation branch.
- [ ] Reviewed all changes.
- [ ] Used a Conventional Commit message.
- [ ] Pushed the branch.
- [ ] Created a Pull Request.
- [ ] Reviewed and merged the Pull Request.
Repository verification¶
- [ ] README visible on repository home page.
- [ ] License recognized by GitHub.
- [ ] Community Standards inspected.
- [ ] Issue templates available.
- [ ] Pull Request template available.
16. Recommended commit messages¶
Use these examples when you prefer to split the work into smaller commits:
git commit -m "docs(repo): improve repository readme"
git commit -m "docs(repo): add mit license"
git commit -m "docs(repo): add contributing guidelines"
git commit -m "docs(repo): add code of conduct"
git commit -m "docs(repo): add security policy"
git commit -m "docs(github): add issue form templates"
git commit -m "docs(github): add pull request template"
Alternatively, one commit for the entire set of standards is acceptable:
17. Tags and releases¶
Continue using the tag and release strategy established in Lesson 5.
Do not create a release for every lesson.
A suitable milestone is the completion of Module 1, after its lessons and practical exercises are complete.
Before creating a release:
Confirm that the working tree is clean, the milestone changes are merged, and the intended version tag does not already exist.
Prepare a changelog describing the completed module, then create and publish the appropriate release according to your versioning plan.
Do not recreate or move an already-published tag.
18. What comes next?¶
In Lesson 7, we will study Repository Settings and Access Management.
Topics include:
- Repository visibility: public, private, and internal.
- Collaborators and repository permissions.
- Read, Write, Maintain, Triage, and Admin roles.
- Default branch configuration.
- Branch protection rules.
- Repository rulesets.
- Pull Request merge strategies.
- Repository security settings.
- Managing access safely.