Customizing Spawn Prompts
wu:brief ships with a host-neutral prompt composition. Projects can add or
override domain guidance under .lumenflow/templates/ without creating a
second agent contract.
Defaults first
Section titled “Defaults first”Most projects should use the built-in composition unchanged:
Create .lumenflow/templates/ only when the project needs additional domain,
architecture, verification, or lane guidance.
Cache-aware layout
Section titled “Cache-aware layout”Every brief has three stable regions:
- a cacheable prefix containing standing methodology;
<!-- LUMENFLOW_STABLE_PREFIX_END -->;- the volatile WU body and final constraints recap.
Do not move content across that boundary casually. Changing the prefix bytes reduces prompt-cache reuse and invalidates brief-metrics baselines.
Inspect token attribution with:
Add a project template
Section titled “Add a project template”-
Create a template
Add
.lumenflow/templates/spawn-prompt/api-standards.md: -
Register it in the manifest
-
Validate and preview
Override built-in sections
Section titled “Override built-in sections”A project template with the same id as a built-in section replaces that
section. Common IDs include:
| Purpose | Template ID |
|---|---|
| Testing methodology | methodology-tdd, methodology-test-after, methodology-none |
| Architecture | architecture-hexagonal, architecture-layered, architecture-none |
| Verification | verification-requirements, structured-content-directive |
| Skill selection | skills-selection, code-craft |
| Edit discipline | read-before-write |
| Coordination | mandatory-agents, agent-coordination |
| Completion | self-review, completion-workflow, constraints |
Wrapper-style overrides can use the fully rendered default section token to prepend or append project guidance without losing computed content.
Tokens and conditions
Section titled “Tokens and conditions”Useful tokens include:
| Token | Meaning |
|---|---|
{WU_ID} | Current WU id |
{LANE} | Lane name |
{TYPE} | WU type |
{WORKTREE_PATH} | Claimed worktree path |
{TITLE} | WU title |
{DESCRIPTION} | WU description |
{WORK_DOMAIN} | Classified work domain |
{REQUIRED_VERIFICATION} | Verification declared by the WU |
Conditions may use type, lane, laneParent, work.domain,
work.testMethodologyHint, hasRequiredVerification, and the tests.*
presence flags.
Prompt optimizer dry run
Section titled “Prompt optimizer dry run”Maintainers can evaluate a rewrite without applying it:
The report contains the source hash, diff, token delta, provenance, and eval result. Only an eval-passing candidate should be adopted.
Portability rules
Section titled “Portability rules”- Keep project commands and domain knowledge in project templates.
- Refer to canonical skills by their
.lumenflow/skills/<name>/SKILL.mdname. - Do not embed host invocation syntax, plugin namespaces, or host-specific paths.
- If a host requires a different prompt transport, adapt the completed brief in project-owned configuration; do not fork the canonical template policy.
- Test conditions and token replacement after every template change.