singleton-patterns

Community

Safe serverless state management.

AuthorSufficientDaikon
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses the challenge of managing module-level state reliably in serverless and edge environments, preventing issues like connection exhaustion and ensuring expensive resources are initialized only once.

Core Features & Use Cases

  • GlobalThis Attachment: Persists state across warm serverless invocations.
  • Initialization Guards: Guarantees setup code runs exactly once, even under concurrent access.
  • Connection Pooling: Reuses database clients, HTTP agents, and SDK instances to prevent resource leaks.
  • Use Case: Creating a reusable Prisma database client for a serverless API that needs to handle multiple concurrent requests without re-initializing the client for each one.

Quick Start

Use the singleton-patterns skill to create a reusable PrismaClient instance attached to globalThis.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: singleton-patterns
Download link: https://github.com/SufficientDaikon/omniskill/archive/main.zip#singleton-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.