prdddDocsOpen viewer ↗

Writing an orchestrator adapter

Read the manifest in the main checkout. Each task names its branch, parent, dependencies, spec sections and gate. Start a task when its prerequisites and gate rules permit it. Use the package entry point @prddd/contract/js from a JavaScript runner to locate the shared workspace and validate the manifest.

  1. Locate the main checkout’s state with cairnDir and decode its manifest with parseManifest. A linked worktree shares that state with the main checkout.

  2. Append state changes with appendEvent(path, event). Each event carries a task ID, timestamp and status. Record the actual model and reasoning when known, and on running the concrete catalog ID the model ran as in modelId; routing from history counts only attempts that carry one. Include a reason on failure. The helper validates the event and appends one JSON line.

  3. Attach the task, implemented sections and session to commits using formatTrailers or trailerArgs. Store redacted session evidence under the same session ID so a commit can lead a reviewer back to the work.

  4. Report gated work as waiting for a human. Let the reviewer run the approval command. Record landing only after the commits reach the target branch.

  5. Anchor persistent findings with prd note and generate a location with prd link. A link can identify the section, task, file and line a reviewer should inspect.

Check the result with prd status --json. Reconcile retries with the recorded events and branches before assigning the same work again.