10 KiB
Workflow Parity Matrix
This document maps Plandex Go workflows to CleverAgents Python modules.
Summary Statistics
- Total workflows: 15
- Go components: 51
- Python modules: 47
- Total stages: 73
Workflows by Category
Plan Lifecycle
Plan creation, building, applying, and archiving
Plan Create
Create a new plan with initial context
Stages:
- initialization: Create plan structure and metadata
- context_setup: Set up initial context and files
- model_selection: Choose default model for the plan
- persistence: Save plan to database/filesystem
Python Modules:
cleveragents.domain.planscleveragents.application.plan_servicecleveragents.cli.commands.plan
Test Coverage:
- behave: features/plans.feature
- robot: robot/plan_lifecycle.robot
- go_tests: app/cli/cmd/plan_test.go
Notes: Must maintain backward compatibility with existing plan formats
Plan Build
Build plan by processing prompts through AI models
Stages:
- prompt_processing: Process user prompts and context
- model_interaction: Send to AI model and get response
- diff_generation: Generate diffs from AI response
- validation: Validate generated changes
- storage: Store diffs and conversation history
Python Modules:
cleveragents.application.build_servicecleveragents.domain.diffscleveragents.infrastructure.ai_providerscleveragents.cli.commands.tell
Test Coverage:
- behave: features/plan_build.feature
- robot: robot/build_workflow.robot
Notes: Streaming updates must match Go implementation timing
Plan Apply
Apply plan changes to files with review and confirmation
Stages:
- diff_preview: Show pending changes to user
- confirmation: Get user confirmation
- file_updates: Apply diffs to files
- git_operations: Optional git commit
- cleanup: Clean up temporary files
Python Modules:
cleveragents.application.apply_servicecleveragents.domain.file_operationscleveragents.infrastructure.git_integrationcleveragents.cli.commands.apply
Test Coverage:
- behave: features/apply.feature
- robot: robot/apply_workflow.robot
Notes: Must handle merge conflicts and rollback on failure
Context Management
Context loading, modification, and auto-detection
Context Load
Load files and directories into plan context
Stages:
- path_resolution: Resolve file paths and globs
- content_reading: Read file contents
- filtering: Apply ignore patterns
- indexing: Index content for search
- storage: Store in context database
Python Modules:
cleveragents.domain.contextcleveragents.application.context_servicecleveragents.infrastructure.file_loadercleveragents.cli.commands.context
Test Coverage:
- behave: features/context.feature
- robot: robot/context_management.robot
Notes: Auto-context detection must match Go heuristics
Context Auto
Automatically detect and load relevant context
Stages:
- detection: Detect project type and structure
- heuristics: Apply loading heuristics
- filtering: Filter irrelevant files
- loading: Load detected context
Python Modules:
cleveragents.application.auto_contextcleveragents.domain.heuristics
Test Coverage:
- behave: features/auto_context.feature
- robot: robot/auto_context.robot
Notes: Heuristics extracted in implicit behaviors discovery
Execution Flows
Command execution, auto-debug, and rollback
Exec Command
Execute commands in plan context with capture
Stages:
- command_parsing: Parse command and arguments
- environment_setup: Set up execution environment
- execution: Run command with output capture
- result_processing: Process output and errors
- context_update: Update context with results
Python Modules:
cleveragents.application.exec_servicecleveragents.infrastructure.process_runnercleveragents.domain.exec_results
Test Coverage:
- behave: features/exec.feature
- robot: robot/execution.robot
Notes: Must support process groups and cgroup isolation
Auto Debug
Automatically debug and retry failed operations
Stages:
- error_detection: Detect errors in output
- error_analysis: Analyze error for fix strategy
- fix_generation: Generate fix with AI model
- fix_application: Apply fix and retry
- validation: Validate fix succeeded
Python Modules:
cleveragents.application.debug_servicecleveragents.domain.error_analysiscleveragents.infrastructure.ai_debug
Test Coverage:
- behave: features/auto_debug.feature
- robot: robot/debug_workflow.robot
Notes: Retry limits and backoff must match Go implementation
Branching
Branch creation, switching, merging, and diff management
Branch Create
Create and switch plan branches
Stages:
- validation: Validate branch name
- creation: Create branch structure
- copying: Copy current state to branch
- switching: Switch to new branch
- persistence: Save branch metadata
Python Modules:
cleveragents.domain.branchescleveragents.application.branch_servicecleveragents.cli.commands.branches
Test Coverage:
- behave: features/branches.feature
- robot: robot/branching.robot
Notes: Branch switching must preserve unsaved changes
Branch Merge
Merge branches with conflict resolution
Stages:
- diff_comparison: Compare branch diffs
- conflict_detection: Detect merge conflicts
- conflict_resolution: Resolve conflicts
- merge_application: Apply merged changes
- cleanup: Clean up merged branch
Python Modules:
cleveragents.application.merge_servicecleveragents.domain.conflict_resolution
Test Coverage:
- behave: features/merge.feature
- robot: robot/merge_workflow.robot
Notes: Must support manual and automatic conflict resolution
Collaboration
Team invites, sharing, and permissions
Team Invite
Invite team members and manage permissions
Stages:
- invite_creation: Create invite
- notification: Send invite notification
- acceptance: Process invite acceptance
- permission_grant: Grant permissions
- sync: Sync team state
Python Modules:
cleveragents.domain.teamscleveragents.application.invite_servicecleveragents.infrastructure.notifications
Test Coverage:
- behave: features/collaboration.feature
- robot: robot/team_workflow.robot
Notes: Replace cloud invites with SMTP or local alternatives
Model Management
Model selection, custom models, and provider configuration
Model Selection
Select and configure AI models
Stages:
- model_listing: List available models
- capability_check: Check model capabilities
- selection: Select model
- validation: Validate API keys
- configuration: Save model configuration
Python Modules:
cleveragents.domain.modelscleveragents.application.model_servicecleveragents.infrastructure.model_providerscleveragents.cli.commands.models
Test Coverage:
- behave: features/models.feature
- robot: robot/model_management.robot
Notes: Model catalog refresh must be automated
Authentication
Login, logout, session management, and API keys
Auth Login
User authentication and session establishment
Stages:
- credential_input: Get user credentials
- authentication: Verify credentials
- session_creation: Create session token
- token_storage: Store token locally
- verification: Verify session active
Python Modules:
cleveragents.infrastructure.authcleveragents.domain.sessionscleveragents.cli.commands.auth
Test Coverage:
- behave: features/authentication.feature
- robot: robot/auth_workflow.robot
Notes: Must support both API key and email/password auth
Configuration
Settings, environment variables, and config files
Config Management
Manage application configuration
Stages:
- config_loading: Load configuration files
- env_merging: Merge environment variables
- validation: Validate configuration
- application: Apply configuration
- persistence: Save configuration changes
Python Modules:
cleveragents.infrastructure.configcleveragents.domain.settingscleveragents.cli.commands.config
Test Coverage:
- behave: features/configuration.feature
- robot: robot/config_management.robot
Notes: Must support CLEVERAGENTS_ env vars exclusively
Streaming
Real-time updates, logs, and progress tracking
Stream Updates
Stream real-time updates during operations
Stages:
- connection: Establish streaming connection
- buffering: Buffer incoming chunks
- rendering: Render updates to UI
- error_handling: Handle connection errors
- cleanup: Clean up on completion
Python Modules:
cleveragents.infrastructure.streamingcleveragents.application.stream_servicecleveragents.cli.ui.stream_renderer
Test Coverage:
- behave: features/streaming.feature
- robot: robot/streaming.robot
Notes: Must handle reconnection and backpressure
Background Jobs
Async tasks, retries, and job scheduling
Background Jobs
Manage background tasks and job scheduling
Stages:
- job_creation: Create job definition
- scheduling: Schedule job execution
- execution: Execute job task
- retry: Retry on failure
- completion: Mark job complete
Python Modules:
cleveragents.infrastructure.jobscleveragents.application.job_servicecleveragents.domain.background_tasks
Test Coverage:
- behave: features/background_jobs.feature
- robot: robot/job_scheduling.robot
Notes: Use asyncio or celery for job management
Recommended Implementation Order
Based on dependency analysis:
- team_invite - Invite team members and manage permissions
- auth_login - User authentication and session establishment
- model_selection - Select and configure AI models
- background_jobs - Manage background tasks and job scheduling
- auto_debug - Automatically debug and retry failed operations
- config_management - Manage application configuration
- context_load - Load files and directories into plan context
- plan_apply - Apply plan changes to files with review and confirmation
- branch_merge - Merge branches with conflict resolution
- branch_create - Create and switch plan branches
- stream_updates - Stream real-time updates during operations
- plan_build - Build plan by processing prompts through AI models
- plan_create - Create a new plan with initial context
- context_auto - Automatically detect and load relevant context
- exec_command - Execute commands in plan context with capture