{"id":2230,"date":"2025-09-23T13:04:10","date_gmt":"2025-09-23T13:04:10","guid":{"rendered":"https:\/\/makeaiprompt.com\/blog\/ai-agent-prompt-for-automated-code-debugging-assistant\/"},"modified":"2025-09-23T13:04:10","modified_gmt":"2025-09-23T13:04:10","slug":"ai-agent-prompt-for-automated-code-debugging-assistant","status":"publish","type":"post","link":"https:\/\/makeaiprompt.com\/blog\/ai-agent-prompt-for-automated-code-debugging-assistant\/","title":{"rendered":"AI Agent Prompt for Automated Code Debugging Assistant"},"content":{"rendered":"<div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div><div style=\"padding:20px;border-radius:8px;margin-bottom:20px;\">\n<h3 style=\"margin-top:0;\">About Prompt<\/h3>\n<ul style=\"list-style: none; padding: 0;\">\n<li style=\"margin:8px 0;padding:8px;border-radius:4px;box-shadow:0 1px 3px rgba(255, 255, 255, 1);\"><strong>Prompt Type<\/strong> &#8211; Dynamic<\/li>\n<li style=\"margin:8px 0;padding:8px;border-radius:4px;box-shadow:0 1px 3px rgba(255, 255, 255, 1);\"><strong>Prompt Platform<\/strong> &#8211; ChatGPT, Grok, Deepseek, Gemini, Copilot, Midjourney, Meta AI and more<\/li>\n<li style=\"margin:8px 0;padding:8px;border-radius:4px;box-shadow:0 1px 3px rgba(255, 255, 255, 1);\"><strong>Niche<\/strong> &#8211; Coding<\/li>\n<li style=\"margin:8px 0;padding:8px;border-radius:4px;box-shadow:0 1px 3px rgba(255, 255, 255, 1);\"><strong>Language<\/strong> &#8211; English<\/li>\n<li style=\"margin:8px 0;padding:8px;border-radius:4px;box-shadow:0 1px 3px rgba(255, 255, 255, 1);\"><strong>Category<\/strong> &#8211; Developer Tools<\/li>\n<li style=\"margin:8px 0;padding:8px;border-radius:4px;box-shadow:0 1px 3px rgba(255, 255, 255, 1);\"><strong>Prompt Title<\/strong> &#8211; AI Agent Prompt for Automated Code Debugging Assistant<\/li>\n<\/ul>\n<\/div>\n<h3 style=\"margin-top:0;\">Prompt Details <\/h3>\n<div id=\"promptContent\">## AI Agent Prompt for Automated Code Debugging Assistant<\/p>\n<p>**Prompt Type:** Dynamic<\/p>\n<p>**Target Audience:** Developers<\/p>\n<p>**Purpose:** Automated code debugging and solution generation across various programming languages.<\/p>\n<p>**AI Platform Compatibility:** Designed for general compatibility across AI platforms capable of code interpretation and generation.  Adaptations may be necessary for platform-specific features.<\/p>\n<p>**Prompt Structure:**<\/p>\n<p>&#8220;`<br \/>\n## Code Debugging Assistant<\/p>\n<p>**Task:** Debug the provided code snippet and suggest corrections.  Provide a detailed explanation of the identified bug(s), the proposed solution, and the logic behind the fix.  If applicable, suggest alternative approaches for improved code quality, performance, or maintainability.<\/p>\n<p>**Programming Language:** {programming_language}<\/p>\n<p>**Code Snippet:**<br \/>\n&#8220;`<br \/>\n{code_snippet}<br \/>\n&#8220;`<\/p>\n<p>**Error Message (Optional):**<br \/>\n&#8220;`<br \/>\n{error_message}<br \/>\n&#8220;`<\/p>\n<p>**Expected Behavior:** {expected_behavior}<\/p>\n<p>**Current Behavior:** {current_behavior}<\/p>\n<p>**Context (Optional):**<br \/>\n* **Relevant Code Sections:** {related_code_snippets}  (e.g., function calls, class definitions, etc.)<br \/>\n* **External Libraries\/Dependencies:** {list_of_dependencies}<br \/>\n* **Specific Requirements\/Constraints:** {specific_instructions} (e.g., performance constraints, coding style guidelines, etc.)<\/p>\n<p>**Output Format:**<\/p>\n<p>&#8220;`json<br \/>\n{<br \/>\n  &#8220;bugs&#8221;: [<br \/>\n    {<br \/>\n      &#8220;description&#8221;: &#8220;Description of the bug&#8221;,<br \/>\n      &#8220;location&#8221;: {  \/\/ Line number or other location identifier<br \/>\n        &#8220;line&#8221;: 12,<br \/>\n        &#8220;column&#8221;: 5<br \/>\n      },<br \/>\n      &#8220;severity&#8221;: &#8220;high\/medium\/low&#8221; \/\/ Optional severity level<br \/>\n    }<br \/>\n  ],<br \/>\n  &#8220;solutions&#8221;: [<br \/>\n    {<br \/>\n      &#8220;description&#8221;: &#8220;Description of the solution&#8221;,<br \/>\n      &#8220;code&#8221;: &#8220;Corrected code snippet&#8221;<br \/>\n    }<br \/>\n  ],<br \/>\n  &#8220;alternative_approaches&#8221;: [ \/\/ Optional suggestions for improvement<br \/>\n    {<br \/>\n      &#8220;description&#8221;: &#8220;Description of the alternative approach&#8221;,<br \/>\n      &#8220;code&#8221;: &#8220;Alternative code snippet&#8221;<br \/>\n    }<br \/>\n  ],<br \/>\n  &#8220;explanation&#8221;: &#8220;Detailed explanation of the bug, solution, and alternative approaches (if any).&#8221;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>**Example Usage:**<\/p>\n<p>**Programming Language:** Python<\/p>\n<p>**Code Snippet:**<br \/>\n&#8220;`python<br \/>\ndef calculate_sum(a, b):<br \/>\n  return a &#8211; b<\/p>\n<p>result = calculate_sum(5, 3)<br \/>\nprint(f&#8221;The sum is: {result}&#8221;)<br \/>\n&#8220;`<\/p>\n<p>**Expected Behavior:**  The function should return the sum of two numbers.<\/p>\n<p>**Current Behavior:** The function returns the difference between two numbers.<\/p>\n<p>**Output (Example):**<\/p>\n<p>&#8220;`json<br \/>\n{<br \/>\n  &#8220;bugs&#8221;: [<br \/>\n    {<br \/>\n      &#8220;description&#8221;: &#8220;The function `calculate_sum` subtracts `b` from `a` instead of adding them.&#8221;,<br \/>\n      &#8220;location&#8221;: {<br \/>\n        &#8220;line&#8221;: 2,<br \/>\n        &#8220;column&#8221;: 12<br \/>\n      },<br \/>\n      &#8220;severity&#8221;: &#8220;high&#8221;<br \/>\n    }<br \/>\n  ],<br \/>\n  &#8220;solutions&#8221;: [<br \/>\n    {<br \/>\n      &#8220;description&#8221;: &#8220;Corrected the function to add `a` and `b`.&#8221;,<br \/>\n      &#8220;code&#8221;: &#8220;def calculate_sum(a, b):\\n  return a + b&#8221;<br \/>\n    }<br \/>\n  ],<br \/>\n  &#8220;explanation&#8221;: &#8220;The original code had a &#8216;-&#8216; operator instead of a &#8216;+&#8217; operator, resulting in subtraction instead of addition. The solution replaces the &#8216;-&#8216; with &#8216;+&#8217; to correctly calculate the sum.&#8221;<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>**Guidelines for Effective Prompts:**<\/p>\n<p>* **Be Specific:** Clearly define the expected behavior and the observed behavior.  Include any relevant error messages.<br \/>\n* **Provide Context:** Include relevant code sections, dependencies, and constraints to help the AI understand the code&#8217;s environment.<br \/>\n* **Structure the Input:** Use a consistent format to provide the code, error message, and expected behavior.  This helps the AI parse the information effectively.<br \/>\n* **Specify the Output Format:** Requesting a structured JSON output simplifies parsing and integration with other tools.<br \/>\n* **Iterate and Refine:** Test and refine the prompt based on the AI&#8217;s responses.  Adjust the level of detail and specificity as needed.<\/p>\n<p>This structured prompt allows for dynamic input, making it a versatile tool for debugging various code snippets across different programming languages. The JSON output format facilitates easy integration with other developer tools and workflows, enhancing the debugging process. Remember to adapt the prompt to specific AI platform requirements for optimal performance.\n<\/p><\/div>\n<div style=\"margin-top: 40px; text-align: center;\"><button class=\"copyPostContent\" id=\"copyPostContent\">\ud83d\udccb Copy Prompt<\/button><\/div>\n<div class=\"ai-buttons\"><a href=\"https:\/\/makeaiprompt.com\">Create Your Own Prompts<\/a><a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\">View All Prompts<\/a><a href=\"https:\/\/makeaiprompt.com\/top-ai-tools\">Top AI Tools<\/a><a href=\"https:\/\/chatgpt.com\/\" target=\"_blank\" rel=\"noopener\">Try on ChatGPT<\/a><a href=\"https:\/\/gemini.google.com\/app\" target=\"_blank\" rel=\"noopener\">Try on Gemini<\/a><a href=\"https:\/\/aistudio.google.com\" target=\"_blank\" rel=\"noopener\">Try on Google AI Studio<\/a><a href=\"https:\/\/grok.com\" target=\"_blank\" rel=\"noopener\">Try on Grok<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>AI Agent Prompt for Automated Code Debugging Assistant: This structured prompt allows for dynamic input, making it a versatile tool for debugging various&#8230;<\/p>\n","protected":false},"author":4,"featured_media":2229,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,7,5,6,4,26,8,1,25],"tags":[],"class_list":["post-2230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chatgpt-prompts","category-copilot-prompts","category-deepseek-prompts","category-gemini-prompts","category-grok-prompts","category-meta-ai-prompts","category-midjourney-prompts","category-prompts","category-veo-prompts"],"jetpack_featured_media_url":"https:\/\/makeaiprompt.com\/blog\/wp-content\/uploads\/2025\/09\/AI-Agent-Prompt-for-Automated-Code-Debugging-Assistant.jpg","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"rttpg_featured_image_url":{"full":["https:\/\/makeaiprompt.com\/blog\/wp-content\/uploads\/2025\/09\/AI-Agent-Prompt-for-Automated-Code-Debugging-Assistant.jpg",1200,630,false],"landscape":["https:\/\/makeaiprompt.com\/blog\/wp-content\/uploads\/2025\/09\/AI-Agent-Prompt-for-Automated-Code-Debugging-Assistant.jpg",1200,630,false],"portraits":["https:\/\/makeaiprompt.com\/blog\/wp-content\/uploads\/2025\/09\/AI-Agent-Prompt-for-Automated-Code-Debugging-Assistant.jpg",1200,630,false],"thumbnail":["https:\/\/makeaiprompt.com\/blog\/wp-content\/uploads\/2025\/09\/AI-Agent-Prompt-for-Automated-Code-Debugging-Assistant-150x150.jpg",150,150,true],"medium":["https:\/\/makeaiprompt.com\/blog\/wp-content\/uploads\/2025\/09\/AI-Agent-Prompt-for-Automated-Code-Debugging-Assistant-300x158.jpg",300,158,true],"large":["https:\/\/makeaiprompt.com\/blog\/wp-content\/uploads\/2025\/09\/AI-Agent-Prompt-for-Automated-Code-Debugging-Assistant-1024x538.jpg",1024,538,true],"1536x1536":["https:\/\/makeaiprompt.com\/blog\/wp-content\/uploads\/2025\/09\/AI-Agent-Prompt-for-Automated-Code-Debugging-Assistant.jpg",1200,630,false],"2048x2048":["https:\/\/makeaiprompt.com\/blog\/wp-content\/uploads\/2025\/09\/AI-Agent-Prompt-for-Automated-Code-Debugging-Assistant.jpg",1200,630,false]},"rttpg_author":{"display_name":"AIPrompts","author_link":"https:\/\/makeaiprompt.com\/blog\/author\/aiprompts\/"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\/chatgpt-prompts\/\" rel=\"category tag\">ChatGPT Prompts<\/a> <a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\/copilot-prompts\/\" rel=\"category tag\">Copilot Prompts<\/a> <a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\/deepseek-prompts\/\" rel=\"category tag\">Deepseek Prompts<\/a> <a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\/gemini-prompts\/\" rel=\"category tag\">Gemini Prompts<\/a> <a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\/grok-prompts\/\" rel=\"category tag\">Grok Prompts<\/a> <a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\/meta-ai-prompts\/\" rel=\"category tag\">Meta AI Prompts<\/a> <a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\/midjourney-prompts\/\" rel=\"category tag\">Midjourney Prompts<\/a> <a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\/\" rel=\"category tag\">Prompts<\/a> <a href=\"https:\/\/makeaiprompt.com\/blog\/category\/prompts\/veo-prompts\/\" rel=\"category tag\">Veo Prompts<\/a>","rttpg_excerpt":"AI Agent Prompt for Automated Code Debugging Assistant: This structured prompt allows for dynamic input, making it a versatile tool for debugging various...","_links":{"self":[{"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/posts\/2230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/comments?post=2230"}],"version-history":[{"count":0,"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/posts\/2230\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/media\/2229"}],"wp:attachment":[{"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/media?parent=2230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/categories?post=2230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/makeaiprompt.com\/blog\/wp-json\/wp\/v2\/tags?post=2230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}