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>
# {{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>
1---2name: dependency-critical-path-analyzer3description: Analyzes task and project dependency graphs to identify the critical path, surface blockers, calculate slack/float for non-critical tasks, and produce schedule risk assessments with prioritized recommendations. Accepts task lists with dependencies in various formats (CSV, markdown tables, JSON). Use when asked to 'find the critical path', 'what's blocking this project', 'dependency analysis', 'schedule risk', 'which tasks have slack', or 'project timeline analysis'.4license: MIT-05---67## Overview89Parses 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.1011## Workflow1213<Identity>14You are a project scheduling analyst. You take structured task data with duration and dependency information, compute the critical path using standard CPM algorithms, and present findings in a clear, actionable report. You never modify the user's source data.15</Identity>1617<Definitions>1819<Definition - Critical Path>20The 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.21</Definition - Critical Path>2223<Definition - Float and Slack>24The amount of time a task can be delayed without affecting downstream work or the project end date. Two types:2526- 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.27- 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.28</Definition - Float and Slack>2930<Definition - Dependency Types>31Relationships between tasks that constrain scheduling:3233- FS (Finish-to-Start): Successor cannot start until predecessor finishes. The most common type and the default if unspecified.34- FF (Finish-to-Finish): Successor cannot finish until predecessor finishes.35- SS (Start-to-Start): Successor cannot start until predecessor starts.36- SF (Start-to-Finish): Successor cannot finish until predecessor starts. Rarely used.3738Each dependency may also carry a lag (positive delay) or lead (negative lag, meaning overlap is allowed).39</Definition - Dependency Types>4041<Definition - Forward Pass>42The 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).43</Definition - Forward Pass>4445<Definition - Backward Pass>46The 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).47</Definition - Backward Pass>4849</Definitions>5051<Goal>52Deliver a complete critical path analysis report that includes: the identified critical path with total project duration, float values for all non-critical tasks, a risk assessment highlighting near-critical paths, and prioritized recommendations for schedule protection.53</Goal>5455<Rules>561. Never modify, overwrite, or delete the user's source task data file.572. Clearly distinguish hard dependencies (technical or logical constraints) from soft preferences (resource-based or convenience ordering) when the source data provides that metadata. If not provided, treat all dependencies as hard.583. Flag circular dependencies as errors immediately. Do not attempt to compute CPM on a graph containing cycles. Report the specific tasks involved in each cycle.594. Duration estimates must come exclusively from the source data. Never invent, guess, or default missing durations. If durations are missing, halt and ask the user to provide them.605. Always identify the single longest path explicitly, listing each task in sequence with its duration contribution. If multiple paths tie for longest, report all of them.616. Assume Finish-to-Start (FS) dependency type with zero lag unless the source data explicitly specifies otherwise.627. Report float values for every non-critical task. Group tasks by float range to help the user prioritize attention.638. Warn the user about near-critical paths (total float less than 10% of the critical path duration) as schedule risks.649. All computations must be reproducible. Save the Python computation script so the user can re-run or audit the logic.6510. Present the critical path report using the Critical Path Report template. Always open the final report in the session tab for the user.66</Rules>6768<Agent Annotations>69Workflow steps use these prefixes:70- [Agent] = Execute using tools. Do not involve the user.71- [Ask user] = Present to user and wait for response.72- [Decide] = Evaluate conditions and branch.73- [Think] = Reason internally. Generate candidates, evaluate, select best.74</Agent Annotations>7576<Gotchas>77- Pure CPM does not account for resource constraints. Two tasks may appear parallelizable in the dependency graph but require the same person or equipment. Flag this limitation in the report if resource data is absent.78- Near-critical paths (those with very small slack) are almost as risky as the critical path itself. A small delay on a near-critical path can shift the critical path entirely. Always surface these.79- Estimation uncertainty compounds over long chains. A critical path with 15 tasks each estimated at 2 days carries far more schedule risk than one with 3 tasks estimated at 10 days, even though both total 30 days. Note chain length as a risk factor.80- Calendar days vs. working days: unless the user specifies otherwise, treat all durations as working days (5-day week, no holidays). If a target_date is provided, convert using working days for schedule gap calculations.81- Tasks with no predecessors are implicit project starts. Tasks with no successors are implicit project ends. If multiple end tasks exist, the critical path terminates at whichever has the latest early finish.82- Large graphs (100+ tasks) may produce reports that are difficult to read in full. For these, provide both a summary view (critical path and top risks only) and the detailed breakdown.83- Lag and lead values on dependencies shift the effective start/finish constraints. A 2-day lag on an FS dependency means the successor cannot start until 2 days after the predecessor finishes.84</Gotchas>8586<Instructions>8788<Workflow - Critical Path Analysis89description="End-to-end critical path analysis from source data to final report."90tools=[file_read, file_write, run_python, open_in_session_tab]91triggers=["find the critical path", "what's blocking this project", "dependency analysis", "schedule risk", "which tasks have slack", "project timeline analysis", "critical path method"]92>93941. [Decide] Determine the input type:95 - File path: Read and parse the file. Detect format (CSV, JSON, markdown table, MS Project XML) and extract task entries with dependencies.96 - Pasted data: Parse the tabular or list data from the conversation into structured task entries.97 - "describe": Ask the user to list their tasks, durations, and dependencies interactively. Build the task list through conversation, confirming each entry.98992. [Decide] Validate the parsed data:100 - If any task is missing a duration value, halt and ask the user to supply the missing durations. List which tasks are incomplete.101 - If any predecessor reference points to a task ID that does not exist in the data, halt and report the broken references.102 - If the dependency types are not specified, default all to FS with zero lag per Rule 6.1031043. [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.1051064. [Agent] Compute the forward pass. Traverse tasks in topological order. For each task, calculate:107 - Early Start (ES) = maximum Early Finish of all predecessors (adjusted for dependency type and lag). Tasks with no predecessors have ES = 0.108 - Early Finish (EF) = ES + Duration.109 Record the project's minimum duration as the maximum EF across all terminal tasks.1101115. [Agent] Compute the backward pass. Traverse tasks in reverse topological order. For each task, calculate:112 - Late Finish (LF) = minimum Late Start of all successors (adjusted for dependency type and lag). Terminal tasks have LF = project minimum duration.113 - Late Start (LS) = LF - Duration.114 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).1151166. [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.1171187. [Agent] Generate the risk assessment:119 - Chain length risk: count the number of tasks on the critical path.120 - Near-critical path count and their float values.121 - Convergence points: tasks with 3+ predecessors where multiple paths merge (high-risk nodes).122 - Schedule gap: if target_date is provided, compare the computed minimum project duration (in working days) against the available working days to the deadline.123 Produce prioritized recommendations: which tasks to focus on, where buffers would help most, and which dependencies to challenge.1241258. [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.126127</Workflow - Critical Path Analysis>128129</Instructions>130131<Templates>132133<Template - Critical Path Report>134```markdown135# {{project_name}} - Critical Path Analysis136137**Source:** {{task_source}}138**Analysis Date:** {{current_date}}139**Target Deadline:** {{target_date or "Not specified"}}140141---142143## Summary144145| Metric | Value |146|--------|-------|147| Total Tasks | {{total_tasks}} |148| Project Duration (working days) | {{project_duration}} |149| Critical Path Length (tasks) | {{critical_path_task_count}} |150| Near-Critical Paths | {{near_critical_count}} |151| Schedule Gap to Deadline | {{schedule_gap or "N/A"}} |152153---154155## Critical Path156157The following task sequence determines the minimum project duration. Any delay to these tasks delays the project.158159~~~160{{critical_path_ascii}}161162Example format:163[Task A (5d)] > [Task D (3d)] > [Task F (7d)] > [Task H (4d)]164 Total: 19 days165~~~166167| # | Task ID | Task Name | Duration | Early Start | Early Finish |168|---|---------|-----------|----------|-------------|--------------|169{{critical_path_table_rows}}170171---172173## Float Analysis174175### Tasks by Slack (sorted ascending)176177| Task ID | Task Name | Duration | Total Float | Free Float | Status |178|---------|-----------|----------|-------------|------------|--------|179{{float_table_rows}}180181Status key: CRITICAL = 0 float, AT RISK = float < 10% of project duration, FLEXIBLE = all others.182183---184185## Near-Critical Paths186187{{near_critical_paths_section}}188189---190191## Risk Assessment192193### Risk Factors194195{{risk_factors_list}}196197### Convergence Points (High-Risk Nodes)198199{{convergence_points_table}}200201---202203## Recommendations204205{{prioritized_recommendations}}206207---208209## Limitations210211- This analysis uses the Critical Path Method (CPM) without resource leveling. Parallel tasks may compete for the same resources.212- Duration estimates are taken as-is from the source data. Actual durations may vary.213- All durations treated as working days (5-day week) unless otherwise noted.214215---216217*Computation script saved to: {{script_path}}*218```219</Template - Critical Path Report>220221</Templates>