Contributor Covenant · Citizen · Minimal

Generate a CODE_OF_CONDUCT.md

Drop a standard CoC into your repo — Contributor Covenant 2.1, Citizen CoC, or a tiny minimal version. Email is filled in for you.

Code of Conduct Generator
Markdown
1.7 KB
44 lines
Template
Covenant 2.1
contributor-covenant
Contact
set
conduct@example.com
Tone
formal
standard
input · fields
About Covenant 2.1
The de-facto standard for open-source projects. Adopted by Linux, Rails, Node.js, Kubernetes.
output · CODE_OF_CONDUCT.md
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to a positive environment include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologising to those affected by our mistakes
- Focusing on what is best for the overall community

Examples of unacceptable behavior include:

- The use of sexualised language or imagery, and sexual attention of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
**conduct@example.com**. All complaints will be reviewed and investigated promptly and fairly.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
<https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.

[homepage]: https://www.contributor-covenant.org
Quick Start

How to add a CoC

Pick a template, set the contact email, drop the file into your repo root.

  1. 01

    Pick a template

    Covenant for OSS, Citizen for lighter projects, Minimal for personal repos.

    Parsing runs through marked with GFM extensions enabled — tables, task lists, strikethrough, and fenced code blocks all match GitHub’s rendering.

    templateGFMmarkedCommonMarklive
    preset · markdowncovenant · GFM
    Contributor Covenant 2.1
    loaded · GFMGFM · ready
  2. 02

    Set contact email

    Reports go here — use a dedicated address or moderator alias.

    Soft-break behaviour is configurable: by default a single newline becomes a space (CommonMark), toggle on for chat-style <br> insertion.

    contactsoft-breaksoptionsconfiglive
    email · optionsset · live
    conduct@example.com
    options applied · livelive
  3. 03

    Review the text

    Read it once. Adjust local terms if needed before committing.

    The preview is scoped under a .mde class so its CSS doesn’t bleed into the rest of the page. Output HTML is whitespace-controlled for clean diffs.

    reviewpreviewscoped CSSrenderstable
    scan · renderedok · ready
    Our Pledge
    Our Standards
    …
    rendered · liverendered
  4. 04

    Commit the file

    Save as CODE_OF_CONDUCT.md in repo root or .github/.

    Export covers both raw Markdown and rendered HTML; downloads stream as text/markdown or text/html via Blob + object URL.

    exportclipboard.md.htmlblob
    ✓ · exportedready · done
    ✓ Copied CoC
    shipped · ready to shipsuccess
Pro tips

Author Markdown that renders everywhere

GFM is the safe default

GitHub-Flavored Markdown is the de-facto baseline (tables, task lists, strikethrough). CommonMark is stricter but ubiquitous as a fallback.

Soft-break behaviour varies

A single newline is a space in CommonMark, a <br> in GFM. Toggle soft breaks when source matters.

Escape inside code fences

Backticks inside fenced blocks need a longer fence — three becomes four. Use ~~~ if your content has many backticks.

Anchors are slugified

GitHub lowercases, strips punctuation, and joins with hyphens. Duplicate headings get -1, -2 suffixes.

Tables need a header row

The dash row sets alignment (:---, :-:, ---:). Use Table Aligner for diff-friendly columns.

Front matter is YAML

Triple-dash blocks at the top of files are parsed by static-site generators. Use the Front-Matter Validator to catch syntax errors.

Use Cases

When to add a CoC

Open-source repos, meetups, community sites.

Open-source project

Standard practice for any public repo with external contributors. Render path uses marked with GFM extensions enabled (tables, task lists, strikethrough, autolinks), so what you preview matches what GitHub publishes bit-for-bit. Soft-break behaviour is configurable for chat-style vs prose Markdown.

GFM-compliant

Meetup / event

Set expectations for participants ahead of time. Pairs cleanly with the Markdown Cheatsheet for syntax you can't quite remember — callout blocks, footnotes, definition lists. Output stays diff-friendly so style-only changes don't drown out real edits in PRs.

GitHub-perfect

Discord / Slack

Pin in the welcome channel so rules are visible. Cross-platform safe: anchors, code fences, and tables behave identically on GitHub, GitLab, Bitbucket, and Gitea. Heading-anchor slugs follow GitHub's lowercase-and-hyphenate rules so deep links survive a docs migration.

diff-friendly

Forum / Discussions

GitHub Discussions readers find the CoC alongside CONTRIBUTING. No server roundtrip — perfect for proprietary content you can't paste into a public tool. The full marked + GFM bundle ships with the page, so it works offline once loaded.

render-stable

Repository audit

GitHub flags repos without a CoC during community-standard checks. Front matter (YAML / TOML / JSON) passes through unchanged so static-site pipelines (Jekyll, Hugo, Astro, Eleventy) read it correctly. Pair with the Front-Matter Validator to catch syntax errors before deploy.

cross-platform

Hackathon

Lighter Citizen CoC works well for short, scoped events. Output is reproducible: identical input always produces identical Markdown, so doc-generation scripts can rely on it for snapshot tests and embedded into release workflows.

SEO-friendly
FAQ

Frequently asked questions

Contributor Covenant 2.1 is the de-facto OSS standard. Citizen is shorter; Minimal is for personal repos.
Save as CODE_OF_CONDUCT.md in repo root or in /.github/ — GitHub auto-detects both.
Recommended. A moderator alias keeps reports separate from regular issue email.
Yes — copy it out and tweak. The Contributor Covenant text is CC-BY-4.0.
No — the document is built locally and runs locally in your browser.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!