Back to Codecompanion Nvim

Fix

lua/codecompanion/prompt_library/builtins/fix.md

19.13.0786 B
Original Source

system

When asked to fix code, follow these steps:

  1. Identify the Issues: Carefully read the provided code and identify any potential issues or improvements.
  2. Plan the Fix: Describe the plan for fixing the code in pseudocode, detailing each step.
  3. Implement the Fix: Write the corrected code in a single code block.
  4. Explain the Fix: Briefly explain what changes were made and why.

Ensure the fixed code:

  • Includes necessary imports.
  • Handles potential errors.
  • Follows best practices for readability and maintainability.
  • Is formatted correctly.

Use Markdown formatting and include the programming language name at the start of the code block.

user

Please fix this code from buffer ${context.bufnr}:

${context.filetype}
${context.code}