Skip to content

4-Level Workflow System ​

The CCW 4-level workflow system provides a structured approach to software development from specification to deployment.

Overview ​

text
Level 1: SPECIFICATION → Level 2: PLANNING → Level 3: IMPLEMENTATION → Level 4: VALIDATION

Level 1: Specification ​

Goal: Define what to build and why.

Activities ​

ActivityDescriptionOutput
ResearchAnalyze requirements and contextDiscovery context
Product BriefDefine product visionProduct brief
RequirementsCreate PRD with acceptance criteriaRequirements document
ArchitectureDesign system architectureArchitecture document
Epics & StoriesBreak down into trackable itemsEpics and stories

Agents ​

  • analyst: Conducts research and analysis
  • writer: Creates specification documents
  • discuss-subagent: Multi-perspective critique

Quality Gate ​

QUALITY-001 validates:

  • All requirements documented
  • Architecture approved
  • Risks assessed
  • Acceptance criteria defined

Example Tasks ​

text
RESEARCH-001 → DRAFT-001 → DRAFT-002 → DRAFT-003 → DRAFT-004 → QUALITY-001

Level 2: Planning ​

Goal: Define how to build it.

Activities ​

ActivityDescriptionOutput
ExplorationMulti-angle codebase analysisExploration cache
Task BreakdownCreate implementation tasksTask definitions
Dependency MappingIdentify task dependenciesDependency graph
Resource EstimationEstimate effort and complexityPlan metadata

Agents ​

  • planner: Creates implementation plan
  • architect: Provides technical consultation (on-demand)
  • explore-subagent: Codebase exploration

Output ​

json
{
  "epic_count": 5,
  "total_tasks": 27,
  "execution_order": [...],
  "tech_stack": {...}
}

Level 3: Implementation ​

Goal: Build the solution.

Activities ​

ActivityDescriptionOutput
Code GenerationWrite source codeSource files
Unit TestingCreate unit testsTest files
DocumentationDocument code and APIsDocumentation
Self-ValidationVerify implementation qualityValidation report

Agents ​

  • executor: Coordinates implementation
  • code-developer: Simple, direct edits
  • ccw cli: Complex, multi-file changes

Execution Strategy ​

Tasks executed in topological order based on dependencies:

text
TASK-001 (no deps) → TASK-002 (depends on 001) → TASK-003 (depends on 002)

Backends ​

BackendUse Case
agentSimple, direct edits
codexComplex, architecture
geminiAnalysis-heavy

Level 4: Validation ​

Goal: Ensure quality.

Activities ​

ActivityDescriptionOutput
Integration TestingVerify component integrationTest results
QA TestingUser acceptance testingQA report
Performance TestingMeasure performancePerformance metrics
Security ReviewSecurity vulnerability scanSecurity findings
Code ReviewFinal quality checkReview feedback

Agents ​

  • tester: Executes test-fix cycles
  • reviewer: 4-dimension code review

Review Dimensions ​

DimensionFocus
ProductRequirements alignment
TechnicalCode quality, patterns
QualityTesting, edge cases
CoverageCompleteness
RiskSecurity, performance

Workflow Orchestration ​

Beat Model ​

Event-driven execution with coordinator orchestration:

text
Event           Coordinator              Workers
────────────────────────────────────────────────
callback/resume → handleCallback ─────────────────┐
                 → mark completed                 │
                 → check pipeline                │
                 → handleSpawnNext ──────────────┼───→ [Worker A]
                 → find ready tasks              │
                 → spawn workers ─────────────────┼───→ [Worker B]
                 → STOP (idle) ──────────────────┘      │
                                                        │
callback <──────────────────────────────────────────────┘

Checkpoints ​

Spec Checkpoint (after QUALITY-001):

  • Pauses for user confirmation
  • Validates specification completeness
  • Requires manual resume to proceed

Final Gate (after REVIEW-001):

  • Final quality validation
  • All tests must pass
  • Critical issues resolved

Fast-Advance ​

For simple linear successions, workers can spawn successors directly:

text
[Worker A] complete
    → Check: 1 ready task? simple successor?
    → YES: Spawn Worker B directly
    → NO: SendMessage to coordinator

Parallel Execution ​

Some epics can execute in parallel:

text
EPIC-003: Content Modules ──┐
                           ├──→ EPIC-005: Interaction Features
EPIC-004: Search & Nav ────┘

Error Handling ​

ScenarioResolution
Syntax errorsRetry with error context (max 3)
Missing dependenciesRequest from coordinator
Backend unavailableFallback to alternative
Circular dependenciesAbort, report graph

See Also

Released under the MIT License.