dbos-python – Coding skill for AI agents
Guide for building reliable, fault-tolerant Python applications with DBOS durable workflows. Use when adding DBOS to existing Python code, creating workflows and steps, or using queues for concurrency control.
Install the dbos-python skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbos-python-9d8bd.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /dbos-python – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbos-python-9d8bd.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $dbos-python – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbos-python-9d8bd.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /dbos-python – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbos-python-9d8bd.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /dbos-python – then describe the task you want done.
SKILL.md content
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
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Lifecycle | CRITICAL | lifecycle- |
| 2 | Workflow | CRITICAL | workflow- |
| 3 | Step | HIGH | step- |
| 4 | Queue | HIGH | queue- |
| 5 | Communication | MEDIUM | comm- |
| 6 | Pattern | MEDIUM | pattern- |
| 7 | Testing | LOW-MEDIUM | test- |
| 8 | Client | MEDIUM | client- |
| 9 | Advanced | LOW | advanced- |
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 resultKey Constraints
- Do NOT call
DBOS.start_workfloworDBOS.recvfrom a step - Do NOT use threads to start workflows - use
DBOS.start_workflowor 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.mdReferences
- https://docs.dbos.dev/
- https://github.com/dbos-inc/dbos-transact-py
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.
Related skills
- dbos-typescript – Guide for building reliable, fault-tolerant TypeScript applications with DBOS durable…
- ddd-tactical-patterns – Apply DDD tactical patterns in code using entities, value objects, aggregates…
- monorepo-navigator – Navigate, manage, and optimize monorepos. Covers Turborepo, Nx, pnpm workspaces, and…
- debate-review – Two-model debate review of a GitHub PR, GitLab MR, Azure DevOps PR, or local working…
- debug-buttercup – All pods run in namespace crs. Use when pods in the crs namespace are in…
- debugger – Debugging specialist for errors, test failures, and unexpected behavior. Use proactively…
- debugging-and-error-recovery – Guides systematic root-cause debugging. Use when tests fail, builds break, behavior…
- debugging-code – Interactively debug source code — set breakpoints, step through execution line by line…