Schema reference

The JSON Schemas that define workflows, activities, techniques, conditions, and session state. The Zod schemas in src/schema/ are the source of truth; the JSON files under schemas/ are generated from them (npm run build:schemas) and validate workflow definitions at authoring time.

The field tables below show each schema's top-level shape and are rendered from the checked-in schema files. For authoring guidance — how the pieces fit together when writing a workflow — read the schema guide.

activity.schema.json

Activity definition schema — unified ordered, kind-tagged steps[] (technique | action | checkpoint | loop).

Edit source on GitHub

Top-level fields

FieldTypeRequiredDescription
idstringyesUnique identifier for the activity
versionstringyesSemantic version of the activity
namestringyesHuman-readable activity name
descriptionstringnoDetailed description of the activity
techniquesstring[]noActivity-wide technique references (:: paths); bundled into get_activity.
bundleTechniquesobjectnoOpt-in hybrid bundling: get_activity inlines each ungated step technique whose composed wire form is at most maxChars; larger and gated ones remain lazy-fetched via get_technique. Bundled deliveries are recorded as technique_bundled history events and satisfy the manifest fidelity check.
steps(technique | action | checkpoint | loop)[]noOrdered, kind-tagged execution steps for this activity
decisionsobject[]noConditional branching points; branch conditions are evaluated by the orchestrator, not the server.
decisions[].idstringyes-
decisions[].namestringyes-
decisions[].descriptionstringno-
decisions[].branchesobject[]yes-
decisions[].branches[].idstringyes-
decisions[].branches[].labelstringyes-
decisions[].branches[].conditionconditionno-
decisions[].branches[].transitionTostringnoActivity ID to transition to. Omit for terminal branches (workflow ends)
decisions[].branches[].isDefaultbooleannoDefault: false
transitionsobject[]noNavigation to other activities. Legality is validated warn-only at next_activity — an out-of-graph transition warns in _meta.validation but is not blocked.
transitions[].tostringyesActivity ID to transition to
transitions[].conditionconditionno-
transitions[].isDefaultbooleannoDefault: false
triggersobject[]noWorkflows the orchestrator dispatches from this activity (via dispatch_child with an explicit workflow_id); the server does not act on trigger declarations.
triggers[].workflowstringyesID of the workflow to trigger
triggers[].descriptionstringnoDescription of when/why this workflow is triggered
triggers[].passContextstring[]noContext variable names the dispatching agent relays to the child workflow. The server does not copy them — a child session's bag starts from the child workflow's own declared defaults, nothing more.
outcomestring[]noExpected outcomes when activity completes successfully. Advisory — the server does not reconcile them against activity_manifest outcomes.
requiredbooleannoWhether this activity is required in the workflow Default: true
rulesstring[]noActivity-level rules and constraints that agents must follow
artifactPrefixstringnoNumeric prefix for artifact filenames, inferred from the activity filename (e.g., "02" from 02-design-philosophy.yaml). Server-computed — do not set in definition files.

condition.schema.json

Condition expression schema

Edit source on GitHub

One of 4 variants: simple, and, or, not.

session-file.schema.json

Server-managed session file (session.

Edit source on GitHub

Top-level fields

FieldTypeRequiredDescription
schemaVersion1yes-
sessionIndexstringyes-
workflowIdstringyes-
workflowVersionstringyes-
agentIdstringyes-
seqintegeryes-
tsintegeryes-
startedAtstringyes-
currentActivitystringnoDefault: ""
currentTechniquestringnoDefault: ""
conditionstringnoDefault: ""
activeCheckpointobjectno-
variablesobjectnoDefault: {}
completedActivitiesstring[]noDefault: []
skippedActivitiesstring[]noDefault: []
checkpointResponsesobjectnoDefault: {}
historyobject[]noDefault: []
history[].timestampstringyes-
history[].type"workflow_started" | "workflow_completed" | "workflow_aborted" | "workflow_triggered" | "workflow_returned" | "workflow_suspended" | "activity_entered" | "activity_exited" | "activity_skipped" | "step_started" | "step_completed" | "checkpoint_reached" | "checkpoint_response" | "checkpoint_replayed" | "decision_reached" | "decision_branch_taken" | "loop_started" | "loop_iteration" | "loop_completed" | "loop_break" | "variable_set" | "error" | "technique_fetched" | "resource_fetched" | "technique_bundled" | "variables_seeded"yes-
history[].activitystringno-
history[].stepintegerno-
history[].checkpointstringno-
history[].decisionstringno-
history[].loopstringno-
history[].dataobjectno-
history[].errorobjectno-
status"running" | "completed" | "aborted"noDefault: "running"
triggeredWorkflowsobject[]noDefault: []
triggeredWorkflows[].workflowIdstringyes-
triggeredWorkflows[].sessionIndexstringyes-
triggeredWorkflows[].triggeredAtstringyes-
triggeredWorkflows[].triggeredFromobjectyes-
triggeredWorkflows[].status"running" | "completed" | "aborted" | "error"yes-
triggeredWorkflows[].completedAtstringno-
triggeredWorkflows[].returnedContextobjectno-
triggeredWorkflows[].statesession-fileno-
planningFolderPathstringno-
contextMode"persistent" | "fresh"no-
deliveredContentobjectno-
parentSessionsession-fileno-

state.schema.json

Workflow state schema

Edit source on GitHub

Top-level fields

FieldTypeRequiredDescription
workflowIdstringyes-
workflowVersionstringyes-
stateVersionintegernoDefault: 1
startedAtstringyes-
updatedAtstringyes-
completedAtstringno-
currentActivitystringno-
currentStepintegerno-
completedActivitiesstring[]noDefault: []
skippedActivitiesstring[]noDefault: []
completedStepsobjectnoDefault: {}
checkpointResponsesobjectnoDefault: {}
decisionOutcomesobjectnoDefault: {}
activeLoopsobject[]noDefault: []
activeLoops[].activityIdstringyes-
activeLoops[].loopIdstringyes-
activeLoops[].currentIterationintegeryes-
activeLoops[].totalItemsintegerno-
activeLoops[].currentItemanyno-
activeLoops[].startedAtstringyes-
variablesobjectnoDefault: {}
historyobject[]noDefault: []
history[].timestampstringyes-
history[].type"workflow_started" | "workflow_completed" | "workflow_aborted" | "workflow_triggered" | "workflow_returned" | "workflow_suspended" | "activity_entered" | "activity_exited" | "activity_skipped" | "step_started" | "step_completed" | "checkpoint_reached" | "checkpoint_response" | "checkpoint_replayed" | "decision_reached" | "decision_branch_taken" | "loop_started" | "loop_iteration" | "loop_completed" | "loop_break" | "variable_set" | "error" | "technique_fetched" | "resource_fetched" | "technique_bundled" | "variables_seeded"yes-
history[].activitystringno-
history[].stepintegerno-
history[].checkpointstringno-
history[].decisionstringno-
history[].loopstringno-
history[].dataobjectno-
history[].errorobjectno-
status"running" | "paused" | "suspended" | "completed" | "aborted" | "error"noDefault: "running"
parentWorkflowobjectno-
triggeredWorkflowsobject[]noDefault: []
triggeredWorkflows[].workflowIdstringyes-
triggeredWorkflows[].planningSlugstringno-
triggeredWorkflows[].sessionIndexstringno-
triggeredWorkflows[].triggeredAtstringyes-
triggeredWorkflows[].triggeredFromobjectyes-
triggeredWorkflows[].status"running" | "completed" | "aborted" | "error"yes-
triggeredWorkflows[].completedAtstringno-
triggeredWorkflows[].returnedContextobjectno-
lastErrorobjectno-

technique.schema.json

Technique definition schema for workflow-server

Edit source on GitHub

Top-level fields

FieldTypeRequiredDescription
idstringyesUnique identifier for the technique
versionstringyesSemantic version of the technique
capabilitystringyesWhat this technique enables agents to do
provenance_notestringnoDelivery-only, server-populated on a step-bound get_technique: states the output delivery mechanics that the source:/destination: annotations rely on. Never authored in technique markdown.
rulesrulesDefinitionno-
inputsinputsDefinitionno-
inherited_inputsinheritedInputsno-
protocolprotocolDefinitionno-
outputsoutputsDefinitionno-
inherited_outputsinheritedOutputsno-

workflow.schema.json

Workflow definition schema

Edit source on GitHub

Top-level fields

FieldTypeRequiredDescription
$schemastringno-
idstringyesUnique workflow identifier
versionstringyesSemantic version
titlestringyesHuman-readable workflow title
descriptionstringnoDetailed workflow description
authorstringnoAuthor metadata; not read by the server.
tagsstring[]no-
rulesobjectnoWorkflow rules partitioned by audience: workflow (orchestrator-only) and activity (inherited by every activity, injected into get_activity). Entries are rule strings or { ref } references into fragments.rules.
fragmentsobjectnoShared rule texts and checkpoint bodies, declared once and imported by reference ([workflow::]name) from rules slots and kind:checkpoint steps — this workflow's or another's. Resolved at load; agents always receive materialized content.
variablesobject[]noWorkflow-level variable declarations, rendered in get_workflow for agents. The session variable bag is seeded from each declaration's defaultValue at session creation; thereafter the server writes it only through checkpoint setVariable effects.
variables[].namestring | "requirements" | "features" | "exclusions" | "dimensions" | "tasks" | "results" | "submodules" | "paths" | "fields" | "filters" | "stats" | "effects" | "substitutions" | "findings" | "assumptions" | "subsystems" | "transitions" | "options" | "branches" | "agents" | "changes" | "failures" | "items" | "files" | "gaps" | "outcomes" | "body" | "query" | "repo" | "owner" | "number" | "title" | "branch" | "diff" | "limit" | "name" | "sha" | "url" | "head" | "base" | "ref" | "labels" | "path" | "cursor" | "cql" | "jql" | "description" | "assignee" | "depth" | "direction" | "summary" | "state" | "target" | "adr" | "type" | "mode" | "kind"yesQualified snake_case noun phrase (>=2 words, AP-60), or an enumerated bare-word exemption.
variables[].type"string" | "number" | "boolean" | "array" | "object"yesDeclared type. The server validates checkpoint setVariable values against it, warn-only: a mismatch is stored as written and surfaced in _meta.validation and on the variable_set history event. Agents honor it for their own writes.
variables[].descriptionstringno-
variables[].defaultValueanynoInitial value the server seeds into the session variable bag at session creation (start_session fresh sessions and dispatch_child children), recorded as one variables_seeded history event. Do not gate a defaulted variable with exists/notExists — seeding makes the gate constant (check:variable-model enforces this).
variables[].requiredbooleannoAuthoring metadata; the server does not check that the variable is ever set. Default: false
techniquesobjectnoWorkflow techniques partitioned by audience: workflow (orchestrator, bundled into get_workflow) and activity (inherited by every activity, injected into get_activity).
initialActivitystringnoID of the first activity to execute. Required for sequential workflows, optional when all activities are independent entry points.
activitiesobject[]noActivities that comprise this workflow. Activities with transitions form sequences; activities without transitions are independent entry points. Omitted in definition files where activities are separate files.
activities[].idstringyesUnique identifier for the activity
activities[].versionstringyesSemantic version of the activity
activities[].namestringyesHuman-readable activity name
activities[].descriptionstringnoDetailed description of the activity
activities[].techniquesstring[]noActivity-wide technique references (:: paths); bundled into get_activity.
activities[].bundleTechniquesobjectnoOpt-in hybrid bundling: get_activity inlines each ungated step technique whose composed wire form is at most maxChars; larger and gated ones remain lazy-fetched via get_technique. Bundled deliveries are recorded as technique_bundled history events and satisfy the manifest fidelity check.
activities[].steps(technique | action | checkpoint | loop)[]noOrdered, kind-tagged execution steps for this activity
activities[].decisionsobject[]noConditional branching points; branch conditions are evaluated by the orchestrator, not the server.
activities[].decisions[].idstringyes-
activities[].decisions[].namestringyes-
activities[].decisions[].descriptionstringno-
activities[].decisions[].branchesobject[]yes-
activities[].decisions[].branches[].idstringyes-
activities[].decisions[].branches[].labelstringyes-
activities[].decisions[].branches[].conditionconditionno-
activities[].decisions[].branches[].transitionTostringnoActivity ID to transition to. Omit for terminal branches (workflow ends)
activities[].decisions[].branches[].isDefaultbooleannoDefault: false
activities[].transitionsobject[]noNavigation to other activities. Legality is validated warn-only at next_activity — an out-of-graph transition warns in _meta.validation but is not blocked.
activities[].transitions[].tostringyesActivity ID to transition to
activities[].transitions[].conditionconditionno-
activities[].transitions[].isDefaultbooleannoDefault: false
activities[].triggersobject[]noWorkflows the orchestrator dispatches from this activity (via dispatch_child with an explicit workflow_id); the server does not act on trigger declarations.
activities[].triggers[].workflowstringyesID of the workflow to trigger
activities[].triggers[].descriptionstringnoDescription of when/why this workflow is triggered
activities[].triggers[].passContextstring[]noContext variable names the dispatching agent relays to the child workflow. The server does not copy them — a child session's bag starts from the child workflow's own declared defaults, nothing more.
activities[].outcomestring[]noExpected outcomes when activity completes successfully. Advisory — the server does not reconcile them against activity_manifest outcomes.
activities[].requiredbooleannoWhether this activity is required in the workflow Default: true
activities[].rulesstring[]noActivity-level rules and constraints that agents must follow
activities[].artifactPrefixstringnoNumeric prefix for artifact filenames, inferred from the activity filename (e.g., "02" from 02-design-philosophy.yaml). Server-computed — do not set in definition files.