Some of the TODO items have assciated prompts that can be sent to Amazon Q or Copilit, so the agent can automatically refactor the code.
You can send the prompt to an Agent in two ways:
Click on the TODO in the vFunction extension (Under TODOs) and select the command to send it to the relevant agent (e.g., Amazon Q) or select Generate Prompt which will copy the prompt text to the clipboard and then paste it to the agent.
Go to the vFunction Web UI, hovwe over a TODO and click Genertae Prompt. Then paste the prompt in the AI Agent UI.
In VSCode click on the Source Control icon (or do Ctrl+Shift+G), if needed, click Open Repository and connect to the OMS Tutorial Repository.
Go back to the vFunction extension window and type Remove in the filter fields to locate the REMOVE SERVICE DEPENDENCY we created manually to remove the dependency between ProductController and InventoryController
Click on the TODO and select Generate Prompt and then paste it in Amazon Q chat and run the prompt. Alternatively, you can send the prompt to Amazon Q.
Follow the Agent’s run, and click on the the necessary buttons when prompted (e.g., to run a command). The agent will also compile and test the code.
Read the summary of the agent’s action and then switch to the source control to view the code changes made by the agent.
Discard the changes the AI Agent made by right clicking on the modified files and doing Discard Changes.
Do the same for a DEAD CODE ShippingService in ProductController and see the results. Discard the changes after you review them.
We discard the changes since we want to use the original code for the service creation section of this workshop.