本文へスキップ
Skillpedia
APIとサーバー(バックエンド)48k · #5956

temporal-golang-pro

できること

このツールは、Temporal Go SDKを使って、堅牢で信頼性の高い分散システムを構築するのに役立ちます。一時的に失敗しても処理が正しく実行されるようにし、セキュリティとパフォーマンスの設定も支援します。

使う場面

  • ✓永続的な状態と信頼性の高いオーケストレーションが必要なマイクロサービスを構築するとき。
  • ✓数日から数か月に及ぶ長時間実行プロセスや、複雑なトランザクションパターンを実装するとき。
  • ✓システムのセキュリティ(mTLS)とパフォーマンスを最適化したいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/temporal-golang-pro/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/temporal-golang-pro/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Goで分散システム用に、mTLSを使った安全なワーカーを設定するにはどうすればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは要件を分析し、Temporal Go SDKのベストプラクティスを適用します。コードが決定的(常に同じ結果を生む)であることを確認し、ワーカーの設定、複雑なワークフローの管理、すべての信頼性の高いテストを支援します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Temporal Go SDK (temporal-golang-pro)

Overview

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.

When to Use This Skill

  • Designing Distributed Systems: When building microservices that require durable state and reliable orchestration.
  • Implementing Complex Workflows: Using the Go SDK to handle long-running processes (days/months) or complex Saga patterns.
  • Optimizing Performance: When workers need fine-tuned concurrency, mTLS security, or custom interceptors.
  • Ensuring Reliability: Implementing idempotent activities, graceful error handling, and sophisticated retry policies.
  • Maintenance & Evolution: Versioning running workflows or performing zero-downtime worker updates.

Do not use this skill when

  • Using Temporal with other SDKs (Python, Java, TypeScript) - refer to their specific -pro skills.
  • The task is a simple request/response without durability or coordination needs.
  • High-level design without implementation (use workflow-orchestration-patterns).

Step-by-Step Guide

  1. Gather Context: Proactively ask for:
    • Target Temporal Cluster (Cloud vs. Self-hosted) and Namespace.
    • Task Queue names and expected throughput.
    • Security requirements (mTLS paths, authentication).
    • Failure modes and desired retry/timeout policies.
  2. Verify Determinism: Before suggesting workflow code, verify against these 5 Rules:
    • No native Go concurrency (goroutines).
    • No native time (time.Now, time.Sleep).
    • No non-deterministic map iteration (must sort keys).
    • No direct external I/O or network calls.
    • No non-deterministic random numbers.
  3. Implement Incrementally: Start with shared Protobuf/Data classes, then Activities, then Workflows, and finally Workers.
  4. Leverage Resources: If the implementation requires advanced patterns (Sagas, Interceptors, Replay Testing), explicitly refer to the implementation playbook and testing strategies.

Capabilities

Go SDK Implementation

  • Worker Management: Deep knowledge of worker.Options, including MaxConcurrentActivityTaskPollers, WorkerStopTimeout, and StickyScheduleToStartTimeout.
  • Interceptors: Implementing Client, Worker, and Workflow interceptors for cross-cutting concerns (logging, tracing, auth).
  • Custom Data Converters: Integrating Protobuf, encrypted payloads, or custom JSON marshaling.

Advanced Workflow Patterns

  • Durable Concurrency: Using workflow.Go, workflow.Channel, and workflow.Selector instead of native primitives.
  • Versioning: Implementing safe code evolution using workflow.GetVersion and workflow.GetReplaySafeLogger.
  • Large-scale Processing: Pattern for ContinueAsNew to manage history size limits (defaults: 50MB or 50K events).
  • Child Workflows: Managing lifecycle, cancellation, and parent-child signal propagation.

Testing & Observability

  • Testsuite Mastery: Using WorkflowTestSuite for unit and functional testing with deterministic time control.
  • Mocking: Sophisticated activity and child workflow mocking strategies.
  • Replay Testing: Validating code changes against production event histories.
  • Metrics: Configuring Prometheus/OpenTelemetry exporters for worker performance tracking.

Examples

Example 1: Versioned Workflow (Deterministic)

// 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
        }


…
よくある質問

分散システムとは何ですか?

複数のコンピューターが協力して一つの作業を行うシステムのことです。大規模なウェブサイトや決済サービスなどが該当します。

この文脈で「決定的」とはどういう意味ですか?

同じ入力で実行したときに、外部要因やランダムな要素に左右されず、常に同じ出力になることを意味します。

mTLSとは何ですか?

クライアントとサーバーの両方が互いを認証する、高度なセキュリティの仕組みです。通信を始める前に、双方が行う秘密の握手のようなものです。

詳細

作者による元の説明

Use when building durable distributed systems with Temporal Go SDK. Covers deterministic workflow rules, mTLS worker configs, and advanced patterns.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5956
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル