protocol-change
Change agent-office's public contracts — AgentEvent fields, inbox/reply/messages HTTP APIs, the IPC contract (AgentOfficeApi, ServerMessage), or the hook's output. Use whenever packages/shared/src/{pr
SKILL.md.claude/skills/protocol-change/SKILL.md
GitHubChange a public contract (additive only)
External agents and installed hooks depend on these shapes. See ARCHITECTURE.md.
- Red — add a case to
packages/shared/src/index.test.tsfor the new field/shape. The compatibility guard ({agentId}alone parses; unknown fields ignored) must stay green. - Green — add the field as optional in the zod schema / type. Never rename, remove, retype, or make a field required.
- Core — if it's agent state: merge logic + tests in
packages/core/src/domain/agent.ts(applyEventmerges only defined fields; add it to the visible fields if it should trigger an upsert). - Adapters — HTTP route +
packages/adapters/src/http/http-api.test.ts(400 for invalid input, success path); IPC handler +packages/desktop/src/main/ipc-api.test.tsand the preload bridge. - Renderer — reducer (
web/src/app/state.ts) and view-model tests, then rendering (adapters/three/avatar.ts,adapters/dom/*) withtextContentonly. - E2E — extend the relevant
packages/adapters/test/e2e.*.test.ts; for IPC, a spec inpackages/desktop/e2e/. - Docs — README schema tables and examples.
make checkandmake build test-ui.
A breaking change is only allowed with an explicit major-version note in the README and the user's agreement.