agentleFS
CodeWithBehnamCodeWithBehnam/cc-docs/skills/doc-gen/SKILL.md

doc-gen

Skill2 starsChanged 9 months agoMITView on GitHub

Generate or update documentation for a module, file, function, or class. Produces JSDoc, docstrings, README sections, or standalone docs depending on the target. Use when the user says "document this", "add docs", "generate documentation", or "write a README for this module".

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If $ARGUMENTS is a file path, read it directly

    line 16
  2. Distinctive:

    If $ARGUMENTS is a module or function name, use Grep and Glob to find the definition

    line 17
  3. Distinctive:

    If $ARGUMENTS is empty, document the current directory's main entry point

    line 18
  4. Distinctive:

    Read the target fully, including:

    line 20
  5. Distinctive:

    All public functions, methods, classes, and constants

    line 21
  6. Distinctive:

    If a README does not exist for the module and the target is a directory:

    line 38
  7. Distinctive:

    Create a README.md with: module name, one-paragraph description, installation/import, quick start example, API summary table, notes on …

    line 39
  8. Distinctive:

    Write all documentation in-place (inline comments/docstrings) and also create or update any separate doc files.

    line 41
  9. Distinctive:

    If the target is not found: report and suggest similar names

    line 51
  10. Distinctive:

    If documentation already exists and is accurate: note it and suggest only additions

    line 52
  11. Distinctive:

    If the code is too complex to document without understanding domain context: ask the user for clarification before writing

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “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

Generate or update documentation for: $ARGUMENTS

  1. Locate the target:
    • If $ARGUMENTS is a file path, read it directly
    • If $ARGUMENTS is a module or function name, use Grep and Glob to find the definition
    • If $ARGUMENTS is empty, document the current directory's main entry point
  2. Read the target fully, including:
    • All public functions, methods, classes, and constants
    • Existing documentation (to update rather than duplicate)
    • Related test files to understand intended behavior and edge cases
    • Callers to understand real-world usage
  3. Detect the documentation format from the project:
    • TypeScript/JavaScript: JSDoc (/** */) with @param, @returns, @throws, @example
    • Python: Google-style docstrings with Args:, Returns:, Raises:, Example:
    • Go: standard Go doc comments (// FunctionName ...)
    • Other languages: use the idiomatic format for that language
  4. Generate documentation:
    • Module/file-level: overview of what the module does, when to use it, key concepts
    • Each public function/method: description, all parameters with types and meaning, return value, exceptions/errors thrown, at least one usage example
    • Each public class: purpose, construction, key methods summary
    • Skip private/internal functions unless they have complex logic worth explaining
  5. If a README does not exist for the module and the target is a directory:
    • Create a README.md with: module name, one-paragraph description, installation/import, quick start example, API summary table, notes on configuration
  6. Write all documentation in-place (inline comments/docstrings) and also create or update any separate doc files.
  7. Report what was added or updated with a file list.

Requirements

  • The target ($ARGUMENTS) must be a valid file path, module name, or function name in the project

Error Handling

  • If the target is not found: report and suggest similar names
  • If documentation already exists and is accurate: note it and suggest only additions
  • If the code is too complex to document without understanding domain context: ask the user for clarification before writing

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.