First, thank you. The reason Safrochain documentation is good is that people like you take time to make it better. This guide explains how contributions flow, what we expect, and how to ship a change quickly.
- Fork the repo and create a feature branch from
main. - Edit markdown in
docs/(or React insrc/): seeREADME.mdfor layout. - Run
npm run buildlocally; the build is strict and fails on broken links, anchors, or YAML. - Open a Pull Request against
mainwith a short, descriptive title. - CI runs build + typecheck + lint; a maintainer reviews; on merge the site auto-deploys.
| Contribution | Examples |
|---|---|
| Typo & grammar fixes | clearer wording, fixing dead links |
| Clarifications | adding examples, expanding a paragraph that is too dense |
| New pages | a guide we are missing: open an issue first to discuss the slot |
| Code samples | tested, copy-pasteable bash / toml / json blocks |
| Diagrams | Mermaid or ASCII; SVG accepted under static/img/ |
| Translations | start a discussion before opening a translation PR |
| Bug reports | rendering issues, broken builds, accessibility problems |
- "Drive-by" content rewrites with no
npm run buildrun locally. - Edits that change foundation policy, tokenomics, or governance copy without a corresponding governance proposal or foundation sign-off.
- Style-only churn (rewrap, comma juggling) that does not improve clarity.
- Adding an em dash. Use
:,,, or;.
git clone https://github.com/<your-fork>/docs.git safrochain-docs
cd safrochain-docs
npm install
npm start # http://localhost:3000Use the Node version pinned in .nvmrc:
nvm install
nvm use-
Branch off
main. Name branches with a short prefix:docs/,fix/,feat/,chore/, e.g.docs/validators-grafana-dashboard. -
Keep one logical change per branch. Smaller PRs review faster.
-
We use Conventional Commits for the merge commit subject so the changelog can be auto-generated. Format:
type(scope): short description Optional body: what & why, not how.Common types:
docs,fix,feat,chore,ci,refactor,style,test,revert.Examples:
docs(validators): add Grafana dashboard JSON snippet fix(networks): correct testnet RPC port feat(home): redesign architecture diagramInside the PR you can write any number of commits in any style; the squash-merge subject is what becomes the conventional commit on
main.
A page is well-written when an operator can copy commands, run them, and the system behaves the way the page claims. Optimise for that.
- 2-space indent, no tabs, no trailing whitespace.
- One sentence per line where possible (cleaner diffs).
- Use ATX headings (
##), never set-ext (underlined) headings. - Wrap prose at ~80 columns when convenient; do not break code blocks.
- Tables: pipe-aligned, with a separator row, and a trailing newline after the table.
Every doc page must declare:
---
title: <page title in title case>
description: <one or two sentence summary>
sidebar_position: <integer>
keywords:
- <kw 1>
- <kw 2>
---If description (or any value) contains a colon, wrap it in double
quotes. Otherwise YAML breaks.
- Always include a language tag:
```bash,```toml,```yaml,```json,```text,```mermaid,```go. - Avoid leading
$inbashblocks; the user copy-pastes the line. - For multi-step shell sessions, use a single fenced block with
# 1.numbered comments rather than many tiny blocks. - Replace your real addresses, IPs, and tokens with the canonical placeholders below.
| Placeholder | Use for |
|---|---|
addr_safro1exampleexampleexampleexampleexample |
account address |
addr_safrovaloper1example… |
validator operator address |
addr_safrovalcons1example… |
validator consensus address |
<your_node_id> |
40-char CometBFT node ID |
<rpc_endpoint> |
RPC URL the user must replace |
- Internal: relative path without
.md, e.g.[Slashing & jail](./slashing). - External: full
https://URL. - Do not link to draft Notion pages, internal Slack threads, or Loom videos behind a login wall.
| Don't | Do |
|---|---|
| em dash (U+2014) | : for explanation, , for parenthetical, ; for list joins |
… (ellipsis char) |
... (three dots) |
Smart quotes ("…", '…') |
straight quotes ("…", '…') |
The em-dash rule is a hard build rule for new pages: see
README.md.
Use Mermaid for sequence diagrams, ER diagrams, and flow charts:
```mermaid
sequenceDiagram
participant U as User
participant N as safrochaind
U->>N: tx bank send
N-->>U: tx hash
```Use ASCII for small topologies that would be visually heavier as a
Mermaid graph. Use SVG (committed under static/img/) only when
neither works.
- Open a PR against
main. Fill out the PR template: it asks for what changed, why, and how to verify. - CI runs
npm run build,npm run typecheck,npm run lint. All three must pass. - For GitHub Pages, after merge, check the Deploy to GitHub Pages job; open the site URL from the run summary (or your custom domain).
- A maintainer reviews. Expect comments: most are small style fixes. Push more commits to the same branch; re-check the PR build in Actions until it is green.
- Squash-merge. The maintainer sets the conventional-commit subject; the body becomes the merge commit body.
-
npm run buildpasses locally -
npm run typecheckandnpm run lintpass - No em dashes in new or changed prose
- Frontmatter present (title, description, sidebar_position, keywords)
- Code samples copy-paste cleanly into a fresh shell
- Cross-links use relative paths without
.md - If you added a page, you also added it to
sidebars.ts - Screenshots / diagrams committed under
static/img/, not embedded as base64
- Does the page solve a real operator question?
- Are the commands tested on a clean machine?
- Are the links live? (CI will catch broken internal links; check external links manually.)
- Does the writing carry our voice: direct, plainspoken, technically accurate, no hype?
- Does it duplicate content already covered elsewhere? If so, link rather than copy.
Open an issue using the Docs issue template. Include:
- The URL of the page
- The browser & OS (for rendering issues)
- The exact text that is wrong, and what it should say
- (Optional) a screenshot
We aim to acknowledge issues within 3 business days.
Do not open public issues for security problems: in the docs or
in the chain. Follow SECURITY.md.
By submitting a contribution, you agree that your work is licensed under the Apache License, Version 2.0, the same license as this repository.
Significant contributors are listed in AUTHORS.md. If
your contribution belongs there and we missed it, open a PR adding
yourself.
If something here is unclear, the contribution process itself is a bug: open an issue and we'll fix this guide.