16. Project Management System#
Overview#
The Project Management system is Marcusβs multi-project orchestration layer that provides comprehensive project lifecycle management from creation to execution. It acts as the central coordination hub that manages project configurations, context switching, resource isolation, and workflow execution across multiple provider backends (Planka, Linear, GitHub Projects).
Architecture#
Core Components#
The system consists of three primary architectural layers:
Project Registry (
src/core/project_registry.py) - Configuration and persistence layerProject Context Manager (
src/core/project_context_manager.py) - Runtime state and resource managementProject Workflow Manager (
src/workflow/project_workflow.py) - Execution orchestration layer
NOTE: NOT IMPLEMENTED β
ProjectWorkflowManager(src/workflow/project_workflow.py) has been removed. Thesrc/workflow/directory exists but is empty (only__init__.py). References to this class in the architecture diagram and workflow descriptions below reflect the original design intent, not the current codebase.
graph TB
A[MCP Tools Layer] --> B[Project Registry]
A --> C[Project Context Manager]
A --> D[Project Workflow Manager]
B --> E[Persistence Layer]
C --> F[Kanban Factory]
C --> G[Context Services]
C --> H[State Isolation]
D --> I[Marcus MCP Client]
D --> J[Pipeline Flow Manager]
F --> K[Planka Client]
F --> L[Linear Client]
F --> M[GitHub Client]
Data Flow Architecture#
sequenceDiagram
participant User as Agent/User
participant MCP as MCP Tools
participant PM as Project Manager
participant PR as Project Registry
participant KC as Kanban Client
participant WF as Workflow
User->>MCP: create_project()
MCP->>PR: add_project(config)
PR->>PM: switch_project(id)
PM->>KC: create kanban client
PM->>WF: initialize workflow
WF->>User: project ready
Position in Marcus Ecosystem#
The Project Management system serves as the primary orchestration layer between user intent and execution infrastructure. It sits at the intersection of:
User Interface Layer (MCP tools)
Backend Providers (Kanban integrations)
Execution Engine (Agent task assignment)
State Management (Context and persistence)
Integration Points#
Upward Integration: Exposes MCP tools for Claude agents
Downward Integration: Manages provider-specific kanban clients
Lateral Integration: Coordinates with visualization, logging, and monitoring systems
Temporal Integration: Maintains state continuity across sessions
Workflow Integration#
The Project Management system is invoked at these key points in the Marcus workflow:
Primary Workflow Sequence#
1. create_project (NLP Tool) β Project Registry + Context Manager
2. register_agent (Agent Tool) β Uses active project context
3. request_next_task (Task Tool) β Queries active project's kanban board
4. report_progress (Task Tool) β Updates active project's task state
5. report_blocker (Task Tool) β Records blockers in active project context
6. finish_task (Task Tool) β Marks completion in active project
Multi-Project Workflow#
1. list_projects β Shows available projects
2. switch_project β Changes active context
3. [Normal workflow continues in new project context]
4. get_current_project β Confirms active project
What Makes This System Special#
1. Provider Abstraction#
The system provides a unified interface across heterogeneous kanban providers:
SQLite: Local database, zero dependencies, recommended for getting started
Planka: Self-hosted, full control
Linear: Issue tracking with automation
GitHub Projects: Git-integrated project management
2. Context Isolation#
Each project maintains completely isolated state:
Separate kanban connections
Independent event histories
Isolated assignment persistence
Project-specific configurations
3. Resource Management#
Intelligent resource lifecycle management:
LRU cache for project contexts (max 10 projects)
Automatic cleanup of idle projects (30-minute timeout)
Connection pooling and reuse
Background maintenance tasks
4. State Continuity#
Maintains state across sessions:
Persistent project configurations
Saved context state
Active project tracking
Assignment history preservation
Technical Implementation Details#
Project Registry Implementation#
@dataclass
class ProjectConfig:
id: str
name: str
provider: str # 'sqlite', 'planka', 'linear', 'github'
provider_config: Dict[str, Any]
created_at: datetime
last_used: datetime
tags: List[str]
Key Features:
CRUD Operations: Full lifecycle management
Filtering: By tags, provider, usage patterns
Persistence: JSON serialization with datetime handling
Migration: Legacy configuration import support
Context Manager Implementation#
class ProjectContext:
kanban_client: Optional[KanbanInterface]
context: Optional[Context]
events: Optional[Events]
project_state: Optional[ProjectState]
assignment_persistence: Optional[AssignmentPersistence]
last_accessed: datetime
is_connected: bool
Key Features:
Service Composition: Each project gets isolated service instances
Connection Management: Automatic connect/disconnect lifecycle
LRU Caching: OrderedDict-based cache with size limits
Background Cleanup: Async cleanup loop for idle projects
Workflow Manager Implementation#
Key Features:
Auto-Assignment: Continuous task distribution to available agents
Progress Monitoring: Real-time workflow metrics collection
Event Integration: Pipeline flow visualization support
Resource Constraints: Configurable agent limits and resource controls
Provider Configuration Patterns#
SQLite Configuration#
provider_config = {
"db_path": "path/to/database.db" # optional, defaults to local data dir
}
Planka Configuration#
provider_config = {
"project_id": "uuid",
"board_id": "uuid"
}
GitHub Configuration#
provider_config = {
"owner": "username",
"repo": "repository",
"project_number": 1
}
Linear Configuration#
provider_config = {
"team_id": "team_uuid",
"project_id": "project_uuid"
}
Pros and Cons#
Advantages#
Multi-Provider Support: Single interface for multiple backends
Resource Efficiency: Intelligent caching and cleanup
State Isolation: Complete project separation
Scalability: Supports unlimited projects with bounded resource usage
Persistence: Survives restarts and maintains continuity
Legacy Support: Migration from single-project configurations
Disadvantages#
Complexity: Multi-layered architecture increases cognitive overhead
Memory Usage: Caching multiple contexts consumes memory
Provider Coupling: Still dependent on specific provider implementations
Debugging Difficulty: State distributed across multiple components
Configuration Burden: Requires provider-specific setup knowledge
Design Rationale#
Why This Approach Was Chosen#
Scalability Requirements: Need to support multiple concurrent projects
Provider Diversity: Different organizations use different kanban tools
Resource Constraints: Limited memory/connection resources require management
State Isolation: Projects should not interfere with each other
User Experience: Seamless switching between projects
Alternative Approaches Considered#
Single Project Model: Rejected due to scalability limitations
Database-Centric: Rejected due to complexity and dependency overhead
Stateless Design: Rejected due to performance and connection overhead
Provider-Specific Managers: Rejected due to code duplication
Future Evolution#
Planned Enhancements#
Advanced Caching: Redis-backed distributed cache for multi-instance deployments
Project Templates: Pre-configured project types for common use cases
Cross-Project Operations: Task dependencies and resource sharing between projects
Advanced Metrics: Project-level analytics and performance tracking
Backup/Restore: Project configuration export/import functionality
Potential Architectural Changes#
Event Sourcing: Move to event-driven project state management
Microservices: Split into separate project management service
GraphQL API: Unified query interface across all providers
Plugin Architecture: Dynamic provider loading and registration
Simple vs Complex Task Handling#
Simple Tasks (Prototype Projects)#
Minimal Context: Basic kanban connection only
Reduced Monitoring: Less frequent progress checks
Simplified Workflow: Direct task assignment without complex routing
Limited History: Shorter event retention
Complex Tasks (Enterprise Projects)#
Full Context: Complete service composition (events, context, persistence)
Intensive Monitoring: Real-time progress tracking and metrics
Advanced Workflow: Multi-agent coordination with dependency management
Complete History: Full audit trail and event logging
Board-Specific Considerations#
Planka Boards#
Strengths: Full API control, custom fields, webhook support
Limitations: Requires self-hosting, limited automation
Use Case: Internal projects with custom workflows
Linear Boards#
Strengths: Advanced automation, integrated time tracking, API-rich
Limitations: External dependency, cost considerations
Use Case: Professional product development
GitHub Project Boards#
Strengths: Git integration, issue linking, free for public repos
Limitations: Limited customization, basic automation
Use Case: Open source projects, code-centric workflows
AI Integration#
NOTE: The methods shown below (
cato.analyze_project_description(),cato.generate_project_structure(),cato.analyze_task_complexity(),cato.suggest_agent_allocation()) are illustrative β there is no callableCatoClientclass inside Marcus exposing them today. NLP project creation and AI analysis are performed directly byNaturalLanguageProjectCreatorandAIAnalysisEngine.
The Project Management system integrates with AI components through:
NLP Project Creation:
NaturalLanguageProjectCreatorprocesses natural language project descriptionsTask Complexity Analysis:
AdvancedPRDParserdetermines appropriate project sizingResource Planning:
AIAnalysisEnginesuggests optimal agent allocationProgress Analysis:
AIAnalysisEngineanalyzes project metrics for insights
Complete Workflow Context#
Within the standard Marcus scenario flow:
ββ create_project (NLP) βββββββββββββββββββββββββββββββββββ
β β’ NaturalLanguageProjectCreator analyzes requirements β
β β’ Project Registry creates configuration β
β β’ Context Manager initializes services β
β β’ Workflow Manager prepares execution environment β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ register_agent βββββββββββββββββββββββββββββββββββββββββ
β β’ Agent registers with active project context β
β β’ Assignment Persistence tracks agent availability β
β β’ Context Manager provides project-specific services β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ request_next_task ββββββββββββββββββββββββββββββββββββββ
β β’ Queries active project's kanban board β
β β’ Context Manager provides isolated board connection β
β β’ Workflow Manager handles task distribution logic β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ report_progress ββββββββββββββββββββββββββββββββββββββββ
β β’ Updates active project's task state β
β β’ Events system logs progress in project context β
β β’ Workflow Manager tracks metrics β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ report_blocker βββββββββββββββββββββββββββββββββββββββββ
β β’ Records blocker in active project context β
β β’ Context Manager maintains project-specific event log β
β β’ Workflow Manager may trigger rebalancing β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββ finish_task ββββββββββββββββββββββββββββββββββββββββββββ
β β’ Marks completion in active project β
β β’ Assignment Persistence updates agent status β
β β’ Workflow Manager checks for completion triggers β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The Project Management system ensures that each step operates within the correct project context, maintains isolation between projects, and provides the necessary services for successful task execution.
Error Handling and Resilience#
The system implements comprehensive error handling:
Connection Failures: Automatic retry with exponential backoff
State Corruption: Graceful degradation and recovery mechanisms
Resource Exhaustion: Proactive cleanup and resource limiting
Provider Outages: Circuit breaker patterns and fallback strategies
Performance Characteristics#
Context Switch Time: ~100ms for cached projects, ~2s for new projects
Memory Usage: ~50MB per active project context
Connection Limits: Max 10 concurrent provider connections
Cleanup Frequency: Every 5 minutes for idle projects
Cache Hit Rate: >90% for active development workflows
The Project Management system represents Marcusβs commitment to scalable, multi-project development workflows while maintaining the simplicity and efficiency that makes Marcus effective for both prototype and enterprise-scale projects.