Goal
Design serverless functions that are focused, secure, and explicit about runtime constraints.
When to Use
- The implementation target is a serverless runtime.
- A webhook, lightweight API, or event handler needs design.
- Cold start, execution time, or stateless behavior matter.
Instructions
- Define trigger, payload, caller, and trust boundary.
- Separate validation, auth, business logic, and integration code.
- Plan retries, idempotency, timeout behavior, and observability.
- Keep deployment and environment assumptions explicit.
Constraints
- Do not turn one function into a miniature monolith.
- Never expose privileged credentials to the client.
- Keep runtime limits visible in the design.
Output Format
- function summary
- trigger and contract
- runtime and security notes
- scaffold guidance
Examples
- "Plan a serverless webhook handler."
- "How should these event-driven functions be split?"