Skip to main content

Syntax

Description

The link 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
Relationships are the foundation of sudocode’s graph-based planning system.
sudocode automatically detects entity types (spec or issue) by checking which exists in the database. You don’t need to specify types explicitly.

Arguments

string
required
Source entity IDExample: ISSUE-001 or SPEC-001The entity creating the relationship. sudocode automatically determines if this is a spec or issue.
string
required
Target entity IDExample: SPEC-001 or ISSUE-002The entity being referenced. sudocode automatically determines if this is a spec or issue.

Options

string
required
Relationship typeExample: --type implementsValid relationship types:
  • blocks - Hard blocker dependency
  • implements - Issue implements spec
  • depends-on - Soft dependency
  • references - General reference
  • related - General association
  • discovered-from - Issue discovered during implementation
See Relationship Types section for detailed explanations.

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
Example:
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

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
Example:
Graph behavior:
  • Specs show which issues implement them
  • Issues show which specs they fulfill
  • Enables traceability from requirement to implementation

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
Example:
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

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
Example:
Graph behavior:
  • No blocking or ordering implications
  • Purely for navigation and context
  • Automatic type for cross-references without explicit type
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:
Graph behavior:
  • No blocking or ordering
  • Useful for finding peripheral context
  • Can group related work for visualization

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
Example:
Graph behavior:
  • Shows issue genealogy
  • Helps understand how work expands
  • Can identify issues that frequently spawn new issues

Examples

Create a simple relationship:

Block an Issue

Prevent work until dependency is done:
Interpretation: ISSUE-002 is blocked by ISSUE-001. ISSUE-002 cannot proceed until ISSUE-001 is closed. Connect implementation tasks to requirements:

Create Dependency Chain

Model sequential dependencies:
This creates: ISSUE-001 → ISSUE-002 → ISSUE-003

Cross-Reference Specs

Link related specifications:

Track Issue Discovery

Document when issues are discovered:

JSON Output

Get machine-readable output:

Viewing Relationships

After creating relationships, view them with show commands:
The output includes:
  • Outgoing Relationships - From this entity to others
  • Incoming Relationships - From others to this entity

Choosing the Right Relationship Type

Use this decision matrix:
1

Is it a hard blocker?

Use blocks if FROM must complete before TO can proceed
2

Is it implementing requirements?

Use implements for issue → spec implementation links
3

Is it informational context?

Use depends-on for soft dependencies or references for general links
4

Is it associative?

Use related for bidirectional associations without specific semantics
5

Was it discovered during work?

Use discovered-from to track issue genealogy

Common Workflows

Spec-Driven Development

1

Create a spec

2

Create implementation issues

3

Link issues to spec

4

Model dependencies

Modeling Complex Dependencies

1

Create all issues

2

Model blockers

3

Find ready work

Discovering and Linking New Work

1

Start work on issue

2

Discover new requirement

While implementing, realize password reset is needed
3

Create new issue

4

Link as discovered

Relationship Best Practices

Understanding Bidirectional Tracking

All relationships are automatically tracked in both directions:
From ISSUE-001 perspective:
From SPEC-001 perspective:
This enables:
  • 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

Yes! Entities can have multiple relationship types between them:
Both relationships are tracked independently.
  • 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.
There’s currently no unlink command in the CLI. To remove relationships:
  1. Edit the JSONL file directly
  2. Run sudocode sync to update the database
  3. Or update the database directly using SQL
No, sudocode validates that both entities exist before creating the relationship. You’ll get an error if either ID doesn’t exist.
Relationships are not automatically deleted. They become orphaned, which can cause broken links. Best practice: clean up relationships before deleting entities.

Troubleshooting

Cause: One or both entity IDs don’t existSolution: Verify both IDs exist:
Cause: The relationship type isn’t validSolution: Use one of: blocks, implements, depends-on, references, related, discovered-from
Cause: Sync or cache issueSolution: Run sync:
Cause: Created circular blocks relationshipsSolution: Review your dependency chain. Use depends-on for soft dependencies that don’t need strict ordering.

spec show

View spec relationships

issue show

View issue relationships

ready

Find unblocked work

blocked

View blocked issues

add-ref

Add inline references

Next Steps

1

Create entities

2

Link them

3

View relationships

4

Find ready work

Relationships Concept Guide

Learn more about relationships and graph-based planning