Cookbooks
Six recipes for taking the substrate beyond a demo. Each maps to a workshop block.
The six recipes
1 · Modify a guardrail agent
Open Guardrail Designer in LIFEOSAI UI · edit Skills + Instructions · re-run. Day 2 PM.
2 · Build your own front-end
Minimal HTML + fetch against orchestration API. Replace the LIFEOSAI UI. Day 3 PM.
3 · Add a 10th agent in code
Author AGENTS.md + skills + adapter config. Wire into the existing 9-agent pipeline. Day 3 PM.
4 · Philippines-IoT reframe
Replace email-driven review with heartbeat-watching agent + approval gate. Day 4.
5 · Spin up a new office
Live-add a company in LIFEOSAI · same engine · isolated data · shared library. Day 5 Slide 5.
6 · Wire a Claude hook
SessionStart · UserPromptSubmit · PreCompact · PostCompact. What hooks see and when.
Detailed write-ups
Each cookbook expands during workshop prep. Today’s stubs:
1 · Modify a guardrail agent
In LIFEOSAI UI: navigate to AI Guardrail Lab → Agents → Guardrail Designer. The right pane shows Skills (markdown files) and Instructions (the SOUL). Edit. Save. Trigger a re-run from an existing issue.
The change is live for the next wakeup. No deploy. No restart.
2 · Build your own front-end
The orchestration substrate exposes 17 HTTP routes. A minimal viable front-end needs three:
GET /api/agents/:companyId— list agentsGET /api/issues/:companyId— list issues (Kanban board)POST /api/issues/:id/comment— drop a comment
A 200-line HTML file with fetch() calls is enough to replace the entire LIFEOSAI UI for read+comment workflows.
3 · Add a 10th agent in code
# 1. Create the SOULvim agents/10-watchdog.md # follow the Analyzer SOUL template
# 2. Wire it into orchestrationpsql -c "INSERT INTO agents (id, name, role, adapter_type, company_id) VALUES (...)"
# 3. Create a routinepsql -c "INSERT INTO routines (agent_id, schedule) VALUES (..., '*/5 * * * *')"That’s it. The watchdog runs every 5 minutes. Heartbeat picks it up.
4 · Philippines-IoT reframe
Current: 4–5 chief engineers read IoT alerts + manuals + circulars, write emails to superintendents.
Reframe:
- Heartbeat agent watches IoT alert stream
- 5 analyzers read each alert through Engineer · Class · Operator · Charterer · Owner lenses
- Story-builder clusters per-vessel
- Approval gate queues the draft email to superintendent — approved via WhatsApp
- Sender dispatches on approval
Could scale 5/day → 50/day. Engineers shift from doing to reviewing.
5 · Spin up a new office
LIFEOSAI top-left dropdown → ”+ New company”. Name it, pick a baseline (Guardrail Lab, blank, IoT-watch). The DB schema isolates by company_id. The library is shared. Agents per-office.
Demo on Day 5: live-add NBS-Dev in front of the room. Single command.
6 · Wire a Claude hook
# Edit your global hooksvim ~/.claude/hooks/SessionStart
# Hook receives JSON on stdin, can output context-injection JSON on stdoutThe four hook points:
- SessionStart — agent waking up · inject cold-start context here
- UserPromptSubmit — user typed input · inject recent-act memory here
- PreCompact — context about to compact · save state to leave-note
- PostCompact — context just compacted · post recovery report