haops_read_protocol
Read the work protocol for a specific agent role in a project, defining scope, workflow, and handoff instructions. Supports lazy loading of skills or bundled full document.
Instructions
Read the work protocol for a specific agent role in a project. Protocols define HOW agents should work (scope, workflow, handoff, etc.).
OUTPUT SHAPES (v2.6 — F4 composed protocols):
• Legacy project (templateId IS NULL) — always returns the raw monolithic shape regardless of mode: { mode: "legacy", version, bytes, body, content, ... }. The mode and bundle params have no effect; output is byte-identical to v2.5.
• Composed project + mode="lazy" (DEFAULT) — { mode: "composed-lazy", version, bytes, body: "", coreContent, skillRefs[], warnings? }. Agent reads coreContent for the boot section, then uses haops_read_skill to fetch individual skill bodies on demand.
• Composed project + mode="bundle" — { mode: "composed-bundle", version, bytes, body, skillRefs[], warnings? }. Full composed markdown in body (template baseBody + each enabled skill body + customContent, joined with "---"). Use this when caching offline or when you need the full document in one round-trip.
When version is set, returns that specific historical row (raw DB shape — version history predates composed mode; mode/bundle are ignored).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | F4: how to resolve composed protocols. 'lazy' (default) returns the boot section + skill manifest; agent fetches skill bodies via haops_read_skill. 'bundle' returns the full composed markdown in one shot. Ignored for legacy projects. | |
| role | Yes | Agent role to read protocol for (e.g., architect, dev, qa, devops) | |
| version | No | Specific version number to read. If omitted, returns the current version. When set, mode is ignored (historical snapshots are raw DB rows). | |
| projectSlug | Yes | The project slug (URL identifier) |