Skip to main content
context-doctor is an archived example, not installed by init; copy it from examples/init-pack/ with its dependency closure, or ask create-workflow for an equivalent, then run it below. context-doctor lints a context contract: it deterministically parses the contract JSON and runs seven structural checks (goal, output spec, acceptance criteria, blocking-criteria verification, required-input sources, side-effect approvals, report spec), then an agent suggests a fix for each finding. Reach for it before handing a contract to an agent, catching missing inputs, ungated side effects, or absent acceptance criteria.

Stages

  1. check: deterministic (no agent), JSON.parse the contract and run the structural checks, returning { issues, summary, score }.
  2. advise: an agent reads the diagnosis and writes one { check, fix } pair per non-ok issue (check is the check id being resolved), ordered error → warning → info.

Checks

  • hasGoal: goal is non-empty.
  • hasOutputSpec: outputSpec (or output) describes the produced artifact.
  • hasAcceptanceCriteria: at least one acceptance criterion is listed.
  • allBlockingCriteriaHaveVerification: every blocking criterion names a verification. Plain-string criteria warn: a string can’t declare blocking or verification, so use {text, blocking, verification} objects.
  • allRequiredInputsHaveSource: every required input declares a source.
  • allSideEffectsHaveApproval: every sideEffects entry is gated by an approval. Plain-string entries count as unguarded; use {name, approval} objects.
  • reportSpecExists: reportSpec describes how results are reported.

Inputs

Monitor it