jevrecipes

Recipe catalog / instruction-readability

Grade how easy patient instructions are to follow

instruction-readability is a Jev recipe from the jev-recipes TypeScript package. How easy are instructions to follow for a general reader, from dense jargon to plain and stepwise? Use it when you are generating or reviewing after-visit instructions, discharge notes, or medication directions and need to catch wording a patient cannot act on.

Last updated .

Explore this recipe interactively · Source and implementation guide · Markdown version

How do I use instruction-readability in TypeScript?

Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.

import { instructionReadability } from 'jev-recipes/instruction-readability';

const result = await instructionReadability({
  "instructions": "Administer 500 mg PO BID with food x 10 days. Do not discontinue prematurely. If a dose is missed, take it as soon as possible unless the next dose is imminent. Contact the clinic for any rash or swelling.",
  "audience": "Adult patient with no medical background, reading the after-visit summary at home.",
  "minConfidence": 0.8
});
console.log(result);

What input does instruction-readability take?

FieldTypeNeeded
instructionsstringRequired
audiencestringOptional
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "instructions": {
        "type": "string"
      },
      "audience": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "instructions"
    ]
  },
  "result": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "model": {
        "type": "string"
      },
      "usage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "input_tokens",
          "output_tokens"
        ],
        "additionalProperties": false
      },
      "status": {
        "type": "string",
        "enum": [
          "ready",
          "review"
        ]
      },
      "score": {
        "type": "number",
        "minimum": 0
      },
      "level": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      },
      "readability": {
        "type": "string",
        "enum": [
          "dense",
          "heavy",
          "mixed",
          "plain",
          "clear"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "score",
      "level",
      "confidence",
      "probabilities",
      "readability"
    ],
    "additionalProperties": false
  }
}

What does a instruction-readability result look like?

This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo instruction-readability.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "score": 1.14,
  "level": 1,
  "confidence": 0.82,
  "probabilities": {
    "0": 0.04,
    "1": 0.82,
    "2": 0.11,
    "3": 0.02,
    "4": 0.01
  },
  "readability": "heavy"
}

Input

See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas. audience is optional and is omitted from the request when absent.

Result

readability is one of dense, heavy, mixed, plain, clear, taken from the most likely rubric level. level is that level's index from 0 to 4. score is Jev's expected value across the rubric and can fall between levels; use it for ranking or thresholds where a single label loses information.

A result is ready when confidence meets minConfidence. Otherwise it is review and still carries the graded values for inspection. probabilities is keyed by level index.

Reuse and calls

Uses the shared score helper. This folder owns the question, the rubric wording, and the review policy. A live invocation makes one logical Jev request.

Limits

The grade describes how easy the wording is to follow, not whether it is correct: dangerously wrong instructions can grade as clear, and correct ones as dense. It does not verify doses, check the instructions against a care plan, or produce a formal reading-level number; use a readability formula in code if you need a metric and clinical review for the content. When audience is supplied the grade is relative to that reader, so the same text can grade differently for a nurse than for a patient.

Example input

demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo instruction-readability shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe instruction-readability to inspect the input and result schemas.

How accurate is instruction-readability?

Fixture only

No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.

Use the evaluation guide to measure this decision on your own labeled cases.

What are the limits of instruction-readability?