docs: document hook-based system prompt; fix hooks example to array form

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-04-19 12:16:42 +02:00
parent 800dfa526e
commit d8c0f8a8a3
1 changed files with 13 additions and 3 deletions

View File

@ -57,15 +57,25 @@ No build step — ollie-core is a library.
}
},
"hooks": {
"agentSpawn": "notify-send ollie started",
"userPromptSubmit": "",
"stop": ""
"agentSpawn": [
"$OLLIE/x/prime 00_base",
"$OLLIE/x/prime 01_ollie",
"notify-send ollie started"
],
"userPromptSubmit": [],
"stop": []
}
}
```
MCP server `env` values support `${VAR}` expansion from the parent environment.
Hook values accept a string or an array of strings. Commands run in order; each command's stdout is appended to the system prompt context. Exit code 2 blocks the triggering action; any other non-zero exit is a non-blocking warning.
### System prompt
There is no built-in system prompt. The system prompt is assembled entirely from `agentSpawn` hook output. The `prime` script (`$OLLIE/x/prime <name>`) reads a file from `p/` and writes it to stdout with environment variable substitution — use it in `agentSpawn` to compose the system prompt from prompt template files. The fully assembled result is readable at `s/<id>/systemprompt`.
### Sandbox config: `~/.config/ollie/sandbox.yaml`
Controls landrun sandboxing for `execute_code`. Created automatically with defaults on first run. See the file header for documentation.