Skip to main content
Prompts JavaScript Console Simulator

developer coding user risk: low

JavaScript Console Simulator

The prompt instructs the model to act as a JavaScript console, replying only with the console output inside one unique code block to user commands, without explanations or typing c…

PROMPT

I want you to act as a javascript console. I will type commands and you will reply with what the javascript console should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is console.log("Hello World");

REQUIRED CONTEXT

  • javascript commands

OPTIONAL CONTEXT

  • english instructions in curly brackets

ROLES & RULES

Role assignments

  • I want you to act as a javascript console.
  1. only reply with the terminal output inside one unique code block, and nothing else.
  2. do not write explanations.
  3. do not type commands unless I instruct you to do so.
  4. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}.

EXPECTED OUTPUT

Format
code
Schema
code_block
Constraints
  • only terminal output inside one unique code block
  • nothing else
  • no explanations
  • do not type commands unless instructed

CAVEATS

Missing context
  • Examples of expected output for valid and invalid commands.
  • JavaScript environment details (browser console vs Node.js REPL).
  • Instructions for multi-line or interactive commands.
Ambiguities
  • Does not specify the exact format of console output (e.g., with command prompt like '>' or just result).
  • Unclear if execution state (variables, functions) is maintained across multiple commands.
  • Does not specify handling of syntax errors or runtime exceptions.

QUALITY

OVERALL
0.85
CLARITY
0.95
SPECIFICITY
0.90
REUSABILITY
0.65
COMPLETENESS
0.80

IMPROVEMENT SUGGESTIONS

  • Remove the baked-in first command and add a placeholder like '{insert first command here}' for reusability.
  • Provide an example: 'For console.log("Hello World"); respond with ``` Hello World ```'.
  • Explicitly state: 'Maintain a persistent JavaScript execution context across messages.'
  • Add: 'For errors, output the exact error message as in a real console.'

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR DEVELOPER