Prompt Library
Prompts I actually reach for — each one has a copy button, expected output, and the best practice behind it.
Explain an exact line, not "this code"
Get a focused explanation of one line instead of a generic walkthrough of the whole file.
I know basic Spring Boot but I have never used SecurityContextHolder before. In JWTAuthenticationFilter.java line 51: `if (userEmail != null && authentication == null)` — why do we check `authentication == null`? What happens if we remove it? One paragraph, no code.
Root-cause a bug without a rewrite
Force a diagnosis instead of a silent fix, so you understand the cause before touching the code.
I am a Spring Boot developer. In UserService.java line 32, I get a NullPointerException on `user.getEmail()`. What is the root cause? Do not rewrite the code.
Strict senior reviewer, no rewrites
Role-prompting to get harder, more honest feedback than a default assistant tone gives.
Act as a strict senior Spring Boot developer reviewing my code. Do not rewrite it. Only point out what is wrong and ask me how I would fix it.
Explain a SQL concept with exactly one example
Constrain the domain so the example is directly reusable, instead of getting five generic ones.
I know basic SQL but never used indexes. Explain a B-tree index with ONE banking example (account balance lookups). Short answer, no history.
The "I think" understanding check
Test your own understanding instead of passively reading another explanation.
I think we check `authentication == null` because the filter could otherwise run twice per request and overwrite a valid session. Is that correct? Just yes or no, then one sentence why.
Review every branch of a dynamic MyBatis query
Force branch-by-branch index analysis instead of judging only the branch you happen to test.
Here is a MyBatis mapper with `<if>` and `<choose>` blocks [paste XML]. Write out the actual SQL for each possible branch, and for each one tell me whether it can use an existing index on `users(status, created_at)`. Do not rewrite the mapper.
Check a payment endpoint for idempotency
Ask specifically about retry-safety, the failure mode that's easy to miss in a normal review.
I am reviewing a Spring Boot endpoint that an external system calls and retries on timeout: [paste controller method]. If the exact same request arrives twice, what happens? Explain the risk only, no rewritten code, 5 sentences max.
Iterative 4-step understanding builder
Break one big topic into four small prompts instead of one giant question.
Prompt 1: What does `jwtService.isTokenValid()` do at a high level? Prompt 2 (after reading the answer): Go deeper on how it checks expiry specifically. Prompt 3: I think it also checks the signature — is that correct? Prompt 4: Give me one real scenario where this method returns false unexpectedly.
Refactor review with a negative constraint
Tell the model what NOT to touch so a refactor suggestion doesn't balloon into a rewrite of unrelated code.
In PaymentService.java, the `process()` method is doing too much. Suggest how to split it into smaller methods. Do not touch the transaction annotation or the logging calls — explain only the split, no full file rewrite.
Check a new endpoint against existing API conventions
Catch inconsistency with your own codebase's conventions, which generic advice can't see.
Here are two existing endpoints from my API [paste both]. Here is a new endpoint I'm about to add [paste it]. Does the new one follow the same response-wrapper and error-handling pattern as the existing two? List only the inconsistencies.
Compare two libraries for my actual use case
Force a recommendation grounded in your project's constraints instead of a generic pros/cons list.
I need to map UserApp to UserDTO in a Spring Boot project with about 15 DTOs total, and the team is new to annotation processors. Compare MapStruct vs ModelMapper specifically for this — which one and why, one paragraph, no code.
Trace why a value is null through a filter chain
For bugs caused by a filter silently not running, ask the model to trace the chain instead of guessing at the symptom.
In my Spring Security setup, SecurityContextHolder.getContext().getAuthentication() is null on an endpoint that should be authenticated. Here is my AuthTokenFilter [paste it] and my SecurityFilterChain config [paste it]. Trace the possible reasons authentication would stay null — do not suggest a fix yet, just the possible causes.
Identify which normal form a table violates
Get a specific diagnosis (1NF/2NF/3NF, and which columns) instead of a generic "normalize your schema" suggestion.
Here is a table schema with sample rows: [paste schema + a few rows]. Which normal form does this violate first (1NF, 2NF, or 3NF), and which specific columns cause it? Do not redesign the schema yet — just the diagnosis.