Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
prompt
What it is
Part of the agent sessions feature. Static prompt fragments composed into
AI system prompts: one module per prompt section, each exporting a
StaticPrompt (or a dynamically-built ComposedPrompt) that chains via
StaticPrompt::compose.
Start here
src/lib.rs: the module list — one file per topic (about_macro.rs,agent_identity.rs,mentions.rs,user_tools.rs, ...).src/types.rs:StaticPromptandComposedPrompt— the composition mechanism every module uses.src/coding_agents.rs: an example pairing a.rsmodule with a sibling text file for the actual prompt text.
Scope
- Owns: the wording of static, reusable prompt sections and how they compose.
- Not here: deciding which sections go into a given agent's final prompt, or
per-turn dynamic context →
agent,agent_harness.
Boundaries
- Used by:
ai_tools,agent_inmem,channel_bots,agent,system_skills,services/agent_harness_service,services/agent_harness_service,services/agent_harness_service.
Recipes
- Add a prompt section: new
src/<topic>.rs(+src/<topic>.mdif the text is long) exporting apub static PROMPT: StaticPrompt→pub modit insrc/lib.rs→ compose it where the caller builds its prompt. - Guidance for one tool goes in that tool's description, and how an area of
Macro works (databases, CRM, email, calendar, channels, tasks, routines,
documents, search) in its SDK namespace's
@agentTSDoc block, never here:ai_toolsinlines it from the generated catalog, and routed turns load it per entity. Only cross-cutting rules live in this crate.code_mode.rsis only the general code-mode section.
Tool contracts
Direct session-aware search/listing stays available in code mode; do not route conversation work to legacy chat tools or SDK namespaces.
Canvas live reads/edits stay on
ReadCanvas/ApplyCanvasEdits/EditCanvas, including code mode; the public SDK document content endpoint does not represent the shared scene. The agent-session prompt distinguishes typed<m-notifications>system facts from user requests and defines the notification-only<noop/>contract. In-app replies usem-document-mentionwithblockName: "routine"for routines; external MCP replies use/app/routines/<id>URLs. A form for a channel is a poll (one required select question, tally visible), posted once as<m-document-card>withblockName: "form"; the card's message reference grants the channel View, so no second message or link is needed.src/privacy.rssupplies generation/judge privacy policy;composejoins runtime memory sections without static lifetimes.
Checks
cargo test -p prompt(SQLX_OFFLINEunset).
Related
- Rules:
.agents/rules/rust/architecture.md