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/Hamza-Haadi/disease-risk-classifier-hamza --skill enterprise-infrastructure-hamza-haadi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: enterprise-infrastructure
Source: https://github.com/Hamza-Haadi/disease-risk-classifier-hamza/tree/main/.claude/skills/15-enterprise-infrastructure
Command: npx skills add https://github.com/Hamza-Haadi/disease-risk-classifier-hamza --skill enterprise-infrastructure-hamza-haadi

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Scaling a Kailash application from a single-process SQLite setup to a multi-worker PostgreSQL or MySQL deployment normally requires rewriting persistence, queueing, and concurrency logic. This Skill encodes the progressive infrastructure model so the same workflow code runs at Level 0 (SQLite), Level 1 (shared database), and Level 2 (multi-worker with task queue) using only environment variables. ## Core Features & Use Cases - Progressive Infrastructure Model: Scale from Level 0 to Level 2 via KAILASH_DATABASE_URL and KAILASH_QUEUE_URL, with StoreFactory auto-detecting the correct store backends. - Dialect-Portable SQL: Write queries once with canonical ? placeholders and let QueryDialect translate them for PostgreSQL, MySQL 8.0+, and SQLite, including upsert, insert-ignore, and JSON extraction. - Task Queue and Worker Registry: Distribute work with SQLTaskQueue using FOR UPDATE SKIP LOCKED, monitor workers via heartbeats, and reap dead workers with automatic task requeue. - Idempotent Execution: Guarantee exactly-once workflow execution with IdempotentExecutor using the atomic claim-execute-store pattern and TTL expiry. - Use Case: A team running ETL workflows locally on SQLite needs to move to production PostgreSQL with multiple workers. They set two environment variables, and StoreFactory, SQLTaskQueue, and IdempotentExecutor handle shared state, distributed dequeue, and duplicate-execution prevention without code changes. ## Quick Start Ask the AI to configure the Kailash StoreFactory with KAILASH_DATABASE_URL pointing to your PostgreSQL database and show how to enqueue and dequeue tasks with SQLTaskQueue.

Frequently Asked Questions about enterprise-infrastructure

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

FAQPage Schema
How do I scale Kailash from SQLite to PostgreSQL without changing code?▼

Set the KAILASH_DATABASE_URL environment variable to your PostgreSQL connection string. StoreFactory auto-detects the URL and switches all infrastructure stores from SQLite backends to shared database backends, with no workflow code changes required.

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

Use canonical ? placeholders in all queries and let ConnectionManager translate them via the QueryDialect strategy pattern. Use dialect methods like upsert(), insert_ignore(), and json_extract() instead of hardcoding database-specific syntax.

Redis vs SQL task queue, which should I use for Kailash workers?▼

Use Redis if you already run it and need sub-millisecond dequeue with 100K+ ops/sec throughput. Use the SQL queue with FOR UPDATE SKIP LOCKED if you want zero new dependencies on a PostgreSQL-only stack, accepting 1-5ms dequeue latency.

How do I prevent duplicate workflow executions with the same request?▼

Use IdempotentExecutor with an idempotency key. It atomically claims the key via INSERT IGNORE with fingerprint verification, executes the workflow, stores the result, and returns cached results for repeated keys. Failed executions release the claim for retry.

Why does my Kailash code raise ConnectionManager is not initialized?▼

This error occurs when execute(), fetch(), or transaction() is called before await conn.initialize(). Always initialize the ConnectionManager first, or use StoreFactory which handles initialization and shares a single connection across all stores.

What happens to tasks when a Kailash worker crashes?▼

SQLWorkerRegistry detects dead workers through missed heartbeats and reaps them transactionally. Their in-progress tasks are requeued to pending status, and tasks exceeding max_attempts or visibility_timeout are moved to dead_lettered status.