Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
eca74d6
Add initial skill for testing, which is simply Steve's skill (#1)
donald-pinckney Feb 2, 2026
5998c64
Use claude to merge Steve's, Max's, and Mason's skills. (#2)
donald-pinckney Feb 4, 2026
ff033bc
add simple feedback mechanism (#3)
donald-pinckney Feb 4, 2026
b8b74c0
Change skill name to kebab-case, for compatibility with Amp and Cline…
donald-pinckney Feb 13, 2026
d25073a
Clean up references/core/ai-integration.md
donald-pinckney Feb 13, 2026
b0fcfe3
Clean up references/core/common-gotchas.md
donald-pinckney Feb 13, 2026
e113399
Clean up references/core/common-gotchas.md
donald-pinckney Feb 13, 2026
2b6676f
Clean up references/core/determinism.md
donald-pinckney Feb 13, 2026
efc8ef2
Clean up references/core/determinism.md
donald-pinckney Feb 13, 2026
45497f4
Update error-reference.md
donald-pinckney Feb 17, 2026
f61d2ea
Update interactive-workflows.md
donald-pinckney Feb 17, 2026
1f4c53d
Clean up patterns.md
donald-pinckney Feb 17, 2026
3c19991
Cut shell scripts
donald-pinckney Feb 17, 2026
d237247
Edit troubleshooting.md
donald-pinckney Feb 17, 2026
5695854
remove interceptors for now
donald-pinckney Feb 18, 2026
e10cbb8
remove dynamic workflows
donald-pinckney Feb 18, 2026
d4d9921
clarify on heartbeating of async activity completions, and prompt it …
donald-pinckney Feb 18, 2026
1c185b6
Improve references/python/advanced-features.md
donald-pinckney Feb 18, 2026
e945f1d
Use explicit namespace in connect
donald-pinckney Feb 18, 2026
322f85a
remove duplicated content from determinism.md, clean up
donald-pinckney Feb 18, 2026
bb46cb4
Improve references/python/data-handling.md
donald-pinckney Feb 18, 2026
3dcccb8
Prefer start_to_close_timeout
donald-pinckney Feb 18, 2026
8b7dffa
don't explicitely provide defaults for retry policies
donald-pinckney Feb 18, 2026
f693cc7
error-handling.md cleanup
donald-pinckney Feb 18, 2026
3d43cd2
move idempotency patterns to patterns.md
donald-pinckney Feb 18, 2026
f0387e3
remove multi-param activities
donald-pinckney Feb 18, 2026
f36faca
small edits
donald-pinckney Feb 18, 2026
0bc69b2
Unify sandbox stuff into one file
donald-pinckney Feb 18, 2026
56dde75
local activities aren't experimental
donald-pinckney Feb 18, 2026
35c3bc5
Clean up references/python/sync-vs-async.md
donald-pinckney Feb 18, 2026
d61866b
Cleanup observability.md, remove duplicated search attributes
donald-pinckney Feb 19, 2026
ad4cc34
Cut otel for now
donald-pinckney Feb 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 88 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,88 @@
# skill-temporal-dev
# Temporal Development Skill

A comprehensive skill for building Temporal applications in Python and TypeScript.

## Overview

This skill provides multi-language guidance for Temporal development, combining:
- **Core concepts** shared across languages (determinism, patterns, versioning)
- **Language-specific references** for Python and TypeScript
- **AI/LLM integration patterns** for building durable AI applications

## Structure

```
temporal-dev/
├── SKILL.md # Core architecture, quick references (always loaded)
├── references/
│ ├── core/ # Language-agnostic concepts
│ │ ├── determinism.md # Why determinism matters, replay mechanics
│ │ ├── patterns.md # Signals, queries, saga, child workflows
│ │ ├── versioning.md # Patching, workflow types, worker versioning
│ │ ├── troubleshooting.md # Decision trees, recovery procedures
│ │ ├── error-reference.md # Common error types, workflow status
│ │ ├── interactive-workflows.md # Testing signals, updates, queries
│ │ ├── dev-management.md # Dev cycle & management of server and workers
│ │ ├── logs.md # Log file locations, search patterns
│ │ └── ai-integration.md # AI/LLM integration concepts
│ ├── python/ # Python SDK references
│ │ ├── python.md # SDK overview, quick start
│ │ ├── sandbox.md # Python sandbox mechanics
│ │ ├── sync-vs-async.md # Activity type selection
│ │ ├── patterns.md # Python implementations
│ │ ├── testing.md # WorkflowEnvironment, mocking
│ │ ├── error-handling.md # ApplicationError, retries
│ │ ├── data-handling.md # Pydantic, encryption
│ │ ├── observability.md # Logging, metrics
│ │ ├── versioning.md # Python patching API
│ │ ├── advanced-features.md # Continue-as-new, updates, schedules, and more
│ │ └── ai-patterns.md # Python AI Cookbook patterns
│ └── typescript/ # TypeScript SDK references
│ ├── typescript.md # SDK overview, quick start
│ ├── patterns.md # TypeScript implementations
│ ├── testing.md # TestWorkflowEnvironment
│ ├── error-handling.md # ApplicationFailure
│ ├── data-handling.md # Data converters
│ ├── observability.md # Sinks, logging
│ ├── versioning.md # TypeScript patching API
│ └── advanced-features.md # Sinks, updates, schedules and more
```

## Progressive Disclosure

The skill uses progressive loading to manage context efficiently:

1. **SKILL.md** - Always loaded when skill triggers
- Core architecture diagram
- Determinism quick reference
- Pattern index with links
- Troubleshooting quick reference

2. **Core references** - Loaded when discussing concepts
- Language-agnostic theory and patterns
- Versioning strategies
- Troubleshooting decision trees

3. **Language references** - Loaded when working in that language
- SDK-specific implementations
- Language-specific gotchas
- Testing patterns

## Trigger Phrases

The skill activates on phrases like:
- "create a Temporal workflow"
- "write a Temporal activity"
- "debug workflow stuck"
- "fix non-determinism error"
- "Temporal Python" / "Temporal TypeScript"
- "workflow replay"
- "activity timeout"
- "signal workflow" / "query workflow"
- "worker not starting"
- "activity keeps retrying"
- "Temporal heartbeat"
- "continue-as-new"
- "child workflow"
- "saga pattern"
- "workflow versioning"
162 changes: 162 additions & 0 deletions SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
---
name: temporal-developer
description: This skill should be used when the user asks to "create a Temporal workflow", "write a Temporal activity", "debug stuck workflow", "fix non-determinism error", "Temporal Python", "Temporal TypeScript", "workflow replay", "activity timeout", "signal workflow", "query workflow", "worker not starting", "activity keeps retrying", "Temporal heartbeat", "continue-as-new", "child workflow", "saga pattern", "workflow versioning", "durable execution", "reliable distributed systems", or mentions Temporal SDK development.
version: 1.0.0
---

# Skill: temporal-developer

## Overview

Temporal is a durable execution platform that makes workflows survive failures automatically. This skill provides guidance for building Temporal applications in Python and TypeScript.

## Core Architecture

```
┌─────────────────────────────────────────────────────────────────┐
│ Temporal Cluster │
│ ┌─────────────────┐ ┌─────────────────┐ ┌────────────────┐ │
│ │ Event History │ │ Task Queues │ │ Visibility │ │
│ │ (Durable Log) │ │ (Work Router) │ │ (Search) │ │
│ └─────────────────┘ └─────────────────┘ └────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│ Poll / Complete
┌─────────────────────────────────────────────────────────────────┐
│ Worker │
│ ┌─────────────────────────┐ ┌──────────────────────────────┐ │
│ │ Workflow Definitions │ │ Activity Implementations │ │
│ │ (Deterministic) │ │ (Non-deterministic OK) │ │
│ └─────────────────────────┘ └──────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
```

**Components:**
- **Workflows** - Durable, deterministic functions that orchestrate activities
- **Activities** - Non-deterministic operations (API calls, I/O) that can fail and retry
- **Workers** - Long-running processes that poll task queues and execute code
- **Task Queues** - Named queues connecting clients to workers

## History Replay: Why Determinism Matters

Temporal achieves durability through **history replay**:

1. **Initial Execution** - Worker runs workflow, generates Commands, stored as Events in history
2. **Recovery** - On restart/failure, Worker re-executes workflow from beginning
3. **Matching** - SDK compares generated Commands against stored Events
4. **Restoration** - Uses stored Activity results instead of re-executing

**If Commands don't match Events = Non-determinism Error = Workflow blocked**

| Workflow Code | Command | Event |
|--------------|---------|-------|
| Execute activity | `ScheduleActivityTask` | `ActivityTaskScheduled` |
| Sleep/timer | `StartTimer` | `TimerStarted` |
| Child workflow | `StartChildWorkflowExecution` | `ChildWorkflowExecutionStarted` |

See `references/core/determinism.md` for detailed explanation.

## Determinism Quick Reference

| Forbidden | Python | TypeScript |
|-----------|--------|------------|
| Current time | `workflow.now()` | `Date.now()` (auto-replaced) |
| Random | `workflow.random()` | `Math.random()` (auto-replaced) |
| UUID | `workflow.uuid4()` | `uuid4()` from workflow |
| Sleep | `asyncio.sleep()` | `sleep()` from workflow |

**Python sandbox**: Explicit protection, use `workflow.unsafe.imports_passed_through()` for libraries
**TypeScript sandbox**: V8 isolation, automatic replacements, use type-only imports for activities

## Language Selection

### Python
- Decorators: `@workflow.defn`, `@workflow.run`, `@activity.defn`
- Async/await throughout
- Explicit sandbox with pass-through pattern
- **Critical**: Separate workflow and activity files for performance
- See `references/python/python.md`

### TypeScript
- Functions exported from workflow file
- `proxyActivities()` with type-only imports
- V8 sandbox with automatic replacements
- Webpack bundling for workflows
- See `references/typescript/typescript.md`

## Pattern Index

| Pattern | Use Case | Python | TypeScript |
|---------|----------|--------|------------|
| **Signals** | Fire-and-forget events to running workflow | `references/python/patterns.md` | `references/typescript/patterns.md` |
| **Queries** | Read-only state inspection | `references/python/patterns.md` | `references/typescript/patterns.md` |
| **Updates** | Synchronous state modification with response | `references/python/patterns.md` | `references/typescript/patterns.md` |
| **Child Workflows** | Break down large workflows, isolate failures | `references/python/patterns.md` | `references/typescript/patterns.md` |
| **Continue-as-New** | Prevent unbounded history growth | `references/python/advanced-features.md` | `references/typescript/advanced-features.md` |
| **Saga** | Distributed transactions with compensation | `references/python/patterns.md` | `references/typescript/patterns.md` |

## Troubleshooting Quick Reference

| Symptom | Likely Cause | Action |
|---------|--------------|--------|
| Workflow stuck (RUNNING but no progress) | Worker not running or wrong task queue | Check worker, verify task queue name |
| `NondeterminismError` | Code changed mid-execution | Use patching API or reset workflow |
| Activity keeps retrying | Activity throwing errors | Check activity logs, fix root cause |
| Workflow FAILED | Unhandled exception in workflow | Check workflow error, fix code |
| Timeout errors | Timeout too short or activity stuck | Increase timeout or add heartbeats |

See `references/core/troubleshooting.md` for decision trees and detailed recovery steps.

## Versioning

To safely change workflow code while workflows are running:

1. **Patching API** - Code-level branching for old vs new paths
2. **Workflow Type Versioning** - New workflow type for incompatible changes
3. **Worker Versioning** - Deployment-level control with Build IDs

See `references/core/versioning.md` for concepts, language-specific files for implementation.

## Additional Resources

### Core References (Language-Agnostic)
- **`references/core/determinism.md`** - Why determinism matters, replay mechanics
- **`references/core/patterns.md`** - Conceptual patterns (signals, queries, saga)
- **`references/core/versioning.md`** - Versioning strategies and concepts
- **`references/core/troubleshooting.md`** - Decision trees, recovery procedures
- **`references/core/error-reference.md`** - Common error types, workflow status reference
- **`references/core/common-gotchas.md`** - Anti-patterns and common mistakes
- **`references/core/interactive-workflows.md`** - Testing signals, updates, queries
- **`references/core/dev-management.md`** - Dev cycle & management of server and workers
- **`references/core/logs.md`** - Log file locations and search patterns
- **`references/core/ai-integration.md`** - AI/LLM integration patterns

### Python References
- **`references/python/python.md`** - Python SDK overview, quick start
- **`references/python/sandbox.md`** - Python sandbox mechanics
- **`references/python/sync-vs-async.md`** - Activity type selection, event loop
- **`references/python/patterns.md`** - Python pattern implementations
- **`references/python/testing.md`** - WorkflowEnvironment, mocking
- **`references/python/error-handling.md`** - ApplicationError, retries
- **`references/python/data-handling.md`** - Pydantic, encryption
- **`references/python/observability.md`** - Logging, metrics, tracing
- **`references/python/versioning.md`** - Python patching API
- **`references/python/advanced-features.md`** - Continue-as-new, updates, schedules, and more
- **`references/python/ai-patterns.md`** - Python AI Cookbook patterns
- **`references/python/gotchas.md`** - Python-specific anti-patterns

### TypeScript References
- **`references/typescript/typescript.md`** - TypeScript SDK overview, quick start
- **`references/typescript/patterns.md`** - TypeScript pattern implementations
- **`references/typescript/testing.md`** - TestWorkflowEnvironment
- **`references/typescript/error-handling.md`** - ApplicationFailure, retries
- **`references/typescript/data-handling.md`** - Data converters
- **`references/typescript/observability.md`** - Sinks, logging
- **`references/typescript/versioning.md`** - TypeScript patching API
- **`references/typescript/advanced-features.md`** - Sinks, updates, schedules and more
- **`references/typescript/gotchas.md`** - TypeScript-specific anti-patterns

## Feedback

If this skill's explanations are unclear, misleading, or missing important information—or if Temporal concepts are proving unexpectedly difficult to work with—draft a GitHub issue body describing the problem encountered and what would have helped, then ask the user to file it at https://github.com/temporalio/skill-temporal-developer/issues/new. Do not file the issue autonomously.
Loading
Loading