AI Compass

Context engineering and system prompts

Giving an AI the right background, rules and role before the task, so it behaves consistently.

What is it?

Context engineering is the practice of deciding everything the model sees before it answers: its role and rules (often in a system prompt), relevant documents, examples, the conversation so far and the results of any tools it used. A system prompt is a set of standing instructions that applies to the whole conversation, such as "You are a careful code reviewer; never invent APIs".

The idea is that a model's answer can only be as good as the information and instructions around it. Good context is relevant, accurate, clearly organized and no longer than needed.

Which models use it?

  • Developers set system prompts when building apps on the OpenAI, Anthropic and Google APIs.
  • ChatGPT offers custom instructions and custom GPTs that act like standing instructions.
  • Claude offers projects with shared instructions and files.
  • Coding agents such as Claude Code, GitHub Copilot and Cursor read project files and instruction files for context.

How to use it

  1. Write a short role and goal: who the AI should act as and what it should achieve.
  2. List firm rules, such as what it must never do and how to handle uncertainty.
  3. Attach or paste only the documents and data relevant to the task.
  4. Describe the output format you expect.
  5. Add one or two examples of good results if the task is unusual.
  6. Test with real requests and tighten the instructions where the answers go wrong.
  7. Keep the context up to date as your project changes.

Benefits

  • More consistent behaviour across many requests.
  • Fewer invented details because the model works from real sources.
  • Saves repeating the same instructions in every message.
  • Makes AI tools safer to use in real projects.

Limits and risks

  • Too much or irrelevant context can distract the model and raise cost.
  • System prompts guide behaviour but cannot guarantee it.
  • Outdated context leads to outdated or wrong answers.
  • Documents placed in context may contain hidden instructions (prompt injection), so treat untrusted content with care.

Prompt template

Copy it, replace the parts in [brackets] and paste it into any AI chat.

Act as a senior software engineer, AI coding agent, system architect, and debugging specialist. Your objective is to help me build, improve, test, and maintain production-ready software using modern engineering practices. 1. Context Engineering: inspect all relevant files and existing project architecture before proposing changes; use the existing codebase as the source of truth; identify dependencies, conventions, naming patterns, and architectural constraints; never invent files, functions, APIs, or configuration values; ask for missing information only when it materially affects the solution. 2. Planning: break the task into small, verifiable steps; identify affected files and dependencies; consider edge cases, security, performance, and backward compatibility; choose the simplest reliable implementation; avoid unnecessary abstractions. 3. Implementation: complete, production-quality code; follow project conventions; preserve unrelated functionality; handle errors, null values, invalid inputs, and loading states; no hardcoded secrets; don't claim code was run or tested unless it was. 4. Debugging: identify the exact error and location; determine the likely root cause from evidence; inspect dependencies and surrounding code; propose the smallest safe fix; run tests when possible; report remaining uncertainty. 5. Tool usage: inspect files, use the terminal when authorized, check docs for version-specific APIs, validate with tests/linters, never assume a tool succeeded, request approval before destructive changes. 6. Output: objective, findings, plan, files to change, complete code or patches, commands, test results, remaining issues. 7. Communication: direct, accurate, practical; don't fabricate test results or capabilities.

More in Using AI well

Learn AI in the AI Compass app

Every guide and dictionary card is also in the AI Compass app, with saved items, search and “Try it” buttons that open chat, image or video with the example filled in. Reading is free; creating uses credits, and the price is shown before you start.