Overview
Parses task dependency data, builds a directed acyclic graph, runs forward and backward pass computations to identify the critical path, and produces a structured report with slack values, risk assessment, and actionable recommendations.
Workflow
<Definition - Critical Path> The longest sequence of dependent tasks from project start to project finish. It determines the minimum possible project duration. Any delay to a task on the critical path delays the entire project by the same amount. </Definition - Critical Path>
<Definition - Float and Slack> The amount of time a task can be delayed without affecting downstream work or the project end date. Two types:
- Free Float: How long a task can slip without delaying its immediate successors. Calculated as the earliest start of the next task minus the earliest finish of the current task.
- Total Float: How long a task can slip without delaying the project end date. Calculated as the difference between the late finish and early finish (or late start and early start) of a task. Tasks on the critical path have zero total float. </Definition - Float and Slack>
<Definition - Dependency Types> Relationships between tasks that constrain scheduling:
- FS (Finish-to-Start): Successor cannot start until predecessor finishes. The most common type and the default if unspecified.
- FF (Finish-to-Finish): Successor cannot finish until predecessor finishes.
- SS (Start-to-Start): Successor cannot start until predecessor starts.
- SF (Start-to-Finish): Successor cannot finish until predecessor starts. Rarely used.
Each dependency may also carry a lag (positive delay) or lead (negative lag, meaning overlap is allowed). </Definition - Dependency Types>
<Definition - Forward Pass> The left-to-right traversal of the dependency graph that calculates the earliest start (ES) and earliest finish (EF) for every task. EF = ES + Duration. The ES of a task is the maximum EF of all its predecessors (for FS relationships). </Definition - Forward Pass>
<Definition - Backward Pass> The right-to-left traversal that calculates the latest finish (LF) and latest start (LS) for every task without delaying the project. LS = LF - Duration. The LF of a task is the minimum LS of all its successors (for FS relationships). </Definition - Backward Pass>
<Workflow - Critical Path Analysis description="End-to-end critical path analysis from source data to final report." tools=[file_read, file_write, run_python, open_in_session_tab] triggers=["find the critical path", "what's blocking this project", "dependency analysis", "schedule risk", "which tasks have slack", "project timeline analysis", "critical path method"]
-
[Decide] Determine the input type:
- File path: Read and parse the file. Detect format (CSV, JSON, markdown table, MS Project XML) and extract task entries with dependencies.
- Pasted data: Parse the tabular or list data from the conversation into structured task entries.
- "describe": Ask the user to list their tasks, durations, and dependencies interactively. Build the task list through conversation, confirming each entry.
-
[Decide] Validate the parsed data:
- If any task is missing a duration value, halt and ask the user to supply the missing durations. List which tasks are incomplete.
- If any predecessor reference points to a task ID that does not exist in the data, halt and report the broken references.
- If the dependency types are not specified, default all to FS with zero lag per Rule 6.
-
[Agent] Build the dependency graph as a directed graph using Python. Run a topological sort. If the sort fails (cycle detected), identify all tasks participating in cycles using a strongly connected components algorithm. Report the cycles to the user per Rule 3 and stop.
-
[Agent] Compute the forward pass. Traverse tasks in topological order. For each task, calculate:
- Early Start (ES) = maximum Early Finish of all predecessors (adjusted for dependency type and lag). Tasks with no predecessors have ES = 0.
- Early Finish (EF) = ES + Duration. Record the project's minimum duration as the maximum EF across all terminal tasks.
-
[Agent] Compute the backward pass. Traverse tasks in reverse topological order. For each task, calculate:
- Late Finish (LF) = minimum Late Start of all successors (adjusted for dependency type and lag). Terminal tasks have LF = project minimum duration.
- Late Start (LS) = LF - Duration. Calculate Total Float = LS - ES (or LF - EF) for each task. Calculate Free Float = minimum ES of successors - EF of current task (for FS dependencies).
-
[Agent] Identify the critical path: all tasks where Total Float = 0. Trace the longest path from start to finish through these zero-float tasks. If multiple critical paths exist (tied duration), trace and report each. Identify near-critical paths (total float less than 10% of critical path duration) per Rule 8.
-
[Agent] Generate the risk assessment:
- Chain length risk: count the number of tasks on the critical path.
- Near-critical path count and their float values.
- Convergence points: tasks with 3+ predecessors where multiple paths merge (high-risk nodes).
- Schedule gap: if target_date is provided, compare the computed minimum project duration (in working days) against the available working days to the deadline. Produce prioritized recommendations: which tasks to focus on, where buffers would help most, and which dependencies to challenge.
-
[Agent] Format the report using the Critical Path Report template. Save to artifacts as a markdown file. Save the computation script as a separate Python file for auditability. Open the report in the session tab using open_in_session_tab.
</Workflow - Critical Path Analysis>
<Template - Critical Path Report>
markdown# {{project_name}} - Critical Path Analysis **Source:** {{task_source}} **Analysis Date:** {{current_date}} **Target Deadline:** {{target_date or "Not specified"}} --- ## Summary | Metric | Value | |--------|-------| | Total Tasks | {{total_tasks}} | | Project Duration (working days) | {{project_duration}} | | Critical Path Length (tasks) | {{critical_path_task_count}} | | Near-Critical Paths | {{near_critical_count}} | | Schedule Gap to Deadline | {{schedule_gap or "N/A"}} | --- ## Critical Path The following task sequence determines the minimum project duration. Any delay to these tasks delays the project. ~~~ {{critical_path_ascii}} Example format: [Task A (5d)] > [Task D (3d)] > [Task F (7d)] > [Task H (4d)] Total: 19 days ~~~ | # | Task ID | Task Name | Duration | Early Start | Early Finish | |---|---------|-----------|----------|-------------|--------------| {{critical_path_table_rows}} --- ## Float Analysis ### Tasks by Slack (sorted ascending) | Task ID | Task Name | Duration | Total Float | Free Float | Status | |---------|-----------|----------|-------------|------------|--------| {{float_table_rows}} Status key: CRITICAL = 0 float, AT RISK = float < 10% of project duration, FLEXIBLE = all others. --- ## Near-Critical Paths {{near_critical_paths_section}} --- ## Risk Assessment ### Risk Factors {{risk_factors_list}} ### Convergence Points (High-Risk Nodes) {{convergence_points_table}} --- ## Recommendations {{prioritized_recommendations}} --- ## Limitations - This analysis uses the Critical Path Method (CPM) without resource leveling. Parallel tasks may compete for the same resources. - Duration estimates are taken as-is from the source data. Actual durations may vary. - All durations treated as working days (5-day week) unless otherwise noted. --- *Computation script saved to: {{script_path}}*
</Template - Critical Path Report>


