Syntax
Description
Thelink command creates a typed relationship between two entities (specs or issues). Relationships are:
- Typed - Each relationship has a specific meaning (blocks, implements, depends-on, etc.)
- Bidirectional - Automatically tracked in both directions for graph traversal
- Permanent - Persist across updates to entity properties
- Graph-enabling - Power dependency resolution, planning, and visualization
Arguments
ISSUE-001 or SPEC-001The entity creating the relationship. sudocode automatically determines if this is a spec or issue.SPEC-001 or ISSUE-002The entity being referenced. sudocode automatically determines if this is a spec or issue.Options
--type implementsValid relationship types:blocks- Hard blocker dependencyimplements- Issue implements specdepends-on- Soft dependencyreferences- General referencerelated- General associationdiscovered-from- Issue discovered during implementation
Relationship Types
blocks
Direction: FROM blocks TO Meaning: TO entity cannot proceed until FROM entity is complete. Use cases:- Sequential implementation tasks
- Hard dependencies between features
- Prerequisites that must be satisfied first
- Blocked entities won’t appear in
sudocode ready - Topological sorting uses
blocksfor execution order - Status of blocker affects what’s ready to work on
Example scenario
Example scenario
implements
Direction: Issue → Spec Meaning: The issue implements requirements or design from the spec. Use cases:- Linking implementation tasks to requirements
- Tracing code changes back to specs
- Understanding what’s been implemented
- Specs show which issues implement them
- Issues show which specs they fulfill
- Enables traceability from requirement to implementation
Example scenario
Example scenario
depends-on
Direction: FROM depends on TO Meaning: 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
- 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
Example scenario
references
Direction: FROM references TO Meaning: 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
- No blocking or ordering implications
- Purely for navigation and context
- Automatic type for cross-references without explicit type
Example scenario
Example scenario
related
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
- No blocking or ordering
- Useful for finding peripheral context
- Can group related work for visualization
Example scenario
Example scenario
discovered-from
Direction: New Issue → Source Issue Meaning: 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
- Shows issue genealogy
- Helps understand how work expands
- Can identify issues that frequently spawn new issues
Example scenario
Example scenario
Examples
Basic Link Creation
Create a simple relationship:Expected output
Expected output
Block an Issue
Prevent work until dependency is done:Expected output
Expected output
Link Multiple Issues to a Spec
Connect implementation tasks to requirements:Expected output
Expected output
Create Dependency Chain
Model sequential dependencies:Cross-Reference Specs
Link related specifications:Expected output
Expected output
Track Issue Discovery
Document when issues are discovered:Expected output
Expected output
JSON Output
Get machine-readable output:JSON output
JSON output
Viewing Relationships
After creating relationships, view them withshow commands:
- Outgoing Relationships - From this entity to others
- Incoming Relationships - From others to this entity
Choosing the Right Relationship Type
Use this decision matrix:Is it a hard blocker?
blocks if FROM must complete before TO can proceedIs it implementing requirements?
implements for issue → spec implementation linksIs it informational context?
depends-on for soft dependencies or references for general linksIs it associative?
related for bidirectional associations without specific semanticsWas it discovered during work?
discovered-from to track issue genealogyCommon Workflows
Spec-Driven Development
Create a spec
Create implementation issues
Link issues to spec
Model dependencies
Modeling Complex Dependencies
Create all issues
Model blockers
Find ready work
Discovering and Linking New Work
Start work on issue
Discover new requirement
Create new issue
Link as discovered
Relationship Best Practices
✅ Good relationship modeling
✅ Good relationship modeling
❌ Avoid these patterns
❌ Avoid these patterns
Understanding Bidirectional Tracking
All relationships are automatically tracked in both directions:- Forward traversal - What does this entity depend on/reference?
- Backward traversal - What depends on/references this entity?
- Graph queries - Find all connected entities
- Impact analysis - What’s affected if this changes?
Common Questions
Can I create multiple relationships between the same entities?
Can I create multiple relationships between the same entities?
What's the difference between 'blocks' and 'depends-on'?
What's the difference between 'blocks' and 'depends-on'?
- blocks - Hard dependency, prevents work from starting (affects
readyquery) - depends-on - Soft dependency, provides context but doesn’t prevent work
blocks for technical prerequisites, depends-on for informational context.Can I link a spec to another spec?
Can I link a spec to another spec?
How do I remove a relationship?
How do I remove a relationship?
unlink command in the CLI. To remove relationships:- Edit the JSONL file directly
- Run
sudocode syncto update the database - Or update the database directly using SQL
Can I create a relationship to a non-existent entity?
Can I create a relationship to a non-existent entity?
What happens to relationships when I delete an entity?
What happens to relationships when I delete an entity?
Troubleshooting
Error: Entity not found
Error: Entity not found
Error: Invalid relationship type
Error: Invalid relationship type
Relationship created but doesn't appear in show
Relationship created but doesn't appear in show
Circular dependency warning
Circular dependency warning
blocks relationshipsSolution:
Review your dependency chain. Use depends-on for soft dependencies that don’t need strict ordering.Related Commands
spec show
issue show
ready
blocked
add-ref
Next Steps
Create entities
Link them
View relationships
Find ready work

