Replit Prompts
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
Replit Prompts represent the core operational logic and identity of the Replit Assistant, an AI programming assistant embedded within the Replit online IDE. The purpose of these prompts is to guide the assistant in performing complex software engineering tasks, such as creating new features, modifying existing codebases, debugging, and managing environment configurations. The scope of these prompts extends to handling shell executions, package installations, and workspace tool management within a Linux and Nix-based environment.
The system ensures that the assistant remains proactive yet precise, focusing on user-specified goals while adhering to established code patterns. By leveraging specific response protocols, the assistant can propose structured file edits, shell commands, and deployment configurations that are automatically applicable within the IDE.
Sources: Replit/Prompt.txt:1-24, Replit/Prompt.txt:46-52
Assistant Capabilities and Behavioral Logic
The Replit Assistant is designed to handle three primary categories of user queries: file modifications, environment orchestration, and informational responses.
Core Operation Categories
| Category | Purpose | Example Tasks |
|---|---|---|
| File Changes | Propose new features or edits to existing codebase. | "Add a factorial function", "Update CSS background". |
| Shell Execution | Propose execution of commands for environment setup. | "Install image library", "Set up Prisma ORM". |
| Workspace Nudges | Redirect users to specialized IDE tools. | "Set up API key" (Secrets), "Deploy changes" (Deployments). |
Sources: Replit/Prompt.txt:26-44
Decision Flow for Task Handling
The assistant follows a specific logic to determine whether to act directly or "nudge" the user toward specific workspace tools. This prevents the AI from handling sensitive data (like secrets) directly in code or mismanaging deployment workflows.
The diagram shows the logic used to categorize user requests into direct actions or tool-specific redirections.
Sources: Replit/Prompt.txt:38-52
Response Protocols and Tags
To maintain technical accuracy and allow the IDE to parse proposed changes, the assistant must wrap its output in specific XML-style tags. These tags define the exact operation to be performed on the file system or shell.
File Modification Tags
The system utilizes three primary tags for code changes:
<proposed_file_replace_substring>: Used for precise edits. It requires an<old_str>to match unique file content and a<new_str>for the replacement.<proposed_file_replace>: Overwrites the entire contents of a file or creates a new one if it does not exist.<proposed_file_insert>: Inserts content at a specific line number or appends it to the end of the file.
Sources: Replit/Prompt.txt:58-76
Environment and Workflow Configuration
Beyond code, the assistant manages the project lifecycle through specialized tags:
- Shell Commands: Proposes full commands via
<proposed_shell_command>, identifying if the command is "dangerous" (e.g.,rm -rf). - Package Installation: Uses
<proposed_package_install>with language identifiers and comma-separated lists. - Workflow Configuration: Uses
<proposed_workflow_configuration>to set up long-running commands (likenpm run dev) or configure the IDE's "Run" button. - Deployment: Uses
<proposed_deployment_configuration>to define build and run commands for the published application.
Sources: Replit/Prompt.txt:78-112
Interaction and Planning Logic
While the Replit prompts focus on direct execution, the broader project context (as seen in related agents) emphasizes structured planning for non-trivial tasks.
Multi-Step Task Execution
For complex requests, the system adopts a "Task Management" approach similar to patterns found in modern AI coding agents. This involves breaking down a goal into verifiable steps.
This sequence illustrates the integration of planning, execution, and verification gates (Typecheck -> Lint -> Test).
Sources: Amp/gpt-5.yaml:315-325, Augment Code/gpt-5-agent-prompts.txt:45-55, Anthropic/Claude Code/Prompt.txt:135-150
Comparison of Operational Constraints
Different prompt modules within the project define specific constraints to ensure stability and cost-efficiency.
| Constraint | Replit Assistant | Qoder/General Agent Patterns |
|---|---|---|
| Line Limits | Not explicitly capped per tag. | Often capped at 600 lines (e.g., Qoder). |
| Tool Names | Uses XML tags in response. | NEVER mention tool names to user. |
| Verification | IDE applies changes automatically. | Mandatory use of get_problems after edits. |
| Parallelism | Serial proposals in response. | Proactively batch read-only operations. |
Sources: Replit/Prompt.txt:54-115, Qoder/prompt.txt:85-110, Qoder/prompt.txt:225-235
Conclusion
Replit Prompts facilitate a highly integrated AI-assisted development experience by defining clear boundaries between direct code manipulation and workspace tool orchestration. By enforcing a strict response protocol through XML tags, the system ensures that AI-generated proposals are precise, safe, and actionable within the Linux/Nix environment. The transition from natural language intent to structured IDE actions is managed through a combination of behavioral rules and categorized capability gates.