Shift Note: Give Code Prompts a Clear Work Order
A request such as “build a login page” sounds clear until someone has to implement it. Does it need password reset? Which framework should it use? Is authentication already available? A coding model faces the same missing information as a new teammate. When details are absent, it fills the gaps, sometimes with choices you would not make.
Writing a better prompt means turning a broad request into a small, usable work order. You do not need special vocabulary. You need to explain the job, identify the boundaries, and describe how you will check the result.
Start with one change you can inspect
For a first attempt, ask for a function, a bug fix, or a small interface change rather than an entire application. Smaller tasks make it easier to spot incorrect assumptions and understand the generated code.
Instead of “build an expense tracker,” try “write a function that totals expenses by category.” Once that function behaves correctly, ask for the next piece. This keeps each review manageable and prevents an early misunderstanding from spreading through a larger implementation.
State the environment before the implementation
A model cannot reliably infer your project setup from a feature description. Supply the language, relevant versions, framework, and existing interfaces. Include the code it needs to understand, but leave out unrelated files and sensitive information.
- Identify the runtime and framework versions when they affect available APIs or syntax.
- Show the function signature, data structure, or component interface that the new code must fit.
- Say whether new dependencies are allowed and whether existing public interfaces must remain unchanged.
- Remove credentials, customer records, and private configuration before sharing examples.
If you are working in a repository-aware coding tool, point to the relevant files and ask it to inspect them before proposing changes. Do not assume every file is automatically visible or understood.
Describe observable behavior, not vague quality
“Make it robust” expresses a preference, not a testable requirement. Explain what should happen with normal input, empty input, and invalid input. If you have not decided, ask the model to surface that decision before writing code.
A practical prompt could read: “Write a Python 3.12 function named total_by_category(expenses). Each expense is a dictionary with category and amount fields. Return a dictionary mapping categories to totals. An empty list returns an empty dictionary. Amounts are integer cents, and negative amounts represent refunds. Raise ValueError for missing fields or non-integer amounts, including booleans. Use only the standard library. Include tests for ordinary input, refunds, empty input, and invalid records.”
This prompt gives the model a target that you can verify. It also avoids leaving money representation and invalid-data handling to chance.
Use examples to settle ambiguous expectations
Add a small input and its expected output when words could be interpreted in different ways. For example, say that two food expenses of 500 and -100 cents should produce a food total of 400 cents.
Examples complement the rules; they do not replace them. One successful example does not establish what should happen for every other input. Ask the model to flag contradictions between your examples and your written requirements rather than silently choosing one.
Ask for a reviewable result and run the checks
Specify the output you need: a minimal patch, a complete function, or an explanation followed by code. Ask it to avoid unrelated refactoring. For unfamiliar code, request a short explanation of assumptions and any remaining limitations.
Then inspect the result and run the tests yourself. Generated tests can repeat the same misunderstanding as generated code. Check their expected values against your requirements, and add cases the model missed. Report failures with the exact error and a reproducible example instead of simply saying “it does not work.”
Keep the work order steady when changing models
A clear prompt remains useful when you try another model. Relay365 is a pay-as-you-go relay desk for multiple model families and works with Claude Code, Codex, Gemini CLI, and OpenAI SDK clients. It can be a practical option for trying the same bounded task with, for example, Claude Haiku 4.5 and Gemini 2.5 Flash.
If that fits your workflow, create a Relay365 account and compare outputs using the same requirements and tests. The useful result is not the most confident answer; it is code you can explain, verify, and maintain.
Further desk bulletins
| Date | Bulletin title | Filed under | Language |
|---|---|---|---|
| 2026-10-28 | Shift Note: One Python App, Several Model Providers | Field notes from the desk | EN |
| 2026-10-28 | Duty log: one handoff prompt, three different answers | Field notes from the desk | EN |
| 2026-10-28 | Shift Note: Temperature Settings Before the Next Run | Field notes from the desk | EN |
| 2026-10-28 | Shift Note: Keep System Prompts Small and Testable | Field notes from the desk | EN |
| 2026-10-28 | Shift note: Factual answers need an evidence check | Field notes from the desk | EN |
| 2026-10-28 | Shift Note: Teach the Output With Three Examples | Field notes from the desk | EN |
Curious how it runs on your own code? Sign up →