Episode Notes: Does a Small Package Need a Code of Conduct?
This is a written, conversation-style walk through one question, with no audio and no guests. The question comes up whenever a hobby library starts getting outside contributors: is a code of conduct overkill for a repository with three maintainers and a handful of regular contributors? Our short answer is no, and the longer answer is about what the file actually commits you to.
Why a tiny project might want one
A code of conduct is less about preventing bad behaviour than about deciding, in advance and in calm conditions, what you will do when it happens. Without one, the first heated thread forces you to invent a policy on the spot, with everyone watching. With one, you point to a document you wrote months ago and follow it.
There is also a signal to newcomers. Someone deciding whether to open their first pull request can see that the maintainers have thought about how people are treated. GitHub lists a code of conduct among the community health files it checks for on a repository's community profile, alongside a README, licence and contributing guide.
Adopt, don't draft
Writing a conduct policy from scratch is hard and rarely an improvement. The most widely adopted template in open source is the Contributor Covenant, which is free to use and available in many languages. Most projects copy it into CODE_OF_CONDUCT.md at the repository root and fill in one crucial blank: the contact for reports.
repo/
README.md
LICENSE
CONTRIBUTING.md
CODE_OF_CONDUCT.md <- adopted text, with a real contact
SECURITY.md
That contact is where many projects go wrong. A personal email of one maintainer creates a problem when the report is about that maintainer. If you can, use an address that reaches two people, or name a second contact.
What you are signing up for
Here is the part worth saying out loud. Publishing the file means agreeing to:
- Read reports and respond to them, privately.
- Keep the reporter's identity confidential where the policy says so.
- Apply the stated consequences consistently, including to friends and to prolific contributors.
- Use the moderation tools your host offers, such as locking threads, hiding comments and blocking users.
If nobody on the project is willing to do those things, the file is a promise you cannot keep, and that is worse than no file.
Handling the first report
A sensible illustrative sequence: acknowledge receipt quickly, gather the links and context, discuss among the maintainers not involved, decide on an outcome from the ladder in the policy, and tell the reporter what you did without sharing more than necessary. Write a private note of the decision so the next one is consistent. Most incidents on package trackers are small: a frustrated user being abrasive in an issue. A locked thread and a short note referencing the code of conduct usually resolves it. Pair this with the contribution norms in our first pull request guide so expectations run both ways.