Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Code Documentation

  • 438 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

code-documentation is a useful-ai-prompts agent skill that writes JSDoc, Python docstrings, JavaDoc, and inline API comments for developers who need language-standard symbol documentation from code context.

About

code-documentation is a skill from aj-geddes/useful-ai-prompts in a library of 260+ agent skills that teaches agents to document functions, classes, modules, and types with language-specific standards. It covers JSDoc for JavaScript and TypeScript, Python docstrings, JavaDoc, inline comments, thrown exceptions, and usage examples, with six reference guides under references/ for functions, classes, modules, and type definitions. The parent repository applies eleven quality gates to its prompt catalog, but this skill focuses on executable documentation patterns developers paste or generate beside real code. Developers reach for code-documentation when annotating public APIs, adding @param and @returns blocks, or generating module overviews—not when bootstrapping a full docs/ tree or writing marketing copy.

  • README structure with setup and examples
  • API endpoint and parameter documentation
  • Consistent inline comment standards
  • Module-level purpose and dependency notes
  • Changelog-friendly usage descriptions

Code Documentation by the numbers

  • 438 all-time installs (skills.sh)
  • Ranked #399 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill code-documentation

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs438
repo stars305
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you document functions with JSDoc?

Generate and refine README sections, API references, inline comments, and module overviews so new contributors understand behavior, setup, and extension points quickly.

Who is it for?

Developers documenting public functions, classes, and modules who want consistent JSDoc, docstring, or JavaDoc beside the code.

Skip if: Skip code-documentation when you need repository-level architecture docs in docs/SUMMARY.md rather than per-symbol inline documentation.

When should I use this skill?

User asks to add JSDoc, write docstrings, document a function signature, or generate inline API comments from code.

What you get

JSDoc, docstring, or JavaDoc comment blocks with parameters, returns, examples, and type notes

  • JSDoc or docstring comment blocks
  • inline API documentation

By the numbers

  • Ships 6 reference guides under references/ for functions, classes, modules, and types
  • Parent useful-ai-prompts repository contains 260+ agent skills
  • Parent prompt library enforces 11 quality validation gates

Files

SKILL.mdMarkdownGitHub ↗

Code Documentation

Table of Contents

Overview

Create clear, comprehensive code documentation using language-specific standards like JSDoc, Python docstrings, JavaDoc, and inline comments.

When to Use

  • Function and class documentation
  • JSDoc for JavaScript/TypeScript
  • Python docstrings
  • JavaDoc for Java
  • Inline code comments
  • API documentation from code
  • Type definitions
  • Usage examples in code

Quick Start

Minimal working example:

/**
 * Calculates the total price including tax and discount.
 *
 * @param {number} basePrice - The base price before tax and discount
 * @param {number} taxRate - Tax rate as a decimal (e.g., 0.08 for 8%)
 * @param {number} [discount=0] - Optional discount amount
 * @returns {number} The final price after tax and discount
 * @throws {Error} If basePrice or taxRate is negative
 *
 * @example
 * const price = calculateTotalPrice(100, 0.08, 10);
 * console.log(price); // 98
 *
 * @example
 * // Without discount
 * const price = calculateTotalPrice(100, 0.08);
 * console.log(price); // 108
 */
function calculateTotalPrice(basePrice, taxRate, discount = 0) {
  if (basePrice < 0 || taxRate < 0) {
    throw new Error("Price and tax rate must be non-negative");
  }
  return basePrice * (1 + taxRate) - discount;
}

// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Function DocumentationFunction Documentation
Class DocumentationClass Documentation
Type DefinitionsType Definitions
Function DocumentationFunction Documentation
Class DocumentationClass Documentation
Module DocumentationModule Documentation

Best Practices

✅ DO

  • Document public APIs thoroughly
  • Include usage examples
  • Document parameters and return values
  • Specify thrown exceptions/errors
  • Use language-specific standards (JSDoc, docstrings, etc.)
  • Keep comments up-to-date
  • Document "why" not "what"
  • Include edge cases and gotchas
  • Add links to related functions
  • Document type definitions
  • Use consistent formatting

❌ DON'T

  • State the obvious in comments
  • Leave commented-out code
  • Write misleading comments
  • Skip examples for complex functions
  • Use vague parameter descriptions
  • Forget to update docs when code changes
  • Over-comment simple code

Related skills

How it compares

Pick code-documentation for symbol-level JSDoc and docstrings; pick CoBrew docs for full docs/ architecture and SUMMARY.md trees.

FAQ

Which languages does code-documentation cover?

code-documentation covers JavaScript and TypeScript via JSDoc, Python via docstrings, Java via JavaDoc, plus inline comments and type-definition notes. Reference guides under references/ expand patterns for functions, classes, and modules.

How is code-documentation different from repo docs skills?

code-documentation targets per-symbol inline and API comments adjacent to source code. Repo docs skills like CoBrew docs maintain project-level docs/SUMMARY.md folders for architecture and conventions across the whole repository.

Documentationdocsbackendfrontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.