Code of Conduct Toolkit for Open Source Communities
Tags: opensource, dei, community, toolkit
Published: 2024-05-10 02:26:38

This toolkit provides step-by-step guidance and useful information to anyone planning to implement a code of conduct for an Open Source project or community. It also offers best practice recommendations and helpful examples.

## Introduction

A code of conduct is a set of guidelines that states the norms and expected behavior of a community's members. Establishing and following a code of conduct will likely help create a positive and inclusive environment, enhance a community's reputation, increase psychological safety for members, and empower maintainers to address conflicts and unproductive behavior proactively. Proactively introducing such codes is also far more straightforward and has a lower cost than later realizing one was needed.


## Primer

![Code of Conduct Toolkit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1aly7bs1viq5m3vjmkrg.jpg)

Here are the suggested steps for rolling out a code of conduct:

_**Step 1: Assess the current state**_

- Review your Open Source project or community to see if it follows an existing code or derives from another larger project/community’s code of conduct.
- Establish a group of stakeholders to assess the needs of your community.
- Assess if the current code satisfies the needs of your community.

_**Step 2:  Review existing resources and examples**_

- A good place to start is the [Contributor Covenant](https://www.contributor-covenant.org/), licensed [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/legalcode.en). Several Open Source communities use this as a starting point for their codes of conduct. 

- The following projects are good examples of comprehensive codes of conduct, supporting documentation, and policies: the [Django project](https://www.djangoproject.com/conduct/), [Drupal](https://www.drupal.org/dcoc), [LLVM](https://llvm.org/docs/CodeOfConduct.html), and the [Fedora project](https://docs.fedoraproject.org/en-US/project/code-of-conduct/).

_**Step 3: Identify the needs and challenges of your project**_

- After reviewing the resources and examples, discuss the best fit for your community, the level of depth of processes, training for code of conduct committee members, and how you will address community adoption (if applicable). 

_**Step 4: Draft the code of conduct and policies**_

- Draft the code of conduct, supporting documentation, and policies that will suit your community, referencing the above resources and examples with appropriate attribution.

- Apart from the actual code itself, your policies should provide the following details:

1. _Code of Conduct Committee_: Identifies the committee members, provides information about how to contact them, outlines their responsibilities, provides guidelines for onboarding and offboarding committee members, and outlines the committee's responsibilities. 
2. _Reporting Guide_: This guide provides instructions on reporting an incident, identifies the next steps after the incident is reported, and details confidentiality policies.
3. _Response Guide_: This document establishes how the committee will respond to the report and details potential resolutions and policies for handling conflicts of interest. 
4. _Frequently asked questions_: Identify common questions your community may have about the code of conduct and policies and answer them proactively.
5. _Transparency reports_: Publishes updates on open, ongoing, and resolved reports handled by the committee periodically. Your code of conduct policy should define how frequently the committee will publish these reports. 

_**Step 5: Socialize the proposal to roll out a code of conduct and garner support from the community**_

- Some community members may have reservations about an explicit code of conduct. Socialize establishing a code of conduct by discussing the proposal at a conference with a large community presence or proposing it on your community mailing list.
- If your community needs a governing body, such as community stewards or steering committee, to sign off on a new process rollout, share your proposal and the draft policy documents with them. Work with them individually (if needed) to understand and address questions or concerns. Incorporate feedback from the governing members.
- Share the draft code of conduct policy documents for review with key stakeholders such as the community stewards/steering committee and the community itself. You may publish the documents on the community webpage in “Draft” mode.
- Define a specific review period and invite the community members to offer feedback and raise questions. Identify next steps at the end of the review period.
- Incorporate any feedback from the community in your code of conduct or policy documents.

_**Step 6: Recruit code of conduct committee members**_

- Contact diverse community members to serve on the code of conduct committee. 
- Explain the minimum commitment term to serve on the committee, responsibilities, and onboarding/offboarding processes. 
- Some communities may need leadership's approval (ex, steering committee) before accepting individuals to serve on the code of conduct committee. 
- Delegate further recruiting to accepted committee members.

_**Step 7: Formally adopt the code of conduct and make an announcement**_

- After the review period, publish the code of conduct and supporting documentation on the community webpage. If you have already published the draft documents on the community site, remove the “Draft” status.
- Announce the official adoption of the code of conduct and related policies on the mailing list.

_**Step 8: Meet regularly to maintain the code**_

- Code of conduct committee members meet periodically (ideally once a quarter) to review the incident reports and feedback regarding the code and/or policies and publish transparency reports. 

## Best practices

- Be sure to provide the required attribution when referencing or deriving information from other projects or communities.
- Establish clear confidentiality and conflict of interest terms to gain trust and acceptance of the code.
- Keep it simple. Make iterative adjustments to your code and policies based on feedback from your community.
- Terminology: Several communities have used similar terminologies for their codes and incident management. Here is a list of basic terms:

1. incident 
2. report
3. reporter
4. reported person
5. incident responder
6. risk
7. impact
8. response

- Training is highly recommended for code of conduct committee members. If possible, choose a vendor with an Open Source specialized background and experience working with Codes of Conduct and enforcement.
- The code of conduct committee should have more than four members in case existing members cannot perform their responsibilities due to conflicts of interest or other reasons. Ideally, there should be six or more members.
- Continue recruiting committee members or seek out volunteers during the feedback collection process.
- Encourage participation and volunteering from community leaders to join the code of conduct committee.
- Ensure the workload is shared equally among all code of conduct committee members. Assign a chair for the committee if it suits the needs of your community.
- Provide access to a legal team (where possible) that the code of conduct committee can consult as relevant questions arise.
- Resources: There is an abundance of resources available online. Here are a few helpful ones:

1. [Mozilla's process](https://medium.com/mozilla-open-innovation/how-were-making-code-of-conduct-enforcement-real-and-scaling-it-3e382cf94415)
2. [Opensource.com Code of Conduct Guide](https://medium.com/mozilla-open-innovation/how-were-making-code-of-conduct-enforcement-real-and-scaling-it-3e382cf94415)
3. [Otter Tech Code of Conduct workshop](https://otter.technology/code-of-conduct-training/)
4. [ Communication templates](https://github.com/mozilla/inclusion/tree/8df5e99babfee5c6522be4d62946b2aed6dd4bc7/code-of-conduct-enforcement/decisions/communication/decision-comms/reported)
5. Documentation examples: [Elastic](https://www.elastic.co/community/incident-response-plan) and [Python Software Foundation](https://www.python.org/psf/conduct/enforcement/)

## Conclusion
Thousands of Open-Source projects have adopted codes of conduct over the last few years. Codes of Conduct contribute to creating safe, welcoming, and inclusive communities.