nirelbaz / meniai

MeniAI is a CLI tool that lets developers create task-specific AI bots for automating and streamlining development tasks. These bots evolve with user feedback and can be used interactively or fully automated in CI/CD pipelines.
MIT License
2 stars 0 forks source link

[FEATURE] Provide read-only mode for code reviews #3

Open leonj1 opened 1 week ago

leonj1 commented 1 week ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I can see the benefit of committing project standards in Meniai that get engaged along with the project. Because code bases could be of different sizes and ages (legacy), and each team could have different tolerances for change, this proposal will add some form of read-only mode.

Describe the solution you'd like A clear and concise description of what you want to happen. It would be great to support:

  1. Only code review (read-only mode). Meniai would not make any project changes, just recommendations. I tried changing the prompt not to make changes, but it appears to ignore the prompt and make changes anyway.
  2. have a "--easy-changes" mode where it could recommend and change trivial recommendations, such as typos, string formatting, or spacing.
  3. have a "--prompt-per-change" feature that tells the user the next thing it wants to perform, and the user can respond yes/no whether or not it is a change they agree with.
  4. Support prompts from external sources, such as another git repo, where there could be a "team-wide" prompt. For example, a team agrees that all classes cannot exceed 100 lines and no function can exceed 5 parameters. This would allow medium—to larger teams to set their standards in a single place while keeping project-specific standards.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. You have probably heard of devContainers. It aims to ensure everyone has the same project setup and dependencies, making it easier to start a project. Meniai might find some synergy with that ecosystem. There may also be an interest in git hooks, such as ensuring code changes adhere to the prompts.

Additional context Add any other context or screenshots about the feature request here. I have not tried it, but take a look to see if Meniai could work well in a CICD context, where it's running in a pipeline without human interaction. It could exit with an error code stating its findings are not adhering to its prompt (referring to the read-only mode).

nirelbaz commented 1 week ago

Thank you @leonj1 for your detailed feature request! I appreciate your thoughtful suggestions for improving MeniAI. Let me address each of your points:

  1. Read-only mode (code review only): This is an excellent suggestion. I can implement this by adding a new command-line option, such as --read-only. I'll modify the TaskFeedbackLoop class to skip the file saving step when this option is enabled. Additionally, I'll experiment with a new system prompt for this mode, directing the LLM to output only text suggestions and not the file's code, enhancing its code review capabilities.

  2. Easy changes mode: I think this can be achieved today by describing the role of the agent and providing feedback in interactive mode. Adding a specific flag might not be necessary, as each agent can have its own instructions. The flexibility of defining custom agents already allows for this kind of granular control.

  3. Prompt per change: This is an interesting idea that would require changes to the TaskFeedbackLoop logic. The modifications I'll make for the read-only mode could set the groundwork for implementing this feature in the future. It could provide a nice balance between automation and user control.

  4. External prompts support: I believe that the existing --meniai-directory option can already achieve much of what you've requested. I'd like to know if this existing functionality meets your needs or if you're looking for something more specific.

Regarding CI/CD and DevContainers: MeniAI is indeed designed to be used in CI/CD pipelines, with the --no-interactive option allowing agents to run without user interaction. I'll investigate how it might work with DevContainers to further enhance its CI/CD capabilities.

Here's a revised plan based on your request and our current capabilities:

  1. Implement the --read-only option for code review without changes, including a new system prompt that outputs only text suggestions.
  2. Develop the --prompt-per-change feature, building on the groundwork laid by the read-only mode implementation.
  3. Enhance CI/CD compatibility by investigating integration with DevContainers.

I'll prioritize these features in the development roadmap. Thank you again for your valuable input 🙏🏻