mirror of
https://github.com/wshobson/agents.git
synced 2026-03-18 09:37:15 +00:00
feat: add Conductor plugin for Context-Driven Development
Add comprehensive Conductor plugin implementing Context-Driven Development methodology with tracks, specs, and phased implementation plans. Components: - 5 commands: setup, new-track, implement, status, revert - 1 agent: conductor-validator - 3 skills: context-driven-development, track-management, workflow-patterns - 18 templates for project artifacts Documentation updates: - README.md: Updated counts (68 plugins, 100 agents, 110 skills, 76 tools) - docs/plugins.md: Added Conductor to Workflows section - docs/agents.md: Added conductor-validator agent - docs/agent-skills.md: Added Conductor skills section Also includes Prettier formatting across all project files.
This commit is contained in:
@@ -15,6 +15,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
### Python SDK Implementation
|
||||
|
||||
**Worker Configuration and Startup**
|
||||
|
||||
- Worker initialization with proper task queue configuration
|
||||
- Workflow and activity registration patterns
|
||||
- Concurrent worker deployment strategies
|
||||
@@ -22,6 +23,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Connection pooling and retry configuration
|
||||
|
||||
**Workflow Implementation Patterns**
|
||||
|
||||
- Workflow definition with `@workflow.defn` decorator
|
||||
- Async/await workflow entry points with `@workflow.run`
|
||||
- Workflow-safe time operations with `workflow.now()`
|
||||
@@ -31,6 +33,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Workflow continuation and completion strategies
|
||||
|
||||
**Activity Implementation**
|
||||
|
||||
- Activity definition with `@activity.defn` decorator
|
||||
- Sync vs async activity execution models
|
||||
- ThreadPoolExecutor for blocking I/O operations
|
||||
@@ -63,24 +66,28 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
### 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 `ActivityError` in workflows
|
||||
- Extracting error details and context
|
||||
- Implementing compensation logic
|
||||
- Distinguishing transient vs permanent failures
|
||||
|
||||
**Timeout Configuration**
|
||||
|
||||
- `schedule_to_close_timeout`: Total activity duration limit
|
||||
- `start_to_close_timeout`: Single attempt duration
|
||||
- `heartbeat_timeout`: Detect stalled activities
|
||||
@@ -89,6 +96,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
### Signal and Query Patterns
|
||||
|
||||
**Signals** (External Events)
|
||||
|
||||
- Signal handler implementation with `@workflow.signal`
|
||||
- Async signal processing within workflow
|
||||
- Signal validation and idempotency
|
||||
@@ -96,6 +104,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- External workflow interaction patterns
|
||||
|
||||
**Queries** (State Inspection)
|
||||
|
||||
- Query handler implementation with `@workflow.query`
|
||||
- Read-only workflow state access
|
||||
- Query performance optimization
|
||||
@@ -103,6 +112,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- External monitoring and debugging
|
||||
|
||||
**Dynamic Handlers**
|
||||
|
||||
- Runtime signal/query registration
|
||||
- Generic handler patterns
|
||||
- Workflow introspection capabilities
|
||||
@@ -110,6 +120,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
### State Management and Determinism
|
||||
|
||||
**Deterministic Coding Requirements**
|
||||
|
||||
- Use `workflow.now()` instead of `datetime.now()`
|
||||
- Use `workflow.random()` instead of `random.random()`
|
||||
- No threading, locks, or global state
|
||||
@@ -117,6 +128,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Pure functions and deterministic logic only
|
||||
|
||||
**State Persistence**
|
||||
|
||||
- Automatic workflow state preservation
|
||||
- Event history replay mechanism
|
||||
- Workflow versioning with `workflow.get_version()`
|
||||
@@ -124,6 +136,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Backward compatibility patterns
|
||||
|
||||
**Workflow Variables**
|
||||
|
||||
- Workflow-scoped variable persistence
|
||||
- Signal-based state updates
|
||||
- Query-based state inspection
|
||||
@@ -132,6 +145,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
### Type Hints and Data Classes
|
||||
|
||||
**Python Type Annotations**
|
||||
|
||||
- Workflow input/output type hints
|
||||
- Activity parameter and return types
|
||||
- Data classes for structured data
|
||||
@@ -139,6 +153,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Type-safe signal and query handlers
|
||||
|
||||
**Serialization Patterns**
|
||||
|
||||
- JSON serialization (default)
|
||||
- Custom data converters
|
||||
- Protobuf integration
|
||||
@@ -148,6 +163,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
### Testing Strategies
|
||||
|
||||
**WorkflowEnvironment Testing**
|
||||
|
||||
- Time-skipping test environment setup
|
||||
- Instant execution of `workflow.sleep()`
|
||||
- Fast testing of month-long workflows
|
||||
@@ -155,6 +171,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Mock activity injection
|
||||
|
||||
**Activity Testing**
|
||||
|
||||
- ActivityEnvironment for unit tests
|
||||
- Heartbeat validation
|
||||
- Timeout simulation
|
||||
@@ -162,12 +179,14 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Idempotency verification
|
||||
|
||||
**Integration Testing**
|
||||
|
||||
- Full workflow with real activities
|
||||
- Local Temporal server with Docker
|
||||
- End-to-end workflow validation
|
||||
- Multi-workflow coordination testing
|
||||
|
||||
**Replay Testing**
|
||||
|
||||
- Determinism validation against production histories
|
||||
- Code change compatibility verification
|
||||
- Continuous integration replay testing
|
||||
@@ -175,6 +194,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
### Production Deployment
|
||||
|
||||
**Worker Deployment Patterns**
|
||||
|
||||
- Containerized worker deployment (Docker/Kubernetes)
|
||||
- Horizontal scaling strategies
|
||||
- Task queue partitioning
|
||||
@@ -182,6 +202,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Blue-green deployment for workers
|
||||
|
||||
**Monitoring and Observability**
|
||||
|
||||
- Workflow execution metrics
|
||||
- Activity success/failure rates
|
||||
- Worker health monitoring
|
||||
@@ -190,6 +211,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Distributed tracing integration
|
||||
|
||||
**Performance Optimization**
|
||||
|
||||
- Worker concurrency tuning
|
||||
- Connection pool sizing
|
||||
- Activity batching strategies
|
||||
@@ -197,6 +219,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Memory and CPU optimization
|
||||
|
||||
**Operational Patterns**
|
||||
|
||||
- Graceful worker shutdown
|
||||
- Workflow execution queries
|
||||
- Manual workflow intervention
|
||||
@@ -206,6 +229,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
## When to Use Temporal Python
|
||||
|
||||
**Ideal Scenarios**:
|
||||
|
||||
- Distributed transactions across microservices
|
||||
- Long-running business processes (hours to years)
|
||||
- Saga pattern implementation with compensation
|
||||
@@ -215,6 +239,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
- Infrastructure automation and orchestration
|
||||
|
||||
**Key Benefits**:
|
||||
|
||||
- Automatic state persistence and recovery
|
||||
- Built-in retry and timeout handling
|
||||
- Deterministic execution guarantees
|
||||
@@ -225,24 +250,28 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
## Common Pitfalls
|
||||
|
||||
**Determinism Violations**:
|
||||
|
||||
- Using `datetime.now()` instead of `workflow.now()`
|
||||
- Random number generation with `random.random()`
|
||||
- Threading or global state in workflows
|
||||
- Direct API calls from workflows
|
||||
|
||||
**Activity Implementation Errors**:
|
||||
|
||||
- Non-idempotent activities (unsafe retries)
|
||||
- Missing timeout configuration
|
||||
- Blocking async event loop with sync code
|
||||
- Exceeding payload size limits (2MB)
|
||||
|
||||
**Testing Mistakes**:
|
||||
|
||||
- Not using time-skipping environment
|
||||
- Testing workflows without mocking activities
|
||||
- Ignoring replay testing in CI/CD
|
||||
- Inadequate error injection testing
|
||||
|
||||
**Deployment Issues**:
|
||||
|
||||
- Unregistered workflows/activities on workers
|
||||
- Mismatched task queue configuration
|
||||
- Missing graceful shutdown handling
|
||||
@@ -251,18 +280,21 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
## Integration Patterns
|
||||
|
||||
**Microservices Orchestration**
|
||||
|
||||
- Cross-service transaction coordination
|
||||
- Saga pattern with compensation
|
||||
- Event-driven workflow triggers
|
||||
- Service dependency management
|
||||
|
||||
**Data Processing Pipelines**
|
||||
|
||||
- Multi-stage data transformation
|
||||
- Parallel batch processing
|
||||
- Error handling and retry logic
|
||||
- Progress tracking and reporting
|
||||
|
||||
**Business Process Automation**
|
||||
|
||||
- Order fulfillment workflows
|
||||
- Payment processing with compensation
|
||||
- Multi-party approval processes
|
||||
@@ -271,6 +303,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
## Best Practices
|
||||
|
||||
**Workflow Design**:
|
||||
|
||||
1. Keep workflows focused and single-purpose
|
||||
2. Use child workflows for scalability
|
||||
3. Implement idempotent activities
|
||||
@@ -278,6 +311,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
5. Design for failure and recovery
|
||||
|
||||
**Testing**:
|
||||
|
||||
1. Use time-skipping for fast feedback
|
||||
2. Mock activities in workflow tests
|
||||
3. Validate replay with production histories
|
||||
@@ -285,6 +319,7 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
5. Achieve high coverage (≥80% target)
|
||||
|
||||
**Production**:
|
||||
|
||||
1. Deploy workers with graceful shutdown
|
||||
2. Monitor workflow and activity metrics
|
||||
3. Implement distributed tracing
|
||||
@@ -294,16 +329,19 @@ Expert Temporal developer focused on building reliable, scalable workflow orches
|
||||
## Resources
|
||||
|
||||
**Official Documentation**:
|
||||
|
||||
- Python SDK: python.temporal.io
|
||||
- Core Concepts: docs.temporal.io/workflows
|
||||
- Testing Guide: docs.temporal.io/develop/python/testing-suite
|
||||
- Best Practices: docs.temporal.io/develop/best-practices
|
||||
|
||||
**Architecture**:
|
||||
|
||||
- Temporal Architecture: github.com/temporalio/temporal/blob/main/docs/architecture/README.md
|
||||
- Testing Patterns: github.com/temporalio/temporal/blob/main/docs/development/testing.md
|
||||
|
||||
**Key Takeaways**:
|
||||
|
||||
1. Workflows = orchestration, Activities = external calls
|
||||
2. Determinism is mandatory for workflows
|
||||
3. Idempotency is critical for activities
|
||||
|
||||
Reference in New Issue
Block a user