agentleFS
lexicalninjalexicalninja/my-little-scrum-team/skills/code-documentation/SKILL.md

code-documentation

Skill2 starsChanged 4 months agoMITView on GitHub

Generate comprehensive code documentation including docstrings, comments, and API documentation. Use when code lacks documentation, needs better explanations, or requires API docs. Focuses on clarity, completeness, and following language-specific documentation standards.

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use data-analysis, web-design-guidelines and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • shanggqmSkill

    data-analysis

    数据分析技能,提供结构化的数据查询、统计分析和报告生成工作流。当用户需要查询数据库、进行数据统计分析、生成分析报告时使用。按规范输出原始数据、计算结果、Markdown报告和HTML可视化报告。

    Also in 3 projects that use this

  • VercelSkill

    web-design-guidelines

    Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add inline comments for complex logic or non-obvious code

    line 23
  2. Distinctive:

    Keep documentation concise but complete

    line 25
  3. Distinctive:

    Use clear, professional language

    line 26
  4. Distinctive:

    Use Google or NumPy style docstrings

    line 94
  5. Very specific:

    Document exceptions with Raises:

    line 96
  6. Very specific:

    Add Example: section for complex functions

    line 97
  7. Very specific:

    Use JSDoc format with @param, @returns, @throws

    line 100
  8. Very specific:

    Add @example for usage demonstrations

    line 102

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Documentation Skill

Instructions

  1. Analyze the code structure to understand what needs documentation
  2. Generate docstrings/comments following language conventions:
    • Python: Google, NumPy, or Sphinx style
    • JavaScript/TypeScript: JSDoc format
    • Go: Standard Go doc comments
    • Java: JavaDoc format
  3. Document:
    • Function/method purpose and behavior
    • Parameters with types and descriptions
    • Return values with types and descriptions
    • Exceptions/errors that may be raised
    • Usage examples when helpful
    • Edge cases and important notes
  4. Add inline comments for complex logic or non-obvious code
  5. Generate API documentation when requested
  6. Keep documentation concise but complete
  7. Use clear, professional language

Examples

Input (Python function without docs):

def calculate_total(items, tax_rate=0.1):
    subtotal = sum(item.price for item in items)
    return subtotal * (1 + tax_rate)

Output:

def calculate_total(items: List[Item], tax_rate: float = 0.1) -> float:
    """
    Calculate the total price including tax for a list of items.
    
    Args:
        items: List of Item objects with a price attribute
        tax_rate: Tax rate as a decimal (default: 0.1 for 10%)
    
    Returns:
        Total price including tax as a float
    
    Example:
        >>> items = [Item(price=10.0), Item(price=20.0)]
        >>> calculate_total(items, tax_rate=0.08)
        32.4
    """
    subtotal = sum(item.price for item in items)
    return subtotal * (1 + tax_rate)

Input (JavaScript function):

function processUserData(data) {
    const filtered = data.filter(u => u.active);
    return filtered.map(u => ({ id: u.id, name: u.name }));
}

Output:

/**
 * Process user data by filtering active users and extracting key fields.
 * 
 * @param {Array<Object>} data - Array of user objects
 * @param {boolean} data[].active - Whether the user is active
 * @param {string} data[].id - User identifier
 * @param {string} data[].name - User display name
 * @returns {Array<Object>} Array of processed user objects with id and name
 * 
 * @example
 * const users = [
 *   { id: '1', name: 'Alice', active: true },
 *   { id: '2', name: 'Bob', active: false }
 * ];
 * processUserData(users); // [{ id: '1', name: 'Alice' }]
 */
function processUserData(data) {
    const filtered = data.filter(u => u.active);
    return filtered.map(u => ({ id: u.id, name: u.name }));
}

Documentation Standards

Python:

  • Use Google or NumPy style docstrings
  • Include type hints when possible
  • Document exceptions with Raises:
  • Add Example: section for complex functions

JavaScript/TypeScript:

  • Use JSDoc format with @param, @returns, @throws
  • Include type information in JSDoc comments
  • Add @example for usage demonstrations

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.