What Are Relationships?
Relationships are the connective tissue in sudocode’s context graph. They create typed, bidirectional links between specs and issues, enabling graph-based planning, dependency resolution, and intelligent work ordering.Key Principle: Relationships model how entities connect - what blocks what, what implements what, and how context flows through your project.
- From entity - The source (e.g., ISSUE-001)
- To entity - The target (e.g., SPEC-001)
- Relationship type - What kind of connection (e.g.,
implements)
Relationship Types
sudocode supports six relationship types, each with specific semantics:blocks
Hard blocker dependencyFrom entity cannot proceed until To entity is complete
implements
Implementation linkIssue implements requirements from a spec
depends-on
Soft dependencyFrom entity needs To entity but not a hard blocker
references
General referenceContextual link without specific semantics
related
AssociationEntities share context or are related
discovered-from
Discovery trackingIssue was discovered while working on another issue
Detailed Relationship Semantics
blocks - Hard Blocker
blocks - Hard Blocker
Direction: From → To (“From blocks To”)Meaning: To entity cannot start or complete until From entity is done.Use cases:Graph behavior:
- Sequential implementation tasks
- Dependencies between infrastructure and features
- Prerequisites that must be satisfied first
- Blocked entities won’t appear in
sudocode readyquery - Topological sorting uses
blocksfor execution order - Status of blocker affects what’s ready
implements - Implementation Link
implements - Implementation Link
Direction: Issue → Spec (“Issue implements Spec”)Meaning: The issue implements requirements or design from the spec.Use cases:Graph behavior:
- 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
depends-on - Soft Dependency
depends-on - Soft Dependency
Direction: From → To (“From depends on To”)Meaning: From entity needs context/output from To entity, but it’s not a hard blocker.Use cases:Graph behavior:
- 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
references - General Reference
references - General Reference
Direction: From → To (“From references To”)Meaning: General contextual link without specific blocking or implementation semantics.Use cases:Graph behavior:
- 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
related - Association
related - Association
discovered-from - Discovery Tracking
discovered-from - Discovery Tracking
Direction: New Issue → Source Issue (“New was discovered from Source”)Meaning: A new issue was discovered while working on another issue.Use cases:Graph behavior:
- 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
Creating Relationships
Using the CLI
Thelink command creates relationships between entities:
sudocode automatically determines entity types (spec or issue) by checking which exists in your database.
Using Markdown Syntax
You can embed relationships directly in markdown using extended Obsidian-style syntax:[[ID]]- Basic reference (defaults toreferencestype)[[ID|Display Text]]- Reference with custom display text[[ID]]{ type }- Reference with relationship type (shorthand)[[ID]]{ type: typename }- Reference with relationship type (explicit)[[ID|Display]]{ type }- Combination of display text and type
When you use this syntax in markdown files, sudocode automatically creates the corresponding relationships in the database when syncing.
Hierarchical Relationships
While not a relationship type in the table, specs and issues support parent-child hierarchies through theparent_id field:
For Specs
For Issues
Parent-child relationships are stored directly in the
parent_id field, not in the relationships table. This enables efficient tree traversal and hierarchical queries.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?
Graph-Based Planning
Relationships enable sudocode’s graph-based planning and execution:Topological Ordering
Theready command uses blocks relationships to determine execution order:
Finding Blocked Work
Dependency Chains
Relationships create dependency chains that agents can traverse:- Start with a spec
- Find unblocked issues that implement it
- Work through issues in topological order
- Provide feedback back to the spec
Viewing Relationships
In Entity Details
In Graph Form
Best Practices
Choosing the Right Relationship Type
1
Is it a hard blocker?
Use
blocks if From must complete before To can proceed2
Is it implementing requirements?
Use
implements for issue → spec implementation links3
Is it informational context?
Use
depends-on for soft dependencies or references for general links4
Is it associative?
Use
related for bidirectional associations without specific semantics5
Was it discovered during work?
Use
discovered-from to track issue genealogyModeling Dependencies Effectively
✅ Good dependency modeling
✅ Good dependency modeling
❌ Avoid these patterns
❌ Avoid these patterns
Using Relationships for Multi-Agent Workflows
1
Model clear dependencies
Use
blocks to prevent agents from working on blocked tasks2
Link issues to specs
Use
implements so agents can read requirements3
Track discovered work
Use
discovered-from when agents find new issues during implementation4
Query ready work
Agents use
sudocode ready to find unblocked, high-priority workCLI Commands
Quick reference for relationship commands:Link Command Reference
See complete documentation for the link command
Database Schema
For reference, here’s how relationships are stored:- No duplicate relationships
- Same entities can have multiple relationship types
- Efficient bidirectional queries

