Guides

Vibe coding & prompting: best practices

Vibe coding means describing what you want in plain language and letting AI write the code. It is fast and fun, and easy to get wrong. These habits make the difference between a demo that breaks and a tool you can trust.

1. Start with the problem, not the tool

The best projects solve a small, concrete annoyance you meet every week: a calculation you do by hand, a list you keep in a notebook, a handout you rewrite for every patient. Describe it in one sentence before you open any AI tool: "Residents spend ten minutes per shift looking up phone numbers that are spread over three systems."

Ask yourself: who uses it, how often, and what happens if it is wrong? If the answer to the last question is "a patient could be harmed", read the medical device section first.

2. Write a short spec

Half a page is enough. AI tools build much better software from a clear description than from a one-line request.

  • Users: who will use it, on which device, in which situation (a phone on a night shift is different from a desktop in clinic).
  • Inputs and outputs: what goes in, what comes out, with units.
  • Must-haves: the three to five things version 1 has to do. Everything else goes on a "later" list.
  • Constraints: no patient data, works offline, Dutch language, accessible, no login, and so on.
  • Done means: how you will know it works, for example ten worked examples with known answers.

3. Prompting that works

  • Give context, a goal, constraints and an output format. "You are helping a cardiologist build a simple web app. Goal: … Constraints: … Reply with a plan first, no code yet."
  • Ask for a plan before code. Review the plan, correct it, then ask it to build step 1.
  • Let the AI ask questions. End with: "Before you start, ask me up to five questions about anything that is unclear."
  • Be specific. "Make it nicer" gives random results. "Make the buttons at least 44 pixels high so they work with gloves on" gives exactly what you need.
  • Show examples. Paste an example input and the exact output you expect.
  • Keep the AI honest. Ask it to list its assumptions and to say when it is unsure. Never accept clinical facts, dosages or guideline values from an AI without checking the source.
  • Pick a simple stack. Ask for the simplest technology that solves the problem, such as a single HTML page, before reaching for frameworks, databases and logins.

4. Work in small steps

  • Build one feature at a time. Run it and test it before asking for the next.
  • Use version control (Git) and commit after every step that works. When the AI breaks something, and it will, you can go back in seconds.
  • Ask for small, focused changes: "Only change the validation of the weight field; don't touch anything else."
  • Read the summary of what changed. If the AI rewrote half your app to fix one button, undo and ask again more narrowly.

5. Test the clinical logic yourself

AI-written code often looks right and is subtly wrong: a unit mix-up, an off-by-one threshold, a "greater than" that should be "greater than or equal to". You are the domain expert, so you are the tester.

  • Collect worked examples with known answers from the guideline, a textbook or a validated tool, and check every one.
  • Test the edges: exactly on the threshold, zero, empty fields, extreme values, wrong units (kg versus g, mmol/L versus mg/dL).
  • Ask the AI to write automated tests from your examples, then check that the tests really test what you expect.
  • Show the source: display the guideline name and version next to any score or advice.
  • Have a colleague try to break it before anyone relies on it.

6. Understand what you ship

  • Ask the AI to explain each file in plain language, and to add short comments where the logic is not obvious.
  • Keep a README: what the tool does, how to run it, where the data lives and who to contact.
  • If you can't explain how the important part works, it isn't ready for others to use.

7. When you get stuck

  • Paste the exact error message and describe what you expected and what happened instead.
  • If the AI goes round in circles, stop. Start a new conversation with a short summary of the goal, the current code and what you have already tried.
  • Ask it to add logging or print statements to find out what is really going on, instead of guessing at fixes.
  • Roll back to your last working commit rather than piling fixes on top of a broken state.

8. Security basics

  • No secrets in code or in the browser; use environment variables on the server.
  • Validate all input on the server, and escape anything you show back to users.
  • Use HTTPS everywhere and keep dependencies up to date.
  • Ask: "Review this code for security problems as if you were a penetration tester." Then fix what it finds.
  • Follow the privacy guide for anything that touches personal data.

9. When to call in a developer

Vibe coding is great for prototypes, personal tools and teaching material. Bring in professional developers and your IT department when:

  • the tool will process real patient data or connect to the health record;
  • clinical decisions will depend on it;
  • other people will rely on it every day, or it needs to keep working after you leave;
  • you need user accounts, payments or integrations with hospital systems.

Your prototype and spec are then a very valuable starting point: they show exactly what clinicians need.

10. CE marking and the EU AI Act

Two EU regulations decide whether your tool may be used in patient care: the Medical Device Regulation (MDR), which requires CE marking, and the EU AI Act. They answer different questions. The MDR asks what is the software for? The AI Act asks does the software itself contain AI?

When does your tool need CE marking (MDR)?

Software is a medical device when its intended purpose is medical for individual patients: diagnosis, prevention, monitoring, prediction, prognosis, treatment or alleviation of disease. The intended purpose follows from what you say the tool does, on the screen, in a README or on a website, not only from the code. The MDR has applied since 26 May 2021.

  • Usually a medical device: dose and drug calculators, risk scores used for a treatment decision, triage tools, ECG or image interpretation, apps that monitor patients or give patient-specific advice.
  • Usually not a medical device: rosters, phone lists, logistics and capacity planning, teaching and exam apps, literature search, administrative tools, and general information that isn't about one specific patient.
  • Class matters. Under MDR Rule 11, software that provides information for diagnostic or therapeutic decisions is at least class IIa (IIb or III if a wrong decision could seriously harm the patient). Class IIa and higher need assessment by a notified body before CE marking, which takes months and requires a quality management system.
  • In-house exception. Under MDR Article 5(5), a health institution may make and use its own device without CE marking under strict conditions, including documentation, a quality system and a justification that no equivalent CE-marked product exists. That is a decision for your hospital, not for an individual doctor.

Until your tool has a CE mark or an approved in-house route, keep it out of decisions about real patients, and label it: "For education and demonstration only. Not for clinical decisions."

When does the EU AI Act apply?

The AI Act (Regulation (EU) 2024/1689) applies to AI systems: software that itself uses a model to generate output, such as an app that sends text to a language model to summarise, classify or advise. It does not apply to an ordinary app just because you wrote it with AI help. A calculator you vibe coded with Claude or Cursor is not an AI system; a chatbot that answers questions using an AI model is.

If your tool is an AI system, you are its provider when you develop it and put it into use under your name; the hospital or colleague who uses it is the deployer. The obligations depend on the risk:

  • High-risk: AI that is a medical device (or a safety component of one) needing a notified body under the MDR, and AI for emergency patient triage, among others. Requirements include risk management, data governance, technical documentation, logging, human oversight, accuracy and cybersecurity, on top of the MDR.
  • Transparency: chatbots must tell people they are talking to an AI, and AI-generated content must be marked as such.
  • Minimal risk: most other AI tools. No specific obligations beyond AI literacy, but the privacy and security habits in these guides still apply.

AI Act: from when does it apply?

The AI Act entered into force on 1 August 2024 and applies in phases. In 2026 the "Digital Omnibus" (Regulation (EU) 2026/1744, in force since 27 July 2026) postponed the high-risk deadlines.

FromWhat applies
2 February 2025Bans on prohibited AI practices, and the duty for organisations to support AI literacy of their staff.
2 August 2025Rules for general-purpose AI models. These apply to model makers such as OpenAI, Anthropic and Google, not to you as a builder.
2 August 2026Transparency obligations, such as telling users they are talking to a chatbot. Generative AI systems already on the market before that date have until 2 December 2026 to mark AI-generated content.
2 December 2027Standalone high-risk AI (Annex III), such as emergency patient triage. Originally 2 August 2026.
2 August 2028High-risk AI in medical devices (Article 6(1) and Annex I): AI that is a medical device, or part of one, that needs a notified body under the MDR or IVDR. Originally 2 August 2027.

The later AI Act dates don't make anything allowed now that wasn't before: the MDR applies today. An AI-powered tool that makes patient-specific clinical suggestions needs CE marking now, and from 2 August 2028 it also has to meet the AI Act's high-risk requirements.

Quick check

  1. Does the tool give information about an individual patient for diagnosis, treatment or monitoring? Then it is probably a medical device. No use on real patients without CE marking or an approved in-house route.
  2. Does the tool itself call an AI model? Then the AI Act applies: at least transparency (tell users it's AI), and high-risk rules if it is also a medical device.
  3. Neither? Then you are building a regular tool. Follow the privacy guide and the habits above.

This is general information, not legal or regulatory advice. Dates as of November 2026. Ask your hospital's medical technology or quality department, or a regulatory specialist, before a tool is used in care.

11. Prompt templates

Start a project

I am a [specialty] doctor. I want to build [one sentence].
Users: [who, on which device, in which situation].
Must-haves: [3–5 bullet points].
Constraints: no patient data (use clearly fake demo data),
the simplest possible technology, works on a phone.
First ask me up to five questions. Then propose a plan
in small steps. Don't write code until I approve the plan.

Make a focused change

Only change [specific part]. Keep everything else as it is.
Explain what you changed and why, and tell me how to test it.

Check the clinical logic

Here are 10 worked examples with the correct answers: [examples].
Write automated tests for them and run them. For each failing
test, explain the cause before you change any code.

Security and privacy review

Review this project as a security and privacy expert.
Look for secrets in the code, missing input validation, data sent
to third parties, and anything that could expose personal data.
List the problems by severity and suggest fixes.