| name | service-boundary-stub |
| description | Use when an uncertain external system needs a typed service boundary and realistic stub. |
Service Boundary Stub
Use this skill to keep uncertain integrations out of UI code.
Workflow
- Identify the external system, owner, data shape, and failure modes.
- Read
references/service-boundaries-and-stubs.md; fall back to docs/foundation/service-boundaries-and-stubs.md when installed.
- Define the minimum typed interface needed by the product workflow.
- Start with deterministic stubs if the real contract is unclear.
- Include realistic states: success, empty, partial, stale, unavailable, failed.
- Parse untrusted payloads from
unknown before UI uses them.
- Add focused service tests for success and malformed payloads.
Placement
- Shared external integrations:
src/services/<service>/.
- Feature-specific adapters:
src/features/<feature>/<feature>-service.ts.
- Keep screens/routes thin.