Lang python
Skill xiaolai/docs-guardian-for-claude/skills/docs-guardian/languages/lang-python
Use when writing, auditing, or generating documentation for Python projects — covers docstring conventions, API doc extraction, and Python-specific patterns.From its SKILL.md
npx -y skills add xiaolai/docs-guardian-for-claude --skill lang-pythonAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.4 KB, as published. Nobody here has run it
Python Language Adapter
Public API Detection
A symbol is public if:
- It is listed in
__all__(if__all__exists, only listed names are public) - Its name does not start with
_(single underscore = internal convention) - It is defined at module level or is a method of a public class
Priority
- If
__all__exists → only those names are public - If
__all__does not exist → all non-underscore module-level names are public
Symbol Types to Document
| Type | Detection | Documentation Expected |
|---|---|---|
| Functions | def name( at module level | Docstring with params, returns, raises |
| Classes | class Name: or class Name(Base): | Class docstring + __init__ params |
| Methods | def name(self inside class, not _-prefixed | Docstring with params, returns |
| Constants | NAME = value (UPPER_CASE at module level) | Inline comment or module docstring mention |
| Type aliases | Name = TypeAlias or type Name = ... | Docstring or inline comment |
Docstring Formats
Recognize and parse these formats:
Google Style
def foo(bar: int, baz: str) -> bool:
"""One-line summary.
Args:
bar: Description of bar.
baz: Description of baz.
Returns:
True if successful.
Raises:
ValueError: If bar is negative.
"""
NumPy Style
def foo(bar, baz):
"""One-line summary.
Parameters
----------
bar : int
Description of bar.
baz : str
Description of baz.
Returns
-------
bool
True if successful.
"""
Sphinx Style
def foo(bar, baz):
"""One-line summary.
:param bar: Description of bar.
:type bar: int
:param baz: Description of baz.
:returns: True if successful.
:raises ValueError: If bar is negative.
"""
Documentation Completeness Check
A Python symbol is fully documented when:
- Has a docstring (not empty)
- All parameters are described
- Return value is described (if not
None) - Raised exceptions are listed (if any
raisestatements exist)
File Patterns
Source files: **/*.py (exclude __pycache__, *.pyc, test files)