agentsclimarketplace

Serverless patterns

Skill sairam0424/MindForge/.mindforge/skills/serverless-patterns

MindForge: The Enterprise Agentic Framework for Claude Code & Antigravity. High-performance autonomous execution, wave-parallelism, and multi-tier governance for production-grade AI engineering.From the repository description

Install
npx -y skills add sairam0424/MindForge --skill serverless-patterns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.6 KB, 945 tokens by cl100k_base, as published. Nobody here has run it

Skill — Serverless Patterns

When this skill activates

Any task involving serverless function design, cold start optimization, function composition, event-driven architectures using FaaS platforms, or cost modeling for serverless workloads.

Mandatory actions when this skill is active

Before writing any code

  1. Identify the trigger type (HTTP, queue, schedule, storage event, stream).
  2. Determine state requirements and where state will live (DynamoDB, Redis, S3).
  3. Estimate invocation volume and duration for cost projection.
  4. Decide composition pattern (Step Functions vs choreography vs direct invoke).

During implementation

  • Keep functions focused (single responsibility).
  • Externalize all state (no reliance on local filesystem or memory between invocations).
  • Implement idempotency keys for retry-safe operations.
  • Set appropriate timeout values (not max — just enough + buffer).
  • Use structured logging with correlation IDs for distributed tracing.
  • Checkpoint long-running work before timeout boundary.

After implementation

  • Verify cold start latency meets SLA requirements.
  • Confirm cost model aligns with budget (invocations × duration × memory).
  • Test retry and failure scenarios end-to-end.
  • Monitor concurrency limits and throttling metrics.

Cold Start Mitigation

Techniques

  1. Provisioned concurrency — Pre-warm N instances (cost trade-off).
  2. Bundle optimization — Smaller deployment = faster init.
  3. Avoid VPC — VPC attachment adds 5-10s cold start (only if DB needed).
  4. Lazy initialization — Defer heavy setup until first request needs it.
  5. Connection pooling — Use RDS Proxy or connection pool service.
  6. Language choice — Go/Rust cold start < Python < Java/Node.

When cold start matters

  • Synchronous user-facing APIs (matters a lot).
  • Async queue processors (usually doesn't matter).
  • Scheduled jobs (doesn't matter at all).

Composition Patterns

Step Functions (Orchestration)

  • Central coordinator manages workflow state.
  • Built-in retry, catch, timeout per step.
  • Visual debugging of execution history.
  • Best for: complex workflows, human approval steps, long-running processes.

Choreography (Event-Driven)

  • Each function emits events, others react.
  • No single point of failure.
  • Harder to debug end-to-end.
  • Best for: loosely coupled, independent scaling per step.

Fan-Out / Fan-In

  • Dispatch N parallel tasks → aggregate results.
  • Use SQS/SNS for fan-out, DynamoDB for aggregation.
  • Handle partial failures gracefully.

State Management

State TypeSolutionUse When
Session stateDynamoDB / RedisAuth tokens, cart
Workflow stateStep FunctionsMulti-step processes
CacheElastiCache / DAXRepeated reads
File stateS3Large objects
Event stateEvent carriedPass between functions

Cost Model

Monthly cost = (invocations × $0.20/1M) + (GB-seconds × $0.0000166667)

Cost comparison triggers

  • If >1M invocations/hour sustained → consider containers.
  • If function runs >15min → containers or batch.
  • If always-on with predictable load → containers cheaper.
  • If spiky/unpredictable → serverless wins on cost.

Trigger Patterns

TriggerPatternKey Concern
HTTP (API Gateway)Request/responseCold start latency
SQSQueue consumerBatch size, visibility timeout
Schedule (cron)Periodic jobIdempotency on overlap
S3 eventFile processorDuplicate events possible
DynamoDB streamChange captureOrdering guarantees
KinesisStream processorShard iterator, checkpointing

Timeout Strategy

  • Set timeout = expected p99 duration + 20% buffer.
  • Checkpoint work before 80% of timeout.
  • Implement dead-letter queues for timed-out invocations.
  • Never set timeout to maximum "just in case."

Self-check

  • Function is idempotent (safe to retry).
  • State externalized (no local filesystem reliance).
  • Timeout set appropriately (not max).
  • Cold start measured and within SLA.
  • Cost model validated against expected traffic.
  • Dead-letter queue configured for failures.
  • Correlation IDs propagated for tracing.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,782. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.