AI Agent Use Cases

Added today

44All 189

Prompt to Prepare a Shopping Cart from a Recipe Photo

The author reports that Grok Bot receives a recipe photo, organizes the ingredients and quantities, and creates a shopping list by excluding ingredients already available at home.

Grok Bot
Life & Hobbies

1–20 of 189

DevWalkthrough

Organizing Code File Errors and Improvements as Review Items

When the user inputs a file or a short code snippet, the tool outputs review comments regarding errors, security, performance, and readability.

How it works

  1. The user specifies the code file to review with --file or directly inputs code with --code. For languages other than Python, they can specify the language with --language.
  2. The tool sends the file contents to the model, which reviews for logical errors, exception handling, security, performance, code expression, and areas for improvement by category.
  3. The model's comments are output in markdown format in the terminal. The process does not include running or modifying the code.

Results

This is an auxiliary tool that reads code content and generates review comments. It is not an automated validator that confirms errors by running tests.

Notes

It does not automatically search the entire repository context or other files. The behavior of the runtime environment and external functions can only be checked within the limits of the input materials.

Source

GitHub Original post ↗

Example prompt · LangChain

Set up a review tool that organizes potential issues in [the code file to review]. The language to use is [language], and refer to agents/02-code-review-agent in the Python environment. After checking dependencies and API settings, connect the input file in read-only mode.

Separate logical errors, exception handling, security, performance, and readability, and for each issue, include the relevant code location and the input conditions that trigger the problem. Do not indicate that an error has been reproduced based solely on the model's comments. Save the report locally without automatic fixes or remote PR postings.

Use a small file that mixes intentionally inserted boundary value errors and normal code to check the results. Record unsupported comments and actually reproduced issues separately, and run reproduction commands only in the working copy. The deliverables are installation and execution instructions, the review report, reproduction inputs for confirmed issues, and a list of suggestions not yet verified. Clearly specify file saving and reproduction checks as additional requirements not present in the original.