Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:A9T9 RPA System Prompt Assembly

From Leeroopedia
Knowledge Sources
Domains AI_Agent, Prompt_Engineering
Last Updated 2026-10-22 00:00 GMT

Overview

Mechanism for assembling a context-aware system prompt for an AI macro agent, embedding tool definitions, environment state, and format constraints.

Description

System Prompt Assembly is the process of constructing the system prompt that guides the AI macro agent's behavior. The prompt must convey:

  • Tool definitions: the available tools (`MACRO_AGENT_TOOLS`) and their schemas
  • Macro format constraint: the agent must produce JS script macros, never command tables (with rationale)
  • Environment state: the browser (Chrome/Firefox), OS (Windows/macOS/Linux), and XModule install status — probed fresh each turn
  • OCR engine guidance: which OCR engine is configured and what engine name to write into generated macros
  • uiv.* API instructions: the authoring guide for the `uiv.*` API
  • Firefox overlay: browser-specific adjustments (e.g. `uiv.page.click` instead of `uiv.browser.click` on Firefox)

The `getSystemPrompt` function combines a base prompt (from `prompt_basic.ts` or a user override), the JS-first note, the environment line, and the OCR note. `detectXModuleStatus` probes the XModule2 native host for the current install state, refreshed per turn.

Usage

Use this principle when an AI agent needs a dynamically assembled system prompt that reflects the current environment and available tools.

Theoretical Basis

SystemPrompt=Base⊕Tools⊕FormatConstraint⊕Env(browser,OS,XModule)⊕OCR(engine)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment