For the complete documentation index, see llms.txt. This page is also available as Markdown.

Prompting & Workflow Best Practices (Decipher)

This document outlines prompting patterns and workflow practices that produce the most reliable programming output on Metaforms.

Many programmers initially approach Metaforms without being detailed in instruction. However, Metaforms performs best when instructions are explicit, scoped, and structured.

The prompt practices shared in this document are based on observations from real Metaforms users and are intended to help the teams improve programming accuracy, reduce debugging time, and increase speed.

Core Principle: Explicit Instructions, Including Constraints

Metaforms performs best when you describe the intended outcome clearly before generation. The clearer the instruction, the higher the accuracy of Metaforms output

Incorrect/Non-Ideal Workflow

Ideal Workflow

Generate everything and fix errors later

Generate limited questions in batches

Short instructions

Explicit instructions

Debug code line-by-line

Edit with AI across XML for similar change

Edit with AI for very small changes

Manually fix if takes less than 5 seconds

Implicit assumptions

Explicit constraints

Writing Good Prompts – Examples…

Task: Generating the next 3–5 questions from the questionnaire and program them in the survey using the correct XML structure.

  1. Constraints:

    1. Follow the survey programming syntax.

    2. Maintain correct question numbering and labels.

    3. Ensure all XML tags are properly structured.

    4. Apply existing survey logic and formatting standards.

  2. Focus:

    1. Only generate the next 3–5 questions from the questionnaire.

  3. Dont’s:

    1. Aim to modify previously generated questions, logic, or earlier survey sections.

  4. Good Prompt:

  5. Generate the next 3 questions (Q12–Q14) using the questionnaire, maintaining the XML syntax, formatting, and the same numeric validation structure used earlier.

Task: Reviewing the recently generated questions and correct any syntax, validation, or tag errors so they do not repeat in later generations.

  1. Constraints:

    1. Ensure all XML tags are properly opened and closed.

    2. Remove unnecessary tags such as </> within validation or exec blocks.

    3. Maintain the existing question logic and numbering.

  2. Focus:

    1. Fix only the issues present in the selected generation.

  3. Dont’s:

    1. Do not regenerate the questions. Select and edit instead.

  4. Good Prompt:

    1. Review Q15–Q17 and fix XML syntax, ensuring tags are properly opened/closed and vector logic is used for validations without changing the question logic.

Task: Generating the JavaScript logic required for a question behavior basis on the provided structure.

  1. Constraints:

    1. Follow standard JavaScript practices.

    2. Use the correct question IDs or classes from the HTML structure.

    3. Ensure the script does not interfere with existing survey logic.

  2. Focus:

    1. Only generate the JavaScript logic required for the specified question functionality.

  3. Dont’s:

    1. Do not modify the HTML structure or other survey questions.

  4. Good Prompt:

    1. Create JavaScript for Q39 so selecting the checkbox in column 2 automatically selects column 1, using the existing HTML classes without affecting other questions. (User Task: add the relevant HTML code using Inspect Element.)

Task: Creating the hidden variables and calculation logic needed to compute values based on provided rules or table.

  1. Constraints:

    1. Use hidden variables for calculations where required.

    2. Ensure calculations match the rules provided in the questionnaire.

    3. Maintain consistent naming conventions for hidden variables.

  2. Focus:

    1. Only implement the hidden variable logic for the specified question.

  3. Dont’s:

    1. Do not modify question wording or answer options.

  4. Example Prompt:

    1. Generate S7b using hidden variables hS7bx1 and hS7bx2, calculating values based on the scoring table without modifying the visible question. (User task: Also, explain the logic used for hS7bx1 and hS7bx2)

Task: Update the generated questions to ensure they follow the project’s programming standards and coding rules.

  1. Constraints:

    1. Maintain existing question structure and numbering.

    2. Apply the required survey formatting and validation standards.

    3. Ensure no new syntax errors are introduced.

  2. Focus:

    1. Apply the required updates only to the specified questions.

  3. Dont’s:

    1. Do not regenerate questions or modify unrelated sections.

  4. Good Prompt:

    1. Update Q21–Q23 to follow the project’s standard numeric validation and match the formatting and XML structure used in earlier numeric questions.

Last updated

Was this helpful?