Recipe catalog / handoff-completeness
Grade handoff completeness
How ready is item, a work description being handed to another agent or person, to be picked up without asking questions, on a five-level rubric?
You need to grade a task description before delegating it, so an orchestrator can enrich it or ask for missing pieces instead of handing off something a worker will bounce back.
Explore this recipe interactively ยท Source and implementation guide
Use handoff-completeness 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 { handoffCompleteness } from 'jev-recipes/handoff-completeness';
const result = await handoffCompleteness({
"item": "Add rate limiting to the public /search endpoint. Use the existing RateLimiter middleware in src/middleware/rate-limit.ts and the Redis instance already configured for sessions. Done when requests beyond 60 per minute per API key return 429 with a Retry-After header and the integration test in tests/api/search.test.ts covers the limit.",
"minConfidence": 0.8
});
console.log(result);
Input contract
| Field | Type | Needed |
|---|---|---|
| item | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"item": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"item"
]
},
"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
}
},
"completeness": {
"type": "string",
"enum": [
"bare",
"goal",
"inputs",
"defined",
"complete"
]
}
},
"required": [
"model",
"usage",
"status",
"score",
"level",
"confidence",
"probabilities",
"completeness"
],
"additionalProperties": false
}
}Saved example result
This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo handoff-completeness.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"score": 2.96,
"level": 3,
"confidence": 0.82,
"probabilities": {
"0": 0,
"1": 0.02,
"2": 0.08,
"3": 0.82,
"4": 0.08
},
"completeness": "defined"
}
Evaluation evidence
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.
Limitations
- Grades what the item states, not whether the stated goal is correct, feasible, or worth doing.
- Cannot know what the recipient already knows, so shared context that is not written into the item counts as missing.
- The score is an expected value over rubric levels. Application code chooses the level at which to hand off.
Related recipes
- plan-completeness: Use plan-completeness to grade whether a plan covers its goal, rather than whether a single work item is ready to hand off.
- clarify: Use clarify to find the specific missing requirements once an item grades below complete.