This prompt is for AI coding agents that need to perform a reliable, repeatable self-check before executing any task inside a repository. The job-to-be-done is generating a runnable checklist of discovery steps, tool capability confirmations, and constraint verifications that the agent must complete to avoid common early-task failures. The ideal user is an AI engineer or platform developer wiring an agent into a CI pipeline, IDE extension, or autonomous coding harness where the cost of a misconfigured first step—wrong working directory, missing authentication, incorrect branch—is high.
Prompt
Agent Self-Orientation Checklist Generation Prompt

When to Use This Prompt
Define the job, reader, and constraints for the Agent Self-Orientation Checklist Generation Prompt.
Use this prompt when your agent first enters a repository or when the execution environment changes between tasks. It is not a replacement for static configuration or environment provisioning scripts; it is a dynamic, model-driven verification that the agent's runtime assumptions match reality. The prompt requires the agent to introspect its available tools, confirm filesystem access, validate environment variables, and assert that it can perform basic operations like reading a known file or running a build command. The output is a structured checklist with pass/fail states, not a narrative summary.
Do not use this prompt for agents operating in fully sandboxed, pre-configured environments where every capability is guaranteed by the harness. It is also inappropriate for one-shot, stateless completions where the agent has no persistent execution context. If the agent's task involves high-risk operations like database migrations, production deployments, or destructive file operations, the checklist must include a human approval gate before proceeding. The next step after generating the checklist is to execute it and log the results, halting the agent if any critical check fails.
Use Case Fit
Where the Agent Self-Orientation Checklist prompt works and where it introduces risk. Use these cards to decide if this prompt fits your agent architecture before wiring it into a task execution loop.
Good Fit: Pre-Task Bootstrap
Use when: your coding agent is about to start a new task in an unfamiliar repository or workspace. The checklist confirms the working directory, auth status, tool availability, and branch state before any file is touched. Guardrail: run this prompt as a blocking pre-flight step; do not proceed to task execution until all checklist items pass.
Bad Fit: Repeated Mid-Session
Avoid when: the agent has already oriented itself in the current session and the environment hasn't changed. Re-running the full checklist wastes context window tokens and adds latency. Guardrail: cache the checklist result per session and only re-run when the working directory, branch, or toolset changes.
Required Inputs
What you must provide: the target repository path, the task description the agent is about to execute, and a list of expected tools or capabilities. Without these, the checklist will be generic and miss environment-specific risks. Guardrail: validate that all three inputs are non-empty before invoking the prompt; if the task description is vague, the checklist will be too.
Operational Risk: False Confidence
What to watch: the agent may report all checks passing while missing a critical failure mode—such as a stale virtual environment, an expired token that still validates locally, or a monorepo where the working directory is one package behind. Guardrail: add a final checklist item that requires the agent to run a lightweight smoke command (e.g., which python, git status --porcelain) and report the raw output for harness verification.
Operational Risk: Tool Assumption Drift
What to watch: the checklist may assume tools are available based on the agent's default capability list, but the actual execution environment may have restricted permissions, missing binaries, or sandboxed network access. Guardrail: require the checklist to probe each tool with a no-op or version flag (e.g., git --version, npm --version) rather than relying on a static capability manifest.
Operational Risk: Context Window Overrun
What to watch: a verbose checklist with long explanations can consume significant context tokens before the real task begins, especially in repositories with large file trees or complex dependency graphs. Guardrail: enforce a maximum token budget for the checklist output and instruct the agent to produce terse, machine-parseable results rather than prose explanations.
Copy-Ready Prompt Template
A reusable prompt that generates a structured, runnable self-orientation checklist for a coding agent before it executes any task in a repository.
This prompt template is designed to be injected into a coding agent's system instructions or used as a pre-task invocation. It forces the agent to produce a concrete, ordered checklist of discovery steps, tool capability verifications, and constraint confirmations before it attempts any file modification, code execution, or analysis. The output is not a plan for the user's task; it is a plan for the agent to orient itself. The template uses square-bracket placeholders that your application harness must populate with runtime context before sending the prompt to the model.
textYou are a coding agent preparing to execute a task inside a repository. Before you begin any work, you must generate a self-orientation checklist. This checklist will be executed step-by-step to verify your environment, capabilities, and understanding of the codebase. Generate a checklist in the following structured format. Each item must be a single, verifiable action. Do not include items you cannot execute with your available tools. ## Required Inputs - Task Description: [TASK_DESCRIPTION] - Working Directory: [WORKING_DIRECTORY] - Available Tools: [AVAILABLE_TOOLS] - Repository Structure (top-level): [REPO_STRUCTURE_SUMMARY] - User-Provided Constraints: [USER_CONSTRAINTS] ## Output Schema Produce a JSON object with the following structure: { "agent_checklist": [ { "step_id": "string (e.g., '1.1')", "category": "string (one of: 'environment', 'tool_check', 'codebase_discovery', 'constraint_verification', 'task_analysis')", "action": "string (a clear, imperative instruction to yourself)", "expected_outcome": "string (what success looks like for this step)", "tool_required": "string | null (the specific tool name from Available Tools needed, or null if none)", "failure_mode": "string (what could go wrong and how to detect it)", "blocking": "boolean (if true, the task cannot proceed if this step fails)" } ], "critical_path": ["step_id", "..."] (ordered list of step_ids that must succeed before any file modification), "abort_conditions": ["string"] (list of specific failure descriptions that should cause the agent to stop and report to the user) } ## Checklist Generation Rules 1. **Environment First**: Always begin with steps to confirm the current working directory, environment variables, and shell state. 2. **Tool Grounding**: For every tool in [AVAILABLE_TOOLS], add a step to verify it is callable and returns a valid response. Do not assume a tool works. 3. **Task Decomposition**: Analyze [TASK_DESCRIPTION] and add discovery steps for every file, symbol, or pattern you will likely need to read or modify. 4. **Constraint Binding**: For every constraint in [USER_CONSTRAINTS], add a verification step. For example, if a constraint says "do not modify tests," add a step to identify test directories and confirm you will exclude them. 5. **Failure Modes**: For every step, explicitly state what failure looks like and how you will detect it (e.g., "tool returns a non-zero exit code," "file not found," "permission denied"). 6. **Blocking Logic**: Mark a step as `blocking: true` if its failure makes the primary task impossible or unsafe to continue. 7. **Critical Path**: The `critical_path` array must contain the ordered list of `step_id`s that must succeed before you are allowed to modify any file or execute any command with side effects. ## Example Step { "step_id": "1.1", "category": "environment", "action": "Run 'pwd' to confirm the current working directory matches [WORKING_DIRECTORY].", "expected_outcome": "The output of 'pwd' is exactly [WORKING_DIRECTORY].", "tool_required": "execute_command", "failure_mode": "'pwd' returns a different path, indicating the agent shell is not in the expected directory.", "blocking": true } Generate the full checklist now based on the provided inputs.
To adapt this template, your application harness must first gather the five required inputs: the user's task description, the absolute working directory path, a list of tool names and signatures available to the agent, a summary of the repository's top-level structure, and any explicit user constraints. Populate these into the square-bracket placeholders before sending the prompt. The output JSON must be parsed and validated by your harness. Each step's tool_required field should be cross-referenced against your actual tool registry to prevent the agent from hallucinating unavailable tools. If the agent's checklist includes a tool not in [AVAILABLE_TOOLS], the harness should reject the checklist and re-prompt with a corrected tool list. For high-stakes environments, require human approval of the critical_path and abort_conditions before the agent begins executing the checklist.
Prompt Variables
Inputs the Agent Self-Orientation Checklist Generation Prompt needs to produce a reliable, runnable checklist. Each placeholder must be populated by the agent harness before invoking the prompt.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[AGENT_CAPABILITIES] | Declared list of tools, APIs, and actions the agent is allowed to use | ["read_file", "write_file", "run_shell", "search_code"] | Must be a valid JSON array of strings. Validate against the agent's actual tool registry. Empty array is allowed but will produce a checklist with no tool checks. |
[WORKING_DIRECTORY] | Absolute path to the repository root the agent should operate within | /home/agent/project-repo | Must be an absolute path. Harness must verify the directory exists and is readable before prompt invocation. Relative paths are rejected. |
[REPOSITORY_CONTEXT] | Brief description of the repository purpose, language, and framework from prior discovery steps | Python Django web application with PostgreSQL backend | Must be a non-empty string. If prior discovery steps failed, set to "Unknown repository - full discovery required" to trigger broader checklist items. |
[CONSTRAINT_LIST] | Explicit behavioral and operational constraints the agent must obey | Never modify .git directory; Do not run destructive shell commands without confirmation; Respect .gitignore patterns | Must be a newline-separated string or JSON array of strings. Harness must inject safety-critical constraints from system policy even if the caller provides an empty list. |
[AUTH_CHECK_TARGETS] | List of services, APIs, or endpoints the agent should verify connectivity to before starting work | ["github.com", "pypi.org", "internal-artifact-registry"] | Must be a JSON array of hostnames or URLs. Null is allowed if no external services are expected. Harness should warn if this is empty but the repository contains remote dependency references. |
[ENVIRONMENT_VARIABLES] | Key environment variables the agent should inspect for configuration context | ["DATABASE_URL", "API_KEY", "DEBUG"] | Must be a JSON array of variable name strings. Harness should validate that listed variables are not secret values themselves. Use variable names only, never values. |
[PRIOR_TASK_RESULT] | Outcome of the last task the agent executed, used to detect carryover state issues | Previous task: dependency installation failed with permission error in /usr/local/lib | Must be a string or null. If null, the checklist will include a fresh-start verification step. Harness must truncate to 500 characters to avoid context pollution. |
Implementation Harness Notes
How to wire the Agent Self-Orientation Checklist Generation Prompt into an application or agent workflow.
This prompt is designed to be the first tool call an agent makes when entering a new repository or resuming a session after a context reset. The harness should invoke it before any file modification, build execution, or dependency installation. The generated checklist is not just a display artifact—it must be parsed into a structured task list that the agent's planner can consume. Each checklist item should include a tool requirement (e.g., run_command, read_file, search_code) and a success criterion that the harness can later verify. The harness must store the checklist in the agent's working memory and prevent execution of any non-discovery task until the checklist is marked complete or explicitly overridden by a human operator.
Wire the prompt into a pre-flight hook that fires on session start or when the agent's working directory changes. The harness should inject the current working directory, available tool list, and any user-provided constraints into the [REPOSITORY_PATH], [AVAILABLE_TOOLS], and [CONSTRAINTS] placeholders respectively. After the model returns the checklist, validate the output against a strict schema: each item must have an id, action, tool, target, and success_condition field. Reject any checklist item that references a tool not in the provided tool list. If validation fails, retry once with the validation errors injected into the [PREVIOUS_ERRORS] field of a retry prompt. Log the raw checklist and validation results for observability. For high-risk repositories (production infrastructure, monorepos with deployment pipelines), require a human to approve the checklist before the agent proceeds to execution.
Model choice matters here. Use a model with strong instruction-following and structured output capabilities (GPT-4o, Claude 3.5 Sonnet, or equivalent). Avoid smaller models that may hallucinate tool names or skip critical discovery steps like authentication checks. The harness should enforce a token budget for the checklist output—if the generated checklist exceeds 50 items, truncate and flag for human review, as an overly granular checklist often indicates the agent failed to prioritize. After checklist execution, the harness must compare actual results against each item's success_condition. Items that fail should be re-queued with context from the failure. If more than 20% of items fail, abort the orientation and escalate to a human operator with the failure log. Never allow the agent to proceed to file modification or build execution with unresolved checklist failures.
Expected Output Contract
Fields the Agent Self-Orientation Checklist Generation Prompt must return. Use this contract to validate the agent's output before allowing task execution.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
checklist_id | string (UUID v4) | Must parse as valid UUID v4. Reject if missing or malformed. | |
generated_at | ISO-8601 UTC timestamp | Must parse as valid datetime within last 60 seconds of system clock. Reject if future-dated or stale. | |
working_directory | string (absolute path) | Must exist on filesystem and be writable by current process. Reject if relative path or inaccessible. | |
tool_capability_checks | array of objects | Each object must contain 'tool_name' (string), 'available' (boolean), 'version' (string or null). Array must not be empty. | |
tool_capability_checks[].tool_name | string | Must match a tool name from the agent's registered tool manifest. Reject unknown tool names. | |
tool_capability_checks[].available | boolean | Must be true for all tools required by the pending task. Flag if any required tool reports false. | |
constraint_confirmations | array of objects | Each object must contain 'constraint' (string), 'status' (enum: confirmed|violated|unknown), 'detail' (string). Array must not be empty. | |
constraint_confirmations[].status | enum: confirmed, violated, unknown | Reject entire output if any constraint has status 'violated'. Escalate 'unknown' to human review before proceeding. |
Common Failure Modes
What breaks first when an agent generates its own orientation checklist and how to prevent it.
Checklist Mirrors Agent's Existing Knowledge
What to watch: The agent generates a checklist of steps it already knows how to do, skipping the repository-specific discovery steps that actually matter. The checklist becomes a generic 'explore the codebase' list rather than a targeted plan. Guardrail: Require the prompt to reference specific repository signals—file names, build tool outputs, directory listings—and validate that at least 70% of checklist items reference concrete paths or tool invocations.
Missing Precondition Checks
What to watch: The checklist jumps straight to code exploration without verifying the agent can actually operate—wrong working directory, missing API keys, read-only permissions, or unavailable tools. The agent discovers these mid-task and fails after partial work. Guardrail: Mandate that the first 3 checklist items always verify environment state: current directory, available tools, and authentication status. Validate these items appear before any exploration step.
Checklist Ignores Repository-Specific Constraints
What to watch: The agent produces a checklist that would work for any repository but misses constraints unique to this one—monorepo tooling, custom build systems, generated code directories that must be excluded, or deploy-time configuration that differs from local config. Guardrail: Include repository-specific signals in the prompt context (build tool output, top-level file listing, CI config snippets) and require the agent to cite these signals in checklist rationale.
Over-Ordered or Rigid Sequencing
What to watch: The checklist enforces a strict linear order where parallel exploration would be faster, or it fails to specify dependencies between steps, causing the agent to attempt step 5 before step 2 completes. Guardrail: Require each checklist item to declare its dependencies explicitly—'Requires: step 2 complete' or 'No dependencies, can run in parallel with steps 3-4.' Validate that no item references output from a later step.
Checklist Exceeds Context Budget
What to watch: The generated checklist is so verbose that it consumes the context window the agent needs for actual exploration. The agent spends tokens on the plan and has nothing left for execution. Guardrail: Set a hard token limit on the generated checklist (e.g., 500 tokens) and validate length before execution. If exceeded, require the agent to compress by merging redundant steps and removing explanatory text.
No Verification or Completion Criteria
What to watch: Checklist items are vague ('understand the codebase') with no way to determine when a step is done. The agent loops on exploration or marks steps complete without evidence. Guardrail: Require each checklist item to include a concrete completion signal—'Done when: file listing saved to context' or 'Done when: build command succeeds and output logged.' Validate that every item has a falsifiable completion condition.
Evaluation Rubric
Use this rubric to test the Agent Self-Orientation Checklist Generation Prompt before integrating it into a coding agent harness. Each criterion validates a specific failure mode that causes early-task errors in production.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Working directory confirmation | Checklist includes a step to verify and log the current working directory against the expected repository root | Agent executes tasks in wrong directory; file reads return not-found errors; edits land in unexpected paths | Run prompt in a sandbox with a non-root working directory; confirm the generated checklist's first step detects the mismatch |
Authentication and access check | Checklist includes a step to validate that required credentials, tokens, or SSH keys are present and functional before any remote operation | Agent attempts git push, API calls, or package pulls that fail with auth errors mid-task | Strip credentials from the test environment; verify the checklist step fails explicitly rather than proceeding to dependent steps |
Tool capability inventory | Checklist enumerates available tools (file read, file write, shell exec, search) and confirms each responds before task execution | Agent assumes a tool exists, attempts to call it, and fails silently or retries without diagnosis | Run prompt in an environment with a restricted tool set; verify the checklist detects missing tools and reports them |
Repository structure validation | Checklist includes a step to confirm expected top-level directories and key config files exist before planning edits | Agent generates a patch plan referencing files or paths that don't exist in the actual repository | Provide a repository path with a missing expected directory; verify the checklist step flags the anomaly |
Constraint and policy confirmation | Checklist surfaces any explicit constraints from the system prompt or task definition and confirms they are understood before acting | Agent violates a stated constraint (e.g., never edit generated code) because it didn't re-read or confirm the rule | Inject a constraint like 'do not modify files in /vendor'; verify the checklist step acknowledges and records the constraint |
Environment variable and config resolution | Checklist includes a step to read and log critical environment variables or config values needed for the task | Agent uses default values instead of environment-specific overrides, causing incorrect behavior in staging or production | Set a non-default value for a critical env var; verify the checklist step captures the override value |
Task scope and boundary definition | Checklist explicitly states what the task includes and excludes, derived from the user request and system instructions | Agent scope-creeps into unrelated files, refactors beyond the request, or makes changes outside the intended module | Provide a task with ambiguous scope; verify the checklist step narrows and documents the boundary before proceeding |
Rollback and safety plan | Checklist includes a step to confirm that undo mechanisms (git stash, backup copies, dry-run mode) are available and understood | Agent makes destructive edits without a recovery path; user cannot easily revert the changes | Run prompt in a repo without git initialized; verify the checklist step warns about missing rollback capability |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single model call and no external tool integration. Replace [TOOL_MANIFEST] with a hardcoded list of available tools. Skip the checklist execution validation step and rely on manual inspection of the generated checklist.
Prompt modification
- Remove or simplify the
[CONSTRAINTS]block to focus on discovery steps only. - Replace
[OUTPUT_SCHEMA]with a plain markdown checklist format. - Drop the requirement to confirm each item before proceeding.
Watch for
- Checklists that list tools the agent doesn't actually have access to.
- Missing critical checks like working directory verification or auth status.
- Overly verbose items that waste context window space.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us