Skip to content

Instantly share code, notes, and snippets.

@juanmirod
Created September 23, 2023 21:37
Show Gist options
  • Save juanmirod/a32dccd0be70f7233f5ce07f3afcff5f to your computer and use it in GitHub Desktop.
Save juanmirod/a32dccd0be70f7233f5ce07f3afcff5f to your computer and use it in GitHub Desktop.

You: invent a new product using large language models to help developers to maintain big proyects, try to tbrainstorm 10 ideas first, then I will choose one to expand it

JARVIS: Certainly, sir. Here are ten preliminary ideas for a product that utilizes large language models to assist developers in maintaining large projects:

  1. Code Commenter: An AI tool that automatically generates comments for code, making it easier for developers to understand and maintain large codebases.

  2. Code Refactor Assistant: An AI tool that suggests more efficient or cleaner ways to write code, helping to improve the overall quality and maintainability of the project.

  3. Bug Predictor: An AI tool that predicts potential bugs or issues in the code, allowing developers to address them proactively.

  4. Code Reviewer: An AI tool that performs code reviews, identifying potential issues and suggesting improvements.

  5. Documentation Generator: An AI tool that automatically generates documentation for the project, saving developers time and ensuring that the documentation is always up-to-date.

  6. Codebase Navigator: An AI tool that helps developers navigate large codebases, making it easier to find specific pieces of code or understand the overall structure of the project.

  7. Code Translator: An AI tool that translates code from one programming language to another, making it easier to maintain projects that use multiple languages.

  8. Code Tester: An AI tool that automatically generates and runs tests for the code, ensuring that it functions as expected.

  9. Project Manager: An AI tool that helps manage the project, tracking progress, assigning tasks, and ensuring that deadlines are met.

  10. Code Tutor: An AI tool that provides personalized learning and guidance for developers, helping them improve their skills and understand the codebase better.

Please let me know which one you would like to expand upon.

You: the documentation case is interesting because there is no tools right now that can check or generate documentstion, expand on that and write a prompt to get the best documentstion check possible and anothwr one to generate documentation for functions

JARVIS: Certainly, sir. Here's an expanded concept for the Documentation Generator:

Product Name: DocuGen

DocuGen is an AI-powered tool that leverages large language models to automatically generate and maintain documentation for large-scale projects. It can parse through code, understand the functionality, and generate comprehensive documentation that accurately describes the code's purpose, inputs, outputs, and behavior.

DocuGen can also identify areas of the code that lack sufficient documentation and suggest improvements. It can even detect when changes in the code require updates to the documentation, ensuring that the documentation always stays up-to-date.

Prompt for Documentation Check:

"DocuGen, please scan the entire codebase and identify areas that lack sufficient documentation or where the existing documentation is outdated or inconsistent with the code. Provide a detailed report highlighting these areas along with suggestions for improvement."

Prompt for Documentation Generation:

"DocuGen, please generate comprehensive documentation for the following functions in the codebase. The documentation should include a description of the function's purpose, its inputs and outputs, any side effects, and examples of how to use the function. Please also generate a diagram showing how these functions interact with each other and with other parts of the code."

By using DocuGen, developers can save significant time and effort that would otherwise be spent on writing and maintaining documentation, allowing them to focus more on coding and less on documentation. It also ensures that the documentation is always accurate and up-to-date, making it easier for new developers to understand the codebase and for existing developers to maintain it.

You: thanks, very interesting, how would you implement the code reviewer?

JARVIS: Certainly, sir. Here's an expanded concept for the Code Reviewer:

Product Name: CodeGuard

CodeGuard is an AI-powered tool that leverages large language models to perform code reviews. It can parse through code, understand the functionality, and identify potential issues, such as bugs, inefficiencies, or violations of coding standards.

CodeGuard can also suggest improvements to the code, such as refactoring opportunities or more efficient algorithms. It can even predict the impact of these changes on the overall performance and maintainability of the code.

Here's how CodeGuard could be implemented:

  1. Code Parsing: CodeGuard would first parse the code to understand its structure and functionality. This would involve tokenizing the code, building an abstract syntax tree, and performing semantic analysis.

  2. Issue Identification: CodeGuard would then analyze the parsed code to identify potential issues. This could involve checking for common bugs, such as null pointer exceptions or divide-by-zero errors; looking for inefficiencies, such as unnecessary loops or redundant calculations; and verifying compliance with coding standards, such as naming conventions or comment requirements.

  3. Improvement Suggestion: CodeGuard would also suggest improvements to the code. This could involve recommending refactoring opportunities, such as extracting repeated code into a separate function; suggesting more efficient algorithms, such as using a hash map instead of a list for fast lookups; and providing tips for improving code readability and maintainability, such as adding comments or simplifying complex expressions.

  4. Impact Prediction: CodeGuard would also predict the impact of the suggested improvements on the overall performance and maintainability of the code. This could involve estimating the time saved by the improved efficiency, the reduction in bugs due to the elimination of common errors, and the increase in code readability due to the adherence to coding standards.

By using CodeGuard, developers can ensure that their code is high-quality, efficient, and maintainable, making it easier to manage large-scale projects and reducing the likelihood of bugs and other issues.

You: write the prompts that should be used to get those results from GPT-4 supose that the code diff of the pull request will be provided as context

JARVIS: Certainly, sir. Here are the prompts that could be used with GPT-4 to get the desired results from CodeGuard:

Prompt for Issue Identification:

"CodeGuard, given the following code diff from a pull request, please identify any potential issues, such as bugs, inefficiencies, or violations of coding standards. Provide a detailed report highlighting these issues along with their locations in the code."

Prompt for Improvement Suggestion:

"CodeGuard, given the following code diff from a pull request, please suggest any improvements that could be made to the code. This could include refactoring opportunities, more efficient algorithms, or ways to improve code readability and maintainability. Provide a detailed report highlighting these suggestions along with their potential benefits."

Prompt for Impact Prediction:

"CodeGuard, given the following code diff from a pull request and the suggested improvements, please predict the impact of these improvements on the overall performance and maintainability of the code. This could include estimates of the time saved by improved efficiency, the reduction in bugs due to the elimination of common errors, and the increase in code readability due to adherence to coding standards. Provide a detailed report highlighting these predictions."

By using these prompts with GPT-4, developers can leverage the power of AI to improve their code and make their large-scale projects more manageable.

You: q

You: Make a summary of the conversation in 5 words or less.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment