Skip to main content

Schema Reference

CLEO uses JSON Schema for data validation. This reference documents the core data structures.

Task Object

The fundamental unit of work in CLEO.
{
  "id": "T001",
  "title": "Implement authentication",
  "description": "Add JWT-based auth with refresh tokens",
  "status": "pending",
  "priority": "high",
  "type": "task",
  "parentId": null,
  "size": "medium",
  "labels": ["backend", "security"],
  "phase": "core",
  "depends": ["T000"],
  "files": ["src/auth/jwt.ts"],
  "acceptanceCriteria": ["Tests pass", "Code reviewed"],
  "notes": [
    {
      "timestamp": "2025-01-19T12:00:00Z",
      "text": "Started implementation"
    }
  ],
  "createdAt": "2025-01-19T10:00:00Z",
  "updatedAt": "2025-01-19T12:00:00Z",
  "completedAt": null
}

Field Reference

id
string
required
Unique task identifier. Format: T followed by digits (e.g., T001, T1234)
title
string
required
Action-oriented task title. Must differ from description.
description
string
Detailed task description
status
string
required
Task status. One of: pending, active, blocked, done
priority
string
Priority level. One of: critical, high, medium, low. Default: medium
type
string
Task type. One of: epic, task, subtask. Inferred from hierarchy.
parentId
string | null
Parent task ID for hierarchy. null for root tasks.
size
string
Scope-based size (NOT time). One of: small, medium, large
labels
string[]
Array of labels for categorization
phase
string
Project phase assignment (e.g., setup, core, testing)
depends
string[]
Array of task IDs this task depends on
notes
object[]
Array of timestamped notes
createdAt
string
ISO 8601 creation timestamp
updatedAt
string
ISO 8601 last modification timestamp
completedAt
string | null
ISO 8601 completion timestamp. null if not complete.

todo.json Structure

{
  "_meta": {
    "schemaVersion": "2.6.0",
    "lastModified": "2025-01-19T12:00:00Z",
    "checksum": "sha256:abc123..."
  },
  "project": {
    "currentPhase": "core",
    "phases": [
      {
        "slug": "setup",
        "name": "Setup",
        "status": "completed"
      },
      {
        "slug": "core",
        "name": "Core Development",
        "status": "active"
      }
    ]
  },
  "focus": {
    "taskId": "T001",
    "setAt": "2025-01-19T12:00:00Z",
    "sessionNote": "Working on JWT implementation"
  },
  "tasks": [
    { /* task object */ }
  ]
}

Status Transitions

Valid status transitions:
Use cleo complete for the active/pending → done transition. Use cleo reopen for done → pending.

Priority Values

PriorityUse Case
criticalBlocking deployment or other work
highImportant, needs attention soon
mediumNormal priority (default)
lowNice to have, do when time permits

Hierarchy Constraints

ConstraintValue
Maximum depth3 levels (epic → task → subtask)
Maximum siblingsUnlimited (configurable via hierarchy.maxSiblings)
Valid parent typesepic can have tasks, task can have subtasks

config.json Structure

{
  "_meta": {
    "schemaVersion": "1.2.0"
  },
  "archive": {
    "daysUntilArchive": 7,
    "preserveRecentCount": 3
  },
  "validation": {
    "maxActiveTasks": 1,
    "requireDescription": false,
    "maxTitleLength": 200
  },
  "hierarchy": {
    "maxDepth": 3,
    "maxSiblings": 7,
    "autoCompleteParent": true,
    "autoCompleteMode": "auto"
  },
  "defaults": {
    "priority": "medium",
    "phase": "core"
  },
  "contextAlerts": {
    "enabled": true,
    "warningThreshold": 70,
    "criticalThreshold": 90
  }
}

Session Object

Sessions track multi-agent work coordination.
id
string
required
Unique session identifier. Format: session_YYYYMMDD_HHMMSS_hash
status
string
required
Session state. One of: active, suspended, ended, closed
scope
object
required
Defines what tasks this session can access.
focus
object
Current focus state within session.

Verification Object

Verification gates for task completion quality.
{
  "passed": false,
  "round": 1,
  "gates": {
    "implemented": true,
    "testsPassed": true,
    "qaPassed": null,
    "securityPassed": null,
    "documented": false
  },
  "lastAgent": "coder",
  "lastUpdated": "2026-01-19T20:00:00Z",
  "failureLog": [
    {
      "round": 1,
      "agent": "coder",
      "reason": "Tests failing on edge case",
      "timestamp": "2026-01-19T19:45:00Z"
    }
  ]
}
passed
boolean
required
Overall verification status. True when all required gates pass.
gates
object
required
Individual verification gates.
failureLog
object[]
History of verification failures for debugging.

Error Response Object

All error responses follow this structure.
{
  "success": false,
  "error": {
    "code": "E_VALIDATION_FAILED",
    "message": "Task title exceeds maximum length",
    "exitCode": 6,
    "recoverable": true,
    "suggestion": "Shorten title to under 200 characters",
    "fix": "cleo update T001 --title \"Shorter title\"",
    "alternatives": [
      {
        "action": "View current task",
        "command": "cleo show T001"
      }
    ],
    "context": {
      "field": "title",
      "maxLength": 200,
      "actualLength": 250
    }
  }
}
code
string
required
Error code identifier (e.g., E_VALIDATION_FAILED, E_NOT_FOUND)
exitCode
number
required
CLI exit code for scripting
recoverable
boolean
Whether error can be retried with different input
fix
string
Copy-paste ready command to resolve the error
alternatives
object[]
Alternative commands to try
context
object
Structured error context for debugging

Next Steps