Skip to content

Commit 527c292

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 ab09a68 commit 527c292

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
@@ -295,6 +295,40 @@ EOF
295295
)"
296296
```
297297

298+
## Documentation Standards
299+
300+
### Code Blocks in Documentation
301+
302+
When writing documentation (README, CHANGES, docs/), follow these rules for code blocks:
303+
304+
**One command per code block.** This makes commands individually copyable.
305+
306+
**Put explanations outside the code block**, not as comments inside.
307+
308+
Good:
309+
310+
Run the tests:
311+
312+
```console
313+
$ uv run pytest
314+
```
315+
316+
Run with coverage:
317+
318+
```console
319+
$ uv run pytest --cov
320+
```
321+
322+
Bad:
323+
324+
```console
325+
# Run the tests
326+
$ uv run pytest
327+
328+
# Run with coverage
329+
$ uv run pytest --cov
330+
```
331+
298332
## Debugging Tips
299333

300334
When stuck in debugging loops:

0 commit comments

Comments
 (0)