Code Writer & Debugging Ai Tools Prompts Library



PROMPTS IN ENGLISH

(Code Generation)
1. Code Generation
➢ Formula
➢ [Context] + [Code-Type] + [Required Changes] + [Intent/Goal] +
[Response Format]
➢ Template
"I want you to modify my [Code Type, e.g., HTML, CSS, JavaScript]
to improve its appearance. Please add [Required Changes, e.g., new
elements, colors, layout adjustments] to make it more [Intent/Goal, e.g.,
visually appealing, user-friendly, modern]. Provide the updated code in
a [Response Format, e.g., clean and well-structured manner with
comments]."
➢ Example
"I want you to generate code for a simple contact form using HTML,
CSS, and JavaScript. The form should include fields for Name, Email,
Message, and a Submit button. The goal is to create a basic and userfriendly contact form that validates inputs before submission. Please
provide the code in a clean and well-commented format."

(Code Explanation)
2. Code Explanation
➢ Formula
[Context] + [Programming Langauge] + [[Code/Concept] + [Preferred
Language] + [Example for Better Understanding]
➢ Template
"I want you to explain the following code written in [Programming
Language]. The code involves [Code/Concept, e.g., loops, functions,
database queries]. Please explain it in [Preferred Language, e.g.,
simple English, Hinglish]. Also, provide a practical example to help me
understand it better."
➢ Example
"I want you to explain the following Python code
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n- 1)
The code involves recursion for calculating the factorial of a number.
Please explain it in Hinglish with a real-life example to make it easier
to understand."

(Code Modifications)
3. Code Modifications
➢ Formula
[Context] + [Code-Type] + [Required Changes] + [Intent/Goal] +
[Response Format]
➢ Template
"I want you to modify my [Code Type, e.g., HTML, CSS, JavaScript]
to improve its appearance. Please add [Required Changes, e.g., new
elements, colors, layout adjustments] to make it more [Intent/Goal, e.g.,
visually appealing, user-friendly, modern]. Provide the updated code in
a [Response Format, e.g., clean and well-structured manner with
comments]."
➢ Example
"I want you to modify my existing HTML and CSS code to enhance my
web page's design. Please add attractive colors, improve the button
styles, and adjust the layout to look more professional and modern.
Provide the updated code in a clean and well-structured format with
comments."

(Error Fixing)
4. Code Errors Solver
➢ Formula
[Context] + [Programming Language] + [Error/Issue] + [Intent/Goal] +
[Response Format]
➢ Template
"I want you to troubleshoot an error in my [Programming Language]
code. The issue is [Error/Issue, e.g., syntax error, logic error, runtime
error]. Please identify the problem, provide a solution, and explain the
error in a simple way. Present the explanation in [Response Format,
e.g., step-by-step breakdown]."
➢ Example
"I want you to troubleshoot an error in my Python code:
num=int(input("Enter a number: "))
if num =10:
print("Number is ten")
The issue is a syntax error in the if statement. Please identify the
problem, provide a solution, and explain the error in a simple way with
a step-by-step breakdown."

(Code Optimization)
5. Code Optimization
➢ Formula
[Context] + [Programming Language] + [Optimization Focus] +
[Intent/Goal] + [Response Format]
➢ Template
"I want you to optimize my [Programming Language] code to make it
more efficient and readable. Please focus on [Optimization Focus, e.g.,
reducing code of lines and redundancy, improving readability,
enhancing performance]. The goal is to [Intent/Goal, e.g., make the
code shorter, easier to understand, well-structured]. Provide the
optimized code with [Response Format, e.g., proper comments
explaining key parts]."
➢ Example
"I want you to optimize my Python code to make it more readable and
efficient:
numbers = [1, 2, 3, 4, 5]
sum=0
for num innumbers:
sum=sum+num
print("Total:", sum)
Please reduce redundancy, improve readability, and use comments to
explain the changes."

(Code Analysis)
6. Code Analysis (Performance and Security)
➢ Formula
[Context] + [Programming Language] + [Analysis Focus] +
[Intent/Goal] + [Response Format]
➢ Template
"I want you to analyze my [Programming Language] code for [Analysis
Focus, e.g., performance improvements, security vulnerabilities]. The
goal is to [Intent/Goal, e.g., optimize execution speed, identify security
risks, suggest best practices]. Please provide a detailed breakdown with
[Response Format, e.g., suggestions, explanations, and improved code
snippets if necessary]."
➢ Example
"I want you to analyze my Python code for potential security
vulnerabilities and performance issues:
import os
def read_file(filename):
file = open(filename, "r")
data = file.read()
file.close()
return data
print(read_file("user_data.txt"))
Please identify security risks (e.g., file handling vulnerabilities) and
suggest performance improvements with explanations and best practices."

(Code Reusability)
7. Code Reusability (Components/Modules)
➢ Formula
[Context] + [Programming Language] + [Code Complexity] +
[Intent/Goal] + [Response Format]
➢ Template
"I want you to refactor my [Programming Language] code to improve
reusability by breaking it down into [Code Complexity, e.g., functions,
components, modules]. The goal is to [Intent/Goal, e.g., make the code
more modular, scalable, and maintainable]. Please provide the
refactored code with [Response Format, e.g., clear comments and
explanations]."
➢ Example
"I want you to refactor my Python code to improve reusability by
converting it into modular functions:
print("Enter two numbers:")
a =int(input())
b =int(input())
print("Sum:", a + b)
print("Difference:", a- b)
print("Product:", a * b)
print("Quotient:", a / b)
Please restructure this into reusable functions for better scalability and
provide comments explaining the changes."

(Testing Code)
8. Testing Code
➢ Formula
[Context] + [Programming Language] + [Functionality to Test] +
[Intent/Goal] + [Response Format]
➢ Template
"I want you to create unit test cases for my [Programming Language]
code. The focus should be on testing [Functionality to Test, e.g., specific
functions, input validation, error handling]. The goal is to [Intent/Goal,
e.g., ensure reliability, verify correctness, catch edge cases]. Please
provide the test cases in [Response Format, e.g., structured format
using a testing framework like unit test, pytest, or JUnit]."
➢ Example
"I want you to create unit test cases for my Python function using the
unit test framework:
def add(a, b):
return a + b
The focus should be on verifying correct outputs and handling edge
cases. Please provide test cases in a structured format using Python’s
unit test framework."

(Code Documentation)
9. Code Documentation
➢ Formula
[Context] + [Programming Language] + [Documentation Scope] +
[Intent/Goal] + [Response Format]
➢ Template
"I want you to generate proper comments and documentation for my
[Programming Language] code. The focus should be on [Documentation
Scope, e.g., function explanations, input-output details, usage
instructions]. The goal is to [Intent/Goal, e.g., improve readability, make
maintenance easier, follow best practices]. Please provide the
documentation in [Response Format, e.g., docstrings, inline comments,
or a separate README file]."
➢ Example
"I want you to add proper comments and documentation to my Python
function for better readability and maintenance:
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n- 1)
The documentation should include function purpose, input-output
details, and inline comments explaining key parts of the code."

(Code Conversion)
10. Code Conversion
➢ Formula
[Context] + [Source Language] + [Target Language] + [Code
Complexity] + [Intent/Goal] + [Response Format]
➢ Template
"I want you to convert my code from [Source Language] to [Target
Language]. The code involves [Code Complexity, e.g., basic functions,
object-oriented concepts, web components]. The goal is to [Intent/Goal,
e.g., maintain functionality, improve efficiency, follow best practices].
Please provide the converted code in [Response Format, e.g., clean
and well-commented format]."
➢ Example
"I want you to convert my Python function to JavaScript while
maintaining functionality and readability:
def greet(name):
return f"Hello, {name}!"
Please provide the equivalent JavaScript code with comments
explaining the conversion."
PROMPTS IN HINDI

(Code Generation)
1. Code Generation
➢ Formula
[Context] + [Code-Type] + [Required Changes] + [Intent/Goal] + [Response Format]
➢ Template
"Main chahata hoon ki aap [Specific Topic, jaise website, web page,
registration form, contact form] ke liye ek code generate karein. Code
mein [Required Features, jaise HTMLstructure, CSS styling, JavaScript
functionality] hone chahiye. Mera goal hai ki [Intent/Goal, jaise simple
aur user-friendly interface create karna, responsiveness ensure karna,
ya user experience enhance karna]. Kripya code ko [Response Format,
jaise clean aur well-commented format] mein provide karein."
➢ Example
"Main chahata hoon ki aap ek simple contact form ka code generate
karein jo HTML, CSS, aur JavaScript ka use kare. Form mein Name,
Email, Message aur ek Submit button hone chahiye. Mera goal hai ki
ek basic aur user-friendly contact form banaye jo inputs validate kare
submit hone se pehle. Kripya code ko clean aur well-commented format
mein provide karein."

(Code Explanation)
2. Code Explanation
➢ Formula
[Context] + [Programming Language] + [Code/Concept] + [Preferred Language] + [Example for Better Understanding]
➢ Template
"Main chahata hoon ki aap neeche diye gaye code ko explain karein jo
[Programming Language] mein likha gaya hai. Yeh code [Code/Concept,
jaise loops, functions, database queries] ko use karta hai. Kripya ise
[Preferred Language, jaise simple English, Hinglish] mein samjhayein.
Saath hi ek practical example bhi dijiye taki mujhe aur achhe se samajh
aaye."
➢ Example
"Main chahata hoon ki aap neeche diye gaye Python code ko
samjhayein:
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n- 1)
Yeh code recursion ka use karke kisi number ka factorial calculate karta
hai. Kripya ise Hinglish mein explain karein aur ek real-life example bhi
dijiye taki mujhe aur achha samajh aaye."

(Code Modifications)
3. Code Modifications
➢ Formula
[Context] + [Code-Type] + [Required Changes] + [Intent/Goal] + [Response Format]
➢ Template
"Main chahata hoon ki aap mere [Code Type, jaise HTML, CSS,
JavaScript] code ko modify karein taki uska appearance improve ho.
Kripya [Required Changes, jaise naye elements add karna, colors
enhance karna, layout adjust karna] include karein taki yeh aur zyada
[Intent/Goal, jaise visually appealing, user-friendly, modern] lage. Kripya
updated code ko [Response Format, jaise clean aur well-structured
format with comments] mein provide karein.
➢ Example
"Main chahata hoon ki aap mere existing HTML aur CSS code ko modify
karein taki meri web page design enhance ho. Kripya attractive colors
add karein, button styles improve karein, aur layout ko zyada professional
aur modern banayein. Updated code ko clean aur well-structured format
mein comments ke saath provide karein."

(Error Fixing)
4. Code Errors Solver
➢ Formula
[Context] + [Programming Language] + [Error/Issue] + [Intent/Goal] +
[Response Format]
➢ Template
"Main chahata hoon ki aap mere [Programming Language] code mein
error ko troubleshoot karein. Issue hai [Error/Issue, jaise syntax error,
logic error, runtime error]. Kripya problem identify karein, solution
batayein, aur error ko simple tarike se explain karein. Explanation ko
[Response Format, jaise step-by-step breakdown] mein present karein."
➢ Example
"Main chahata hoon ki aap mere Python code ka error troubleshoot
karein:
num=int(input("Enter a number: "))
if num =10:
print("Number is ten")
Issue ek syntax error hai if statement mein. Kripya problem identify
karein, iska solution batayein, aur error ko simple tarike se step-by-step
explain karein."
5. Code Optimization
➢ Formula
[Context] + [Programming Language] + [Optimization Focus] + [Intent/Goal] + [Response Format]
➢ Template
"Main chahata hoon ki aap mere [Programming Language] code ko
optimize karein taki yeh zyada efficient aur readable ho. Kripya
[Optimization Focus, jaise coding lines kam karna, redundancy kam
karna, readability improve karna, performance enhance karna] par
dhyan dein. Mera goal hai ki [Intent/Goal, jaise code chhota aur
samajhne mein aasaan ho, well-structured ho]. Kripya optimized code
ko [Response Format, jaise proper comments ke saath] provide karein."
➢ Example
"Main chahata hoon ki aap mere Python code ko optimize karein taki
yeh zyada readable aur efficient ho:
numbers = [1, 2, 3, 4, 5]
sum=0
for num innumbers:
sum=sum+num
print("Total:", sum)
Kripya redundancy or code of lines kam karein, readability improve
karein, aur changes ko comments ke saath explain karein."
6. Code Analysis (Performance and Security)
➢ Formula
[Context] + [Programming Language] + [Analysis Focus] + [Intent/Goal] + [Response Format]
➢ Template
"Main chahata hoon ki aap mere [Programming Language] code ka
analysis karein jo [Analysis Focus, jaise performance improvements,
security vulnerabilities] se related hai. Mera goal hai ki [Intent/Goal,
jaise execution speed optimize karna, security risks identify karna,
best practices suggest karna]. Kripya ek detailed breakdown dein
[Response Format, jaise suggestions, explanations, aur zaroorat pade
toh improved code snippets]."
➢ Example
"Main chahata hoon ki aap mere Python code ka analysis karein taki
potential security vulnerabilities aur performance issues identify ho sakein:
import os
def read_file(filename):
file = open(filename, "r")
data = file.read()
file.close()
return data
print(read_file("user_data.txt"))
Kripya security risks (jaise file handling vulnerabilities) aur performance
improvements ke suggestions dein, explanations ke saath."
7. Code Reusability (Components/Modules)
➢ Formula
[Context] + [Programming Language] + [Code Complexity] + [Intent/Goal] + [Response Format]
➢ Template
"Main chahata hoon ki aap mere [Programming Language] code ko
refactor karein taki reusability improve ho sake. Kripya isse [Code
Complexity, jaise functions, components, modules] mein tod kar
modular banayein. Mera goal hai ki [Intent/Goal, jaise code ko zyada
modular, scalable, aur maintainable banana]. Kripya refactored code
[Response Format, jaise clear comments aur explanations] ke saath
provide karein."
➢ Example
"Main chahata hoon ki aap mere Python code ko refactor karein taki
reusability improve ho sake, use modular functions mein convert
karein:
print("Enter two numbers:")
a =int(input())
b =int(input())
print("Sum:", a + b)
print("Difference:", a- b)
print("Product:", a * b)
print("Quotient:", a / b)
Kripya isse reusable functions mein tod kar refactor karein aur
comments ke saath explanation dein."
8. Testing Code
➢ Formula
[Context] + [Programming Language] + [Functionality to Test] + [Intent/Goal] + [Response Format]
➢ Template
"Main chahata hoon ki aap mere [Programming Language] code ke liye
unit test cases create karein. Testing ka focus [Functionality to Test,
jaise specific functions, input validation, error handling] par hona
chahiye. Mera goal hai ki [Intent/Goal, jaise reliability ensure karna, correctness verify karna, edge cases handle karna]. Kripya test cases
[Response Format, jaise structured format using unit test, pytest, ya
JUnit] mein provide karein."
➢ Example
"Main chahata hoon ki aap mere Python function ke liye unit test
cases likhein using unittest framework:
def add(a, b):
return a + b
Testing ka focus correct outputs verify karna aur edge cases handle
karna hona chahiye. Kripya structured format mein Python ke unittest
framework ka use karke test cases provide karein.”
9. Code Documentation
➢ Formula
[Context] + [Programming Language] + [Documentation Scope] + [Intent/Goal] + [Response Format]
➢ Template
"Main chahata hoon ki aap mere [Programming Language] code ke
liye proper comments aur documentation generate karein. Focus
[Documentation Scope, jaise function explanations, input-output
details, usage instructions] par hona chahiye. Mera goal hai ki
[Intent/Goal, jaise readability improve karna, maintenance aasaan
banana, best practices follow karna]. Kripya documentation [Response
Format, jaise docstrings, inline comments, ya ek alag README file]
mein provide karein."
➢ Example
"Main chahata hoon ki aap mere Python function ke liye proper
comments aur documentation add karein taki readability aur
maintenance better ho sake:
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n- 1)
Documentation mein function ka purpose, input-output details, aur inline
comments hone chahiye taki code samajhna easy ho.”
10. Code Conversion
➢ Formula
[Context] + [Source Language] + [Target Language] + [Code Complexity] + [Intent/Goal] + [Response Format]
➢ Template
"Main chahata hoon ki aap mera code [Source Language] se [Target
Language] mein convert karein. Code [Code Complexity, jaise basic
functions, object-oriented concepts, web components] ko involve karta
hai. Mera goal hai ki [Intent/Goal, jaise functionality maintain karna,
efficiency improve karna, best practices follow karna]. Kripya converted
code [Response Format, jaise clean aur well-commented format] mein
provide karein."
➢ Example
"Main chahata hoon ki aap mere Python function ko JavaScript mein
convert karein, functionality aur readability maintain karte hue:
def greet(name):
return f"Hello, {name}!"
Kripya equivalent JavaScript code provide karein aur comments ke
saath explain karein."
TEXT TO CODE WRITER & DEBUGGING AI TOOLS

BLACKBOX AI
BLACKBOX AI is the Best AI Model for Code. Millions of developers use Blackbox Code Chat to answer coding questions and assist them while writing code

Gravitywrite
Use AI to create high-quality content for blogs, ads, emails, and social media in seconds. Boost your clicks, conversions, and sales with GravityWrite.

Code Convert
CodeConvert offers automated code generate across a wide range of popular programming languages like Python, Java, C++, JavaScript, PHP and more.
DO YOU WANT TO LEARN HOW TO USE TEXT TO CODE AI TOOLS ?
USING OUR TUTORIALS LIBRARY. YOU CAN EASILY GENERATE CODE AS YOU DESIRE
Unlock the potential of AI-driven code generation tools to automate programming tasks and streamline your development workflow. Our tutorials will help you learn how to generate clean, efficient code for your projects, saving you time and effort.