@bernierllc/slash-commands-tasks
v1.0.2
Published
Task management slash commands for in-app chat systems
Readme
@bernierllc/slash-commands-tasks
Task management slash commands for in-app chat systems. Provides comprehensive task creation, tracking, and collaboration features through chat interfaces.
Installation
npm install @bernierllc/slash-commands-tasksFeatures
- Create Tasks - Quick task creation with priorities and assignments
- List & Filter - View tasks by status, assignee, priority
- Update Tasks - Change status, priority, assignments
- Statistics - Task completion metrics and overdue alerts
- Multi-platform - Works in in-app chat, Slack, Discord, Teams
- NeverHub Integration - Auto-discovery and routing
- Real-time - Instant updates across platforms
Quick Start
Standalone Usage
import { TasksCommandPackage, InMemoryTaskStorage } from '@bernierllc/slash-commands-tasks';
import { createCommandContext } from '@bernierllc/slash-commands-core';
// Initialize the package
const storage = new InMemoryTaskStorage();
const tasks = new TasksCommandPackage(storage);
await tasks.initialize();
// Execute a command
const context = createCommandContext('/task "Fix login bug"', 'user123', 'in-app');
const response = await tasks.execute(context);
console.log(response.message); // "✅ Task created: Fix login bug 🟢"With NeverHub Auto-Discovery
When both @bernierllc/slash-commands-tasks and @bernierllc/in-app-chat are running, commands automatically register via NeverHub service discovery:
- Tasks package registers with NeverHub
- In-app-chat discovers task commands
- Users can execute
/taskcommands across platforms - Responses are formatted for each platform
Available Commands
/task <title> - Create Task
Create a new task with optional parameters:
# Basic task
/task "Fix login bug"
# With priority and assignment
/task "Review PR #123" --priority high --assignee @alice
# With due date (if supported)
/task "Deploy to staging" --due tomorrowAliases: /tasks, /todo
/task-list [filters] - List Tasks
View tasks with optional filtering:
# All tasks
/task-list
# Filter by status
/task-list --status todo
/task-list --status in-progress
# Filter by assignee
/task-list --assignee @me
/task-list --assignee @alice
# Filter by priority
/task-list --priority high
/task-list --priority urgentAliases: /tasks-list, /list-tasks
/task-complete <task-id> - Complete Task
Mark a task as completed:
/task-complete task_1
/task-complete task_42Aliases: /complete-task, /done
/task-update <task-id> [options] - Update Task
Update task properties:
# Change status
/task-update task_1 --status in-progress
# Change priority and assignee
/task-update task_2 --priority urgent --assignee @bob
# Move to review
/task-update task_3 --status review/task-stats [user] - Task Statistics
View task statistics:
# Your stats
/task-stats
# Another user's stats
/task-stats @aliceTask Properties
Status Options
- todo - Not started
- in-progress - Being worked on
- review - Awaiting review
- done - Completed
- cancelled - Cancelled
Priority Levels
- 🔴 urgent - Needs immediate attention
- 🟡 high - Important, should be done soon
- 🟢 medium - Normal priority (default)
- ⚪ low - Nice to have, when time permits
Platform Integration
In-App Chat
- Rich markdown formatting
- Interactive buttons (planned)
- Real-time updates
Slack
- Native Slack formatting
- Mentions and channel integration
- Slack-specific shortcuts
Discord
- Discord markdown support
- Server and channel context
- Emoji reactions (planned)
Microsoft Teams
- Teams formatting limitations handled
- Adaptive cards (planned)
- Teams-specific features
Custom Storage
Replace the default in-memory storage with your own implementation:
import { TaskStorage, Task, TaskStatus } from '@bernierllc/slash-commands-tasks';
class DatabaseTaskStorage implements TaskStorage {
async create(taskData: Omit<Task, 'id' | 'createdAt' | 'updatedAt'>): Promise<Task> {
// Your database logic
}
async update(id: string, updates: UpdateTaskOptions): Promise<Task | null> {
// Your update logic
}
// ... implement other methods
}
const customStorage = new DatabaseTaskStorage();
const tasks = new TasksCommandPackage(customStorage);Response Examples
Creating a Task
✅ Task created: **Fix login bug** 🟢 (assigned to @alice)
ID: `task_123`Listing Tasks
📋 **Your Tasks**
📝 `task_1` **Fix login bug** 🟢 (@alice)
⚡ `task_2` **Review PR #123** 🟡 (@bob)
👀 `task_3` **Update docs** ⚪Task Statistics
📊 **Task Statistics**
**Total Tasks:** 15
**By Status:**
• To Do: 5
• In Progress: 3
• Review: 2
• Done: 4
• Cancelled: 1
**By Priority:**
• 🔴 Urgent: 1
• 🟡 High: 3
• 🟢 Medium: 8
• ⚪ Low: 3
**Alerts:**
• ⚠️ Overdue: 2
• 🕐 Due Soon: 1Configuration
In in-app-chat.config.js
module.exports = {
slashCommands: {
'/task': {
enabled: true,
package: '@bernierllc/slash-commands-tasks',
description: 'Create and manage tasks',
requiresAuth: true,
platforms: ['in-app', 'slack', 'discord'],
aliases: ['/tasks', '/todo']
}
}
};Environment Variables
# Optional: Custom task storage configuration
TASKS_STORAGE_TYPE=database
TASKS_STORAGE_URL=postgresql://...
# Optional: Task limits
TASKS_MAX_PER_USER=100
TASKS_MAX_TITLE_LENGTH=200Integration with Other Packages
With Project Management
// Tasks can reference projects, sprints, etc.
/task "Implement user auth" --project webapp --sprint 2024-q1With Time Tracking
// Integration with time tracking packages
/task "Fix bug" --estimate 2hWith Calendar
// Due dates and scheduling
/task "Team meeting prep" --due "2024-01-15 14:00"Testing
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage reportExample test:
import { TasksCommandPackage, InMemoryTaskStorage } from '@bernierllc/slash-commands-tasks';
import { createCommandContext } from '@bernierllc/slash-commands-core';
describe('Tasks Commands', () => {
let tasks: TasksCommandPackage;
beforeEach(async () => {
const storage = new InMemoryTaskStorage();
tasks = new TasksCommandPackage(storage);
await tasks.initialize();
});
it('should create a task', async () => {
const context = createCommandContext('/task "Test task"', 'user1', 'in-app');
const response = await tasks.execute(context);
expect(response.success).toBe(true);
expect(response.message).toContain('Task created');
});
});API Reference
TasksCommandPackage
Main command package class.
Methods
initialize(): Promise<void>- Initialize the package and NeverHub integrationexecute(context: SlashCommandContext): Promise<SlashCommandResponse>- Execute a commandgetHelp(command?: string): string- Get help informationcleanup(): Promise<void>- Clean up resources
Task Interface
interface Task {
id: string;
title: string;
description?: string;
status: TaskStatus;
priority: TaskPriority;
assignee?: string;
createdBy: string;
createdAt: Date;
updatedAt: Date;
dueDate?: Date;
completedAt?: Date;
tags?: string[];
metadata?: Record<string, any>;
}Storage Interface
interface TaskStorage {
create(task: Omit<Task, 'id' | 'createdAt' | 'updatedAt'>): Promise<Task>;
update(id: string, updates: UpdateTaskOptions): Promise<Task | null>;
delete(id: string): Promise<boolean>;
get(id: string): Promise<Task | null>;
list(options?: ListTasksOptions): Promise<Task[]>;
getStats(userId?: string): Promise<TaskStats>;
}See Also
- @bernierllc/slash-commands-core - Foundation for slash command packages
- @bernierllc/in-app-chat - Main chat suite that routes commands
- @bernierllc/neverhub-adapter - Service discovery and events
License
Copyright (c) 2025 Bernier LLC. All rights reserved.
