撰写、审查或改进 MindStudio 生成文本块的提示词 — 无论输出是纯文本还是结构化 JSON。在有人...时使用此技能
A skill for writing production-ready prompts for MindStudio's Generate Text block, covering text output, JSON output, variable injection, conditional logic, and dot-notation data access.
Always gather context before writing a single line of prompt. The quality of a MindStudio prompt depends entirely on knowing what variables exist, what the block is supposed to do, and what comes next in the workflow. Never guess at variable names — use the exact names the user has defined.
Ask the user these questions before starting. You don't need all answers for every case, but get as many as apply:
About the block's purpose:
About the inputs (variables coming IN):
topic, userMessage, scrapedContent)?About the output:
About what comes after:
Once you have these answers, use the exact variable names the user provided throughout the prompt — never invent placeholder names like {{yourVariable}} or {{inputData}}.
The Generate Text block sends a prompt to an AI model and returns a response. There are two core decisions to make before writing any prompt:
1. Output Behavior
Display to User — the response is shown directly to the end user.Assign to Variable — the response is saved to a named variable (e.g., reportJSON) for use in later blocks.2. Output Schema
Text (Default) — plain text or markdown. Good for display, emails, chat responses.JSON — structured data. Required when downstream blocks need to access specific fields, iterate over arrays, or pass data to sub-workflows.CSV — tabular data for spreadsheets.Always confirm both before writing the prompt. The output schema shapes every other decision.
MindStudio prompts are plain text written directly into the block's Prompt field. Use Markdown headings and sections to organize longer prompts — the AI reads and follows structure well.
text
<context_variable>
{{variableName}}
</context_variable>
## Task
Describe exactly what the AI should do.
## Style
Describe tone, length, and format expectations.
## Output
Describe what the final response should look like.
Use XML-style tags (e.g., <topic>, <research>, <userInput>) to wrap injected variables. This clearly separates data from instructions and reduces hallucination.
Use double curly braces to inject any workflow variable into the prompt:
text
The user's topic is: {{topic}}
Today's date is: {{currentDate}}
Variables are resolved at runtime — whatever value the variable holds at that moment gets injected as plain text.
For Text (Default) output, write the prompt as a clear set of instructions. Be specific about format and length.
text
<userInput>
{{userMessage}}
</userInput>
Respond to the user's message above in a friendly, helpful tone.
Keep your response to 2-3 paragraphs.
Do not include headers or bullet points.
text
<topic>
{{topic}}
</topic>
<researchNotes>
{{allResearchMaterials}}
</researchNotes>
## Task
Write a comprehensive report based on the research notes above.
## Formatting Rules
- Use ## for major section headings
- Use ### for subsection headings
- Write in prose paragraphs, not bullet points
- Minimum 800 words
## Style
Write like a Bloomberg or NYT analyst: specific, factual, engaging.
Use these inside prompts to control AI output formatting:
ElementSyntaxUse it forHeading 1# TitleTop-level report titleHeading 2## SectionMajor sectionsHeading 3### SubsectionSubsectionsBold**text**Emphasis on key instructionsItalic*text*Secondary emphasisBullet list- itemUnordered listsNumbered list1. itemOrdered stepsBlockquote> textCallouts or notesCode`code`Variable names or exact strings
When Output Schema is set to JSON, the prompt must instruct the model to return only valid JSON and nothing else — no preamble, no markdown fences, no explanation.
Always end with an explicit output instruction that shows the exact schema:
text
Respond only with valid JSON. Do not include any explanation, preamble, or markdown code fences.
JSON Output:
{
"key": "value"
}
When Output Schema is set to JSON in MindStudio, a Sample Output field appears below it. This is separate from the prompt — it tells MindStudio what the JSON structure looks like so it can parse and route the data correctly.
The Sample Output must use realistic example data, not placeholder types like "string" or "number. MindStudio reads this field to understand the shape of the output, so it needs to look like a real response the AI would actually return.
For every JSON prompt you write, always deliver two things:
"string")Example — People Extraction:
Prompt schema (inside the prompt):
json
[
{
"firstName": "string",
"lastName": "string",
"jobTitle": "string",
"company": "string",
"linkedin": "string"
}
]
Sample Output (paste into the MindStudio block setting):
json
[
{
"firstName": "Sarah",
"lastName": "Chen",
"jobTitle": "VP of Marketing",
"company": "Acme Corp",
"linkedin": "https://www.linkedin.com/in/sarahchen"
}
]
Example — Research Report:
Prompt schema (inside the prompt):
json
{
"title": "string",
"subtitle": "string",
"sections": [
{
"header": "string",
"subsections": [
{
"h3": "string",
"paragraphs": ["string"]
}
]
}
]
}
Sample Output (paste into the MindStudio block setting):
json
{
"title": "The Rise of Autonomous AI Agents",
"subtitle": "How software that acts on its own is reshaping the enterprise",
"sections": [
{
"header": "Market Overview",
"subsections": [
{
"h3": "Current Adoption",
"paragraphs": ["Enterprise adoption of AI agents has accelerated rapidly since 2023, with over 40% of Fortune 500 companies piloting autonomous workflow tools."]
}
]
}
]
}
Rules for writing Sample Output:
"string", "value", or "example"text
<userTopic>
{{topic}}
</userTopic>
Generate 3 diverse Google search queries that would help research the topic above.
Respond only with a JSON array of strings. No explanation, no markdown.
JSON Output:
["query1", "query2", "query3"]
text
<articleMaterials>
{{allResearchMaterials}}
</articleMaterials>
Write a full research report based on the materials above.
## Output Rules
- Title: concise, descriptive
- Subtitle: one compelling hook sentence
- At least 3 sections, each with 2+ subsections
- Each subsection must have at least 2 long paragraphs
- Sources: include URL and title for each source used
Respond only with valid JSON matching this exact schema. No markdown, no preamble.
JSON Output:
{
"title": "string",
"subtitle": "string",
"sections": [
{
"header": "string",
"subtitle": "string",
"subsections": [
{
"h3": "string",
"paragraphs": ["paragraph 1", "paragraph 2"]
}
]
}
],
"sources": [
{
"url": "string",
"title": "string"
}
]
}
MistakeFixAI wraps output in ```json fencesAdd "Do not use markdown code fences" to promptAI adds explanation before the JSONAdd "Respond ONLY with JSON and nothing else"AI uses single quotesSpecify "Use double quotes for all keys and values"AI adds trailing commasAdd "Ensure valid JSON with no trailing commas"Output schema is missingAlways include a sample JSON schema in the prompt
When a variable holds a JSON object or array, access specific fields using dot notation inside any subsequent prompt or block.
If a variable user holds:
json
{
"name": "Alice",
"contact": {
"email": "alice@example.com"
}
}
Access it in a prompt like this:
text
Name: {{user.name}}
Email: {{user.contact.email}}
If a variable data holds:
json
{
"fruits": ["apple", "banana", "cherry"]
}
Access by index (zero-based):
text
First fruit: {{data.fruits.[0]}}
Second fruit: {{data.fruits.[1]}}
If a variable team holds:
json
{
"users": [
{ "id": 1, "name": "Alice" },
{ "id": 2, "name": "Bob" }
]
}
Access like this:
text
First user: {{team.users.[0].name}}
Second user's ID: {{team.users.[1].id}}
In a sub-workflow launched with a person launch variable:
json
{
"firstName": "Mark",
"lastName": "Benioff",
"jobTitle": "CEO",
"company": "Salesforce"
}
Use in the prompt:
text
Find the work email for {{person.firstName}} {{person.lastName}},
who is the {{person.jobTitle}} at {{person.company}}.
Use {{#if}} / {{else}} / {{/if}} to branch prompt behavior based on whether a variable exists and has a value.
text
{{#if customerName}}
Write a personalized thank-you email to {{customerName}}.
{{else}}
Write a general thank-you email to all customers.
{{/if}}
text
{{#if userType}}
{{#if isPremium}}
Generate a premium onboarding message for {{userType}}.
{{else}}
Generate a standard onboarding message for {{userType}}.
{{/if}}
{{else}}
Generate a generic onboarding message.
{{/if}}
When a Generate Text block outputs a JSON array and a downstream Run Workflow block iterates over it, each item becomes {{item}} in the sub-workflow.
text
Generate an array of 3 Google search queries for the topic: {{topic}}
Respond only with a JSON array. No explanation.
JSON Output:
["query1", "query2", "query3"]
Configure the Run Workflow block:
JSON Array Input (Advanced){{queries}}query : {{item}}text
Search query: {{query}}
Based on this query, write 3 key findings from research on the topic.
For any prompt:
{{double curly braces}}?<userInput>, <research>)?For JSON output:
JSON?"string" placeholders) to paste into the MindStudio block setting?For dot notation access:
.[0], .[1]?.?