Coding prompt library

AI Coding Prompts Library

Ready-made coding prompts to copy and adapt, with the required inputs, the expected outputs, the suitable tool and a practical example. Replace what is between the curly braces with your project's details.

52 results

Create an add-on with a UI panel and an Operator.

Blender promptsIntermediate
View the prompt
Create a Blender add-on for version {{stack}} named {{project}}.
Its job: {{extra}}
- A correct bl_info, and an Operator with bl_options = {'REGISTER', 'UNDO'}.
- A panel in the sidebar (N panel) with adjustable properties.
- Clean register and unregister functions.
- Handle the case where no object is selected with a clear message.
- Installation and testing steps.
Details

Generate a 3D scene in code with materials, lighting and a camera.

Blender promptsBeginner
View the prompt
Write a bpy script that generates a scene: {{project}}.
- Clear the default scene safely.
- Create the objects from parameters, Principled BSDF materials, three-point lighting and a framed camera.
- Put all values in a settings dictionary at the top of the script.
- Render settings: {{stack}}.
{{extra}}
Details

Export several objects to glTF with naming and cleanup.

Blender promptsIntermediate
View the prompt
Write a Blender script that exports every object in the collection {{extra}} of {{project}} to a separate glTF file.
- Apply the transforms, set the origin, and remove unused materials before exporting.
- Safe file names, and a report of the number of exported objects and the errors.
- Runnable from the command line: blender -b file.blend -P script.py.
Details

Review a pull request's changes for correctness, security, performance and tests.

Code review promptsIntermediate
View the prompt
Review the changes in the current branch compared with {{extra}} in {{project}}.
Rank the comments by severity:
- Logic errors and missing edge cases.
- Security problems (injection, permissions, secrets, output escaping).
- Performance (N+1 queries, expensive loops).
- Missing or weak tests.
- Readability (suggestions only, do not overdo them).
For each comment: the file and line, the problem, why it matters and a suggested fix. Do not mention style issues that the formatter handles.
Details

Look for vulnerabilities introduced by the new changes only.

Code review promptsAdvanced
View the prompt
You are a security reviewer. Check only the new changes in {{project}} ({{stack}}).
Focus on the OWASP Top 10: injection, authentication, access control, data exposure, SSRF and insecure deserialisation.
For each possible vulnerability: the evidence from the code, the confidence level, an exploitation scenario and the fix.
Separate "confirmed vulnerability" from "needs verification". {{extra}}
Details

Audit generated code before accepting it: wrong assumptions, hallucinated libraries and superficial tests.

Code review promptsIntermediate
View the prompt
This is code generated by an AI agent in {{project}}. Review it with scepticism:
- Does every library and function used actually exist in the installed version? Check the dependency file.
- Do the tests really test the behaviour, or do they always pass (assert True, mocks for everything)?
- Did the code silently ignore errors (except: pass) or disable checks?
- Did it change files outside the requested scope?
- Does it match the project's existing patterns?
Give me a verdict: accept / accept with changes / reject, with the reasons. {{extra}}
Details

Design tables, relations and indexes for an application's requirements.

Database promptsIntermediate
View the prompt
Design a {{stack}} database schema for the {{project}} application.
Functional requirements: {{extra}}
- Entities and relations with a text ER diagram (Mermaid).
- Precise column types, NOT NULL, UNIQUE and CHECK constraints, and foreign keys with a delete policy.
- Indexes for the expected queries, with a justification for each index.
- A runnable migration file and test seed data clearly marked as test data.
- Notes on normalisation and when breaking it is acceptable.
Details

Analyse the execution plan and suggest indexes or a rewrite.

Database promptsAdvanced
View the prompt
This is a slow query on {{stack}}:
{{extra}}
The EXPLAIN (ANALYZE) output is attached.
- Explain the execution plan and where the time is spent.
- Propose indexes or a rewrite, with their impact on writes and storage.
- Give me before/after verification commands. Do not make any change on a production database.
Details

Plan a schema change on a large table without stopping the service.

Database promptsAdvanced
View the prompt
I need the following schema change in {{project}} ({{stack}}): {{extra}}.
Write a zero-downtime migration plan (expand/contract):
1. The steps in order, with the code for each step.
2. Compatibility with the old version of the app during the transition.
3. Backfilling the data in batches, with the ability to resume.
4. A rollback plan for each step, and checkpoints.
Do not run anything on production; give me only the plan and the scripts.
Details

Analyse a stack trace and reproduce the error before fixing it.

Debugging promptsBeginner
View the prompt
This is an error from {{project}} ({{stack}}):
{{extra}}
Follow this order:
1. Summarise what the error says and where it happens.
2. List hypotheses ranked by likelihood, with the evidence for each.
3. Write a test that reproduces the error and fails.
4. Fix the root cause, not the symptom, then run the test and the neighbouring tests.
5. Explain why the fix prevents the error from recurring.
Details

A plan for diagnosing concurrency, timing and rare-case errors.

Debugging promptsAdvanced
View the prompt
In {{project}} there is an error that only appears sometimes: {{extra}}.
- List the common causes of this pattern (concurrency, event ordering, caches, timing, rare data).
- Propose precise temporary logging to collect evidence without leaking sensitive data.
- Write a script that repeats the scenario hundreds of times or under load.
- After collecting the evidence: identify the cause, then the fix, with a test that covers it.
Details

Explain an inherited code module and map its flow before touching it.

Debugging promptsIntermediate
View the prompt
Read the module {{extra}} in {{project}} and do not change anything.
Write:
1. The overall purpose in one paragraph.
2. The main execution flow and a Mermaid sequence diagram.
3. Entry points, external dependencies and side effects (files, network, database).
4. Risky or unclear areas, and questions that need an answer from the team.
5. Suggested characterization tests that pin down the current behaviour.
Details

Analyse a CI failure log and fix it without disabling tests.

Debugging promptsIntermediate
View the prompt
This is a CI failure log from {{project}}:
{{extra}}
- Identify the failing step and the cause.
- Separate code failures from environment failures (versions, cache, secrets).
- Reproduce it locally if possible, then fix it.
- Not allowed: disabling or skipping the test, or adding a retry to hide the problem.
Details

Write a PyTorch training and evaluation loop with checkpoints and seeds.

Deep learning promptsIntermediate
View the prompt
Write a PyTorch training loop for the {{project}} project.
- The model and data: {{extra}}.
- Fix the seeds, and detect the device (CUDA/MPS/CPU) automatically.
- Optional mixed precision (AMP), gradient clipping and a learning-rate scheduler.
- Save the best checkpoint by the validation metric, with early stopping.
- Clear logs for each epoch (loss, metric), saved as CSV.
- Keep the settings separate in a YAML file or a dataclass.
Test the loop on a small batch (overfit one batch) before full training and show me the result.
Details

Trace the causes of an exploding or flat loss in a deep learning model.

Deep learning promptsIntermediate
View the prompt
Training in {{project}} shows: {{extra}}.
Follow a methodical diagnostic checklist:
1. Check the data: NaN/Inf values, normalisation, and matching shapes and labels.
2. Test overfitting on a single batch.
3. Check the learning rate, the initialisation, and the loss function against the model output (logits or probabilities).
4. Monitor the gradient norms for each layer.
5. With AMP: check GradScaler and unstable operations.
Run each check and show its result before moving to the next, then propose the fix.
Details

Adapt a pretrained model to classify medical images, with a patient-level split.

Deep learning promptsAdvanced
View the prompt
The task: classifying medical images in {{project}} with {{stack}}.
- Split the data at the patient level, not the image level.
- Medically appropriate data augmentation (no horizontal flip if it changes the anatomical meaning).
- Two stages: freeze the backbone, then fine-tune with a smaller learning rate.
- Metrics: sensitivity, specificity and AUC with bootstrap confidence intervals, and the confusion matrix.
- Grad-CAM for correct and wrong samples, with a note that it is not clinical evidence.
{{extra}}
Details

Create an accurate README based on the project's actual files.

Documentation promptsBeginner
View the prompt
Read the {{project}} project and write README.md:
- A short description, the features, and the requirements with their versions from the dependency files.
- Installation and running on Windows, macOS and Linux.
- Settings and environment variables (names only, without secret values).
- Real usage examples from the code, how to run the tests, and the licence.
Do not mention a feature that does not exist in the code. Language: {{extra}}.
Details

Extract an OpenAPI specification from the server routes and write examples.

Documentation promptsIntermediate
View the prompt
Extract an OpenAPI 3.1 specification for the {{project}} API ({{stack}}) from the route code.
- For each route: the description, parameters, request body, responses and status codes, and authentication.
- Realistic request and response examples inferred from the code.
- Validate the file with a validator and show me the result.
{{extra}}
Details

Write docstrings and comments that explain "why", not "what".

Documentation promptsBeginner
View the prompt
Add documentation to the public functions in {{extra}} of {{project}} in the {{stack}} style.
- Describe the purpose, parameters, return value, exceptions and a short example.
- Inline comments only where the reason is not obvious.
- Do not change any executable line.
Details

Build a single-feature screen with state, loading, errors and widget tests.

Flutter promptsIntermediate
View the prompt
You are an expert Flutter developer. The app: {{project}}, state management: {{stack}}.
Build a "{{extra}}" screen that includes:
- States: loading, data, empty, and error with a retry button.
- RTL and Arabic support through Localizations, and a responsive layout for phones and tablets.
- Separation of the UI from the data logic (Repository).
- A widget test for each state, and a unit test for the Repository with a mock.
Run flutter analyze and flutter test and show me the actual output.
Details

Add a local storage layer that works offline and then syncs with the server.

Flutter promptsAdvanced
View the prompt
In the {{project}} app ({{stack}}), add offline support:
1. Propose a local storage option (such as drift, Isar or Hive) with a short comparison, and wait for my choice.
2. Implement a queue of pending operations that is sent when the connection returns.
3. Define the conflict resolution policy (last write wins, or merge) and explain it.
4. Tests for these scenarios: adding offline, the connection returning, and a conflict.
{{extra}}
Details

Diagnose and fix layout overflow errors while keeping the design.

Flutter promptsBeginner
View the prompt
This is a Flutter error from the {{project}} app:
{{extra}}
- Explain the root cause in clear language, based on the error message and the widget tree.
- Propose a fix that does not hide the problem (do not wrap everything in SingleChildScrollView without a reason).
- Make sure the fix works with long Arabic text and with the larger font size from the accessibility settings.
- Add a widget test that reproduces the case at a screen width of 320px.
Details

Build a preprocessing, training and evaluation pipeline with scikit-learn that prevents data leakage.

Machine learning promptsIntermediate
View the prompt
You are a methodologically rigorous data scientist. The data: {{project}}. The goal: {{extra}}.
1. Inspect the data: types, missing values, class balance and duplicates.
2. Split the data before any processing (train/validation/test), with stratify when needed and a fixed seed.
3. Put all preprocessing inside a Pipeline to prevent data leakage.
4. A simple baseline (DummyClassifier/LogisticRegression), then two stronger models.
5. Evaluation with metrics that suit the problem (F1, ROC-AUC, PR-AUC for imbalanced data) with cross-validation.
6. Do not tune hyperparameters on the test set.
Show me only the actual computed results, and do not estimate numbers.
Details

Review an experiment's code to detect leakage and bias in the evaluation.

Machine learning promptsAdvanced
View the prompt
Review the experiment code in {{project}} for:
- Preprocessing (normalisation, encoding, feature selection, SMOTE) before the split.
- Features that carry information from the future or from the target variable.
- Duplicate samples between training and testing, or data from the same patient/user on both sides.
- Tuning hyperparameters or choosing the model on the test set.
- Misleading metrics for imbalanced data.
For each problem: its place in the code, its likely impact and the fix. {{extra}}
Details