Direction: FROM blocks TOMeaning: TO entity cannot proceed until FROM entity is complete.Use cases:
Sequential implementation tasks
Hard dependencies between features
Prerequisites that must be satisfied first
Example:
Copy
# ISSUE-002 cannot start until ISSUE-001 is donesudocode link ISSUE-001 ISSUE-002 --type blocks
Graph behavior:
Blocked entities won’t appear in sudocode ready
Topological sorting uses blocks for execution order
Status of blocker affects what’s ready to work on
Example scenario
Copy
# Database schema must be done before API endpointssudocode link ISSUE-001 ISSUE-002 --type blocks# Frontend can't proceed until API is donesudocode link ISSUE-002 ISSUE-003 --type blocks# Now ISSUE-001 is ready, but ISSUE-002 and ISSUE-003 are blockedsudocode ready# Returns: ISSUE-001# After closing ISSUE-001, ISSUE-002 becomes readysudocode issue close ISSUE-001sudocode ready# Returns: ISSUE-002
Direction: FROM depends on TOMeaning: FROM entity needs context/output from TO entity, but it’s not a hard blocker.Use cases:
Informational dependencies
Context that should be read but doesn’t block work
Related work that informs implementation
Example:
Copy
# ISSUE-003 depends on SPEC-002 for guidancesudocode link ISSUE-003 SPEC-002 --type depends-on
Graph behavior:
Doesn’t block execution (entity still appears in ready queue)
Provides context for agents working on the issue
Can be used for soft ordering hints
Example scenario
Copy
# Frontend issue depends on API spec for context, but can start worksudocode link ISSUE-005 SPEC-010 --type depends-on# ISSUE-005 is still ready (not blocked)sudocode ready# Returns: ISSUE-005 (even though it depends on SPEC-010)# Agent can read SPEC-010 for guidance while implementing ISSUE-005
Direction: FROM references TOMeaning: General contextual link without specific blocking or implementation semantics.Use cases:
Cross-referencing related entities
Creating links between documentation
Default type for [[ID]] syntax without explicit type
Example:
Copy
# SPEC-001 references SPEC-010 for contextsudocode link SPEC-001 SPEC-010 --type references
Graph behavior:
No blocking or ordering implications
Purely for navigation and context
Automatic type for cross-references without explicit type
Example scenario
Copy
# Authentication spec references API design patternssudocode link SPEC-001 SPEC-010 --type references# Issue references another related issue for contextsudocode link ISSUE-005 ISSUE-020 --type references# Helps developers understand related work and context
Direction: Bidirectional (FROM and TO are related)Meaning: Entities share context or are associated without a specific directional relationship.Use cases:
Parallel work on related features
Entities in the same domain
Context grouping without direction
Example:
Copy
# ISSUE-005 and ISSUE-006 are related (both auth work)sudocode link ISSUE-005 ISSUE-006 --type related
Graph behavior:
No blocking or ordering
Useful for finding peripheral context
Can group related work for visualization
Example scenario
Copy
# Two issues working on related authentication featuressudocode link ISSUE-010 ISSUE-011 --type related# Specs covering related architectural domainssudocode link SPEC-005 SPEC-006 --type related# Helps discover related work in same area
Direction: New Issue → Source IssueMeaning: A new issue was discovered while working on another issue.Use cases:
Tracking scope creep
Understanding how issues spawn new work
Tracing problem discovery during implementation
Example:
Copy
# ISSUE-010 was discovered while working on ISSUE-005sudocode link ISSUE-010 ISSUE-005 --type discovered-from
Graph behavior:
Shows issue genealogy
Helps understand how work expands
Can identify issues that frequently spawn new issues
Example scenario
Copy
# While implementing login, discover password reset is also neededsudocode issue create "Add password reset flow"sudocode link ISSUE-010 ISSUE-005 --type discovered-from# Shows ISSUE-010 was discovered from ISSUE-005sudocode issue show ISSUE-010# Outgoing Relationships:# discovered-from → ISSUE-005
# Database schema firstsudocode link ISSUE-001 ISSUE-002 --type blocks# Then API endpointssudocode link ISSUE-002 ISSUE-003 --type blocks# Then frontend
# Clear sequential dependenciessudocode link ISSUE-001 ISSUE-002 --type blocks# Implementation links to specssudocode link ISSUE-001 SPEC-001 --type implements# Soft context dependenciessudocode link ISSUE-005 SPEC-002 --type depends-on
❌ Avoid these patterns
Copy
# Don't create circular dependenciessudocode link ISSUE-001 ISSUE-002 --type blockssudocode link ISSUE-002 ISSUE-001 --type blocks # ❌ Circular!# Don't use 'blocks' for soft contextsudocode link ISSUE-003 SPEC-005 --type blocks # ❌ Use depends-on# Don't over-link everything as 'related'# Only link when there's actual shared context
Can I create multiple relationships between the same entities?
Yes! Entities can have multiple relationship types between them:
Copy
sudocode link ISSUE-001 SPEC-001 --type implementssudocode link ISSUE-001 SPEC-001 --type depends-on
Both relationships are tracked independently.
What's the difference between 'blocks' and 'depends-on'?
blocks - Hard dependency, prevents work from starting (affects ready query)
depends-on - Soft dependency, provides context but doesn’t prevent work
Use blocks for technical prerequisites, depends-on for informational context.
Can I link a spec to another spec?
Yes! All relationship types work between any entities:
Copy
sudocode link SPEC-001 SPEC-010 --type referencessudocode link SPEC-005 SPEC-006 --type related
How do I remove a relationship?
There’s currently no unlink command in the CLI. To remove relationships:
Edit the JSONL file directly
Run sudocode sync to update the database
Or update the database directly using SQL
Can I create a relationship to a non-existent entity?
No, sudocode validates that both entities exist before creating the relationship. You’ll get an error if either ID doesn’t exist.
What happens to relationships when I delete an entity?
Relationships are not automatically deleted. They become orphaned, which can cause broken links. Best practice: clean up relationships before deleting entities.
Cause: One or both entity IDs don’t existSolution:
Verify both IDs exist:
Copy
sudocode spec listsudocode issue list
Error: Invalid relationship type
Cause: The relationship type isn’t validSolution:
Use one of: blocks, implements, depends-on, references, related, discovered-from
Copy
sudocode link ISSUE-001 SPEC-001 --type implements
Relationship created but doesn't appear in show
Cause: Sync or cache issueSolution:
Run sync:
Copy
sudocode syncsudocode issue show ISSUE-001
Circular dependency warning
Cause: Created circular blocks relationshipsSolution:
Review your dependency chain. Use depends-on for soft dependencies that don’t need strict ordering.