Ways to Build Scripts
- Visual Block Editor - A drag-and-drop interface for building scripts without writing code. Add text blocks, insert variables, and create conditional branches visually.
- Code Mode - A full scripting language with syntax highlighting for power users. Includes optional Vim keybindings for those who have seen the light.
Writing a custom AI instruction template in TheBrain 15 involves structuring a prompt using placeholders (variables) that automatically pull contextual data from your current thought, notes, or attached files.
Here is a step-by-step example of how to create and structure a template designed to generate structured sub-topics and note summaries.
Step-by-Step Example: "Thought Analyzer & Sub-Topic Generator"
1. Template Metadata Setup
When creating a new template in Cerebro AI / Script Manager, define the primary trigger parameters:
- Name: Thought Analyzer & Sub-Topic Generator
- Shortcut / Slash Command:
/analyze - Target Output: Notes Editor / Floating Cerebro Window
- Execution Mode: Insert at end of current note
2. Writing the Template Prompt Script
In the template editor code/prompt block, combine standard instructions with TheBrain context variables:
Role: You are a knowledge management specialist and researcher.
Task:
Analyze the active thought titled "{{thought.title}}" and its current notes content below.
Context:
- Active Thought: {{thought.title}}
- Parent Thoughts: {{thought.parents}}
- Tags: {{thought.tags}}
- Note Content:
---
{{thought.note}}
---
Instructions:
1. Provide a concise 2-sentence summary of the core concept.
2. Extract 3–5 key insights or takeaways formatted as bullet points.
3. Suggest 3 new potential child thoughts to expand this topic, formatted as a bulleted list using standard markdown links (e.g., `[Child Thought Name]`).
4. Generate a Markdown Table comparing the primary concepts or items mentioned in the note.
Key Built-in Variables in TheBrain 15