New in Design Studio: Remove Background & Generate Background are live. Try them now →
Sign inTry Free

Technology prompts

Code, explained and fixed

Prompts to explain, debug, test and write code — and to query your data in plain English. Each card shows a sample of the output.

The prompts

Paste, run, fix

Showing 10 prompts

Explain.md
❯ Explain what this Python code does, step by step, for someone who knows the basics. Then point out any bugs or risky parts. [paste your code]
# Step 1: reads the CSV into a list of rows
# Step 2: groups rows by customer_id
# Risk: no check for empty files

Explain this codePopular

Run in Chat SmithRun
CustomizeClose

Why it works: Stating your level sets the depth of the explanation; the bug check is a free second review.

Explain.md
❯ Explain this error message in plain words, list the 3 most likely causes, and tell me what to check first. [paste the error]
CORS error: the browser blocked a request to another domain.
Check first: the API’s Access-Control-Allow-Origin header.

Explain an error message

Run in Chat SmithRun
CustomizeClose

Why it works: Ranking the likely causes tells you where to look first instead of guessing.

Debug.md
❯ I get this error: [paste the error message]. Here is the relevant code. Find the root cause, explain it and give me the fixed code. [paste your code]
Root cause: `user` is undefined before the fetch resolves.
Fix: return early until data loads.
if (!user) return null;

Debug an error

Run in Chat SmithRun
CustomizeClose

Why it works: Asking for the root cause avoids patches that hide the error without fixing it.

Debug.md
❯ Review this Node.js code like a senior engineer. List bugs, security issues and readability problems, most serious first, with a fix for each. [paste your code]
1. SQL injection: user input in query string → use parameters
2. Unhandled promise rejection in /login
3. Magic number 86400 → name it

Review my code for issuesPopular

Run in Chat SmithRun
CustomizeClose

Why it works: “Most serious first” keeps you from polishing names while a security hole stays open.

Build & test.md
❯ Write unit tests in Jest for the function below. Cover normal cases, edge cases and invalid input. [paste your function]
test('returns 0 for empty cart', () => {
  expect(total([])).toBe(0);
});

Write unit tests

Run in Chat SmithRun
CustomizeClose

Why it works: Naming the three kinds of cases gets you coverage that actually catches bugs.

Build & test.md
❯ Write a regular expression that matches Vietnamese phone numbers but not landline numbers. Explain each part of the pattern.
^(0|\+84)(3|5|7|8|9)\d{8}$
# 0 or +84, a mobile prefix, then 8 digits

Regex from examples

Run in Chat SmithRun
CustomizeClose

Why it works: Examples of what should and should not match are the fastest way to a correct pattern.

Build & test.md
❯ Refactor this JavaScript code for readability without changing what it does. Explain each change in one line. [paste your code]
- Renamed `d` → `daysUntilDue`
- Extracted `isOverdue()` helper
- Replaced nested ifs with early returns

Refactor for readability

Run in Chat SmithRun
CustomizeClose

Why it works: “Without changing what it does” keeps the refactor safe to merge.

Build & test.md
❯ Write a Python function that splits a full name into first and last name. Include input validation, a short docstring and 3 example calls.
def split_name(full: str) -> tuple[str, str]:
    """Split “Nguyen Van An” into first and last name."""

Write a function from a description

Run in Chat SmithRun
CustomizeClose

Why it works: Asking for validation and examples gets you code you can trust and try immediately.

Data.md
❯ Write a PostgreSQL query that finds the top 10 customers by revenue last month. Tables: [describe your tables]. Explain the query step by step.
SELECT customer_id, SUM(amount) AS revenue
FROM orders
WHERE created_at >= date_trunc('month', now()) - interval '1 month'
GROUP BY 1 ORDER BY 2 DESC LIMIT 10;

Write a SQL query

Run in Chat SmithRun
CustomizeClose

Why it works: Giving the table structure avoids queries that reference columns you do not have.

Data.md
❯ Here are sample rows from my spreadsheet. Suggest the steps to clean them (formats, duplicates, missing values) and write the Google Sheets formulas or code to do it. [paste 10 sample rows]
=TRIM(PROPER(A2))
=DATEVALUE(SUBSTITUTE(B2,".","/"))
Remove duplicates on column C (email)

Clean messy spreadsheet data

Run in Chat SmithRun
CustomizeClose

Why it works: Real sample rows let the model spot the exact mess — mixed date formats, stray spaces, duplicates.

Write your own

Give it the whole bug

The more of the real problem you paste, the less the AI has to guess.

01

Language

Name the language, framework and version.

02

Code or error

Paste the real thing — not a description of it.

03

Expected behavior

What should happen, and what happens instead.

04

Output

Fixed code, tests, or an explanation — say which.

Keep exploring

More prompts to try

Ready when you are

Ship it cleaner