CMSForNerd

docstring

"Provides structured guidelines for writing PEP-257 Google-style Python docstrings and detailed JSDoc comments."

CMSForNerd 1 Updated 1mo ago
GitHub

Install

npx skillscat add cmsfornerd/cmsfornerd2/docstring

Install via the SkillsCat registry.

SKILL.md

Docstring & API Reference Standard Skill (docstring)

The docstring skill enforces function-level, module-level, and API reference documentation standards across Python, JavaScript, and TypeScript codebases.

Operational Standards

  1. Python Docstrings (PEP-257 & Google Style):

    • Include raw strings (r"""...""") when LaTeX math or backslashes are present.
    • Every public module, function, and class must declare Args, Returns, Raises, and Example sections where appropriate.
    • Explain function intent, contracts, side effects, and failure modes rather than repeating code line-by-line.
  2. TypeScript & JavaScript JSDoc Comments:

    • Provide file header @file overview JSDoc comments for all scripts.
    • Annotate all exported functions with @param, @returns, and @throws.
  3. Code Example Hygiene:

    • Ensure provided docstring code examples are tested, valid, and reproducible.

FAQs

When should raw docstrings (r"""...""") be used?

Use raw triple-quoted strings whenever docstrings contain backslashes, regular expressions, or LaTeX notation.

Can this skill be used for non-PyTorch / non-Python languages?

Yes, while inspired by PyTorch and Google Python conventions, the core principles apply to JSDoc (JavaScript/TypeScript) and function comment standards.


Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-09-06
Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0

Categories