11 min · Advanced
Habits for AI-Assisted Development
Use a professional routine even on small pages: plan first, run the file, paste real errors, keep secrets out, and save a working copy.
Learning objectives
- Ask for a plan before code, keep files small, and run the result before accepting more changes.
- Keep secrets out of chat and avoid claiming authorship you cannot explain when disclosure is required.
- Duplicate a working file before a large change, and use Gemini to explain a public document rather than a private key.
01
Why this matters
The risky moment is not the first prompt but the third, when a working file exists and a big rewrite looks faster than reading. A habit protects that file and protects other people's secrets. Developers use the same checks on a small page, and you can borrow the routine without borrowing a job title.
02
Concept
Describe the outcome before you ask for code. Then ask for a plan: files, steps, and what you will test. Demand small files you can open by double-clicking. Run the plan's first step and look at the real page. If it fails, paste the real error, not a story about the error. Write one sentence about what you understand before you accept the next slice.
Keep secrets out. A key, a password, a private customer list, and a payment credential do not belong in the prompt. If a school or employer requires disclosure — a statement that you used an assistant — do not claim you wrote code you cannot explain. The honest sentence is: I used Gemini, and here is the part I can explain. Check the current screen for the model name if you need to record which model you used.
Developers also use Gemini for tests, for comments, and for translating an error from a library — a package of code someone else wrote. Paste the error and the few lines involved, not the whole library. APIs stay conceptual here. You may paste a public API document and ask what a request returns. You do not drop a private key into the chat to try the live service. This course is independent of Google, so product buttons can change.
Version habit: before you accept a big change, keep the last working file. Duplicate it and name the copy index-working.html. Edit a different copy. If the new idea fails, you still have the file that opened. Do not rely on memory to undo a rewrite. A working copy is the safety net that lets you experiment without losing the page you already understand.
03
Real-world example
Explain a public note, not a private key
You find a public note for a made-up service called Harbor Weather. It says: send a city name to the sample endpoint. The sample returns a temperature in celsius for Oslo or Tunis only. No key is used. Any other city returns a short error, not a guess. You paste that paragraph and ask Gemini to explain the request, the two sample cities, and what the error means. You do not invent a key, and you do not ask it to call the service. A careful reply defines endpoint as the address of the request, lists Oslo and Tunis, and says other cities are errors. It refuses to add a secret. You write two sentences in your own words and keep the public note beside them. That is an API explanation without becoming an account holder.
04
Gemini demonstration
A realistic exchange. Open Gemini beside this page and try a version with your own facts.
You
I want to add a note to my quote page that explains a public weather example. Do not write the code yet. Give a short plan: what will change, what file I will edit, and what I will test. Public note only: Harbor Weather sample takes a city name and returns celsius for Oslo or Tunis. No key. Other cities return an error. Remind me what not to paste.
Gemini
Plan, with no code yet. Outcome: one short paragraph on the quote page that explains the public Harbor Weather sample in your own project's words, clearly marked as an example, not a live feature. File: duplicate the working page first and name the copy index-working.html. Edit the other copy only. Change: add a heading and a paragraph. Do not add a request to any service. Test: double-click the edited file, read the paragraph, and confirm the quote math still shows 100 for 2 hours at 50. Do not paste a key, a password, or a customer list. The public note needs no secret. If a later document mentions a key, stop and delete that idea from the plan.
You
I found a private key in my email that might unlock more cities. I will paste it so you can try the real service and then update the page.
Gemini
Do not paste that key. A private key from email is a secret, even if the goal is only to try a service. I will not use it, store it, or hide it in the page. The public note already says the sample works without a key and only for Oslo and Tunis. Other cities are supposed to return an error. Unlocking more cities would be a different product, and it would still not justify putting a secret in chat. Keep index-working.html untouched. If you already pasted a key in another chat, revoke it with the service that issued it. Then return to the plan: a labeled example paragraph, a local test of the quote math, and no network call.
05
Prompt breakdown
The prompt
I want to add a note to my quote page that explains a public weather example. Do not write the code yet. Give a short plan: what will change, what file I will edit, and what I will test. Public note only: Harbor Weather sample takes a city name and returns celsius for Oslo or Tunis. No key. Other cities return an error. Remind me what not to paste.
- It asks for a plan before code, so you can reject the idea before a file changes.
- It names the public note and states that no key exists in the sample.
- It requires a test, which ties the plan to the quote page you already trust.
- It asks for a reminder of what not to paste, which puts secrets on the table as forbidden.
06
Common mistakes
Usually
Here is my private key. Try the live API and drop the result on the page.
Better
Explain this public document only. Do not call the service, and do not ask me for a key.
Usually
Replace index.html with your new version. I did not keep a copy.
Better
Duplicate the working file as index-working.html before any large change. Edit the other copy.
Usually
I will tell my instructor I wrote every line, even the parts I cannot explain.
Better
If disclosure is required, say you used an assistant, and be ready to explain the lines you kept.
07
Practice exercise
Plan, copy, then decide
Done when: You have a plan that forbids secrets, a preserved working file, and a sentence in your own words about the change you accepted.
08
Challenge
Explain the public note without a secret
Paste only the Harbor Weather public note from this lesson. Ask Gemini to explain endpoint, the sample cities, and the error for any other city. Then ask what would be unsafe to add. A good reply mentions keys and private customer data. Write a five-line explanation yourself and compare it with the reply. Correct your lines where they added a city, a key, or a promise the note does not make. If a school or job would require disclosure, add one honest line that you used an assistant for the comparison. Do not finish by requesting live code that calls a service.
Hint: Oslo and Tunis are the whole sample. Another city is an error. A key is not part of the note.
09
Key takeaways
- Describe the outcome, ask for a plan before code, keep files small, and run what you receive.
- Paste the real error, write what you understand, and keep secrets out of the chat.
- Do not claim you wrote code you cannot explain when a school or employer requires disclosure.
- Before a big change, duplicate the working file as index-working.html.
10