enterprise-infrastructure

Implements progressive database infrastructure with dialect-portable SQL, task queues, and idempotent workflow execution.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/Dchuuuuuu/disease-risk-classifier --skill enterprise-infrastructure-dchuuuuuu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: enterprise-infrastructure
Source: https://github.com/Dchuuuuuu/disease-risk-classifier/tree/main/.claude/skills/15-enterprise-infrastructure
Command: npx skills add https://github.com/Dchuuuuuu/disease-risk-classifier --skill enterprise-infrastructure-dchuuuuuu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires aiosqlite, asyncpg, aiomysql, redis, and includes references (resource) components.

What problem does it solve? Scaling a Python workflow application from a single-process SQLite setup to a multi-worker PostgreSQL or MySQL deployment normally requires rewriting persistence, queueing, and concurrency code. This Skill provides patterns for scaling through environment variables alone while keeping SQL portable across databases and preventing race conditions like duplicate executions and lost tasks. ## Core Features & Use Cases - Progressive Infrastructure Model: Move from Level 0 (SQLite, zero config) to Level 1 (shared database via KAILASH_DATABASE_URL) to Level 2 (multi-worker with KAILASH_QUEUE_URL) without changing workflow code. - Dialect-Portable SQL: Write queries once with canonical ? placeholders and let the QueryDialect strategy translate them for PostgreSQL, MySQL 8.0+, and SQLite, including upserts, JSON extraction, and FOR UPDATE SKIP LOCKED. - Task Queues and Idempotency: Use SQL or Redis-backed task queues with atomic SKIP LOCKED dequeue, worker heartbeat registries with dead-worker reaping, and an IdempotentExecutor that guarantees exactly-once workflow execution via atomic claim-execute-store. - Use Case: A team running ETL workflows locally on SQLite needs to deploy to production with multiple workers on PostgreSQL. They set two environment variables, share one ConnectionManager through StoreFactory, and gain atomic task dequeue, idempotent execution, and crash recovery with no application code changes. ## Quick Start Set KAILASH_DATABASE_URL to your PostgreSQL connection string and ask the AI to configure the StoreFactory and an idempotent task queue worker for your workflow.

Frequently Asked Questions about enterprise-infrastructure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scale a Python workflow app from SQLite to PostgreSQL?▼

Set the KAILASH_DATABASE_URL environment variable to your PostgreSQL connection string. The StoreFactory auto-detects the database, creates a shared ConnectionManager, and switches all infrastructure stores to database backends without any code changes.

How do I write SQL that works on PostgreSQL, MySQL, and SQLite?▼

Use canonical ? placeholders everywhere and let the ConnectionManager translate them via the QueryDialect strategy. Use dialect methods like upsert(), insert_ignore(), and json_extract() instead of hardcoding database-specific syntax, and validate identifiers with _validate_identifier().

Redis vs SQL task queue: which should I use for background jobs?▼

Use Redis if you already run it and need sub-millisecond dequeue and very high throughput. Use the SQL queue with FOR UPDATE SKIP LOCKED if you want zero new infrastructure dependencies on a PostgreSQL-only stack, accepting roughly 1-5ms dequeue latency.

How do I prevent duplicate workflow executions from retried requests?▼

Use the IdempotentExecutor with a unique idempotency key per logical operation. It atomically claims the key with INSERT IGNORE plus fingerprint verification, executes once, stores the result, and returns the cached result on subsequent calls with the same key.

What happens to tasks when a worker process crashes?▼

The SQLWorkerRegistry tracks worker heartbeats and reaps workers whose heartbeat exceeds the staleness threshold. Their in-progress tasks are requeued to pending atomically, and tasks exceeding max_attempts are moved to dead_lettered status.

Why does FOR UPDATE SKIP LOCKED not work on SQLite?▼

SQLite does not support row-level SKIP LOCKED locking, so the dialect returns an empty clause. Instead, SQLite transactions use BEGIN IMMEDIATE, which serializes writes and provides equivalent safety for single-process deployments.