Guides

Prompts Detection

Mind Rig parses active JavaScript, TypeScript, and Python files to detect prompt strings or expressions. Once detected, you can test these prompts in the Playground.

The parser uses simple heuristics to identify likely prompt strings:

  1. Variable names containing prompt:

    const weatherPrompt = `What is the weather forecast today for ${location}?`;
  2. Variable assignments with an annotation comment containing @prompt:

    # @prompt
    hello = f"Say hello to {name}."
  3. String literals with the annotation comment in front of them:

    const hi = /* @prompt */ `Say hi to ${userName}. They live in ${location}.`;

Use these patterns in your code to help Mind Rig identify prompts.