pydoc
Add/improve docstrings in Python files — Google style for functions and modules, argparse epilog examples for CLIs
- License 许可
- MIT
- 最近更新
- 2026-10-19
- Stars
- ★ 2
- Forks
- 1
01 前言 Front Matter
- name
- pydoc
- description
- Add/improve docstrings in Python files — Google style for functions and modules, argparse epilog examples for CLIs
- argument-hint
- <file_or_folder> (optional — if omitted, scan all *.py in the project)
03 SKILL.md 正文
Scope: $ARGUMENTS if given, else all *.py (skip .venv, __pycache__, *.egg-info). Write each file back, print one line per change. Don't touch logic.
Functions — Google style. Omit inapplicable sections. _private: one-liner only.
def foo(bar: int) -> list[str]:
"""One-line summary.
Args:
bar (int): Description.
Returns:
list[str]: Description.
"""
Modules
"""One-line summary.
Description:
2-4 sentences.
Example:
snippet
"""
CLIs — add epilog with runnable example:
parser = argparse.ArgumentParser(
epilog="example: my-command --flag value",
formatter_class=argparse.RawDescriptionHelpFormatter,
)
Logic blocks — one comment above non-obvious for/while/multi-line if/call block, explaining why not what. Remove comments that restate the code.
Already compliant: print ✓ <filename> — no changes and skip.
04 同仓库更多 Skills
example
Brief description of what this skill does
mdupdate
Refine .md file by integrating user's inline answers
mdresearch
Research codebase state from context file
mdplan
Generate step-by-step implementation plan from research
mdimplement
Execute implementation plan with testing and verification
ruff
Format and lint-fix Python file(s) or directory via ruff format + ruff check --fix