Skip to content

Commit cec80fd

Browse files
committed
docs(AGENTS.md): Add documentation standards for code blocks
why: Ensure code examples in documentation are individually copyable. what: - Add Documentation Standards section - Require one command per code block - Require explanations outside code blocks, not as comments
1 parent 849cbca commit cec80fd

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,40 @@ EOF
327327
)"
328328
```
329329

330+
## Documentation Standards
331+
332+
### Code Blocks in Documentation
333+
334+
When writing documentation (README, CHANGES, docs/), follow these rules for code blocks:
335+
336+
**One command per code block.** This makes commands individually copyable.
337+
338+
**Put explanations outside the code block**, not as comments inside.
339+
340+
Good:
341+
342+
Run the tests:
343+
344+
```console
345+
$ uv run pytest
346+
```
347+
348+
Run with coverage:
349+
350+
```console
351+
$ uv run pytest --cov
352+
```
353+
354+
Bad:
355+
356+
```console
357+
# Run the tests
358+
$ uv run pytest
359+
360+
# Run with coverage
361+
$ uv run pytest --cov
362+
```
363+
330364
## Debugging Tips
331365

332366
When stuck in debugging loops:

0 commit comments

Comments
 (0)