Example 1: Using Briefing Template (compose an agent brief)
renderTemplate(templatePath, data) takes a path under Templates/ and a data object and returns the text. renderTemplate({ templatePath, dataPath }) renders from a .yaml or .json file instead.
// Render a structured agent brief from data before launching general-purpose
import { renderTemplate } from '${LIFEOS_SKILL_DIR}/Tools/RenderTemplate.ts';
const prompt = renderTemplate('Primitives/Briefing.hbs', {
briefing: { type: 'research' },
agent: { id: 'EN-1', name: 'Skeptical Thinker', personality: {...} },
task: { description: 'Analyze security architecture', questions: [...] },
output_format: { type: 'markdown' }
});
Example 2: Ideal-state brief from a data file (outcomes, constraints, tools)
The data states what done looks like, the limits, and the tools; it carries no steps.
# Data: attack-surface-brief.yaml
briefing: { type: analysis }
agent: { id: SEC-1, name: Attack Surface Reviewer }
context:
summary: Review the public API of the billing service before launch.
background: "Tools available: the repo checkout, rg, and read-only staging credentials."
constraints:
- Read-only; no writes to staging or production.
- Findings cite file:line or a reproducible request.
task:
description: Report the external attack surface of the billing service.
deliverables:
- Every external entry point is listed with its auth requirement.
- Each finding carries a severity and a reproducible request or file:line.
- Entry points that could not be checked are named, with the reason.
output_format: { type: markdown }
# Relative paths are looked up under Templates/ first, then the current directory (so attack-surface-brief.yaml can sit where you run this).
bun run ${LIFEOS_SKILL_DIR}/Tools/RenderTemplate.ts \
--template Primitives/Briefing.hbs \
--data attack-surface-brief.yaml --preview