Overview
Large engineering problems rarely arrive with clear boundaries. When building something new—especially integrating with unfamiliar systems—you often don’t know what you don’t know. This guide demonstrates how to use sudocode’s hierarchical spec system to progressively decompose ambiguous problems into smaller specifications. The pattern:- Start by discussing your problem statement and design constraints with the agent
- Use the agent to conduct initial research and planning, and create a spec that captures the overall plan
- Discuss the spec with your agent to surface unknowns
- Identify areas of ambiguity through Q&A
- Carve out a sub-specification for scoped investigation of ambiguities
- Design experiments to validate assumptions
- Link discoveries back to original spec, using sub-spec as documentation for disambiguations and implementations
Example: Building a Coder Server API Wrapper
We’ll walk through building a wrapper API for coder-server, an open-source VS Code in the browser. Specifically, we need to understand how authentication flows work—both OpenID Connect sharing and GitHub authentication—across our wrapper API and the underlying coder server. This is a perfect case for spec breakdown because:- The integration surface is unclear
- Authentication flows span multiple systems
- We need to discover how the existing system works before designing our wrapper
Phase 1: Initial Discussion & Spec Creation
Before creating any artifacts, start with a conversation to understand the problem space. The agent conducts research and presents learnings to the user. Step 1: Discuss the problem and constraints Via the sudocode web server atlocalhost:3000/executions, or in your agent CLI (with the sudocode MCP enabled), start a conversation with the agent to discuss your problem and constraints.
localhost:3000. Navigate to the Specs page to see the rendered markdown, review the structure, and make any edits before continuing.

Phase 2: Surfacing Unknowns
With a spec in place, discuss it to probe deeper. The goal is to identify which unknowns are blocking and need focused investigation. Step 3: Discuss the spec to surface unknownsPhase 3: Carving Out Sub-Specs
Here’s where hierarchical specs shine. Instead of trying to resolve ambiguity in the parent spec, you carve out focused sub-specs to investigate specific unknowns. Each sub-spec isolates one area of ambiguity for deep investigation. Step 5: Carve out an investigation sub-specPhase 4: Designing & Running Experiments
With sub-specs carved out, design concrete experiments to validate assumptions. Each experiment should have a clear goal, method, and success criteria. Execute experiments as issues linked to the sub-spec. Step 6: Execute experiments as issuesPhase 5: Linking Back
After experiments complete, link discoveries back to the original spec. The sub-spec becomes permanent documentation of what was investigated and decided. Update the parent spec with the architectural decision. Step 7: Update sub-spec with findings and link back to parentThe Breakdown Pattern Summary
1
1. Discuss Problem & Constraints
Start with conversation before creating artifacts. Understand the problem space, constraints, and what needs to be figured out.
2
2. Create Initial Spec
Agent conducts research and creates a spec capturing the overall plan. Explicitly list open questions—unknowns are first-class content.
3
3. Surface Unknowns
Discuss the spec to probe deeper. Identify which unknowns are blocking vs. minor details.
4
4. Identify Ambiguities
Through Q&A, pinpoint specific areas that need investigation before you can commit to an approach.
5
5. Carve Out Sub-Specs
Create focused child specs to investigate specific unknowns. Each sub-spec isolates one area of ambiguity with clear questions and experiments.
6
6. Design & Run Experiments
Execute experiments as issues linked to sub-specs. Capture findings as feedback on the sub-spec.
7
7. Link Back
Update sub-specs with conclusions. Bubble up the architectural decision to the parent spec. Sub-specs become documentation of what was investigated.
When to Use This Pattern
This breakdown pattern works well when:- Integrating with unfamiliar systems - You need to discover how they work
- Facing architectural forks - Multiple valid approaches need evaluation
- Requirements are unclear - The problem space needs exploration
- Risk is high - Wrong decisions are expensive to reverse
Best Practices
Embrace uncertainty in specs
Embrace uncertainty in specs
Don’t pretend you know more than you do. “Open Questions” and “TBD” sections are valuable—they make unknowns visible and trackable.
Design experiments with clear success criteria
Design experiments with clear success criteria
Each experiment should have:
- A specific question it answers
- A concrete method to execute
- Clear criteria for what “success” looks like
Keep sub-specs focused
Keep sub-specs focused
Each sub-spec should investigate one area of ambiguity. If you find yourself with compound questions, split into multiple sub-specs.
Link everything bidirectionally
Link everything bidirectionally
Use
[[id]] references liberally. The parent should reference children, children should reference parents, and issues should reference the specs they implement.Archive rather than delete
Archive rather than delete
When you choose one approach over another, archive the unchosen sub-spec rather than deleting it. It documents the decision rationale.
Related Documentation
Spec-Driven Development
The complete SDD workflow
Specs Concept
Deep dive into specifications
Workflows
Designing and running workflows

