Help Centre › Building Processes
Best Practices for Writing AI Instructions
AI instructions allow you to control how ChatGPT modifies wiki content after variables are inserted from a form.
Well-written instructions produce accurate, predictable results.
Poorly written ones can cause confusion or inconsistent documents.
This guide teaches you how to write the best possible {AI: ...} instructions.
1. Be Explicit About What You Want
Vague:
{AI: Fix this section.}Better:
{AI: Rewrite this paragraph in clear, simple English suitable for a South African legal document. Do not remove any names or dates.}The more explicit you are, the safer and more consistent the output.
2. State Exactly What Should Be Removed or Kept
AI must understand scope.
Vague:
{AI: Remove if not needed.}Better:
{AI: If 'has_children' = no, delete the entire section titled 'Guardianship'.}Even better:
{AI: If the variable 'has_children' equals 'no', delete everything between the markers and .}Use sections, headings, or markers to help AI target the correct parts.
3. Reference Variables by Name
AI must understand the source of truth.
Good:
{AI: Use the variable 'marital_status' to rewrite the introduction section accordingly.}Bad:
{AI: Check the user’s marital status.}AI doesn’t know “the user” – it ONLY knows form variables.
4. Give AI the Logic Step-by-Step
AI performs best when instructions are structured.
Example:
{AI:
1. If 'beneficiary_count' = 1, rewrite the distribution clause so that 100% of assets go to the single beneficiary.
2. If 'beneficiary_count' > 1, split the estate equally unless 'percentages' table is provided.
3. Ensure the final wording follows South African legal standards.
}Step-by-step = accurate, consistent output.
5. Use Conditions Clearly
Examples of clean conditional logic:
{AI: If 'is_married' is 'yes', include the Spouse section. If 'is_married' is 'no', remove it.}{AI: If 'beneficiary_gender' = 'female', use pronouns she/her. If 'male', use he/him.}Avoid ambiguous language:
❌ “If married…”
✔ “If is_married = yes…”
6. Use Markers to Structure Complex Logic
For large documents, add hidden markers:
[content here]Then AI instruction:
{AI: If 'has_assets' = no, delete everything between and .}Markers give AI anchor points.
This prevents accidental deletions.
7. Keep Each Instruction Close to the Content It Affects
Don’t put all instructions at the top or bottom.
Place logic next to the content:
Section: Guardianship
{AI: If 'has_children' = no, remove this entire section.}This increases accuracy significantly.
8. Use Specific Language: DO vs DO NOT
Example:
{AI: Rewrite this paragraph using simpler English, but DO NOT change any legal terms.}{AI: Summarise this section in 2 sentences. DO NOT remove the child's full name.}AI respects “do not” instructions well.
9. Define Formatting Rules When Needed
If formatting is important, state it:
{AI: Rewrite this section as a numbered list. Use 1., 2., 3.}{AI: Keep all markdown headers (h2, H2, etc.) unchanged.}{AI: Preserve bold text and table formatting.}10. Tell AI How to Handle Calculations
Example for expense forms:
{AI:
1. Add all the values in the table where variable prefix is 'expense_'.
2. Insert the total into {total_expenses}.
3. Round to 2 decimal places.
}11. Avoid Re-Using Variable Names for Multiple Purposes
Good:
primary_beneficiary_name
primary_beneficiary_gender
primary_beneficiary_percentageBad:
beneficiary
beneficiary2
beneficiaryname
beneficiary-nThe clearer your variables, the easier for AI to process correctly.
12. Provide Examples Where Needed
AI loves examples:
{AI:
Rewrite this in professional tone.
Example:
Input: "he is my executor"
Output: "He shall be appointed as my executor."
}13. Avoid Overlapping Conditions
AI may get confused by contradictory logic.
Bad:
{AI: Remove this if person is married}
{AI: Use this if person is not married}Better:
{AI:
If 'is_married' = yes, use the Married Version section.
If 'is_married' = no, use the Single Version section.
Delete the unused version.
}14. Always Test with Multiple Scenarios
Especially for:
- Wills
- Contracts
- Expense reports
- Leave applications
- Incident reports
Test at least:
- Minimum input
- Full input
- Edge cases
- Missing values
- Contradictory values
This ensures the AI behaves correctly under all conditions.
15. When in Doubt, Over-Explain
ChatGPT prefers:
- Long instructions over short ones
- Specific logic over generic
- Step-by-step over paragraphs
Example:
{AI:
Your tasks:
1. Replace the variable {executor_name} with the proper name from the form.
2. Rewrite the clause to follow South African legal will standards.
3. Adjust pronouns based on {executor_gender}.
4. Keep the formatting exactly as it appears.
}Clear. Predictable. Reliable.