From antigravity-awesome-skills
Implements durable distributed systems with Temporal Go SDK. Covers deterministic workflow rules, mTLS worker configs, and advanced patterns.
How this skill is triggered — by the user, by Claude, or both
Slash command
/antigravity-awesome-skills:temporal-golang-proThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Expert-level guide for building resilient, scalable, and deterministic distributed systems using the Temporal Go SDK. This skill transforms vague orchestration requirements into production-grade Go implementations, focusing on durable execution, strict determinism, and enterprise-scale worker configuration.
Expert-level guide for building resilient, scalable, and deterministic distributed systems using the Temporal Go SDK. This skill transforms vague orchestration requirements into production-grade Go implementations, focusing on durable execution, strict determinism, and enterprise-scale worker configuration.
-pro skills.workflow-orchestration-patterns).time.Now, time.Sleep).worker.Options, including MaxConcurrentActivityTaskPollers, WorkerStopTimeout, and StickyScheduleToStartTimeout.workflow.Go, workflow.Channel, and workflow.Selector instead of native primitives.workflow.GetVersion and workflow.GetReplaySafeLogger.ContinueAsNew to manage history size limits (defaults: 50MB or 50K events).WorkflowTestSuite for unit and functional testing with deterministic time control.// Note: imports omitted. Requires 'go.temporal.io/sdk/workflow', 'go.temporal.io/sdk/temporal', and 'time'.
func SubscriptionWorkflow(ctx workflow.Context, userID string) error {
// 1. Versioning for logic evolution (v1 = DefaultVersion)
v := workflow.GetVersion(ctx, "billing_logic", workflow.DefaultVersion, 2)
for i := 0; i < 12; i++ {
ao := workflow.ActivityOptions{
StartToCloseTimeout: 5 * time.Minute,
RetryPolicy: &temporal.RetryPolicy{MaximumAttempts: 3},
}
ctx = workflow.WithActivityOptions(ctx, ao)
// 2. Activity Execution (Always handle errors)
err := workflow.ExecuteActivity(ctx, ChargePaymentActivity, userID).Get(ctx, nil)
if err != nil {
workflow.GetLogger(ctx).Error("Payment failed", "Error", err)
return err
}
// 3. Durable Sleep (Time-skipping safe)
sleepDuration := 30 * 24 * time.Hour
if v >= 2 {
sleepDuration = 28 * 24 * time.Hour
}
if err := workflow.Sleep(ctx, sleepDuration); err != nil {
return err
}
}
return nil
}
func RunSecureWorker() error {
// 1. Load Client Certificate and Key
cert, err := tls.LoadX509KeyPair("client.pem", "client.key")
if err != nil {
return fmt.Errorf("failed to load client keys: %w", err)
}
// 2. Load CA Certificate for Server verification (Proper mTLS)
caPem, err := os.ReadFile("ca.pem")
if err != nil {
return fmt.Errorf("failed to read CA cert: %w", err)
}
certPool := x509.NewCertPool()
if !certPool.AppendCertsFromPEM(caPem) {
return fmt.Errorf("failed to parse CA cert")
}
// 3. Dial Cluster with full TLS config
c, err := client.Dial(client.Options{
HostPort: "temporal.example.com:7233",
Namespace: "production",
ConnectionOptions: client.ConnectionOptions{
TLS: &tls.Config{
Certificates: []tls.Certificate{cert},
RootCAs: certPool,
},
},
})
if err != nil {
return fmt.Errorf("failed to dial temporal: %w", err)
}
defer c.Close()
w := worker.New(c, "payment-queue", worker.Options{})
w.RegisterWorkflow(SubscriptionWorkflow)
if err := w.Run(worker.InterruptCh()); err != nil {
return fmt.Errorf("worker run failed: %w", err)
}
return nil
}
func ApprovalWorkflow(ctx workflow.Context) (string, error) {
var approved bool
signalCh := workflow.GetSignalChannel(ctx, "approval-signal")
// Use Selector to wait for multiple async events
s := workflow.NewSelector(ctx)
s.AddReceive(signalCh, func(c workflow.ReceiveChannel, _ bool) {
c.Receive(ctx, &approved)
})
// Add 72-hour timeout timer
s.AddReceive(workflow.NewTimer(ctx, 72*time.Hour).GetChannel(), func(c workflow.ReceiveChannel, _ bool) {
approved = false
})
s.Select(ctx)
if !approved {
return "rejected", nil
}
return "approved", nil
}
ExecuteActivity and client.Dial.workflow.Go and workflow.Channel for concurrency.activity.RecordHeartbeat for activities lasting > 1 minute.replayer.ReplayWorkflowHistoryFromJSON._ or log.Fatal in production workers.time.Now() or rand.Int().workflow.GetVersion or non-deterministic code (e.g., native maps).ContinueAsNew is implemented.WorkerStopTimeout and ensure all activities handle context cancellation.-pro skills.worker-versioning feature flag (experimental).grpc-golang - Internal transport protocol and Protobuf design.golang-pro - General Go performance tuning and advanced syntax.workflow-orchestration-patterns - Language-agnostic orchestration strategy.npx claudepluginhub sickn33/antigravity-awesome-skills --plugin antigravity-bundle-aas-mobile-app-builderBuilds resilient distributed systems using Temporal Go SDK, enforcing deterministic workflow rules, mTLS worker configs, and advanced patterns like sagas and interceptors.
Develop and manage Temporal workflows and activities using Python, TypeScript, Go, Java, .NET, or Ruby SDKs. Debug non-determinism, stuck workflows, activity retries. Run Temporal CLI commands and dev server.
Design durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism constraints.