Skip to content

Commit 757ad29

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 ce62893 commit 757ad29

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
@@ -309,6 +309,40 @@ EOF
309309
)"
310310
```
311311

312+
## Documentation Standards
313+
314+
### Code Blocks in Documentation
315+
316+
When writing documentation (README, CHANGES, docs/), follow these rules for code blocks:
317+
318+
**One command per code block.** This makes commands individually copyable.
319+
320+
**Put explanations outside the code block**, not as comments inside.
321+
322+
Good:
323+
324+
Run the tests:
325+
326+
```console
327+
$ uv run pytest
328+
```
329+
330+
Run with coverage:
331+
332+
```console
333+
$ uv run pytest --cov
334+
```
335+
336+
Bad:
337+
338+
```console
339+
# Run the tests
340+
$ uv run pytest
341+
342+
# Run with coverage
343+
$ uv run pytest --cov
344+
```
345+
312346
## Debugging Tips
313347

314348
See `.cursor/rules/avoid-debug-loops.mdc` for detailed debugging guidance.

0 commit comments

Comments
 (0)