Automatically classifies tasks into four priority levels (VERY IMPORTANT, HIGH, MEDIUM, LOW) based on due dates, urgency keywords, and explicit priority settings...
The priority classification skill automatically evaluates and assigns priority levels to tasks based on temporal urgency, keyword detection, and explicit priority markers. This skill is fundamental to the todo application's intelligent task management system.
Apply this skill:
This skill defines exactly four priority levels:
A task is classified as VERY IMPORTANT if ANY of the following conditions are met:
Example classifications:
// Task due in 4 hours
{ title: "Submit report", dueDate: "2025-12-16T17:00:00" }
// Current time: 2025-12-16T13:00:00
// Classification: VERY IMPORTANT (due within 6 hours)
// Task with urgency keyword
{ title: "URGENT: Review contract", dueDate: "2025-12-18T10:00:00" }
// Classification: VERY IMPORTANT (contains "urgent")
// Task with critical keyword
{ title: "Fix critical bug in production", dueDate: "2025-12-20T15:00:00" }
// Classification: VERY IMPORTANT (contains "critical")
// Task with asap keyword
{ title: "Need this asap", dueDate: null }
// Classification: VERY IMPORTANT (contains "asap")
A task is classified as HIGH if:
Example classifications:
// Task due in 18 hours
{ title: "Prepare presentation", dueDate: "2025-12-17T07:00:00" }
// Current time: 2025-12-16T13:00:00
// Classification: HIGH (due within 24 hours)
// Task due in 23 hours
{ title: "Email client", dueDate: "2025-12-17T12:00:00" }
// Current time: 2025-12-16T13:00:00
// Classification: HIGH (due within 24 hours)
A task is classified as MEDIUM if:
Example classifications:
// Task due in 3 days
{ title: "Review documentation", dueDate: "2025-12-19T13:00:00" }
// Current time: 2025-12-16T13:00:00
// Classification: MEDIUM (reasonable deadline)
// Task due in 5 days
{ title: "Plan team meeting", dueDate: "2025-12-21T10:00:00" }
// Current time: 2025-12-16T13:00:00
// Classification: MEDIUM (standard deadline)
A task is classified as LOW if:
Example classifications:
// Task due in 10 days
{ title: "Research new tools", dueDate: "2025-12-26T13:00:00" }
// Current time: 2025-12-16T13:00:00
// Classification: LOW (distant deadline)
// Task with no due date
{ title: "Someday review old notes", dueDate: null }
// Current time: 2025-12-16T13:00:00
// Classification: LOW (no deadline, no urgency keywords)
Each priority level has specific visual styling to ensure immediate recognition:
.priority-very-important {
background-color: #8B5CF6; /* Purple background */
color: #FFFFFF; /* White text */
font-weight: 600; /* Bold text */
border-radius: 4px;
padding: 2px 8px;
font-size: 12px;
animation: pulse 2s infinite; /* Animated pulse effect */
}
@keyframes pulse {
0%, 100% {
box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
}
50% {
box-shadow: 0 0 0 8px rgba(139, 92, 246, 0);
}
}
Visual characteristics:
.priority-high {
background-color: transparent;
color: #EF4444; /* Red accent */
font-weight: 600;
border: 1px solid #EF4444;
border-radius: 4px;
padding: 2px 8px;
font-size: 12px;
}
Visual characteristics:
.priority-medium {
background-color: transparent;
color: #F59E0B; /* Yellow accent */
font-weight: 600;
border: 1px solid #F59E0B;
border-radius: 4px;
padding: 2px 8px;
font-size: 12px;
}
Visual characteristics:
.priority-low {
background-color: transparent;
color: #6B7280; /* Gray accent */
font-weight: 600;
border: 1px solid #6B7280;
border-radius: 4px;
padding: 2px 8px;
font-size: 12px;
}
Visual characteristics:
function classifyTaskPriority(task) {
const now = new Date();
const dueDate = task.dueDate ? new Date(task.dueDate) : null;
// Check for explicit priority setting
if (task.explicitPriority) {
return task.explicitPriority;
}
// Check for urgency keywords
const urgencyKeywords = ['urgent', 'critical', 'asap'];
const taskText = `${task.title} ${task.description}`.toLowerCase();
const hasUrgencyKeyword = urgencyKeywords.some(keyword =>
taskText.includes(keyword)
);
if (hasUrgencyKeyword) {
return 'VERY_IMPORTANT';
}
// Temporal classification
if (dueDate) {
const hoursUntilDue = (dueDate - now) / (1000 * 60 * 60);
if (hoursUntilDue <= 6) {
return 'VERY_IMPORTANT';
} else if (hoursUntilDue <= 24) {
return 'HIGH';
} else if (hoursUntilDue <= 168) { // 7 days
return 'MEDIUM';
} else {
return 'LOW';
}
}
// Default for tasks with no due date and no urgency
return 'LOW';
}
function PriorityChip({ priority }) {
const styles = {
VERY_IMPORTANT: 'priority-very-important',
HIGH: 'priority-high',
MEDIUM: 'priority-medium',
LOW: 'priority-low'
};
const labels = {
VERY_IMPORTANT: 'VERY IMPORTANT',
HIGH: 'HIGH',
MEDIUM: 'MEDIUM',
LOW: 'LOW'
};
return (
<span className={styles[priority]}>
{labels[priority]}
</span>
);
}
When a task is classified as VERY IMPORTANT:
Priority should be re-evaluated:
Tasks without due dates default to LOW priority unless:
Completed tasks retain their priority classification for historical record but:
Tasks with past due dates (overdue):
The keyword detection is case-insensitive and matches partial words:
This skill integrates with:
const task = {
id: '1',
title: 'Submit report',
dueDate: new Date(Date.now() + 5 * 60 * 60 * 1000), // 5 hours from now
};
const priority = classifyTaskPriority(task);
// Expected: 'VERY_IMPORTANT'
const task = {
id: '2',
title: 'URGENT: Review contract',
dueDate: new Date(Date.now() + 48 * 60 * 60 * 1000), // 2 days from now
};
const priority = classifyTaskPriority(task);
// Expected: 'VERY_IMPORTANT'
const task = {
id: '3',
title: 'Prepare presentation',
dueDate: new Date(Date.now() + 20 * 60 * 60 * 1000), // 20 hours from now
};
const priority = classifyTaskPriority(task);
// Expected: 'HIGH'
const task = {
id: '4',
title: 'Review documentation',
dueDate: new Date(Date.now() + 72 * 60 * 60 * 1000), // 3 days from now
};
const priority = classifyTaskPriority(task);
// Expected: 'MEDIUM'
const task = {
id: '5',
title: 'Research new tools',
dueDate: new Date(Date.now() + 240 * 60 * 60 * 1000), // 10 days from now
};
const priority = classifyTaskPriority(task);
// Expected: 'LOW'