integrate-internal-serviceslisted
Install: claude install-skill kennguyen887/agent-foundation
# Integrate internal services
How services in the SAME platform talk to each other — sync RPC, async fan-out, robust consumers,
cross-service reads, context propagation, and the worker shape. Examples NestJS/TS, neutral
`listing`/`order`/`payment` domain; `<Svc>` is a placeholder. principle → **▸ Example** → **▸ Other
stacks**. The *client* side of a call (proxy lifecycle/retries/base `send()`) and the single
producer→consumer event live in `write-service-code` §6/§9 — this skill is the rest of the mesh.
For third-party/vendor systems and inbound webhooks, see `integrate-external-services`.
## When to use
You're exposing an operation for another service to call, fanning one event out to many subscribers,
hardening a queue consumer, resolving data that lives in another service, or building a pure worker.
## 1. Synchronous RPC — server side + a uniform envelope
- **Expose operations via a message-pattern handler** (the reply side); the *client* side (proxy
lifecycle, retries, base `send()`) is `write-service-code` §9. Keep the handler thin — delegate to
a command/query bus.
- **Wrap every request and reply in a stable envelope, never bare payloads.** Request carries
`{ id (correlation), service (caller), pattern, input }`; reply carries
`{ success, data, message, statusCode }`. One shared **interceptor** builds the success reply + logs
`id`/`pattern`; one shared **exception filter** maps a thrown error to a failed envelope — so every
caller gets the same shape an