Skip to content

Commit f0cf024

Browse files
authored
Merge pull request #29 from attogram/add-docs-guides
feat(docs): add nine new guides for open-source best practices
2 parents c34ec42 + b2c5a5c commit f0cf024

10 files changed

+501
-0
lines changed

docs/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,12 @@ This directory contains the documentation for the `base` project.
1919
- **[Using Prettier](./prettier.md)**: A guide to installing and using Prettier for code formatting.
2020
- **[Repository Badges](./badges.md)**: An explanation of how to use and create repository badges.
2121
- **[Maintaining `base` as a Template Repository](./template-repo.md)**: A guide for maintainers of this template, outlining best practices and administrative steps.
22+
- **[Versioning and Release Management](./versioning-guide.md)**: A guide to professional release management using Semantic Versioning and GitHub's automated release notes feature.
23+
- **[Community Building Guide](./community-building-guide.md)**: Best-practice advice on how to foster a healthy, welcoming, and effective community around a new open-source project.
24+
- **[Project Launch Checklist](./launch-checklist.md)**: A reusable checklist for ensuring a smooth and successful project launch.
25+
- **[Secrets Management in GitHub Actions](./secrets-management.md)**: A guide on the best practice of using GitHub Actions secrets to manage sensitive credentials.
26+
- **[Scheduling Workflows with Cron](./workflow-scheduling.md)**: A tutorial on how to use cron scheduling within GitHub Actions to automate recurring tasks.
27+
- **[Issue Management Guide](./issue-management-guide.md)**: A guide to best practices for triaging bug reports and feature requests using GitHub Issues.
28+
- **[Documentation Best Practices](./documentation-best-practices.md)**: A tutorial on the art of writing clear and effective documentation.
29+
- **[Using GitHub Discussions](./using-github-discussions.md)**: A guide on how to leverage GitHub Discussions for community conversations.
30+
- **[Security Best Practices for Maintainers](./security-best-practices.md)**: A guide covering basic security practices for open-source maintainers.

docs/community-building-guide.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Community Building Guide
2+
3+
A thriving open-source project is built on a foundation of a healthy, welcoming, and effective community. Here are some best practices for fostering such an environment.
4+
5+
## 1. Establish a Code of Conduct
6+
7+
A [Code of Conduct](./CODE_OF_CONDUCT.md) is a document that outlines the expected standards of behavior for all community members. It's a clear statement that your project is a safe and inclusive space.
8+
9+
- **Adopt a Standard:** You don't have to write one from scratch. The [Contributor Covenant](https://www.contributor-covenant.org/) is a widely used and respected choice. This repository includes a template to get you started.
10+
- **Enforce It:** A Code of Conduct is only effective if it's enforced. Be prepared to act on reports of violations to protect your community.
11+
12+
## 2. Be Welcoming and Responsive
13+
14+
First impressions matter. How you treat newcomers will determine whether they stick around.
15+
16+
- **Welcome Contributions:** Use a `CONTRIBUTING.md` file to explain how people can contribute. Thank contributors for their work, even if you don't merge it.
17+
- **Be Responsive:** Respond to issues and pull requests in a timely manner. If you're busy, a quick "Thanks for the report, I'll look into this next week" is better than silence.
18+
19+
## 3. Provide Clear Communication Channels
20+
21+
Designate specific places for different types of community interaction.
22+
23+
- **GitHub Issues:** Use issues for actionable tasks like bug reports and feature requests. This repository's [issue templates](./.github/ISSUE_TEMPLATE/) help structure this process.
24+
- **GitHub Discussions:** Enable [GitHub Discussions](https://docs.github.com/en/discussions) for open-ended conversations, Q&A, and sharing ideas. This keeps your issue tracker focused.
25+
- **Other Channels:** Consider a chat platform like Slack or Discord for more informal community interaction, but be mindful of the moderation overhead.
26+
27+
## 4. Document Everything
28+
29+
Good documentation is a cornerstone of a healthy community. It empowers users to solve their own problems and lowers the barrier to contribution.
30+
31+
- **User Guides:** Write clear, concise guides for using your project.
32+
- **Reference Material:** Provide detailed documentation for APIs, configuration options, and other technical aspects.
33+
- **Contribution Guidelines:** Your `CONTRIBUTING.md` should clearly explain how to set up a development environment, run tests, and submit changes.
34+
35+
## 5. Empower Your Community
36+
37+
As your community grows, look for opportunities to empower trusted members.
38+
39+
- **Recognize Contributors:** Acknowledge valuable contributions publicly. This could be through release notes, social media shout-outs, or a contributors list in your README.
40+
- **Delegate Responsibility:** Invite experienced community members to help triage issues, review pull requests, or moderate discussion channels.
41+
42+
Building a community takes time and effort, but it's one of the most rewarding aspects of maintaining an open-source project. By being intentional about creating a positive and productive environment, you can build a project that lasts.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Documentation Best Practices
2+
3+
Good documentation is one of the most important aspects of a successful software project. It empowers users, reduces the support burden on maintainers, and encourages contributions. This guide covers the art of writing clear and effective documentation.
4+
5+
## The Two Types of Documentation
6+
7+
It's helpful to think of documentation in two main categories: user guides and reference material. A good project has both.
8+
9+
### 1. User Guides (Tutorials)
10+
11+
- **Purpose:** To teach a user how to accomplish a specific task. They are action-oriented.
12+
- **Audience:** New users or users trying to solve a particular problem.
13+
- **Format:** A step-by-step walkthrough. They tell a story.
14+
- **Example:** A guide on "How to deploy this application to a server" or "How to build your first plugin."
15+
16+
User guides are like a teacher showing a student how to do something. They should be easy to follow and focused on a practical outcome.
17+
18+
### 2. Reference Material (The Dictionary)
19+
20+
- **Purpose:** To provide a comprehensive, factual description of the system. It is information-oriented.
21+
- **Audience:** Users who already have some familiarity with the project and need specific, detailed information.
22+
- **Format:** Organized by topic, like a dictionary or an encyclopedia.
23+
- **Example:** A complete list of all available API endpoints and their parameters, or a detailed description of every configuration option in a file.
24+
25+
Reference material is like a technical manual. It should be accurate, exhaustive, and well-organized so that users can quickly find the exact information they need.
26+
27+
## The Importance of Good Examples
28+
29+
Code examples are the heart of good documentation. They bridge the gap between theory and practice.
30+
31+
- **Make them practical:** Examples should demonstrate a real-world use case, not just the syntax of a function.
32+
- **Make them copy-pasteable:** Ensure that examples can be copied and run directly without modification. This means including any necessary setup or import statements.
33+
- **Keep them up-to-date:** There's nothing more frustrating than documentation with outdated examples. As your code evolves, make sure your examples do too.
34+
35+
## Tips for Writing Good Docs
36+
37+
1. **Know Your Audience:** Write for your users, not for yourself. Avoid jargon where possible, or explain it if it's necessary.
38+
2. **Be Concise:** Get to the point. Users are often looking for a quick solution to a problem.
39+
3. **Use a Clear Structure:** Use headings, lists, and code blocks to make your documentation easy to scan.
40+
4. **Add Visuals:** Screenshots, diagrams, and GIFs can often explain a concept more effectively than text alone.
41+
5. **Document the "Why":** Don't just explain _what_ something does; explain _why_ a user might want to use it. Provide context.
42+
6. **Treat Docs like Code:** Documentation should be part of your development process. When you add a new feature or make a change, update the docs at the same time. Include documentation in your code review process.
43+
44+
Writing documentation is a continuous process of refinement. By investing in clear, comprehensive, and user-focused documentation, you are investing in the long-term success of your project.

docs/issue-management-guide.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Issue Management Guide
2+
3+
Effective issue management is key to keeping your project organized and your community engaged. This guide covers best practices for using GitHub Issues, labels, and templates to triage bug reports and feature requests.
4+
5+
## 1. Use Issue Templates
6+
7+
The first step to effective issue management is to get clear, structured information from contributors. GitHub's issue templates are perfect for this.
8+
9+
- **What they are:** Pre-populated templates for bug reports and feature requests that prompt the user for specific information.
10+
- **Why they're useful:** They ensure you get the information you need to act on an issue, such as steps to reproduce a bug or the use case for a new feature.
11+
- **How to use them:** This repository includes templates in the [`.github/ISSUE_TEMPLATE`](./.github/ISSUE_TEMPLATE) directory. You can customize them to fit your project's needs.
12+
13+
## 2. Leverage Labels
14+
15+
Labels are a powerful tool for categorizing and prioritizing issues. A good set of labels makes it easy to see the state of your project at a glance.
16+
17+
### Recommended Label Categories
18+
19+
- **Issue Type:**
20+
- `bug`: A problem with the existing code.
21+
- `feature-request`: A proposal for new functionality.
22+
- `documentation`: An issue related to the docs.
23+
- `maintenance`: Chores like refactoring or updating dependencies.
24+
25+
- **Status:**
26+
- `needs-triage`: A new issue that hasn't been reviewed yet.
27+
- `confirmed`: A bug report that has been reproduced.
28+
- `in-progress`: An issue that is actively being worked on.
29+
- `blocked`: An issue that cannot be worked on due to external factors.
30+
31+
- **Priority:**
32+
- `critical`: Must be addressed immediately (e.g., a security vulnerability).
33+
- `high`: Important and should be prioritized.
34+
- `medium`: A standard issue.
35+
- `low`: A non-urgent issue or nice-to-have feature.
36+
37+
- **Contribution Welcome:**
38+
- `good-first-issue`: A relatively simple issue that's a great entry point for new contributors.
39+
- `help-wanted`: An issue that you'd like the community to help with.
40+
41+
## 3. The Triage Workflow
42+
43+
Triage is the process of reviewing new issues and preparing them for work. A typical workflow looks like this:
44+
45+
1. **Review New Issues:** Regularly check for issues that don't have any labels or assignees.
46+
47+
2. **Ensure Clarity:** If an issue is unclear, ask the author for more information. If they don't respond after a reasonable amount of time, it's okay to close the issue.
48+
49+
3. **Reproduce Bugs:** For bug reports, try to reproduce the issue based on the information provided. If you can reproduce it, add a `confirmed` label. If not, ask for more details.
50+
51+
4. **Apply Labels:** Add the appropriate `type`, `status`, and `priority` labels to the issue.
52+
53+
5. **Engage with the Community:**
54+
- For valid feature requests, discuss the proposal with the community to gauge interest and gather ideas.
55+
- For issues you won't address, explain why and close the issue respectfully.
56+
- For issues that are good for new contributors, add a `good-first-issue` label and perhaps a comment with pointers on how to get started.
57+
58+
## 4. Use Milestones and Projects
59+
60+
- **Milestones:** Group issues together for a specific release (e.g., `v1.1.0`). This helps you track progress towards your next version.
61+
- **GitHub Projects:** For more complex work, use a project board to visualize and manage the workflow of issues and pull requests, similar to a Kanban board.
62+
63+
By implementing these practices, you can create a clear, organized, and efficient issue management process that will benefit both you and your contributors.

docs/launch-checklist.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Project Launch Checklist
2+
3+
Launching a new open-source project can be a daunting task. This checklist is designed to help you ensure a smooth and successful launch.
4+
5+
## Pre-Launch
6+
7+
This is the phase where you prepare your project for its public debut.
8+
9+
### Code and Repository
10+
11+
- [ ] Finalize initial feature set for `v1.0.0`.
12+
- [ ] Write comprehensive tests and ensure they are all passing.
13+
- [ ] Set up CI/CD workflows for testing and linting.
14+
- [ ] Polish the codebase: remove commented-out code, fix typos, and ensure consistent styling.
15+
- [ ] Run a security audit (e.g., check dependencies for known vulnerabilities).
16+
17+
### Documentation
18+
19+
- [ ] Write a clear and compelling `README.md`.
20+
- [ ] Create a `CONTRIBUTING.md` file with guidelines for contributors.
21+
- [ ] Add a `LICENSE` file (e.g., MIT, Apache 2.0).
22+
- [ ] Write user guides and API reference documentation.
23+
- [ ] Add a `CODE_OF_CONDUCT.md` to set community standards.
24+
25+
### Community & Marketing
26+
27+
- [ ] Prepare a blog post or announcement for the launch.
28+
- [ ] Identify communities (e.g., Reddit, Hacker News, specific forums) where you will share your project.
29+
- [ ] Create a project website or landing page (GitHub Pages is a great option).
30+
- [ ] Set up social media accounts if desired.
31+
32+
## Launch Day
33+
34+
The day you make your project public.
35+
36+
- [ ] **Publish your code:** Make your GitHub repository public.
37+
- [ ] **Push the `v1.0.0` tag:** This will trigger your automated release workflow.
38+
```bash
39+
git tag -a v1.0.0 -m "Initial public release"
40+
git push origin main --tags
41+
```
42+
- [ ] **Publish your announcement:** Share your blog post and post on your chosen communities.
43+
- [ ] **Monitor for feedback:** Keep a close eye on GitHub issues, social media, and other channels for questions and bug reports.
44+
- [ ] **Be responsive:** Engage with early adopters, answer questions, and thank them for their interest.
45+
46+
## Post-Launch
47+
48+
The work doesn't stop after launch day. Now it's about building momentum.
49+
50+
### Short-Term (First Week)
51+
52+
- [ ] Triage and fix critical bugs reported by early users.
53+
- [ ] Publish a `v1.0.1` patch release if necessary.
54+
- [ ] Thank the community for the feedback and support.
55+
- [ ] Share any positive press or comments.
56+
57+
### Long-Term (First Month and Beyond)
58+
59+
- [ ] Continue to be responsive to issues and pull requests.
60+
- [ ] Start working on the features planned for `v1.1.0`.
61+
- [ ] Nurture your community by empowering contributors (see the [Community Building Guide](./community-building-guide.md)).
62+
- [ ] Set up a regular release cadence.
63+
- [ ] Periodically review and update your documentation.
64+
65+
This checklist is a starting point. Feel free to adapt it to the specific needs of your project. Good luck with your launch!

docs/secrets-management.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Secrets Management in GitHub Actions
2+
3+
Properly managing secrets like API keys, access tokens, and other credentials is a critical aspect of security. This guide explains the best practice of using GitHub Actions secrets to handle sensitive information.
4+
5+
## Why Secret Management is Important
6+
7+
**Never commit secrets directly to your repository.** Once a secret is in your git history, it should be considered compromised, even if you later remove it from the current version of the code. A public repository is visible to everyone, and malicious actors actively scan for exposed credentials.
8+
9+
Leaked secrets can lead to:
10+
11+
- Unauthorized access to your accounts and services.
12+
- Financial loss (e.g., if an API key for a paid service is stolen).
13+
- Damage to your project's reputation.
14+
15+
## Using GitHub Actions Secrets
16+
17+
GitHub provides a secure way to store and use secrets within your repository for use in GitHub Actions workflows.
18+
19+
### How it Works
20+
21+
1. **Encrypted Storage:** Secrets are stored as encrypted values at the repository or organization level.
22+
2. **Limited Access:** Secrets are only exposed to the specific GitHub Actions workflows you choose. They are not accessible to collaborators or even the repository owner once they are set.
23+
3. **Redacted Logs:** GitHub automatically redacts secrets from workflow logs, preventing them from being accidentally exposed in build outputs.
24+
25+
### How to Add a Repository Secret
26+
27+
1. Navigate to your repository on GitHub.
28+
2. Go to **Settings** > **Secrets and variables** > **Actions**.
29+
3. Click the **New repository secret** button.
30+
4. Enter a name for your secret (e.g., `NPM_TOKEN`, `AWS_ACCESS_KEY_ID`). This name will be used to reference the secret in your workflow files.
31+
5. Paste the secret value into the **Value** field.
32+
6. Click **Add secret**.
33+
34+
![GitHub new secret page](https://docs.github.com/assets/cb-132240/images/help/settings/actions-secret-new-repo.png)
35+
36+
### How to Use a Secret in a Workflow
37+
38+
Once a secret is stored, you can access it in your workflow `.yml` files using the `secrets` context.
39+
40+
Here's an example of a workflow step that uses a secret to publish a package to the npm registry:
41+
42+
```yaml
43+
- name: Publish to npm
44+
uses: actions/setup-node@v3
45+
with:
46+
node-version: "18"
47+
registry-url: "https://registry.npmjs.org"
48+
- run: npm publish
49+
env:
50+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
51+
```
52+
53+
In this example:
54+
55+
- `secrets.NPM_TOKEN` refers to a repository secret named `NPM_TOKEN`.
56+
- The secret's value is assigned to the `NODE_AUTH_TOKEN` environment variable, which is used by the `npm publish` command for authentication.
57+
58+
By using GitHub Actions secrets, you can automate workflows that require access to sensitive information without compromising on security. It's a fundamental practice for any project that interacts with external services.

0 commit comments

Comments
 (0)