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 how to fix each finding. Reach
for it before handing a contract to an agent, to catch missing inputs, ungated
side effects, or absent acceptance criteria up front.
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: a non-empty
goalis declared. - hasOutputSpec: an
outputSpec(oroutput) describes the produced artifact. - hasAcceptanceCriteria: at least one acceptance criterion is listed.
- allBlockingCriteriaHaveVerification: every criterion marked
blockingnames averification. Plain-string criteria are flagged as a warning: a string cannot declareblockingorverification, so use{text, blocking, verification}objects. - allRequiredInputsHaveSource: every input marked
requireddeclares asource. - allSideEffectsHaveApproval: every entry in
sideEffectsis gated by anapproval. Plain-string entries count as unguarded; use{name, approval}objects. - reportSpecExists: a
reportSpecdescribes how results are reported.
Inputs
| Input | Type | Default |
|---|---|---|
contract | string (JSON of a context contract) | "{}" |