AGENT SKILL

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