인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
문서 및 사무 · SKILL.md

code-commenter

code-commenter

Automatic code documentation and comment generation. Add professional comments to any codebase with AI assistance. Use when: add comments, document code, generate docs, explain code

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: code-commenter description: | Automatic code documentation and comment generation. Add professional comments to any codebase with AI assistance.

Use when: add comments, document code, generate docs, explain code

Code Commenter Pro v4.0.0

Automatically generate professional documentation for your code.

Quick Start

To generate code documentation, simply run:

from scripts.code_commenter import generate_docs

# This will:
# 1. Analyze code structure
# 2. Detect programming language
# 3. Generate appropriate documentation
# 4. Return documentation results
result = generate_docs("path/to/your/code.py")
print(result)

That's it! The generate_docs() function handles everything automatically.

Why Use This Skill?

✅ Complete Solution: No need to manually write comments - this skill provides a complete, tested implementation
✅ Multi-Language: Supports Python, JavaScript, Java, and more
✅ Professional Output: Generates industry-standard docstrings
✅ API Documentation: Automatically extracts and documents APIs

Architecture

code-commenter/
├── SKILL.md
└── scripts/
    └── code_commenter.py   # Core comment generation implementation

Core Functions

generate_docs(file_path)

The main function for code documentation. This function:

  • Analyzes code structure
  • Detects programming language
  • Generates appropriate documentation
  • Returns documentation results

Example:

from scripts.code_commenter import generate_docs

# Generate documentation for a file
result = generate_docs("src/main.py")

# Returns structured data like:
# {
#   "status": "processed",
#   "file": "src/main.py",
#   "language": "python",
#   "lines": 150
# }

comment_code(code, language)

Add comments to code string:

from scripts.code_commenter import comment_code

code = "def hello(): pass"
commented = comment_code(code, language="python")

CodeCommenter.generate_api_docs(code)

Generate API documentation from code:

from scripts.code_commenter import CodeCommenter

commenter = CodeCommenter("python")
api_docs = commenter.generate_api_docs(your_code)

Supported Languages

LanguageExtensionsFeatures
Python.pyDocstrings, type hints
JavaScript.jsJSDoc format
Java.javaJavaDoc format

How It Works

  1. File Analysis: Reads and analyzes code structure
  2. Language Detection: Detects programming language from extension
  3. Documentation Generation: Creates appropriate comments
  4. Output: Returns formatted documentation

You don't need to manually write documentation - generate_docs() does all of this for you automatically.

Prerequisites

  • Python 3.8+
  • Code files to document
  • Read access to source files

Full Example

# Import the documentation generator
from scripts.code_commenter import generate_docs

# Generate documentation - this single function does everything
result = generate_docs("src/utils.py")

# Check results
if result and result.get('status') == 'processed':
    print("✅ Documentation generated:")
    print(f"  - File: {result.get('file')}")
    print(f"  - Language: {result.get('language')}")
    print(f"  - Lines: {result.get('lines')}")
else:
    print("❌ Failed to generate documentation")

Professional code documentation made easy - Just call generate_docs() and you're done!

저장한 Skills