Building block 8 · Going further
Personality
Personality hooks let your extension shape who Charlie is: its voice on every turn, what it does at the start of a new conversation, and how it writes up a conversation when you close it.
What you'd use it for
- Give Charlie a different voice or set of working habits.
- Add a short routine Charlie follows at the start of every new conversation.
- Change how Charlie summarises a conversation when you choose Document and close.
In your manifest
None of the extensions installed today uses these fields, so this is an illustrative example made up for this page. Each field points to a small file that returns text.
{
"name": "plain-speaker",
"description": "Charlie speaks plainly and briefly.",
"version": "0.1.0",
"tier": "core",
"developer": { "name": "You", "contact": "you@example.com" },
"systemPrompt": { "module": "./handlers/systemPrompt.js" },
"bootInstructions": {
"module": "./handlers/bootInstructions.js"
},
"documentInstructions": {
"module": "./handlers/documentInstructions.js"
}
}module.exports = async function systemPrompt() {
return 'You are Charlie. Use short, plain sentences. ' +
'Ask one question at a time.'
}What each part means
| Field | What it does |
|---|---|
systemPrompt | Charlie's base personality. Read fresh on every turn. When any extension provides this, it replaces Charlie's built-in default personality. |
bootInstructions | Instructions delivered once, on the first turn of each new thread. |
documentInstructions | Used instead of Charlie's own write-up instruction when a thread is documented and closed. |
Each module file's default export is an async function that returns a string, or null to add nothing.
Things to know
- Not exclusive. Unlike a role, several extensions can each provide any of these. Charlie joins their text, sorted by extension name, with a blank line between each.
- Static text only. No dates, counters or anything else that changes. Live facts belong in a boot line or a tool.
- No inputs. The function gets an empty
ctx. If your text depends on something live, this is the wrong hook. - Errors are harmless. A hook that throws is logged and treated as adding nothing, so it can't break a turn.
- Replacing the default is all or nothing. As soon as one enabled extension returns
systemPrompttext, Charlie's built-in personality is left out. So write a complete personality that stands on its own. - Old fields are ignored.
wrapInstructionsanddoneInstructionsno longer do anything.
See it in
None of the five examples on this site uses personality hooks, and no extension installed today does either.
Every field in detail: systemPrompt, bootInstructions and documentInstructions in the reference.