Skip to main content

Prompt Engineering — ValorIDE

This guide distills how to write effective prompts and system instructions so ValorIDE behaves consistently, safely, and productively in real-world developer workflows.

Principles at a glance:

  • Be concise and explicit. Describe expected outcomes (not micromanage steps).
  • Include context selectively: use @file, @folder, @problems, and @url to attach relevant artifacts.
  • Prefer iteration: break large tasks into smaller, reviewable subtasks.

Browser-first / Non-blocking execution

ValorIDE follows a browser-first, non-blocking approach for dev servers:

  1. Check whether a dev server is already running (e.g., lsof -i :5173).
  2. If running, open the browser immediately for rapid visual feedback.
  3. If not running, start the service in the background and continue. Never hold the agent waiting for a long-running foreground process.

Why this matters: the agent must be able to run many tasks autonomously without stalling on I/O-hungry foreground commands.

No-Blocking Services Discipline

  • Start dev servers in background and capture logs (e.g. npm run dev > /tmp/dev.log 2>&1 &).
  • Use short, terminating commands for builds & tests. Avoid commands that expect interactive stdin.
  • If processes must be killed after a step, use recorded PIDs and cleanup hooks.

Anti-stall rules & escalation

  • Avoid unbounded retry loops — fail fast and ask the user when blocked.
  • Don't rerun failing commands repeatedly. If a command fails 3 times, pause and escalate with a clear question.
  • Use follow-up UI actions (buttons, choices) instead of free-text prompts for decisions.

Prompt patterns and templates

Use this short template for most tasks:

Goal: <What you want to accomplish>
Context: <Small summary + list of @file or @folder attachments>
Constraints: <time, style, tests to pass>
Acceptance criteria:
- <observable outcome 1>
- <observable outcome 2>

Ask ValorIDE to provide a short plan, then approve each execution step before the agent runs commands or writes files.

Advanced techniques

  • Confidence checks: ask ValorIDE to rate its confidence for a proposed change (1–10).
  • Memory checkpoints: use workspace snapshots before and after major steps so changes can be reverted.
  • MCP tool declarations: prefer small, single-purpose tools exposed through Model Context Protocol.

For step-by-step examples and custom instruction templates, see the Prompting Guide and the Custom Instructions Library pages in this section.