Dbos Rustのロゴ

Dbos Rust

組織
dbos-inc
dbos-rust

DBOS Rust SDK (the dbos crate) for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing Rust code with DBOS, creating workflows and steps, using queues, using the DBOS Client from external applications, or building Rust applications that need to be resilient to failures.

概要

公開者dbos-inc
リポジトリagent-skills
スキル名dbos-rust
スター
20
フォーク
8
同梱ファイル
42
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 42個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    dbos-incがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルDbos RustをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/dbos-inc/agent-skills/tree/main/skills/dbos-rust
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dbos-inc/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/dbos-rust .claude/skills/dbos-rust
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでDbos Rustを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にDbos Rustを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Dbos Rustは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

DBOS Rust Best Practices

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

When to Apply

Reference these guidelines when:

  • Adding DBOS to existing Rust code
  • Creating workflows and steps
  • Running DBOS calls concurrently inside a workflow
  • Using queues for concurrency control
  • Implementing workflow communication (events, messages, streams)
  • Configuring and launching DBOS applications
  • Using the DBOS Client from external applications
  • Testing DBOS applications

Rule Categories by Priority

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

Critical Rules

Installation

Add the dbos crate (0.6) and Tokio:

bash
cargo add dbos
cargo add tokio --features full
cargo add serde --features derive
cargo add thiserror tracing-subscriber futures
cargo add --dev uuid --features v4

serde is for workflow inputs and outputs, thiserror for workflow error types, tracing-subscriber to see DBOS's logs, futures for joining DBOS calls (try_join_all), and uuid for fresh workflow IDs in tests.

DBOS runs on Tokio by default; smol and async-global-executor are Cargo features (see references/lifecycle-runtimes.md). DBOS for Rust does not support DBOS Conductor or DBOS Cloud.

DBOS Configuration and Launch

A DBOS application MUST create a DBOS instance, register every workflow, and launch before running any workflows:

rust
use dbos::{Config, DBOS};

async fn my_workflow(_: ()) -> dbos::Result<String> {
    Ok("done".to_owned())
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    tracing_subscriber::fmt::init();

    // Reads the system database URL from DBOS_SYSTEM_DATABASE_URL.
    let mut config = Config::from_env("my-app");
    config.app_version = Some("0.1.0".to_owned());
    let dbos = DBOS::new(config);

    // Register every workflow before launch.
    let workflow = dbos.register_workflow("my_workflow", my_workflow)?;
    dbos.launch().await?;

    let result = workflow.run(()).await?;
    println!("{result}");

    dbos.shutdown().await;
    Ok(())
}

An application version is REQUIRED: DBOS for Rust doesn't compute one, so set config.app_version (or DBOS__APPVERSION) or launch fails. When creating a new application, set it to "0.1.0" or env!("CARGO_PKG_VERSION"). When editing an existing application, leave its configured version alone: changing it is a deployment decision (see references/advanced-application-versions.md).

Config::from_env(app_name) reads the system database URL from DBOS_SYSTEM_DATABASE_URL; DBOS creates the database if it doesn't exist. See references/lifecycle-config.md for all configuration options.

DBOS is cheap to clone. Outside a workflow, call its methods (dbos.send, dbos.cancel, dbos.list_workflows, queue and schedule management, ...); queue, schedule and app-version management have no free-function forms; from another application, use a Client (see references/client-setup.md).

Workflow and Step Structure

A workflow is an async function of one input that returns a dbos::Result. Any function performing complex operations or accessing external services must run as a step with dbos::step:

rust
async fn generate_random_number(n: u32) -> dbos::Result<u32> {
    Ok(rand::random_range(0..n))
}

async fn workflow_function(n: u32) -> dbos::Result<u32> {
    // The closure passes arguments into the step function.
    let random_number = step("generate_random_number", || generate_random_number(n)).await?;
    Ok(random_number)
}

Inputs, outputs and error types must implement serde::Serialize and serde::Deserialize; an application error type must also implement std::error::Error (see references/workflow-errors.md).

Key Constraints

  • Workflows MUST be deterministic: non-deterministic operations go in steps
  • Do NOT race, time out, spawn, or consume in completion order any DBOS call in a workflow body: no tokio::select!, tokio::time::timeout, FuturesUnordered, buffer_unordered or tokio::spawn around DBOS calls. Use dbos::select_step! to race, tokio::join! / futures::future::try_join_all to run concurrently, and dbos::sleep to wait (see references/workflow-concurrency.md)
  • Every DBOS call takes its step ID where it is built, not where it is awaited; dbos::patch, dbos::deprecate_patch and a debouncer's debounce are the exceptions, so await those on their own, never inside a join
  • A workflow's future must be Send + 'static: don't hold an Rc, a std::sync::MutexGuard or a borrow across an .await in a workflow body
  • To start a child workflow, capture its WorkflowRef in the parent's registered closure; a WorkflowRef can't be a workflow's input
  • Do NOT start or enqueue workflows, or call dbos::recv, dbos::set_event or dbos::patch, from within steps (Error::InsideStep)
  • Do NOT capture the DBOS instance in a workflow closure: use the free functions (dbos::send, dbos::cancel_workflow, ...), which need none (see references/workflow-capture.md)
  • All workflows MUST be registered before launch; queues are registered and schedules created after it
  • Do NOT modify global variables from workflows or steps
  • Starting a workflow with an ID already in use returns the existing workflow by default; set workflow_id_reuse_policy: WorkflowIdReusePolicy::Reject to get dbos::sysdb::Error::WorkflowIdInUse instead (see references/pattern-idempotency.md)
  • A panic in a workflow does not crash the process: the workflow stays PENDING, like a crash, and is recovered on the next launch
  • Steps are at-least-once and there is no transactional step: make database writes in steps idempotent

How to Use

Read individual rule files for detailed explanations and examples:

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

References

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Dbos Rust」では何ができますか?

DBOS Rust SDK (the dbos crate) for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing Rust code with DBOS, creating workflows and steps, using queues, using the DBOS Client from external applications, or building Rust applications that need to be resilient to failures.

TypingMindでDbos Rustを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Dbos Rustはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにDbos Rustをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/dbos-inc/agent-skills/tree/main/skills/dbos-rustを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Dbos Rustを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Dbos Rustは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもDbos Rustを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Dbos Rust」は無料ですか?

はい。dbos-incがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇