AI Code Generation Prompts

💡 AI Code Generation Prompts

15 powerful prompts to generate code for various programming tasks

All Prompts
Python
Web Dev
Database
AI/ML
Scripting
Python

Generate a Python Script for Automating Tasks

Create efficient Python scripts with error handling for automation

Act as a Python developer. Write a Python script to automate [specific task], ensuring efficiency and error handling.
EXAMPLE USAGE: “Act as a Python developer. Write a script to automatically rename and organize files in a folder based on their extensions.”
Web Dev

Generate a Full-Stack Web App Template

Create React + Node.js templates with auth and database integration

Act as a full-stack developer. Generate a basic web app template using React (frontend) and Node.js (backend) with authentication and database integration.
EXAMPLE USAGE: “Act as a full-stack developer. Generate a basic e-commerce web app template with React frontend, Node.js backend, and MongoDB for product storage.”
Database

Create a SQL Query for Data Analysis

Generate optimized SQL queries with indexing and joins

Act as a SQL expert. Write an optimized SQL query to retrieve [specific data] from a database with indexing and joins.
EXAMPLE USAGE: “Act as a SQL expert. Write a query to find the top 5 best-selling products from an orders table in a MySQL database.”
Web Dev

Generate a REST API with Express.js

Create Express.js APIs with CRUD operations and authentication

Act as a backend developer. Create a REST API using Express.js with CRUD operations, authentication, and database integration.
EXAMPLE USAGE: “Act as a backend developer. Generate a REST API for managing employee records using Node.js, Express, and MongoDB.”
AI/ML

Generate a Machine Learning Model in Python

Create Python scripts for ML models with preprocessing and evaluation

Act as a machine learning engineer. Create a Python script to train an ML model using [dataset], with preprocessing and performance evaluation.
EXAMPLE USAGE: “Act as a machine learning engineer. Generate a Python script to predict house prices using scikit-learn and a dataset with square footage, location, and number of bedrooms.”
Web Dev

Generate a Dynamic Form with JavaScript & HTML

Create interactive forms with dynamic fields and validation

Act as a JavaScript developer. Create a dynamic form that updates fields based on user input, validates data, and submits via AJAX.
EXAMPLE USAGE: “Act as a JavaScript developer. Generate a dynamic job application form where users can add multiple work experience sections dynamically.”
Web Dev

Generate a Secure User Authentication System in PHP

Build PHP auth systems with password hashing and sessions

Act as a PHP developer. Build a secure user authentication system in PHP with password hashing and session management.
EXAMPLE USAGE: “Act as a PHP developer. Write a secure login system with session-based authentication for a small business website.”
Python

Generate a Simple Game with Pygame (Python)

Create Python games with Pygame including movement and collision

Act as a game developer. Write a Python game using Pygame with basic player movement, collision detection, and score tracking.
EXAMPLE USAGE: “Act as a game developer. Generate a simple Flappy Bird clone using Pygame with increasing difficulty levels.”
Web Dev

Generate a React Component for a To-Do List

Create React to-do components with state management and local storage

Act as a React developer. Write a React component for a to-do list with state management, local storage, and filtering options.
EXAMPLE USAGE: “Act as a React developer. Create a to-do list component where users can add, delete, and mark tasks as completed.”
Web Dev

Generate a Java Spring Boot Microservice

Create Spring Boot microservices with JWT auth and database integration

Act as a Java backend developer. Generate a Spring Boot microservice for handling authentication and exposing REST endpoints.
EXAMPLE USAGE: “Act as a Java backend developer. Generate a Spring Boot microservice for user authentication with JWT and MySQL integration.”
Python

Generate a Web Scraper in Python with BeautifulSoup

Create Python web scrapers to extract and save structured data

Act as a data analyst. Write a Python web scraper using BeautifulSoup to extract data from [website] and save in CSV format.
EXAMPLE USAGE: “Act as a data analyst. Write a Python web scraper to extract job listings from LinkedIn and save them in a structured CSV file.”
Scripting

Generate a Linux Shell Script for Automation

Create Bash scripts with error handling and logging

Act as a Linux administrator. Write a Bash script to automate [specific task], ensuring error handling and logging.
EXAMPLE USAGE: “Act as a Linux administrator. Generate a shell script to back up MySQL databases daily and store them in an AWS S3 bucket.”
AI/ML

Generate a Chatbot Using OpenAI API

Create Python chatbots with OpenAI API for multiple conversation flows

Act as an AI developer. Create a chatbot using OpenAI API to handle queries and support multiple conversation flows.
EXAMPLE USAGE: “Act as an AI developer. Generate a Python chatbot that answers common customer support questions using OpenAI’s API.”
Web Dev

Generate a CSS Animation for a Loading Spinner

Create pure CSS loading animations with smooth transitions

Act as a front-end developer. Write pure CSS code for a smooth loading spinner with circular animation and color transitions.
EXAMPLE USAGE: “Act as a front-end developer. Generate a CSS-only animated loading spinner for a web app.”
Web Dev

Generate a Blockchain Smart Contract in Solidity

Create Solidity smart contracts with secure transaction handling

Act as a blockchain developer. Write a Solidity smart contract for [use case], including secure transaction handling and token implementation.
EXAMPLE USAGE: “Act as a blockchain developer. Generate a Solidity smart contract for a decentralized voting system with Ethereum integration.”
Prompt copied to clipboard!