Coding Prompt Generator
Generate AI prompts for code generation, debugging, refactoring, code review, and technical documentation.
What is a Coding Prompt?
Coding prompts are AI instructions that help you write, debug, refactor, and document code more efficiently. Whether you're working with Python, JavaScript, React, SQL, or any other language, well-structured coding prompts can dramatically speed up development and improve code quality.
How to use the Coding Prompt Generator
- Describe your goal. Type what you want the AI to produce, in plain language.
- Pick format, tone and Token Saver. Choose the output format and tone, and optionally a Token Saver level (Lite, Caveman or Ultra) so the AI answers in fewer tokens.
- Generate and copy. Verbito builds a structured, scored prompt. Copy it into ChatGPT, Claude, Gemini or any other AI model.
Best practices
- Specify the programming language and version clearly.
- Describe the problem or feature, not just the desired code.
- Include input/output examples with expected results.
- Mention performance constraints (time/space complexity requirements).
- Request error handling and edge case coverage.
- Ask for comments explaining complex logic.
- Specify coding standards or style guides to follow.
Tips
- Provide a code skeleton or template for the AI to fill in.
- Ask the AI to explain its solution before writing code.
- Request unit tests alongside the implementation.
- Use chain-of-thought prompting for complex algorithms.
- Ask for Big O complexity analysis.
- Request multiple implementation approaches with trade-offs.
Examples
API Endpoint
Write a RESTful API endpoint in Node.js/Express for user authentication with JWT tokens. Include registration, login, and password reset. Use bcrypt for password hashing, include input validation with Joi, and handle all error cases. Return proper HTTP status codes and JSON responses.
React Component
Create a React component for a responsive data table with sorting, filtering, and pagination. Use TypeScript, include proper prop types, handle loading and empty states, and make it accessible with ARIA labels. Use Tailwind CSS for styling.
SQL Query
Write an optimized SQL query to find the top 10 customers by total purchase amount in the last 90 days. Include customer name, email, total orders, total spent, and last purchase date. The query should handle the case where a customer has no email gracefully.
Code Review
Review the following Python function for potential bugs, security issues, and performance problems. Suggest improvements and explain the reasoning for each suggestion. Rate the code quality on a scale of 1-10.
Example generated prompts
JWT Auth API (Node.js/Express)
Goal: Write a RESTful API endpoint in Node.js/Express for user authentication with JWT tokens — registration, login, password reset with bcrypt and input validation (prompt score 94/100)
You are a senior Node.js backend engineer with expertise in security-first API design and REST conventions. Task: Implement a complete user authentication system using Express.js. Requirements: - Language: Node.js (v18+) with Express.js - Auth: JWT (access token 15min, refresh token 7d stored in httpOnly cookie) - Password hashing: bcrypt (salt rounds: 12) - Validation: Joi schemas for all inputs - Error handling: Centralized error middleware, no stack traces in production Endpoints to implement: 1. POST /auth/register — validate email uniqueness, hash password, return 201 + user object (no password) 2. POST /auth/login — verify credentials, issue tokens, return 200 + user + set cookie 3. POST /auth/refresh — validate refresh token from cookie, issue new access token 4. POST /auth/logout — clear cookie, blacklist refresh token 5. POST /auth/forgot-password — generate reset token (crypto.randomBytes), email link 6. POST /auth/reset-password/:token — validate token expiry (15min), update password For each endpoint include: route handler, middleware chain, input validation schema, HTTP status codes, and JSDoc comment. Database: Assume Prisma ORM with PostgreSQL. Include the Prisma schema for the User model.
React Data Table Component (TypeScript)
Goal: Create a reusable React data table with sorting, filtering, pagination in TypeScript with Tailwind CSS and full accessibility (prompt score 91/100)
You are a senior React engineer specializing in accessible, reusable component design with TypeScript and Tailwind CSS. Task: Build a fully-featured DataTable React component. Specifications: - TypeScript with strict mode enabled - Generic component: DataTable<T extends Record<string, unknown>> - Props: data, columns (with accessorKey, header, sortable, cell renderer), pageSize, onRowClick - Features: client-side sorting (multi-column with shift+click), debounced search/filter input, pagination with page size selector, loading skeleton state, empty state with custom message - Accessibility: ARIA roles (table, columnheader, rowgroup), sort direction announced to screen readers, keyboard navigation (Tab/Enter/Space), focus management after page change - Styling: Tailwind CSS only, no external UI library, dark mode via dark: prefix, responsive (horizontal scroll on mobile) Deliver: 1. Full component source (DataTable.tsx) 2. Column definition type (ColumnDef.ts) 3. useTableState custom hook (sorting, filtering, pagination logic) 4. Usage example with sample data 5. Unit test outline (Jest + React Testing Library) covering sort, filter, and page change
Code Review Prompt (Security Focus)
Goal: Review a Python Flask API endpoint for security vulnerabilities, SQL injection, and auth weaknesses — provide specific fixes (prompt score 89/100)
You are a senior application security engineer with expertise in Python, Flask, and OWASP Top 10 vulnerabilities. Task: Conduct a thorough security-focused code review of the provided Flask API endpoint. Review checklist (evaluate each explicitly): 1. SQL Injection: Are all queries parameterized? Any raw string formatting in queries? 2. Authentication: Is the auth middleware applied? Is the token validated on every protected route? 3. Authorization: Is object-level access control enforced (not just role check)? 4. Input validation: Are all inputs sanitized and type-checked before processing? 5. Error messages: Do errors leak stack traces, DB structure, or user data? 6. Rate limiting: Is the endpoint protected against brute force? 7. Logging: Are security events (failed auth, suspicious input) logged without logging PII? 8. Dependency risk: Flag any imported libraries with known CVEs Output format for each finding: - Severity: [Critical / High / Medium / Low / Info] - Location: [line number or function name] - Description: What the vulnerability is and how it can be exploited - Fix: Specific corrected code snippet End with: Overall security score (1–10) and top 3 priority fixes.
Frequently asked questions
- Can AI write production-ready code?
- AI can write solid, well-structured code, but it should always be reviewed, tested, and validated before production use. AI is excellent for scaffolding, boilerplate, and solving common patterns.
- Which AI model is best for coding?
- Claude, GPT-4o, and GitHub Copilot (powered by OpenAI Codex) are all excellent for coding tasks. Our generator optimizes prompts for the best results.
- Can I use generated code commercially?
- Yes, all generated code is yours to use. However, be aware that AI may occasionally produce code similar to training data, so review for any licensing concerns when using specific libraries or algorithms.