Skip to content

Commit afefc7f

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 6f855ec commit afefc7f

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
@@ -94,6 +94,40 @@ just design-docs # update CSS/JS assets
9494
- Keep CLI output human-friendly YAML; avoid breaking existing flags/args.
9595
- Doctests: keep concise, narrative Examples blocks; move complex flows to `tests/examples/`.
9696

97+
## Documentation Standards
98+
99+
### Code Blocks in Documentation
100+
101+
When writing documentation (README, CHANGES, docs/), follow these rules for code blocks:
102+
103+
**One command per code block.** This makes commands individually copyable.
104+
105+
**Put explanations outside the code block**, not as comments inside.
106+
107+
Good:
108+
109+
Run the tests:
110+
111+
```console
112+
$ uv run pytest
113+
```
114+
115+
Run with coverage:
116+
117+
```console
118+
$ uv run pytest --cov
119+
```
120+
121+
Bad:
122+
123+
```console
124+
# Run the tests
125+
$ uv run pytest
126+
127+
# Run with coverage
128+
$ uv run pytest --cov
129+
```
130+
97131
## Debugging Tips
98132
- Lean on `pytest -k <pattern> -vv` for focused failures.
99133
- For CLI behavior, run `uv run cihai info 好` or `uv run cihai reverse library`.

0 commit comments

Comments
 (0)