Read this when you start a repo, finish a feature someone else will use or set up a repo so coding agents can work in it.
Good code still needs a README that gets a new person from clone to running robot, docstrings that say what a function promises and an AGENTS.md that gives coding agents the same map. This page sets the standard for all three, plus diagrams and changelogs. The one thing to remember: if you had to explain something to a lab mate out loud, write it down in the repo.
- README standard
- Docstrings per language
- AGENTS.md and CLAUDE.md
- Diagrams
- Changelogs
- Writing well
- Related
Every repo has a README.md at its root. Start from templates/README.template.md, which has these sections in this order:
| Section | What it answers |
|---|---|
| Title and one sentence | What is this, and who is it for? |
| Status | Active, maintained or archived; which robot and software versions it was last tested with |
| Quick start | The fewest commands from a clean machine to something running |
| Requirements | Hardware (which robot, which sensors), OS and ROS 2 distribution, accounts or licenses |
| Usage | Common tasks, launch files, parameters |
| Safety | What can go wrong with the hardware and how to stop it (a > [!WARNING] block) |
| Troubleshooting | The errors people actually hit, with fixes |
| Repo map | Folders and what they hold |
| Contributing | Branches, style and checks (link to this repo) |
| License and citation | License, how to cite the paper if there is one, funding acknowledgment |
Rules:
- Commands are copyable. One command per line in a fenced block tagged with its language, no
$prompts and a comment when a step is not obvious. Say which OS and version they are for. - Everything the lab must supply stays a
[bracketed placeholder]until someone confirms it: robot names and locations, people, accounts, grant numbers. Never guess them. - Images have alt text. Describe what the image shows; decorative images get
alt="". - Keep it current. A README that describes last year's setup is worse than none; update it in the same PR as the change.
Document every public class, function and message field: what it does, its units and what it returns or throws. Put examples in tests, not in long comments.
| Language | Format | Minimal example |
|---|---|---|
| C, C++ | Doxygen, as the ROS 2 style asks: /// or /** */ for docs, // for notes (Doxygen docs) |
/// Returns the command to send, in m/s and rad/s. |
| Python | Google style: summary line, then Args:, Returns:, Raises: (Google guide 3.8) |
"""Load frames from a JSON file.""" |
| Swift | /// with a one-line summary, then - Parameters:, - Returns:, - Throws: (Apple docs) |
/// Stops the robot. |
| Kotlin | KDoc: /** */ with @param, @return, @throws (KDoc) |
/** Adds a phrase to the queue. */ |
| C# | XML comments: /// <summary>, <param>, <returns> (XML documentation) |
/// <summary>Stops following the hand.</summary> |
| TypeScript, JavaScript | TSDoc or JSDoc: /** */ with @param, @returns, @throws (TSDoc) |
/** Formats a speed for display. */ |
Every file in examples/ shows the format for its language and passes the linters.
Coding agents read a file at the repo root before they work. We keep one canonical file and point the others at it:
AGENTS.mdis the source of truth. AGENTS.md is an open format, "a README for agents"; OpenAI's Codex reads it before doing any work (Codex docs).CLAUDE.mdholds exactly one line:@AGENTS.md. Claude Code readsCLAUDE.mdand imports files written as@path(Claude Code memory docs), so both tools read the same instructions and nothing drifts apart.
Start from templates/AGENTS.template.md. It has the same sections as the AGENTS.md files in the lab's docs repos, plus safety rules:
- What the repo is, who uses it and what it is not.
- Repo map: every folder and important file, one line each.
- Sources of truth: where facts come from (datasheets, lockfiles, papers) and the rule that agents never invent names, results, versions or dates.
- Writing rules: which configs from this repo apply, the commit message style, units and frames.
- How to check your work: the exact format, lint, build and test commands.
- Safety rules: what an agent must never do, such as run code that moves the robot or change speed limits without review.
- Open items: every
[placeholder]and who can fill it. - Related repos.
Update AGENTS.md in the same PR as any change to commands, layout or rules. An outdated map misleads agents faster than no map. AI-assisted development has the rules for using agents in lab repos.
- Mermaid in Markdown for architecture, ROS 2 graphs and flows. GitHub renders
mermaidcode blocks (creating diagrams), and the source stays diffable. Start each diagram with the lab theme line fromAGENTS.mdso it reads in light and dark mode. - GitHub also renders ASCII STL files in the browser (same page), which is handy for printed parts; see Hardware and firmware.
- Other drawings: commit the editable source next to the exported image (
robot-wiring.drawioandrobot-wiring.svg), so the next person can edit it. - Every diagram gets a sentence of text that says what it shows, for readers who cannot see it.
Repos that publish releases keep a CHANGELOG.md in the Keep a Changelog 1.1.0 format:
## [Unreleased]
## [1.4.0] - 2026-09-30
### Added
- Dead-man switch timeout parameter (`deadman_timeout_s`).
### Fixed
- The follower no longer coasts after the operator releases the switch.- Group entries under Added, Changed, Deprecated, Removed, Fixed and Security.
- Write for users of the software, not for its developers; link the PR for details.
- The dates follow the format's
YYYY-MM-DD, an exception to the lab's "Sept. 30, 2026" style for prose.
- Lead with what the reader can do, then how. Short paragraphs, active voice, "you" for the reader.
- Define jargon the first time: "teleoperation (controlling a robot from a distance)".
- For bigger docs, separate tutorials, how-to guides, reference and explanation, as Diátaxis describes.
- Good starting points: Write the Docs' beginner's guide to docs and RTFM? How to write a manual worth reading.
- Lint Markdown with
configs/markdown/.markdownlint.jsonc; the VS Code extension is markdownlint (DavidAnson.vscode-markdownlint).
- README template and AGENTS template
- AI-assisted development
- Git and GitHub: releases and tags
- Research standards in Getting started: papers, citations and data
Last reviewed: Sept. 30, 2026 · Sources checked on that date · Suggest a change