Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Workflow for generating JSDoc comments / documentation #1110

Open
madjin opened this issue Dec 15, 2024 · 2 comments
Open

feat: Workflow for generating JSDoc comments / documentation #1110

madjin opened this issue Dec 15, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@madjin
Copy link
Collaborator

madjin commented Dec 15, 2024

Is your feature request related to a problem? Please describe.
Currently, maintaining comprehensive JSDoc documentation across our TypeScript codebase is a manual and time-consuming process. This leads to inconsistent documentation coverage and puts an unnecessary burden on developers. We need an automated solution that can help generate and maintain JSDoc comments while ensuring high quality and consistency.

Describe the solution you'd like

Propose a two-phase approach:

  1. Manual Documentation Phase:

    • Add comprehensive JSDoc comments to all TypeScript files
    • Include documentation for functions, classes, interfaces, and other code blocks
  2. Automation Implementation:

    • Develop an LLM-based automation solution for generating JSDoc comments
    • Integrate the automation into our CI/CD pipeline (like when a PR for a new feat is merged)
    • Create a manual trigger mechanism for the automation process

Create a GitHub Actions workflow/AI agent that:

  1. Automated Documentation Generation:

    • Triggers on demand (via workflow_dispatch) or when specific files change
    • Scans TypeScript files that lack JSDoc documentation
    • Uses an AI service (e.g., OpenAI API) to generate contextually accurate JSDoc comments
    • Maintains existing JSDoc comments and only adds missing ones
  2. Quality Control:

    • Follows our existing JSDoc standards and TypeDoc configuration
    • Validates generated comments for completeness and accuracy
    • Ensures proper documentation of parameters, return types, and function descriptions
  3. Pull Request Management:

    • Creates a new branch for documentation updates
    • Generates a pull request with the changes
    • Adds appropriate labels (e.g., 'documentation', 'automated')
    • Includes a detailed PR description explaining the changes
    • Assigns relevant reviewers
  4. Configuration:

    • Allows customization of AI prompt templates
    • Provides options to include/exclude specific files or directories
    • Configurable commit message and PR templates

Describe alternatives you've considered

  1. Manual documentation enforcement through PR checks
  2. Using existing JSDoc generation tools like https://github.com/TypeStrong/typedoc
  3. Implementing stricter code review policies for documentation
  4. Creating documentation sprints for batch updates

Additional context
Required Permissions and Secrets:

  • GitHub token with PR creation permissions
  • AI service API key (e.g., OpenAI)
  • Repository write access for branch creation

Additional Motivation

This could be a proof of concept AI junior dev Karpathy talks about
image

@madjin madjin added enhancement New feature or request documentation Improvements or additions to documentation labels Dec 15, 2024
@0xbuild-oss
Copy link

I can pick this up. Hmu on discord @0xbuildinpublic if interested in helping.

@ileana-pr
Copy link
Contributor

I am beginner coder but I can help with menial tasks like the manual phase while we get the automation up an running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants