Context Guide
A guide to the context system for setting work scope in large-scale projects.
Overview
Context defines the domain scope you're currently working on. It helps improve work efficiency by focusing on specific areas in large-scale projects.
What is Context?
When context is set:
- Only specs from that domain are displayed
- Dependent domains are included as read-only
- AI assistant recognizes domain boundaries
- Domain is auto-detected when creating new specs
Setting Context
Single Domain
bash
sdd context set authMultiple Domains
bash
sdd context set auth order paymentInclude Dependencies
bash
sdd context set auth --include-depsIf auth depends on core, core is also included as read-only.
Viewing Context
Current State
bash
sdd context showExample output:
📍 Current Context
Active Domains:
✏️ auth (editable)
✏️ order (editable)
Read-only:
📖 core
Spec count: 12Spec List
bash
sdd context specs
sdd context specs --status draftContext Management
Add Domain
bash
sdd context add paymentRemove Domain
bash
sdd context remove orderClear Context
bash
sdd context clearContext File
State is saved in .sdd/.context.json:
json
{
"active_domains": ["auth", "order"],
"read_only_domains": ["core"],
"updated_at": "2025-12-29T10:00:00Z"
}Use Cases
1. Focus on Feature Development
bash
# Auth-related work
sdd context set auth
sdd list # Shows only auth specs
sdd new mfa-setup # Auto-created as auth/mfa-setup2. Cross-Domain Work
bash
# Work on entire payment flow
sdd context set order payment --include-deps3. Review Mode
bash
# Review specific domain
sdd context set auth
sdd validate # Validates auth-related onlyContext with Other Commands
sdd new
With context set:
bash
sdd context set auth
sdd new user-login # → Creates auth/user-loginsdd list
bash
sdd context set auth
sdd list # Shows only auth domain specs
sdd list --all # Shows all specssdd validate
bash
sdd context set auth
sdd validate # Validates auth-related specs only
sdd validate --all # Full validationWarning System
When modifying domains outside context:
⚠️ Warning: payment domain is not in current context.
Continue? [y/N]Bypass with --force option:
bash
sdd new payment/refund --forceBest Practices
At Work Start
bash
# 1. Set domain to work on
sdd context set auth
# 2. Check current state
sdd context specs
# 3. Proceed with work
sdd new oauth-googleWhen Switching Tasks
bash
# 1. Clear current context
sdd context clear
# 2. Set new context
sdd context set paymentFor Large-Scale Changes
bash
# Include dependencies for full picture
sdd context set order --include-deps
sdd context specs # Check impact scope