Skip to content

Contributing

Docs and code live in the same repository and go through the same review.

Workflow

  1. Create a branch: docs/<topic> for documentation, feature/<topic> for code. For example: git switch -c docs/short-description.
  2. Make your change. A code change comes with its documentation in the same pull request. Record a significant decision as a new ADR (see Decisions).
  3. Preview docs with mkdocs serve, and run the checks below.
  4. Open a pull request. Describe what changed and why in plain language.
  5. Wait for the checks to pass. The maintainer reviews and merges every pull request. Nobody pushes to main directly.

When the pull request is merged into main, the docs site is rebuilt and published automatically.

Preview the docs

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements-docs.txt
mkdocs serve

Then open http://127.0.0.1:8000.

Update the sample email

The README shows docs/assets/sample-email.png, built from the fictional jobs in samples/jobs-sample.json. Nothing is sent. After a change to the email, rebuild it:

python ranker/rank_jobs.py samples/jobs-sample.json --quiet --out /tmp/wfh/picks.json
python mailer/send_email.py /tmp/wfh/picks.json --test --preview /tmp/wfh

/tmp/wfh/email.html is the email's HTML. Wrap it in a page, save the page as docs/assets/sample-email.html, and take a 700-pixel-wide screenshot of it, for example with headless Chrome, as docs/assets/sample-email.png.

Automatic checks

Every pull request runs these checks. A failing check blocks the merge.

Check Tool What it catches
Style Vale with the Google style Wordy, passive, or inconsistent writing
Formatting markdownlint Broken Markdown structure
Links lychee Links that point nowhere
Build mkdocs build --strict Missing pages, broken navigation
Tests python -m unittest on Python 3.12 and 3.14 Broken code. The tests never use the internet.

To run every check on your computer, install the tools and run, from the root of the repository:

markdownlint-cli2 "**/*.md"
vale sync && vale --minAlertLevel=error docs
lychee --no-progress --exclude 127.0.0.1 "./**/*.md"
mkdocs build --strict
python3 -m pip install -r requirements.txt   # once, for the tests
python3 -m unittest discover tests

Vale fails the pull request only on errors, but read its warnings too.

Keys and CVs

Never commit an API key or a CV. git ignores .env, the private/ folder, and every .pdf, .doc, and .docx file. Turn on the pre-commit hook once per clone, so a commit that contains one of them is blocked:

git config core.hooksPath .githooks

The hook can be skipped, so the tests also fail if such a file is tracked (tests/test_private_files.py).

Writing style

  • Write for someone who has never seen the project.
  • Use short sentences and active voice.
  • Put the most important information first.
  • Use "you" for the reader.
  • Add product terms Vale doesn't know to .github/styles/config/vocabularies/Project/accept.txt.

Where things go

You're writing… Put it in
How to use a feature docs/user-guide/
How to run or change a part of the code docs/developer/
A job source and its terms docs/sources.md
How the system is built docs/architecture/
Why something was decided docs/decisions/ (see Decisions)
How to fix a specific problem docs/kb/ (see Knowledge base)
What changed in a release docs/changelog.md