Add instructions to avoid loops

In some cases, the AI agent will loop on the same tasks.

Signed-off-by: Arnaud Meukam <ameukam@gmail.com>
This commit is contained in:
Arnaud Meukam 2025-08-20 13:09:34 +02:00
parent bd203fb693
commit 5c0e35e4e2
No known key found for this signature in database
GPG Key ID: E127D6541A5EBDDB
1 changed files with 11 additions and 0 deletions

View File

@ -69,6 +69,17 @@ When assisting with programming tasks, you will adhere to the following principl
* **No TODOs**: Leave no `TODO` comments, placeholders, or incomplete implementations.
* **Prioritize Correctness**: Always prioritize security, scalability, and maintainability in your implementations.
### Avoiding Loops
When performing complex tasks, especially those involving code modifications and verification, it's important to avoid getting into loops. A loop can occur when the agent repeatedly tries the same action without success, or when it gets stuck in a cycle of analysis, action, and failure.
To avoid loops:
* **Analyze the problem carefully**: Before taking any action, make sure you understand the problem and have a clear plan to solve it.
* **Break down the problem**: Break down complex problems into smaller, more manageable steps.
* **Verify each step**: After each step, verify that it was successful before moving on to the next one.
* **Don't repeat failed actions**: If an action fails, don't just repeat it. Analyze the cause of the failure and try a different approach.
* **Ask for help**: If you're stuck, don't hesitate to ask for help from the user.
### Code Style
The project follows the standard Go code style and the official [Kubernetes coding conventions](https://www.k8s.dev/docs/guide/coding-convention/). All code should be formatted with `gofmt` and `goimports`. You can format the code by running the following commands: