eyaltoledano/claude-task-master · error

Task description is required

Error message

Task description is required

What it means

This error is thrown by the internal validateTask helper in the storage interface when a task object being validated has no description. Task Master requires every task to carry a non-empty description field, so writes/creates of a task without one are rejected before reaching storage. It is a data-integrity guard, not an environment problem.

Source

Thrown at packages/tm-core/src/common/interfaces/storage.interface.ts:459

		const extension = parts.pop();
		const baseName = parts.join('.');
		return `${baseName}.backup.${timestamp}.${extension}`;
	}

	/**
	 * Utility method to validate task data before storage operations
	 * @param task - Task to validate
	 * @throws Error if task is invalid
	 */
	protected validateTask(task: Task): void {
		if (!task.id) {
			throw new Error('Task ID is required');
		}
		if (!task.title) {
			throw new Error('Task title is required');
		}
		if (!task.description) {
			throw new Error('Task description is required');
		}
		if (!task.status) {
			throw new Error('Task status is required');
		}
	}

	/**
	 * Utility method to sanitize tag names for file system safety
	 * @param tag - Tag name to sanitize
	 * @returns Sanitized tag name
	 */
	protected sanitizeTag(tag: string): string {
		return tag.replace(/[^a-zA-Z0-9-_]/g, '-').toLowerCase();
	}
}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Add a non-empty description string to the task object before saving/creating it
  2. Validate the task shape (title, description, status all truthy) before calling the storage API
  3. If description is genuinely unknown, provide a placeholder like 'TBD' so validation passes and can be updated later
  4. Check any upstream data source/mapper for a field-mapping bug that drops description

Example fix

// before
await storage.createTask({ id: 5, title: 'Setup CI', status: 'pending' });
// after
await storage.createTask({ id: 5, title: 'Setup CI', description: 'Configure GitHub Actions pipeline for lint and test.', status: 'pending' });
Defensive patterns

Strategy: validation

Validate before calling

function hasRequiredTaskFields(task) {
  return Boolean(task && task.id && task.title && task.description && task.status);
}
if (!hasRequiredTaskFields(task)) {
  if (!task.description) throw new Error('description missing: refusing to save task');
}

Type guard

function isValidTask(task): task is Required<Pick<Task,'id'|'title'|'description'|'status'>> & Task {
  return !!task && typeof task.title === 'string' && task.title.length > 0
    && typeof task.description === 'string' && task.description.length > 0
    && typeof task.status === 'string' && task.status.length > 0;
}

Try / catch

try {
  await storage.createTask(task);
} catch (err) {
  if (err instanceof Error && err.message === 'Task description is required') {
    console.error('Task is missing a description; add one before saving.');
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling storage/task-creation APIs with a task object whose description property is missing, null, or the empty string ('' is falsy).

Common situations: Programmatic task generation scripts that set only id/title/status; importing tasks from JSON or another tracker that lacks a description field; template objects created before fields are filled; migrations or data pipelines that skip description.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/4c28c8fe38968bb3. Report an issue: GitHub.