dbos-golang – Coding skill for AI agents
Guide for building reliable, fault-tolerant Go applications with DBOS durable workflows. Use when adding DBOS to existing Go code, creating workflows and steps, or using queues for concurrency control.
Install the dbos-golang 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-golang-9376c.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /dbos-golang – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbos-golang-9376c.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $dbos-golang – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbos-golang-9376c.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /dbos-golang – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbos-golang-9376c.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /dbos-golang – then describe the task you want done.
SKILL.md content
DBOS Go Best Practices
Guide for building reliable, fault-tolerant Go applications with DBOS durable workflows.
When to Use
Reference these guidelines when:
- Adding DBOS to existing Go code
- Creating workflows and steps
- 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
Reliability and version boundaries
Pin and verify the DBOS Go SDK version before adapting these illustrative fragments; the current SDK documentation uses dbos.Context while this snapshot uses dbos.DBOSContext. Helpers, imports, registrations and application-specific functions are omitted. Do not claim snippets compile as a complete app. Check every returned error before using a handle or result. Workflow IDs and checkpointed steps do not make external payment/API side effects exactly-once: a crash after the remote action but before checkpointing can replay it. Use provider idempotency keys and reconciliation. Authenticate and deduplicate webhook messages before Send; scope workflow access to the caller. Queue limits govern workflow starts, not every request/retry inside a workflow. Cancellation cannot undo committed effects. Keep workflow inputs, outputs and error payloads free of secrets/unnecessary personal data. Do not enable admin endpoints, schedules, paid calls or management mutations without authorization.
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
Installation
Install the DBOS Go module:
go get github.com/dbos-inc/dbos-transact-golang/dbos@latestDBOS Configuration and Launch
A DBOS application MUST create a context, register workflows, and launch before running any workflows:
package main
import (
"context"
"log"
"os"
"time"
"github.com/dbos-inc/dbos-transact-golang/dbos"
)
func main() {
ctx, err := dbos.NewDBOSContext(context.Background(), dbos.Config{
AppName: "my-app",
DatabaseURL: os.Getenv("DBOS_SYSTEM_DATABASE_URL"),
})
if err != nil {
log.Fatal(err)
}
defer dbos.Shutdown(ctx, 30*time.Second)
dbos.RegisterWorkflow(ctx, myWorkflow)
if err := dbos.Launch(ctx); err != nil {
log.Fatal(err)
}
}Workflow and Step Structure
Workflows are comprised of steps. Any function performing complex operations or accessing external services must be run as a step using dbos.RunAsStep:
func fetchData(ctx context.Context) (string, error) {
resp, err := http.Get("https://api.example.com/data")
if err != nil {
return "", err
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
return string(body), nil
}
func myWorkflow(ctx dbos.DBOSContext, input string) (string, error) {
result, err := dbos.RunAsStep(ctx, fetchData, dbos.WithStepName("fetchData"))
if err != nil {
return "", err
}
return result, nil
}Key Constraints
- Do NOT start or enqueue workflows from within steps
- Do NOT use uncontrolled goroutines to start workflows - use
dbos.RunWorkflowwith queues ordbos.Go/dbos.Selectfor concurrent steps - Workflows MUST be deterministic - non-deterministic operations go in steps
- Do NOT modify global variables from workflows or steps
- All workflows and queues MUST be registered before calling
Launch()
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-golang
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-python – Guide for building reliable, fault-tolerant Python applications with DBOS durable…
- 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…