writing-code-comments-and-docstrings

Generate inline code comments and docstrings following language-specific conventions.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/maltemd/hoover-content-design-system --skill writing-code-comments-and-docstrings-maltemd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-code-comments-and-docstrings
Source: https://github.com/maltemd/hoover-content-design-system/tree/main/skills/developer-content/writing-code-comments-and-docstrings
Command: npx skills add https://github.com/maltemd/hoover-content-design-system --skill writing-code-comments-and-docstrings-maltemd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of writing clear, effective, and maintainable code by generating high-quality inline comments and documentation strings. It ensures that code is understandable to current and future developers.

Core Features & Use Cases

  • Docstring Generation: Creates comprehensive docstrings for functions, classes, and modules following established conventions (e.g., Google style, JSDoc).
  • Inline Comment Explanations: Generates comments that explain the "why" behind complex logic, workarounds, or non-obvious decisions.
  • Annotation Support: Adds TODO, FIXME, HACK, and NOTE annotations with appropriate context and tracking information.
  • Use Case: You have a complex Python function with several edge cases. Use this Skill to generate a detailed docstring explaining its parameters, return values, potential exceptions, and a clear example of its usage.

Quick Start

Use the writing-code-comments-and-docstrings skill to generate a Python docstring for the provided function.

Frequently Asked Questions about writing-code-comments-and-docstrings

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Python docstrings for functions with complex logic?

You can generate Python docstrings for complex functions by applying this Skill to analyze your code structure and create comprehensive documentation. It produces clear parameter descriptions, return values, and usage examples following established conventions.

What is the best way to add inline comments explaining non-obvious code logic?

The best way to add inline comments for non-obvious logic is to generate explanations that focus on the 'why' behind workarounds and decisions. This approach ensures comments provide context for complex logic rather than simply restating what the code does.

Does this support generating JSDoc and Google style docstrings for TypeScript and Python?

Yes, it supports generating JSDoc and Google style docstrings for TypeScript and Python. It adheres to language-specific conventions and quality standards to ensure clarity and maintainability across your codebase.

How do I document API endpoints and add TODO annotations in my code?

You document API endpoints and add TODO annotations by generating standardized documentation strings and context-aware annotations like TODO, FIXME, and HACK. This adds appropriate tracking information and explanations directly within your codebase.

When do I need to write docstrings for maintaining code clarity?

You need to write docstrings for maintaining code clarity when working with functions, classes, or modules that contain edge cases, complex workarounds, or non-obvious decisions. This ensures code remains understandable to current and future developers.