Dependencies¶
TrakFlow maintains a dependency graph to track relationships between tasks.
Dependency Types¶
| Type | Description | Use Case |
|---|---|---|
blocks |
Hard dependency (default) | Task A must complete before Task B |
related |
Soft link | Reference between related tasks |
parent-child |
Hierarchical | Subtask relationship |
discovered-from |
Traceability | Track where a task originated |
Adding Dependencies¶
Basic Syntax¶
The source task blocks/relates-to the target task.
Examples¶
# Design must complete before implementation
tf dep add tf-design tf-implement
# Specify dependency type
tf dep add tf-design tf-implement --type blocks
tf dep add tf-bug1 tf-bug2 -t related
Removing Dependencies¶
Viewing Dependencies¶
Dependency Tree¶
Output:
tf-implement
├── blocked by:
│ └── tf-design (open)
└── blocks:
├── tf-test (open)
└── tf-deploy (open)
Dependency Graph¶
Generate a visual graph:
Ready Work Detection¶
Find tasks with no open blockers:
A task is "ready" when:
- Status is open
- All blocking dependencies are closed
- Not a Plan (Plans can't be executed directly)
How It Works¶
graph LR
A[Design ✓] -->|blocks| B[Implement]
B -->|blocks| C[Test]
B -->|blocks| D[Docs]
style A fill:#90EE90
style B fill:#90EE90
style C fill:#FFE4B5
style D fill:#FFE4B5
In this example: - Design is closed (✓) - Implement is ready (no open blockers) - Test and Docs are NOT ready (blocked by Implement)
Common Patterns¶
Sequential Workflow¶
tf create "Step 1: Research"
tf create "Step 2: Design"
tf create "Step 3: Implement"
tf create "Step 4: Test"
tf dep add tf-step1 tf-step2
tf dep add tf-step2 tf-step3
tf dep add tf-step3 tf-step4
graph LR
A[Research] --> B[Design] --> C[Implement] --> D[Test]
Parallel Tasks with Sync Point¶
tf create "Frontend work"
tf create "Backend work"
tf create "Integration"
tf dep add tf-frontend tf-integration
tf dep add tf-backend tf-integration
graph LR
A[Frontend] --> C[Integration]
B[Backend] --> C
Feature with Prerequisites¶
tf create "Add payment support" -t feature
tf create "Set up Stripe account"
tf create "Get API keys"
tf create "Implement payment flow"
tf dep add tf-stripe tf-implement
tf dep add tf-keys tf-implement
graph LR
A[Stripe Account] --> C[Implement Payment]
B[Get API Keys] --> C
Dependency Validation¶
TrakFlow validates dependencies:
| Rule | Error |
|---|---|
| No self-reference | Can't add dependency to itself |
| Tasks must exist | Both source and target must exist |
| No cycles (optional) | Prevents circular dependencies |
Cycle Detection¶
# This would create a cycle: A → B → C → A
tf dep add tf-c tf-a
# Warning: Creates circular dependency
Querying Dependencies¶
Find Blocked Tasks¶
Find Tasks Blocking Others¶
Find Orphan Tasks¶
Tasks with no dependencies:
Impact on Operations¶
Closing Tasks¶
When you close a task, dependent tasks may become ready:
Reopening Tasks¶
Reopening a task re-blocks its dependents:
Best Practices¶
Dependency Guidelines¶
- Keep graphs simple - Avoid overly complex dependency chains
- Use meaningful types - Choose the right dependency type
- Document relationships - Add notes explaining why dependencies exist
- Review regularly - Clean up stale dependencies
Avoiding Issues¶
- Check for cycles - Before adding dependencies
- Don't over-connect - Not everything needs to be linked
- Use labels for grouping - Instead of
relateddependencies - Keep chains short - Long chains slow progress