mcpField
D
dbos-python

dbos-python

github.com/sickn33Development49.2k74 installsUpdated 1d ago
Repository

About dbos-python

A best-practices skill for developers building reliable Python applications with DBOS durable workflows. It covers workflow structure, queues, communication, lifecycle, testing, and external clients, with guidance on determinism and safe handling of side effects.

Key features

  1. 01Configure and launch DBOS applications
  2. 02Structure deterministic workflows and steps
  3. 03Control concurrency with queues
  4. 04Use workflow events, messages, and streams
  5. 05Test DBOS applications
  6. 06Connect through DBOSClient

Use cases

  1. 01Add DBOS to an existing Python application
  2. 02Implement durable workflows and steps
  3. 03Limit concurrency for queued work
  4. 04Test applications using DBOS

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/sickn33/agentic-awesome-skills --skill dbos-python

After installing, type/dbos-pythonin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

CLAUDE.md
AGENTS.md
references/
comm-events.md
client-setup.md
advanced-versioning.md
_sections.md
advanced-async.md
client-enqueue.md
advanced-patching.md
comm-messages.md
comm-streaming.md
pattern-idempotency.md
lifecycle-fastapi.md
pattern-debouncing.md
lifecycle-config.md
pattern-classes.md
pattern-scheduled.md
queue-concurrency.md
pattern-sleep.md
queue-listening.md
queue-priority.md
step-basics.md
queue-basics.md
queue-deduplication.md
step-retries.md
queue-rate-limiting.md
queue-partitioning.md
step-transactions.md
workflow-background.md
workflow-control.md

Details

From the project README

DBOS Python Best Practices

Guide for building reliable, fault-tolerant Python applications with DBOS durable workflows.

When to Use

Reference these guidelines when:

  • Adding DBOS to existing Python code
  • Creating workflows and steps
  • Using queues for concurrency control
  • Implementing workflow communication (events, messages, streams)
  • Configuring and launching DBOS applications
  • Using DBOSClient from external applications
  • Testing DBOS applications

Runtime boundaries

Examples are version-sensitive fragments with omitted app setup/imports/handlers; verify installed DBOS APIs. Durable workflow identity does not make arbitrary external side effects exactly-once: steps may repeat after a crash before checkpointing. Use provider idempotency keys plus reconciliation for payments/messages. Authorize database targets and writes, protect serialized inputs/results, and never deserialize untrusted pickle data. API routes need authentication, tenant ownership, webhook signature/replay validation and bounded waits. Destructive test reset must use a dedicated disposable system database; a variable name alone is not target proof.

Rule Categories by Priority

PriorityCategoryImpactPrefix
1LifecycleCRITICALlifecycle-
2WorkflowCRITICALworkflow-
3StepHIGHstep-
4QueueHIGHqueue-
5CommunicationMEDIUMcomm-
6PatternMEDIUMpattern-
7TestingLOW-MEDIUMtest-
8ClientMEDIUMclient-
9AdvancedLOWadvanced-

Critical Rules

DBOS Configuration and Launch

A DBOS application MUST configure and launch DBOS inside its main function:

import os
from dbos import DBOS, DBOSConfig

@DBOS.workflow()
def my_workflow():
    pass

if __name__ == "__main__":
    config: DBOSConfig = {
        "name": "my-app",
        "system_database_url": os.environ.get("DBOS_SYSTEM_DATABASE_URL"),
    }
    DBOS(config=config)
    DBOS.launch()
Workflow and Step Structure

Workflows are comprised of steps. Any function performing complex operations or accessing external services must be a step:

@DBOS.step()
def call_external_api():
    return requests.get("https://api.example.com").json()

@DBOS.workflow()
def my_workflow():
    result = call_external_api()
    return result
Key Constraints
  • Do NOT call DBOS.start_workflow or DBOS.recv from a step
  • Do NOT use threads to start workflows - use DBOS.start_workflow or queues
  • Workflows MUST be deterministic - non-deterministic operations go in steps
  • Do NOT create/update global variables from workflows or steps

How to Use

Read individual rule files for detailed explanations and examples:

references/lifecycle-config.md
references/workflow-determinism.md
references/queue-concurrency.md

References

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Comments

Markdown supported