# Clear Instructions and System Prompts

> The basics that fix most bad outputs: be specific, give context and constraints, define the audience and format, and use the system prompt well. Free notes,...

Canonical: https://www.internhack.in/roadmaps/tracks/ai-engineer/prompt-fundamentals
Last updated: 2026-11-28

The basics that fix most bad outputs: be specific, give context and constraints, define the audience and format, and use the system prompt well.

Beginner · about 4 hours · difficulty 2/5

Learn first: [Messages APIs and Provider SDKs](https://www.internhack.in/roadmaps/tracks/ai-engineer/first-api-calls)

A prompt is a specification written for a very capable colleague who knows nothing about your project. Most "the model is dumb" problems are really "the prompt was vague" problems.

### What a good prompt contains

- **Role and context**: who the assistant is, who the user is, what product it lives in.
- **The task**: stated directly, with the goal behind it. Explaining \*why\* helps the model generalize.
- **Constraints**: length, tone, what not to do, what to do when information is missing.
- **Output format**: headings, JSON, bullet points, or plain prose. Show it.
- **Inputs clearly separated** from instructions.

### The system prompt

Use it for stable behaviour: persona, rules, policies, formatting defaults, tool usage guidance. Put per-request data in the user turn. Keep it organized; long system prompts are fine, messy ones are not.

### Habits that work

- Tell the model what to do rather than only what not to do.
- Give an explicit escape hatch: "If the answer is not in the documents, say you do not know."
- Iterate against a set of test inputs, not a single example. A prompt that works once may fail on the fifth input.
- Modern models follow instructions literally; if you want thorough or creative output, ask for it.

### Good enough to move on

You can take a weak one-line prompt, rewrite it into a structured specification, and show improved results across at least ten test inputs.

## Key concepts

- **Role, context and goal**
- **Constraints and output format**
- **System vs user prompt content**
- **Escape hatches for missing info**
- **Positive instructions over prohibitions**
- **Prefilling the response**: Supported by some APIs

## Mini project

Write a system prompt for a college placement FAQ assistant, test it against 15 realistic student questions including ones it should decline, and iterate until all answers meet your checklist.

## Check yourself

Why does explaining the reason behind an instruction often produce better results than stating the rule alone?

## Free resources

- [Anthropic prompt engineering overview](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview) (Anthropic)
- [OpenAI prompt engineering guide](https://platform.openai.com/docs/guides/prompt-engineering) (OpenAI)
- [Prompt Engineering Guide](https://www.promptingguide.ai/) (DAIR.AI)

Previous: [Running Open-Weight Models Locally](https://www.internhack.in/roadmaps/tracks/ai-engineer/open-weight-models) · Next: [Few-Shot Examples](https://www.internhack.in/roadmaps/tracks/ai-engineer/few-shot-prompting)

## More in Prompt Design That Holds Up

- [Clear Instructions and System Prompts](https://www.internhack.in/roadmaps/tracks/ai-engineer/prompt-fundamentals)
- [Few-Shot Examples](https://www.internhack.in/roadmaps/tracks/ai-engineer/few-shot-prompting)
- [Chain-of-Thought and Task Decomposition](https://www.internhack.in/roadmaps/tracks/ai-engineer/chain-of-thought)
- [Structured Prompts and Long Context](https://www.internhack.in/roadmaps/tracks/ai-engineer/structured-prompts)
- [Prompt Templates, Versioning and Iteration](https://www.internhack.in/roadmaps/tracks/ai-engineer/prompt-management)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [AI Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/ai-engineer)
