💡 How to use these prompts:
Replace everything in [BRACKETS] with your specific details before sending.
Click Copy to copy any prompt to your clipboard instantly.
[USE IN GROK BUILD OR CURSOR WITH GROK 4.5]
Complete the following terminal-based task. Work through it step by step, running commands and fixing errors as they appear.
Task: [DESCRIBE WHAT YOU NEED TO ACCOMPLISH]
OS: [LINUX / MAC / WINDOWS]
Working directory: [PATH OR DESCRIPTION]
Constraints: [ANYTHING TO AVOID — e.g. do not install global packages, keep under X MB]
Run each command, capture the output, and proceed. If an error occurs, diagnose and fix it before continuing. At the end, confirm the task is complete with a verification command.
Write a complete API integration for the following. Include error handling, retry logic, and a test function.
API: [NAME AND ENDPOINT]
Auth method: [API KEY / OAUTH / BEARER TOKEN]
What I need to do: [DESCRIBE THE OPERATION — fetch data, post, stream, etc.]
Language: [PYTHON / NODE / OTHER]
Response handling: [WHAT TO DO WITH THE API RESPONSE]
Error cases to handle: [RATE LIMITS / AUTH ERRORS / NETWORK FAILURES]
Write the complete integration code and a test function I can run immediately to verify it works.
[GROK 4.5 uses fewer output tokens than other frontier models — ideal for this task]
Refactor the following code for performance. Be direct — no explanation unless I ask, just the improved code.
Performance target: [WHAT TO OPTIMISE FOR — speed / memory / token efficiency / database queries / API calls]
Language/stack: [DESCRIBE]
Current bottleneck (if known): [WHERE YOU THINK IT IS SLOW]
Code to refactor: [PASTE CODE]
Output the refactored code only. Add inline comments only where the change is non-obvious.
[USE ON GROK — combines coding with live X data]
I have a bug related to [LIBRARY / FRAMEWORK / API]. Before debugging my code, search X for:
1. Any recent known issues or breaking changes with [LIBRARY/FRAMEWORK] in the last 30 days
2. Any relevant GitHub issue discussions or maintainer posts
Then debug my code with that current context in mind.
My code: [PASTE CODE]
Error: [PASTE ERROR MESSAGE OR DESCRIBE BEHAVIOUR]
Expected behaviour: [WHAT IT SHOULD DO]
Write a complete command-line tool in [PYTHON / NODE / GO / RUST] with the following specification.
Tool name: [NAME]
What it does: [DESCRIBE IN PLAIN ENGLISH]
Commands: [LIST EACH COMMAND AND WHAT IT DOES]
Arguments and flags: [LIST WITH TYPES AND DEFAULTS]
Output format: [PLAIN TEXT / JSON / TABLE / FILE]
Error handling: [HOW TO HANDLE BAD INPUT / MISSING FILES / NETWORK ERRORS]
Include: help text, version flag, and a README section I can paste into a README.md. Write the complete, working code.
Review the following code. Be direct and specific. No filler, no praise unless earned.
Focus on:
1. Bugs or logic errors (highest priority)
2. Security vulnerabilities
3. Performance problems
4. Code that will be hard to maintain
5. Missing error handling
For each issue: line number (if applicable), what the problem is, and the fix. If the code is clean, say so in one sentence and stop.
Language: [LANGUAGE]
Context: [WHAT THIS CODE DOES / WHERE IT RUNS]
Code: [PASTE CODE]