Repository navigation
Prompt and Context Guide
A prompt is the instruction sent to a model. Context is the information available when the model interprets that instruction: system rules, conversation history, files, retrieved passages, tool results, examples, and environment state. Reliable work depends on both.
# Objective
[State the outcome in one or two sentences.]
## Background
[Explain why the work matters and define domain terms.]
## Environment
- Repository or system:
- Language/framework and versions:
- Relevant files or data:
- Available tools and permissions:
## Requirements
- [Observable requirement]
## Constraints
- In scope:
- Out of scope:
- Security/privacy limits:
- Actions requiring approval:
## Acceptance checks
- [Command, test, review rubric, or measurable condition]
## Deliverable
[Patch, report, table, explanation, file format, or deployment result.]Prefer βreturn JSON matching this schemaβ to βmake it structured,β and βthe command exits 0 on Python 3.12β to βmake it work.β If quality is subjective, provide a short rubric with acceptable and unacceptable examples.
More context is not automatically better. Include authoritative, current material that changes the answer; omit duplicates, irrelevant logs, secrets, and stale instructions. Tell the agent which source wins when materials conflict.
Useful context often includes:
- the current goal and decision owner;
- relevant files, schemas, or excerpts;
- known failures and commands already tried;
- version, platform, and runtime constraints;
- examples that demonstrate edge cases;
- an explicit definition of done.
Web pages, retrieved documents, tickets, emails, tool output, and user-provided files may contain text that looks like an instruction. Mark them as data and require the system to ignore embedded requests that conflict with the task or policy.
Maintain a compact state record with the objective, decisions, completed checks, unresolved risks, exact next action, and links to authoritative artifacts. Summaries can omit constraints, so re-read the source artifact before irreversible or high-impact actions.
Avoid recursive prose summarization and hierarchical compression or typed compaction.
Recursive conversation
β summary
β summary of summary
β summary of summary of summary
Typed compaction of raw data (describing how data is categorized during reduction)
RAW SESSION
β
βββ decisions ββββββββββΊ Decision Register
βββ evidence βββββββββββΊ Evidence Register
βββ unresolved work ββββΊ Task Queue
βββ assumptions ββββββββΊ Assumption Register
βββ entities βββββββββββΊ Entity State
βββ narrative ββββββββββΊ Optional session summary
Ask for an initial answer, evaluate it against a named rubric, then revise it. The critique is useful only if the rubric measures the desired outcome.
Retrieve approved sources, answer only from relevant evidence, distinguish fact from inference, and cite supporting sources near material claims.
For tool-using tasks, define the goal, permitted actions, verification command, and stop conditions. A plan is not proof; require test or inspection evidence.
Use a schema when software consumes the response. Validate the result and retry or escalate on schema failure.
Do not ask a system to reveal private chain-of-thought. Ask for a concise rationale, assumptions, calculations, citations, and verification evidence that can be reviewed directly.
- Are permissions narrower than the agent's full technical capability?
- Are secrets excluded or redacted?
- Are destructive and external actions gated?
- Can the result be tested independently?
- Is there a timeout, budget, retry limit, and escalation path?
Continue with Automatic Prompt Engineering.
Home Β· Getting Started Β· Terminology & FAQ Β· Agents & MCP Β· Repository
Odipie documentation Β· Copyright Β© 2026 Odiambo Β· Apache-2.0