Motivation
SDD (Spec-Driven Development) is an established pattern where:
- Specs come first - Define requirements before code
- Tasks break down specs - Decompose into implementable tasks
- Code satisfies specs - Implementation follows specs
- Verify against specs - Validation matches specifications
However, AI agents often:
- Skip specs and jump to code
- Use excessive tokens with verbose prompts
- Don't validate against specifications
- Create inconsistent implementations
Proposal
Create a sdd-orchestrator module that:
- Enforces SDD workflow - Agents must follow spec → tasks → code → verify
- Optimizes token usage - Efficient prompts, caching, context management
- Orchestrates sub-agents - Coordinates multiple AI agents efficiently
Token Optimization Strategies
| Strategy |
Description |
Savings |
| Spec templates |
Reuse prompt templates instead of full prompts |
~40% tokens |
| Context compression |
Compress historical context |
~30% tokens |
| Delta specs |
Only process what changed, not full specs |
~50% tokens |
| Caching |
Cache common operations |
Varies |
| Smart delegation |
Route to appropriate sub-agent |
~20% tokens |
Module Features
1. SDD Workflow Enforcement
sz sdd init # Start new feature with spec
sz sdd propose # Create proposal
sz sdd spec # Write detailed spec
sz sdd tasks # Break into tasks
sz sdd apply # Implement tasks
sz sdd verify # Validate against spec
2. Token Management
# Show token usage
sz tokens status
# Optimize current context
sz tokens compress
# Set budget
sz tokens budget --max 100000
3. Agent Orchestration
# Delegate to sub-agent
sz delegate --agent code-reviewer --task "Review PR #123"
# Orchestrate multi-agent
sz orchestrate --flow "spec → code → test → review"
Integration with Existing Modules
| Module |
Integration |
heartbeat |
Schedule SDD cycles |
skill-library-ce |
Load SDD-specific skills |
approval-gate |
Approve spec changes |
context-assembler-ce |
Build context efficiently |
Token Budget Example
Without optimization:
- Full spec per tick: ~50,000 tokens
- Daily: ~500,000 tokens
With optimization:
- Delta specs only: ~25,000 tokens
- Smart delegation: ~20,000 tokens
- Total savings: ~70%
Why This Matters
SDD ensures:
- ✅ Consistent development process
- ✅ Specs are always current
- ✅ No feature creep
- ✅ Easier maintenance
Token optimization ensures:
- ✅ Reduced costs
- ✅ Faster responses
- ✅ Better context management
Together: efficient, spec-driven AI development.
Looking to contribute this! Has experience with SDD workflows and token optimization.
Motivation
SDD (Spec-Driven Development) is an established pattern where:
However, AI agents often:
Proposal
Create a
sdd-orchestratormodule that:Token Optimization Strategies
Module Features
1. SDD Workflow Enforcement
2. Token Management
3. Agent Orchestration
Integration with Existing Modules
heartbeatskill-library-ceapproval-gatecontext-assembler-ceToken Budget Example
Without optimization:
With optimization:
Why This Matters
SDD ensures:
Token optimization ensures:
Together: efficient, spec-driven AI development.
Looking to contribute this! Has experience with SDD workflows and token optimization.