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
- check: deterministic (no agent),
JSON.parsethe contract and run the structural checks, returning{ issues, summary, score }. - advise: an agent reads the diagnosis and writes one
{ check, fix }pair per non-ok issue (checkis the check id being resolved), ordered error → warning → info.
Checks
- hasGoal:
goalis non-empty. - hasOutputSpec:
outputSpec(oroutput) describes the produced artifact. - hasAcceptanceCriteria: at least one acceptance criterion is listed.
- allBlockingCriteriaHaveVerification: every
blockingcriterion names averification. Plain-string criteria warn: a string can’t declareblockingorverification, so use{text, blocking, verification}objects. - allRequiredInputsHaveSource: every
requiredinput declares asource. - allSideEffectsHaveApproval: every
sideEffectsentry is gated by anapproval. Plain-string entries count as unguarded; use{name, approval}objects. - reportSpecExists:
reportSpecdescribes how results are reported.