src.detection.board_analyzer module#

Board State Analyzer for Marcus Hybrid Approach.

Analyzes kanban board state to determine optimal Marcus mode and understand project organization level.

class src.detection.board_analyzer.WorkflowPattern[source]#

Bases: Enum

Detected workflow patterns.

SEQUENTIAL = 'sequential'#
PARALLEL = 'parallel'#
PHASED = 'phased'#
AD_HOC = 'ad_hoc'#
UNKNOWN = 'unknown'#
class src.detection.board_analyzer.BoardState[source]#

Bases: object

Represents the analyzed state of a board.

task_count: int#
tasks_with_descriptions: int#
tasks_with_labels: int#
tasks_with_estimates: int#
tasks_with_dependencies: int#
structure_score: float#
workflow_pattern: WorkflowPattern#
phases_detected: List[str]#
components_detected: List[str]#
metadata_completeness: float#
is_empty: bool#
is_chaotic: bool#
is_well_structured: bool#
recommended_mode: str#
__init__(task_count, tasks_with_descriptions, tasks_with_labels, tasks_with_estimates, tasks_with_dependencies, structure_score, workflow_pattern, phases_detected, components_detected, metadata_completeness, is_empty, is_chaotic, is_well_structured, recommended_mode)#
Parameters:
  • task_count (int)

  • tasks_with_descriptions (int)

  • tasks_with_labels (int)

  • tasks_with_estimates (int)

  • tasks_with_dependencies (int)

  • structure_score (float)

  • workflow_pattern (WorkflowPattern)

  • phases_detected (List[str])

  • components_detected (List[str])

  • metadata_completeness (float)

  • is_empty (bool)

  • is_chaotic (bool)

  • is_well_structured (bool)

  • recommended_mode (str)

Return type:

None

class src.detection.board_analyzer.BoardAnalyzer[source]#

Bases: object

Analyzes kanban board state to determine optimal Marcus mode.

PHASE_PATTERNS = {'deployment': '(deploy|release|launch|ship|production)', 'design': '(design|architect|plan|model|schema)', 'development': '(implement|build|create|develop|code)', 'maintenance': '(maintain|fix|bug|patch|update)', 'setup': '(setup|init|initialize|config|configure|scaffold)', 'testing': '(test|qa|quality|verify|validate)'}#
COMPONENT_PATTERNS = {'backend': '(backend|api|server|endpoint|service)', 'database': '(database|db|sql|mongo|redis|cache)', 'frontend': '(frontend|ui|client|react|vue|angular)', 'infrastructure': '(infra|devops|ci|cd|docker|k8s)', 'mobile': '(mobile|ios|android|app|native)', 'testing': '(test|spec|e2e|unit|integration)'}#
async analyze_board(board_id, tasks)[source]#

Analyze board characteristics to determine state and recommended mode.

Parameters:
  • board_id (str) – The board identifier.

  • tasks (List[Task]) – List of tasks on the board.

Returns:

BoardState with analysis results.

Return type:

BoardState

async calculate_structure_score(tasks)[source]#

Score 0-1 indicating how well-structured the board is.

  • 0.0-0.3: Chaotic (just task titles)

  • 0.3-0.6: Basic (some organization)

  • 0.6-0.8: Good (clear structure)

  • 0.8-1.0: Excellent (full metadata)

Parameters:

tasks (List[Task]) – List of tasks to analyze.

Returns:

Structure score between 0 and 1.

Return type:

float

async detect_workflow_patterns(tasks)[source]#

Detect how the team works based on task patterns.

Parameters:

tasks (List[Task]) – List of tasks to analyze.

Returns:

Detected workflow pattern.

Return type:

WorkflowPattern