Contract
- Input: workload inventory, event sources, traffic profile, latency requirements, cost constraints, and failure cases.
- Output: serverless architecture with function boundaries, event source mapping, cold start strategy, scaling policy, cost model, and failure handling.
- Scope: stay within the skill's declared boundaries; do not broaden without explicit direction.
- Rule: documented standards override defaults; explicit project rules take precedence.
- Rule: if blocked by missing context or dependencies, surface the blocker before proceeding.
Provenance
| Question |
Answer |
| What is the source of truth? |
The user's request, originating spec/issue, and the skill's declared outputs |
| What is in scope? |
Work covered by the skill's acceptance criteria and completion rules |
| What is explicitly out of scope? |
Files, behaviors, and decisions outside the skill's declared boundary |
| Who or what consumes this artifact afterward? |
The next skill in the workflow or the user |
| What evidence proves it is done? |
Completion criteria met, artifact saved, validation passed |
| What risk remains? |
Subjective judgment calls, missing context, or external dependency failures |
Artifact
Emit ServerlessArtifact as both:
- JSON:
.agents/skills/platform/artifacts/serverless/{identifier}.json
- Markdown view: same filename with
.md extension
Serverless
Use this skill when designing, reviewing, or refactoring serverless systems — Lambda, Azure Functions, Google Cloud Functions, FaaS platforms, event-driven workflows, cold start mitigation, auto-scaling, and cost optimization.
Process
1. Inventory workloads and event sources
- Catalog existing functions, triggers, and integrations.
- Classify workloads by traffic shape: steady, spiky, batch, or event-burst.
- Map event sources: HTTP, queue, schedule, storage change, or stream.
Completion criterion: workload inventory documented with event sources and traffic shape.
2. Define function boundaries and triggers
- Group functionality by domain capability and ownership.
- Assign event sources to functions: API Gateway, SQS, SNS, EventBridge, or storage notifications.
- Define function timeout, memory, and environment configuration.
Completion criterion: function map documented with triggers, timeouts, and ownership.
3. Design cold start and scaling strategy
- Classify functions by latency sensitivity: latency-critical, background, or batch.
- Plan provisioned concurrency, reserved concurrency, and burst limits.
- Define scaling limits and queue-based throttling behavior.
Completion criterion: cold start mitigation and scaling limits documented per function class.
4. Plan state, storage, and integration
- Choose stateless function design with external state stores: DynamoDB, S3, Redis, or databases.
- Define connection pooling and reuse for external services.
- Plan idempotency and exactly-once processing where required.
Completion criterion: state management and integration strategy documented with retry behavior.
5. Configure observability and logging
- Define structured logging, distributed tracing, and metric collection.
- Set up error reporting, dead-letter queues, and alarm thresholds.
- Document operational runbook for function failures and throttles.
Completion criterion: observability and operational runbook documented.
6. Estimate cost and define budgets
- Model cost per invocation, duration, and data transfer.
- Define budget alerts and cost allocation tags.
- Plan cost optimization: memory tuning, batching, and reducing unnecessary invocations.
Completion criterion: cost model and budget controls documented.
Rules
- Rule: keep function logic under the invocation timeout; offload long-running work to queues or step functions.
- Rule: treat environment variables as configuration, not secrets; use a secrets manager for credentials.
- Rule: design for retry semantics at the event source; handle duplicates idempotently.
- Rule: document cold start impact and provisioned concurrency decisions explicitly.
- Rule: version function artifacts and keep deployment immutable.
- Rule: test locally with production-like event payloads and cold start conditions.
Completion
- the skill's completion criteria are explicitly checked
- the artifact is saved and validated
- any blockers or skipped validations are documented
- the next consumer is identified or the work is handed off
@include .agents/skills/platform/contract-base.xml
1---2name: "serverless"3category: "backend"4maturity: "stable"5version: "1"6description: "Serverless architecture (Lambda, Functions, FaaS, event-driven, cold starts, scaling, cost)."7license: "MIT"8capabilities:9 - apply serverless methods within explicit backend boundaries10 - analyze serverless architecture (lambda, functions, faas, event-driven, cold starts, scaling, cost) with assumptions, constraints, and failure modes11 - produce and validate a backend artifact with evidence, decisions, and next steps12outputs: "serverless architecture with function boundaries, event source mapping, cold start strategy, scaling policy, cost model, and failure handling."13sideEffects: []14dependencies: []15stopCondition: "Serverless architecture, event sources, scaling behavior, and cost model are explicit."16risk: "medium"17trustTier: "3"18maxIterations: "6"19promptVersion: "2.0"20artifactType: "backend"21modelTier: "reasoning"22evaluators: ["behavioral", "regression"]23fixturesPath: .agents/skills/platform/fixtures/behavioral/serverless.json24diataxis: "how-to"25tags: ["backend"]26compatibility: []27approvalRequired: "true"28approvalFor: []29metadata:30 source: https://skillmd.com/skills/quantumquirkxyz/serverless31---3233## Contract3435- Input: workload inventory, event sources, traffic profile, latency requirements, cost constraints, and failure cases.36- Output: serverless architecture with function boundaries, event source mapping, cold start strategy, scaling policy, cost model, and failure handling.37- Scope: stay within the skill's declared boundaries; do not broaden without explicit direction.38- Rule: documented standards override defaults; explicit project rules take precedence.39- Rule: if blocked by missing context or dependencies, surface the blocker before proceeding.4041## Provenance4243| Question | Answer |44|---|---|45| What is the source of truth? | The user's request, originating spec/issue, and the skill's declared outputs |46| What is in scope? | Work covered by the skill's acceptance criteria and completion rules |47| What is explicitly out of scope? | Files, behaviors, and decisions outside the skill's declared boundary |48| Who or what consumes this artifact afterward? | The next skill in the workflow or the user |49| What evidence proves it is done? | Completion criteria met, artifact saved, validation passed |50| What risk remains? | Subjective judgment calls, missing context, or external dependency failures515253## Artifact5455Emit `ServerlessArtifact` as both:56- JSON: `.agents/skills/platform/artifacts/serverless/{identifier}.json`57- Markdown view: same filename with `.md` extension585960# 61# 62# Serverless6364Use this skill when designing, reviewing, or refactoring serverless systems — Lambda, Azure Functions, Google Cloud Functions, FaaS platforms, event-driven workflows, cold start mitigation, auto-scaling, and cost optimization.656667## Process6869### 1. Inventory workloads and event sources70- Catalog existing functions, triggers, and integrations.71- Classify workloads by traffic shape: steady, spiky, batch, or event-burst.72- Map event sources: HTTP, queue, schedule, storage change, or stream.7374**Completion criterion:** workload inventory documented with event sources and traffic shape.7576### 2. Define function boundaries and triggers77- Group functionality by domain capability and ownership.78- Assign event sources to functions: API Gateway, SQS, SNS, EventBridge, or storage notifications.79- Define function timeout, memory, and environment configuration.8081**Completion criterion:** function map documented with triggers, timeouts, and ownership.8283### 3. Design cold start and scaling strategy84- Classify functions by latency sensitivity: latency-critical, background, or batch.85- Plan provisioned concurrency, reserved concurrency, and burst limits.86- Define scaling limits and queue-based throttling behavior.8788**Completion criterion:** cold start mitigation and scaling limits documented per function class.8990### 4. Plan state, storage, and integration91- Choose stateless function design with external state stores: DynamoDB, S3, Redis, or databases.92- Define connection pooling and reuse for external services.93- Plan idempotency and exactly-once processing where required.9495**Completion criterion:** state management and integration strategy documented with retry behavior.9697### 5. Configure observability and logging98- Define structured logging, distributed tracing, and metric collection.99- Set up error reporting, dead-letter queues, and alarm thresholds.100- Document operational runbook for function failures and throttles.101102**Completion criterion:** observability and operational runbook documented.103104### 6. Estimate cost and define budgets105- Model cost per invocation, duration, and data transfer.106- Define budget alerts and cost allocation tags.107- Plan cost optimization: memory tuning, batching, and reducing unnecessary invocations.108109**Completion criterion:** cost model and budget controls documented.110111## Rules112113- Rule: keep function logic under the invocation timeout; offload long-running work to queues or step functions.114- Rule: treat environment variables as configuration, not secrets; use a secrets manager for credentials.115- Rule: design for retry semantics at the event source; handle duplicates idempotently.116- Rule: document cold start impact and provisioned concurrency decisions explicitly.117- Rule: version function artifacts and keep deployment immutable.118- Rule: test locally with production-like event payloads and cold start conditions.119120## Completion121122- the skill's completion criteria are explicitly checked123- the artifact is saved and validated124- any blockers or skipped validations are documented125- the next consumer is identified or the work is handed off126---127@include .agents/skills/platform/contract-base.xml