Skip to content

Commit dee9719

Browse files
committed
Update AGENTS file to demonstrate preferred method of documenting python functions
1 parent fe4e2f7 commit dee9719

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

AGENTS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,20 @@ Skills follow the [Agent Skills](https://agentskills.io) open standard. Each ski
2525

2626
- `SKILL.md` — The skill definition with YAML frontmatter (name, description, argument-hint) and detailed instructions.
2727
- Additional supporting files as needed.
28+
29+
## Python Function Docstrings
30+
31+
Every Python function must include a docstring with usage examples.
32+
33+
- **Examples are required**: Each function needs at least one doctest-style example
34+
demonstrating basic usage.
35+
- **Optional parameters**: If a function has optional parameters, include separate
36+
examples that show usage both without and with the optional arguments. Pass
37+
optional arguments using their keyword name (e.g., `step=dfn.lit(3)`) so readers
38+
can immediately see which parameter is being demonstrated.
39+
- **Reuse input data**: Use the same input data across examples wherever possible.
40+
The examples should demonstrate how different optional arguments change the output
41+
for the same input, making the effect of each option easy to understand.
42+
- **Alias functions**: Functions that are simple aliases (e.g., `list_sort` aliasing
43+
`array_sort`) only need a one-line description and a `See Also` reference to the
44+
primary function. They do not need their own examples.

0 commit comments

Comments
 (0)