Skip to content

feat(compat): wire the identity + safety-preamble prompt block into subagent prompts #186

Description

@OGtwelve

Problem

The ordered prompt-block pipeline (#105) exports identityBlock and a safety-preamble slot, but production prompts never use them: identityBlock appears only in packages/ai-claude-compat/src/index.ts (re-export) — role identity is scattered inline in session guidance ("You are the Worker…"), and no safety-preamble text exists anywhere in the built subagent prompts. The decomposition's block 1 (identity + safety preamble) is unrepresented.

What

Add a shared default safety-preamble to defaultContractBlocks() (or route each role's first line through identityBlock) so every production subagent prompt carries the identity + safety preamble the harness leads with. Keep it provider-agnostic, short, and behavioral (no policy the loop can't honor).

Constraints (per CLAUDE.md)

Portable ESM, strict TS, paired *.test.ts; primitives in compat, wiring in aitm.

Acceptance criteria

  • Every production subagent prompt (planner/worker/reviewer/editor/ci-fix/take-over) contains the identity + safety-preamble block.
  • bun test + node --test + biome + tsc all green (both packages).

Found during the post-epic-#100 parity verification pass (A1). P2 follow-up.

Part of #196.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions