Tutorial Overview
This tutorial walks through building a complete user authentication system using sudocode’s spec-driven development workflow. You’ll learn how to create specifications, plan implementation with AI agents, manage dependencies, provide feedback, and iterate to completion.1
Create high-level specification
Define what you want to build
2
Break down into sub-specs
Organize complex features hierarchically
3
Plan implementation with agent
AI agent creates issues from specs
4
Execute issues in dependency order
Agents claim and complete work
5
Handle blockers
Model dependencies and work on blockers
6
Provide feedback
Surface ambiguities and refine specs
7
Iterate to completion
Track progress and close work
Step 1: Initialize Project
First, set up a sudocode project in your repository:Expected output
Expected output
Step 2: Create High-Level Specification
Define what you want to build at a high level:Expected output
Expected output
Step 3: Break Down into Sub-Specs
For complex features, create sub-specifications:Expected output
Expected output
Token Storage
- Encrypt tokens using AES-256-GCM
- Store in database with user association
- Never expose tokens to client
- Use httpOnly cookies for session
Configuration
Error Handling
- Invalid authorization code → redirect to error page
- Token exchange fails → log error, retry once
- Token expired → use refresh token automatically
- Refresh token invalid → force re-authentication
Step 4: Plan Implementation with AI Agent
Now, ask an AI agent (via MCP) to create an implementation plan from the specs. Agent conversation:Step 5: Execute Issues
Check status:Execute Issue 001
Agent claims the work:Execute Issue 002
Agent claims work:Step 6: Provide Feedback
Agent adds feedback to spec:Expected output
Expected output
Step 7: Handle Dependencies and Continue
Close ISSUE-002:Step 8: Track Progress
View current status:Step 9: Complete Remaining Work
Finish ISSUE-004 (Session Management):Step 10: Verify Against Spec
Review SPEC-001:Git History
View the complete history:Example Pull Request
When creating a PR, reference the specs and issues:Best Practices Demonstrated
Spec refinement through feedback
Spec refinement through feedback
What we did:
- Agent discovered missing expiration times
- Provided anchored feedback with recommendation
- Human updated spec with explicit values
- Specs improve based on implementation reality
- Ambiguities surface early
- Knowledge compounds in version control
Hierarchical organization
Hierarchical organization
What we did:
- High-level SPEC-001
- Detailed sub-specs (SPEC-002, SPEC-003, SPEC-004)
- Issues implement specific sub-specs
- Allows parallel work on independent pieces
- Focused reviews
- Incremental delivery possible
Explicit dependencies
Explicit dependencies
What we did:
- Used
blocksrelationships - Foundation work (ISSUE-001) blocks everything else
- Clear dependency graph
- Automatic ready work detection
- Prevents blocking on unavailable work
- Enables parallel execution
Context with code
Context with code
What we did:
- Every code commit includes sudocode changes
- Commit messages reference specs and issues
- Complete git history
- Context travels with code through branches
- Code review includes design decisions
- History explains why, not just what
Agent feedback timing
Agent feedback timing
What we did:
- Agent provided feedback immediately on discovery
- Continued with reasonable assumption
- Didn’t block waiting for clarification
- Keeps agent unblocked
- Human reviews feedback asynchronously
- Iteration continues smoothly
Progressive status tracking
Progressive status tracking
What we did:
- Used
sudocode statusto monitor progress sudocode readyto find next worksudocode blockedto identify bottlenecks
- Clear visibility into project state
- Easy to identify what needs attention
- Metrics for project health
What You Learned
Spec Creation
- Write effective specifications
- Organize hierarchically
- Define success criteria
- Leave open questions
Implementation Planning
- Break specs into issues
- Model dependencies
- Use
implementsrelationships - Prioritize work
Execution
- Query ready work
- Claim issues
- Commit code + context together
- Close with summaries
Feedback Loop
- Surface ambiguities early
- Anchor feedback to lines
- Continue with assumptions
- Iterate on specs
Dependency Management
- Use
blocksrelationships - Track blockers
- Unblock automatically
- Enable parallel work
Progress Tracking
- Monitor with
status - Find work with
ready - Identify bottlenecks with
blocked - Measure with
stats
Common Patterns
Pattern: Foundation First
Always start with foundation/setup work:- Configuration (ISSUE-001)
- Core functionality (ISSUE-002, ISSUE-003)
- Enhancements (ISSUE-005)
- Polish (ISSUE-006)
Pattern: Continuous Refinement
Specs improve through implementation:- Start with high-level requirements
- Add details as questions arise
- Update based on learnings
- Never “done” - always evolving
Pattern: Parallel Execution
After foundation, multiple agents can work simultaneously:- ISSUE-004 (session) and ISSUE-005 (refresh) both depend on ISSUE-002
- Once ISSUE-002 completes, both become ready
- Agents can work independently
Pattern: Commit Granularity
One commit per issue completion:- Includes both code and context changes
- Clear commit message referencing issue
- Easy to review
- Easy to revert if needed
Troubleshooting
Issue shows as blocked but blocker is closed
Issue shows as blocked but blocker is closed
Cause: Database not synced after closing blockerSolution:
Feedback anchor shows as stale
Feedback anchor shows as stale
Cause: Spec content moved, anchor needs relocationSolution:
Can't find spec or issue after git pull
Can't find spec or issue after git pull
Cause: JSONL imported but not synced to markdownSolution:
Ready query returns nothing but work exists
Ready query returns nothing but work exists
Cause: All open issues are blockedSolution:
Next Steps
1
Try it yourself
Follow this tutorial with your own feature
2
Explore advanced features
- Multi-agent collaboration
- Git branching with context
- Feedback workflows
- Graph visualization
3
Set up MCP integration
Enable AI agents to autonomously execute this workflow
4
Customize for your team
Adapt the workflow to your development process
Related Documentation
Spec-Driven Development
Complete SDD workflow guide
CLI Reference
All CLI commands
MCP Workflows
AI agent workflow examples
Feedback System
Anchored feedback details
Relationships
Dependency modeling
Storage Model
How data flows

