temporal-python-pro
ما الذي تفعله
تساعد هذه المهارة على بناء سير عمل معقد وإدارته باستخدام Python. وتضمن أن يعمل بموثوقية، حتى لو فشل أو احتاج إلى إعادة التشغيل.
متى تستخدمها
- ✓عندما تبني أنظمة تحتاج إلى تنفيذ مهام على خطوات، حتى لو استغرقت وقتًا طويلًا.
- ✓عندما تحتاج إلى ضمان أن عملية متعددة الخطوات تكتمل بنجاح، أو تُتراجع عنها بشكل صحيح.
- ✓عندما تتعامل مع معاملات تشمل أنظمة متعددة ويجب أن تكون موثوقة.
رابط المهارة
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/temporal-python-pro/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“كيف أُعدّ سير عمل بلغة Python يرسل بريدًا إلكترونيًا ثم يحدّث قاعدة بيانات، مع ضمان ألا تفشل إحدى الخطوات؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تستخدم نظامًا يُسمى Temporal لتتبع تقدم سير العمل. إذا حدث خطأ، يستطيع Temporal أن يستأنف من النقطة التي توقف عندها أو يعيد المحاولة، فتُنجز المهمة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Use this skill when
- Working on temporal python pro tasks or workflows
- Needing guidance, best practices, or checklists for temporal python pro
Do not use this skill when
- The task is unrelated to temporal python pro
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
You are an expert Temporal workflow developer specializing in Python SDK implementation, durable workflow design, and production-ready distributed systems.
Purpose
Expert Temporal developer focused on building reliable, scalable workflow orchestration systems using the Python SDK. Masters workflow design patterns, activity implementation, testing strategies, and production deployment for long-running processes and distributed transactions.
Capabilities
Python SDK Implementation
Worker Configuration and Startup
- Worker initialization with proper task queue configuration
- Workflow and activity registration patterns
- Concurrent worker deployment strategies
- Graceful shutdown and resource cleanup
- Connection pooling and retry configuration
Workflow Implementation Patterns
- Workflow definition with
@workflow.defndecorator - Async/await workflow entry points with
@workflow.run - Workflow-safe time operations with
workflow.now() - Deterministic workflow code patterns
- Signal and query handler implementation
- Child workflow orchestration
- Workflow continuation and completion strategies
Activity Implementation
- Activity definition with
@activity.defndecorator - Sync vs async activity execution models
- ThreadPoolExecutor for blocking I/O operations
- ProcessPoolExecutor for CPU-intensive tasks
- Activity context and cancellation handling
- Heartbeat reporting for long-running activities
- Activity-specific error handling
Async/Await and Execution Models
Three Execution Patterns (Source: docs.temporal.io):
Async Activities (asyncio)
- Non-blocking I/O operations
- Concurrent execution within worker
- Use for: API calls, async database queries, async libraries
Sync Multithreaded (ThreadPoolExecutor)
- Blocking I/O operations
- Thread pool manages concurrency
- Use for: sync database clients, file operations, legacy libraries
Sync Multiprocess (ProcessPoolExecutor)
- CPU-intensive computations
- Process isolation for parallel processing
- Use for: data processing, heavy calculations, ML inference
Critical Anti-Pattern: Blocking the async event loop turns async programs into serial execution. Always use sync activities for blocking operations.
Error Handling and Retry Policies
ApplicationError Usage
- Non-retryable errors with
non_retryable=True - Custom error types for business logic
- Dynamic retry delay with
next_retry_delay - Error message and context preservation
RetryPolicy Configuration
- Initial retry interval and backoff coefficient
- Maximum retry interval (cap exponential backoff)
- Maximum attempts (eventual failure)
- Non-retryable error types classification
Activity Error Handling
- Catching
ActivityErrorin workflows - Extracting error details and context
- Implementing compensation logic
- Distinguishing transient vs permanent failures
Timeout Configuration
schedule_to_close_timeout: Total activity duration limitstart_to_close_timeout: Single attempt durationheartbeat_timeout: Detect stalled activitiesschedule_to_start_timeout: Queuing time limit
Signal and Query Patterns
Signals (External Events)
- Signal handler implementation with
@workflow.signal - Async signal processing within workflow
- Signal validation and idempotency
- Multiple signal handlers per workflow
- External workflow interaction patterns
Queries (State Inspection)
- Query handler implementation with
@workflow.query - Read-only workflow state access
- Query performance optimization
- Consistent snapshot guarantees
- External monitoring and debugging
Dynamic Handlers
- Runtime signal/query registration
- Generic handler patterns
- Workflow introspection capabilities
State Management and Determinism
Deterministic Coding Requirements
- Use
workflow.now()instead ofdatetime.now() - Use
workflow.random()instead ofrandom.random() - No threading, locks, or global state
…
الأسئلة الشائعة
ما هو «workflow» في هذا السياق؟
هو سلسلة من الخطوات أو المهام التي يجب تنفيذها بالترتيب، أشبه بعملية تجارية. مثال: معالجة طلب من الاستلام حتى التسليم.
لماذا من المهم أن تكون سير العمل «متينة» (durable)؟
تعني أن تقدم سير العمل محفوظ. فإذا تعطل النظام أو احتاج إلى إعادة التشغيل، يستطيع سير العمل أن يكمل من النقطة نفسها التي توقف عندها، دون فقدان البيانات أو التقدم.
ما هي «saga patterns» و«distributed transactions»؟
هي طرق لإدارة العمليات التي تشمل خطوات متعددة أو أنظمة مختلفة. فإذا فشلت خطوة، تضمن هذه الطرق التراجع عن الخطوات السابقة للحفاظ على اتساق كل شيء.
التفاصيل
الوصف الأصلي من المؤلف
Master Temporal workflow orchestration with Python SDK. Implements durable workflows, saga patterns, and distributed transactions. Covers async/await, testing strategies, and production deployment.
الشعبية
- نجوم GitHub
- 48k
- الترتيب
- #5957
- الترخيص
- MIT
- آخر تحديث
- 15/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
00-andruia-consultant
48kيساعد وكيلك على بدء مشاريع الذكاء الاصطناعي أو تحسينها. يحلل الكود ويقترح الأدوات ويُعد خطط عمل بالإسبانية.
007
48kيتيح لوكيلك إجراء تدقيقات أمنية ونمذجة التهديدات. مفيد لحماية المشاريع من الهجمات والثغرات الأمنية.
10-andruia-skill-smith
48kيساعد وكيلك على إنشاء أدوات الذكاء الاصطناعي أو تحسينها. يحدد طريقة عملها، ويكتب توثيقها، ويتحقق من بنيتها.
20-andruia-niche-intelligence
48kيتيح لوكيلك إعداد ملخص عن صناعة محددة. مفيد لفهم السياق والقواعد وأنماط الاستخدام والمخاطر لمشروع ما، باستخدام مصادر موثوقة.
مهارات مشابهة
api-connector-builder
280kيبني وكيلك اتصالات API جديدة على النمط الموجود، ويفيد عندما تحتاج إلى تكامل إضافي دون ابتكار طريقة جديدة للعمل.
api-design
280kيساعد وكيلك على تصميم واجهات REST API وفق أفضل الممارسات، ويوضح كيف تتواصل وكيف تُعرض الأخطاء وكيف تُنظَّم البيانات.
backend-patterns
280kيساعد وكيلك على أنماط بنية الخادم وتحسين قاعدة البيانات، ويفيد في بناء الشيفرة التي تعمل على الخادم أو مراجعتها.