Claude-code-optimizer document

Use when the user wants to add documentation, JSDoc, docstrings, or API docs to existing code.

install
source · Clone the upstream repo
git clone https://github.com/huzaifa525/claude-code-optimizer
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/huzaifa525/claude-code-optimizer "$T" && mkdir -p ~/.claude/skills && cp -r "$T/templates/.claude/skills/document" ~/.claude/skills/huzaifa525-claude-code-optimizer-document && rm -rf "$T"
manifest: templates/.claude/skills/document/SKILL.md
source content

Document: $ARGUMENTS

Steps

  1. Detect the language and doc style

    • Check existing docs in the codebase for style
    • TypeScript/JavaScript → JSDoc or TSDoc
    • Python → Google-style docstrings
    • Go → godoc comments
    • Rust →
      ///
      doc comments
    • Match whatever style already exists
  2. Read the code thoroughly — understand every function, class, and type

  3. Add documentation for:

    ElementWhat to Document
    FunctionsPurpose, params, return value, throws, example
    ClassesPurpose, usage pattern
    Interfaces/TypesWhat it represents, field descriptions
    ConstantsWhy this value
    Complex logicStep-by-step explanation
    Module/FileTop-level description of what this file does
  4. Rules

    • Document the WHY, not the WHAT (code already shows what)
    • Keep descriptions concise — one line if possible
    • Include
      @example
      for non-obvious usage
    • Don't document getters/setters or trivial functions
    • Match existing doc style in the codebase exactly
  5. Verify — ensure no code was accidentally changed

    git diff --stat
    
<!-- Skill by Huzefa Nalkheda Wala | github.com/huzaifa525 | claude-code-optimizer -->