🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 8 Min Lesezeit
0

AI does exactly what you ask — that's the problem

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

I asked Claude to add pagination to a product list. Response in 30 seconds: clean, functional, complete. And completely disconnected from the rest of the app. Wrong pagination component (we already had one), invented styles, existing filters broken. Technically correct. Unusable as-is.



The problem wasn't the AI — it was my prompt. I wrote: "Add pagination to this list." That's exactly what it did. Nothing more, nothing less.



Current models (Claude 4.x, GPT-4o) have dropped the "infer intent" behavior. They take prompts literally. That's progress overall, but it fundamentally changes how you need to prompt for code. A good code prompt isn't about tricks — it's about giving the AI the same context you'd give a junior dev joining the project.



I tested and scored dozens of formulations across the four most common coding tasks. Here's what actually works.






The structure that applies to everything



Before getting into specific cases, there are four elements present in every good code prompt:




  1. Stack/context — language, version, framework, relevant files

  2. Precise task — what you want, phrased as an instruction, not a question

  3. Constraints — what NOT to touch, scope limits

  4. Expected output — diff, full code, explanation only, CVSS score…



Anthropic's golden rule sums it up: show your prompt to a colleague with no context. If they'd be confused, the AI will be too.



For larger prompts (multiple files, complex instructions), XML tags help separate sections. Tests show 30–39% improvement in response quality when prompts are structured with clear tags:




CODE

<context>PHP 8.1, Laravel 10, multi-tenant app</context>
<task>Add pagination to ProductList</task>
<constraints>Do not touch getFilteredProducts()</constraints>
<code>[paste files here]</code>






Second rule: code first, question last. Placing context and files at the top with the instruction at the bottom improves precision by ~30% on large contexts. The AI reads everything before acting.






Bug fix — describe the symptom, not the theory



The classic mistake: paste code and ask "this doesn't work." The AI doesn't know if it's crashing, returning a wrong value, or just too slow. It will invent a plausible problem and "fix" it.






❌ Vague prompt — score: 3/10






CODE

This code doesn't work, help me.

function getUserById($id) {
$result = $db->query("SELECT * FROM users WHERE id = $id");
return $result->fetch();
}






Typical result: the AI fixes the SQL injection (fair, real issue), ignores the actual error, and rewrites with PDO prepared statements. Technically sound, but not what you needed.






✅ Precise prompt — score: 9/10






CODE

Stack: PHP 8.1 + PDO, Laravel 10.

Current behavior:
Call to a member function fetch() on bool
→ only when the ID doesn't exist in the table

Expected behavior:
Return null if user doesn't exist (no exception thrown)

Already tried:
isset($result) before fetch() — same error

Code:
function getUserById($id) {
$result = $db->query("SELECT * FROM users WHERE id = $id");
return $result->fetch();
}






The "already tried" line is critical. Without it, the AI will re-suggest exactly what you already attempted. With it, it looks elsewhere — and finds that PDO::query() returns false on failure, so the fix is $result !== false ? $result->fetch() : null.



Bug fix template:




CODE

Stack: [language + version + framework]
Current behavior: [exact symptom — error message, wrong return value, observed behavior]
Expected behavior: [what the code should do]
Already tried: [previous attempts and why they didn't work]
Code: [minimal code that reproduces the bug]









New feature — acceptance criteria and out-of-scope



"Add a comment system." The AI will choose a stack (database, probably), a UI (modals, inline, dedicated page?), validation (client-side, server-side?). Each of those choices may be incompatible with your project.






❌ Without integration context — score: 3/10






CODE

Add a comment system to this blog.






Likely result: MySQL solution, jQuery form, a design that matches nothing in the existing project.






✅ With context, criteria, and out-of-scope — score: 9/10






CODE

Stack: PHP 8 + Bootstrap 3, no database (JSON file storage).

Task: Add comments to blog articles.

Acceptance criteria:
- Form: name + message (no email, no account required)
- Server-side validation only (no JS)
- Storage: one JSON file per article at /blog/comments/{slug}.json
- Email notification to author on each new comment (PHPMailer already installed)

Out of scope:
- No moderation for now
- No nested replies
- No changes to existing CSS

Files involved: [blog_footer.php, template.php]






The out-of-scope section is the key difference. Telling the AI what not to implement is just as important as what to build. Without it, the AI will either over-engineer (moderation, auth, nested threads) or invent constraints that don't exist.



New feature template:




CODE

Stack: [technical context]
Integration context: [what it must integrate with — existing components, project patterns]
Task: [precise feature description]
Acceptance criteria: [list of expected behaviors]
Out of scope: [what we do NOT want implemented now]
Files involved: [files to modify or create]









Refactoring — define the problem, not the solution



"Refactor this code" is the worst possible refactoring prompt. The AI will choose its own quality criteria, likely change method signatures, add unsolicited abstractions, and break the existing public API.






❌ Without goal or constraints — score: 2/10






CODE

Refactor this code to make it cleaner.

[450 lines of OrderService]






Typical result: 8 extracted private methods, renames, interfaces added, an abstract class "for future flexibility." It compiles. Tests break.






✅ Concrete problem + goal + constraints — score: 9/10






CODE

Concrete problem:
OrderService::processOrder() (450 lines) is called from 8 places
with different parameter combinations.
Impossible to know which cases are covered by existing tests.

Goal:
Extract pricing rules into immutable Value Objects.
One class = one rule (e.g., DiscountRule, TaxRule, ShippingRule).

Hard constraints:
- Observable behavior unchanged — existing tests must pass without modification
- Do not modify public method signatures
- Do not change return types

Scope: pricing calculation only, not persistence or validation.

Code: [OrderService.php]






The key phrase: "observable behavior unchanged — existing tests must pass without modification." Without this constraint, the AI optimizes by its own criteria. With it, it stays on track.



Refactoring template:




CODE

Concrete problem: [why this code is problematic — not "it's messy", but the real impact]
Goal: [what we want after the refactoring]
Hard constraints:
- [what must not change: signatures, tests, observable behavior]
Scope: [what's IN and what's OUT]
Code: [the code to refactor]









Code review — choose your angle



Without a focus, the AI runs a generic style review. It will flag missing docstrings, suggest more descriptive variable names, and miss the SQL injection sitting at the bottom of the file. AI code review only pays off if you tell it where to focus.






❌ Generic review — score: 4/10






CODE

Review this code as a senior dev and give me improvement suggestions.






Typical result: 80% style suggestions, naming, comments. 20% real issues — buried in noise.






✅ Targeted angle + intentional decisions — score: 9/10






CODE

Context:
Public endpoint POST /api/documents/upload
Unfiltered incoming data, filesystem access, JWT auth verified upstream.

Review focus: security only
- Injection (command, SQL, path)
- Path traversal
- Malicious file uploads (server-side execution)
- IDOR

Intentional decisions — do not flag:
- The (int) cast on ID is deliberate
- Minimal error handling is intentional (internal app, centralized logs)
- Variable name $tmp follows team convention

Output format:
For each issue: severity (critical/high/medium) + description + fix with code.

Code: [upload-handler.php]






The "intentional decisions" section cuts noise in half. The AI doesn't flag what you already know about — it focuses on what you asked for.



Code review template:




CODE

Context: [endpoint type, who calls it, input data, auth in place]
Focus: [security / performance / business logic / architecture — one angle at a time]
Intentional decisions (do not flag): [deliberate choices in the code]
Output format: [severity + description + fix with code / simple list / …]
Code: [the code to review]









Two cross-cutting techniques that change everything






1. Two passes beat one



For complex tasks (large refactors, deep reviews), separating critique from implementation consistently outperforms asking for everything at once:



Pass 1: "What's wrong with this code? List the problems without fixing anything."


Pass 2: "Now fix problems 1, 2, and 4 you identified. Skip 3."



The separation forces the AI to analyze before acting. Second-pass results are significantly more precise.






2. "Suggest" vs "Change" — it matters now



With Claude 4.x, this distinction became literal:




  • Can you suggest some changes? → AI lists suggestions, touches nothing

  • Change this function to improve its performance. → AI modifies



If you want the AI to act: use action verbs. "Modify", "Fix", "Extract", "Rename". Not "Could you maybe look at whether...".






Summary: the 4 templates



Task



Essential elements



Most common mistake



Bug fix



Exact symptom + expected behavior + "already tried"



Forgetting previous attempts



New feature



Integration context + criteria + out-of-scope



Not defining out-of-scope



Refactoring



Concrete problem + goal + behavioral constraints



No "tests must pass" constraint



Code review



Targeted angle + intentional decisions + output format



Generic review without focus






Conclusion



The real value of these templates isn't about the AI — it's about you. Writing "current behavior vs expected behavior" forces you to precisely characterize the bug. Writing out-of-scope forces you to decide what isn't a priority. Writing refactoring constraints forces you to define what must not move.



Multiple times, while drafting a structured prompt, I realized the task itself was poorly defined from the start. The AI didn't need to run — the prompt had already done the work.



AI doesn't solve the problem for you. It solves the problem you described. You might as well make that description accurate.



📄 Associated CLAUDE.md



Catalogue

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 37%
🟡 In Evaluierung 30%
🟢 Keine Auswirkung 16%
Spannende Innovation 17%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten AI does exactly what you ask — that's the problem

Thematisch verwandte Begriffe: does, exactly, what, thats · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...